/* Zoom Builder: the Zoom Studio scene inside the practice shell's stage (about 1066 × 628 at 1366 × 768). */
.zb { position: absolute; inset: 0; overflow: hidden; color: #1f2933; font-size: 16px; line-height: 1.35;
  --zb-panel: rgba(255, 253, 248, .94); --zb-line: #b9a98e; --zb-ink: #1f2933; --zb-soft: #5a4a36; --zb-accent: #2f5d8a;
  --zb-ok: #1f7a44; --zb-ok-bg: #e3f6e8; --zb-bad: #b42318; --zb-bad-bg: #fde7e4; --zb-slide: #fffaf0; }
html[data-theme="dark"] .zb { color: #eef2f6; --zb-panel: rgba(30, 36, 46, .94); --zb-line: #56657a; --zb-ink: #eef2f6; --zb-soft: #c9d3de;
  --zb-ok: #7fdca0; --zb-ok-bg: #173d27; --zb-bad: #ffb4a8; --zb-bad-bg: #4a1e1a; --zb-slide: #f4ecdc; }
.zb *, .zb *::before, .zb *::after { box-sizing: border-box; }
.zb-studio { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
.zb-wall { fill: url(#zb-wall); }
.zb-benchtop { fill: url(#zb-bench); }
html[data-theme="dark"] .zb-wall { fill: url(#zb-wall-dark); }
html[data-theme="dark"] .zb-benchtop { fill: url(#zb-bench-dark); }
.zb-main { position: relative; height: 100%; display: grid; gap: 14px; padding: 12px 14px; }
.zb-main--inspect { grid-template-columns: minmax(0, 1fr) 380px; }
.zb-main--order { grid-template-columns: minmax(0, 1fr) 400px; }
.zb p { margin: 0; }

/* slides: every picture sits on a lit cream slide (the same in light and dark) */
.zb-slide, .zb-example .zb-slide { display: block; background: var(--zb-slide, #fffaf0); border-radius: 10px; box-shadow: inset 0 0 0 1px rgba(90, 74, 54, .25), 0 1px 3px rgba(0, 0, 0, .12); }
.zb-pic { display: block; width: 100%; height: 100%; }
.zb-slide--big { width: min(100%, 420px); aspect-ratio: 4 / 3; margin: 0 auto; }
.zb-slide--mini { width: 58px; height: 44px; flex: none; }
.zb-slide--rung { width: 52px; height: 39px; flex: none; }
.zb-slide--tour { width: 300px; height: 225px; margin: 0 auto; }
.zb-slide--strip { width: 100%; aspect-ratio: 4 / 3; }

/* ── zoom viewer (identify / next / emergent) ── */
.zb-viewer { display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.zb-bezel { flex: 1 1 auto; min-height: 0; padding: 12px; border-radius: 18px; background: linear-gradient(#3b4654, #232b35); box-shadow: 0 10px 24px rgba(0, 0, 0, .28), inset 0 1px 0 rgba(255, 255, 255, .12); }
.zb-screen { position: relative; height: 100%; display: grid; grid-template-columns: minmax(0, 1fr) 0fr; grid-template-rows: auto minmax(0, 1fr); gap: 8px 0; padding: 10px 14px 14px;
  border-radius: 10px; background: radial-gradient(circle at 50% 35%, #fbfdff, #dde8f1); color: #1f2933; overflow: hidden; transition: grid-template-columns .5s ease, gap .5s ease; }
html[data-theme="dark"] .zb-screen { background: radial-gradient(circle at 50% 35%, #e9f0f6, #c7d5e2); }
.zb-screen-k { grid-column: 1 / -1; font-size: 16px; font-weight: 700; letter-spacing: .02em; color: #2f5d8a; display: flex; align-items: center; gap: 8px; }
.zb-rec { width: 10px; height: 10px; border-radius: 50%; background: #d64545; box-shadow: 0 0 0 3px rgba(214, 69, 69, .2); }
.zb-shot { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 0; min-width: 0; }
.zb-shot .zb-slide--big { max-height: calc(100% - 64px); width: auto; height: 100%; max-width: 100%; }
.zb-caption { font-size: 19px; font-weight: 700; text-align: center; max-width: 34ch; color: #1f2933; }
.zb-placard { width: min(100%, 440px); padding: 18px 22px; border-radius: 12px; background: linear-gradient(#fffdf6, #f3e7cf); border: 3px solid #8c6a48; box-shadow: 0 6px 14px rgba(0, 0, 0, .18); color: #2b2118; }
.zb-placard-k { font-size: 16px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: #7a5a3a; margin-bottom: 6px !important; }
.zb-placard-t { font-size: 20px; font-weight: 600; line-height: 1.35; }
.zb-placard--small { width: 100%; padding: 8px 14px; border-width: 2px; }
.zb-placard--small .zb-placard-t { font-size: 17px; }
.zb-placard--small .zb-placard-k { margin-bottom: 2px !important; }
.zb-screen.is-revealed { grid-template-columns: minmax(0, 1fr) 290px; gap: 8px 12px; }
.zb-screen.is-revealed .zb-caption { font-size: 17px; }
.zb-ladder { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; min-height: 0; overflow: hidden; }
.zb-ladder[hidden] { display: none; }
.zb-rung { display: flex; align-items: center; gap: 8px; padding: 3px 6px; border-radius: 8px; background: rgba(255, 255, 255, .75); border: 2px solid transparent; position: relative;
  animation: zb-rung-in .35s ease both; animation-delay: calc(var(--i) * 70ms); }
.zb-rung-t { font-size: 16px; line-height: 1.15; min-width: 0; }
.zb-rung-t b { display: block;  }
.zb-rung.is-answer { border-color: #1f7a44; background: #e3f6e8; }
.zb-rung.is-pick { border-color: #b42318; background: #fde7e4; border-style: dashed; }
.zb-rung.is-shown { border-color: #2f5d8a; background: #e4eef8; }
.zb-badge { margin-left: auto; flex: none; font-size: 16px; font-weight: 800; white-space: nowrap; }
.zb-rung.is-answer .zb-badge { color: #145530; }
.zb-rung.is-pick .zb-badge { color: #8a1a10; }
.zb-rung.is-shown .zb-badge { color: #1d3d5e; }
@keyframes zb-rung-in { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }

/* ── answer panel ── */
.zb-panel { align-self: start; max-height: 100%; display: flex; flex-direction: column; gap: 10px; min-height: 0; overflow-y: auto; padding: 12px; border-radius: 14px; background: var(--zb-panel); border: 1px solid var(--zb-line); box-shadow: 0 6px 16px rgba(0, 0, 0, .12); }
.zb-ticket { padding: 8px 12px; border-radius: 10px; border: 2px dashed #8fb0cf; background: #f2f7fc; color: #1f2933; }
html[data-theme="dark"] .zb-ticket { background: #1e2c3b; color: #e6eef6; border-color: #5d7f9f; }
.zb-ticket-k { font-size: 16px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: #2f5d8a; }
html[data-theme="dark"] .zb-ticket-k { color: #9cc4ec; }
.zb-ticket-t { font-size: 16px; margin-top: 2px !important; }
.zb-field-k { font-size: 16px; font-weight: 700; margin-bottom: 6px !important; color: var(--zb-ink); }
.zb-chips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.zb-field--reasons .zb-chips { grid-template-columns: 1fr; }
.zb .zb-chip { display: flex; align-items: center; gap: 8px; min-height: 46px; padding: 6px 10px; font-size: 16px; line-height: 1.2; text-align: left; justify-content: flex-start; white-space: normal; border-radius: 12px; }
.zb .zb-chip span { text-transform: none; }
.zb-field--levels .zb-chip span::first-letter { text-transform: uppercase; }
.zb-ico { width: 22px; height: 22px; flex: none; opacity: .85; }
.zb .zb-chip:focus-visible, .zb button:focus-visible { outline: 3px solid #b16a08; outline-offset: 2px; }
.zb-chip:disabled { cursor: default; }
.zb-msg { min-height: 1.2em; font-size: 16px; font-weight: 700; color: var(--zb-bad); }

/* ── clue bar + status ── */
.zb-cluebar { display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.zb-cluebar:has(.zb-clue[hidden]):has(.zb-cluetext:empty) { display: none; }
.zb .zb-clue { min-height: 44px; padding: 6px 14px; border-radius: 22px; border: 2px solid #2f5d8a; background: #fff; color: #1d3d5e; font: inherit; font-weight: 700; cursor: pointer; }
.zb .zb-clue:hover:not(:disabled) { background: #e4eef8; }
.zb .zb-clue:disabled { opacity: .55; cursor: default; }
html[data-theme="dark"] .zb .zb-clue { background: #1e2c3b; color: #cfe3f7; border-color: #7aa6d2; }
.zb-cluetext { flex: 1 1 260px; font-size: 16px; padding: 0; border-radius: 10px; color: var(--zb-ink); }
.zb-cluetext:not(:empty) { padding: 6px 10px; background: var(--zb-panel); border: 1px solid var(--zb-line); }
.zb-status { font-size: 16px; font-weight: 600; color: var(--zb-ink); }
.zb-status:not(:empty) { padding: 6px 10px; border-radius: 10px; background: var(--zb-panel); border: 1px solid var(--zb-line); }

/* ── order: light table ── */
.zb-left { display: flex; flex-direction: column; gap: 8px; min-height: 0; overflow-y: auto; }
.zb-table { position: relative; padding: 10px 12px 12px; border-radius: 16px; background: linear-gradient(#f5fbff, #dcebf6); border: 3px solid #8aa3ad; box-shadow: 0 8px 18px rgba(0, 0, 0, .18), inset 0 0 30px rgba(255, 255, 255, .8); color: #1f2933; }
html[data-theme="dark"] .zb-table { background: linear-gradient(#e7f1f8, #c8dbe8); }
.zb-table-k { font-size: 16px; margin-bottom: 8px !important; color: #2c3e50; }
.zb-tray { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.zb-tray.is-hidden { display: none; }
.zb .zb-card { position: relative; display: flex; flex-direction: column; align-items: stretch; gap: 4px; padding: 6px; min-height: 0; border-radius: 12px; border: 2px solid #9fb3c4; background: #fff; color: #1f2933;
  font: inherit; font-size: 16px; line-height: 1.15; text-align: center; cursor: grab; box-shadow: 0 3px 6px rgba(0, 0, 0, .12); transition: transform .12s ease, box-shadow .12s ease; }
.zb .zb-card .zb-slide { aspect-ratio: 4 / 3; width: 100%; }
.zb .zb-card:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 6px 12px rgba(0, 0, 0, .18); border-color: #2f5d8a; }
.zb .zb-card.is-placed { opacity: .45; cursor: default; box-shadow: none; }
.zb .zb-card.is-dragging { opacity: .4; }
.zb-card-name { font-weight: 700; min-height: 2.3em; display: flex; align-items: center; justify-content: center; }
.zb-card-tag { position: absolute; top: 8px; left: 8px; padding: 1px 8px; border-radius: 10px; background: #2f5d8a; color: #fff; font-size: 16px; font-weight: 700; }
@media (pointer: fine), (min-width: 901px) { html .zb-card:not(:disabled), html .zb-slot-grab { touch-action: none; } }

/* tour (after Check) */
.zb-tour { display: flex; flex-direction: column; align-items: center; gap: 8px; min-height: 0; }
.zb-tour[hidden] { display: none; }
.zb-tour-frame .zb-slide { animation: zb-zoom .55s ease both; }
.zb-tour-cap { font-size: 18px; text-align: center; }
.zb-tour-cap b { }
.zb-tour-dots { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; }
.zb-tour-dots li { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 16px; font-weight: 700; border: 2px solid #8aa3ad; background: #fff; color: #2c3e50; }
.zb-tour-dots li.is-on { background: #2f5d8a; border-color: #2f5d8a; color: #fff; }
@keyframes zb-zoom { from { opacity: 0; transform: scale(.3); } 60% { opacity: 1; } to { opacity: 1; transform: scale(1); } }
.zb-strip { list-style: none; margin: 0; padding: 0; width: 100%; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; counter-reset: none; }
.zb-strip li { display: flex; flex-direction: column; gap: 3px; padding: 5px; border-radius: 10px; background: #fff; border: 2px solid #9fb3c4; font-size: 16px; line-height: 1.15; text-align: center; color: #1f2933; animation: zb-rung-in .3s ease both; }
.zb-strip li b { display: block;  }
.zb-strip li .zb-slide { aspect-ratio: 16 / 9; }

/* AP emergent placard on the order screen */
.zb-emerge { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-radius: 14px; background: var(--zb-panel); border: 1px solid var(--zb-line); }
.zb-emerge .zb-chips { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.zb-emerge .zb-chip { min-height: 42px; padding: 4px 8px; }

/* ── order: zoom rail ── */
.zb-rail { display: flex; flex-direction: column; gap: 6px; min-height: 0; padding: 10px 12px; border-radius: 16px; background: var(--zb-panel); border: 1px solid var(--zb-line); box-shadow: 0 6px 16px rgba(0, 0, 0, .14); }
.zb-rail-k { display: flex; justify-content: space-between; align-items: baseline; font-size: 16px; }
.zb-rail-k span { color: var(--zb-soft); }
.zb-slots { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; flex: 1 1 auto; min-height: 0; }
.zb-slot { position: relative; flex: 1 1 0; min-height: 56px; display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 12px; border: 2px solid #b7c6d3; background: rgba(255, 255, 255, .9); color: #1f2933; }
html[data-theme="dark"] .zb-slot { background: #f2f6fa; }
.zb-slot.is-empty { border-style: dashed; background: rgba(255, 255, 255, .5); }
html[data-theme="dark"] .zb-slot.is-empty { background: rgba(242, 246, 250, .12); color: #eef2f6; border-color: #6c819a; }
.zb-slot.is-over { border-color: #2f5d8a; border-style: solid; box-shadow: 0 0 0 3px rgba(47, 93, 138, .3); }
.zb-slot-n { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: #2f5d8a; color: #fff; }
.zb-slot-empty { font-size: 16px; color: inherit; opacity: .8; }
.zb-slot-grab { display: flex; align-items: center; gap: 8px; flex: 1 1 auto; min-width: 0; cursor: grab; }
.zb-slot-name { font-size: 16px; font-weight: 700; line-height: 1.15; min-width: 0; }
.zb-slot-tools { display: flex; gap: 4px; flex: none; }
.zb .zb-tool { width: 38px; height: 38px; border-radius: 10px; border: 1.5px solid #8aa3ad; background: #fff; color: #1d3d5e; font: inherit; font-size: 18px; font-weight: 800; cursor: pointer; padding: 0; }
.zb .zb-tool:hover:not(:disabled) { background: #e4eef8; }
.zb .zb-tool:disabled { opacity: .35; cursor: default; }
.zb-slot-mark { display: none; }
.zb.is-locked .zb-slot-tools { display: none; }
.zb.is-locked .zb-slot-grab { cursor: default; }
.zb-slot.is-ok, .zb-slot.is-bad { animation: zb-pop .3s ease; }
.zb-slot.is-ok { border-color: #1f7a44; background: #e3f6e8; }
.zb-slot.is-bad { border-color: #b42318; background: #fde7e4; border-style: dashed; }
.zb-slot.is-ok .zb-slot-mark, .zb-slot.is-bad .zb-slot-mark { display: block; flex: none; font-size: 16px; font-weight: 800; white-space: nowrap; }
.zb-slot.is-ok .zb-slot-mark { color: #145530; }
.zb-slot.is-bad .zb-slot-mark { color: #8a1a10; }
@keyframes zb-pop { 50% { transform: scale(1.03); } }

/* drag ghost */
html .zb-ghost { position: fixed; z-index: 1000; pointer-events: none; transform: translate(-50%, -50%) rotate(-3deg); display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 12px;
  background: #fff; color: #1f2933; border: 2px solid #2f5d8a; box-shadow: 0 10px 20px rgba(0, 0, 0, .25); font-size: 16px; font-weight: 700; }

/* Briefing worked example */
.zb-example { display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; }
.zb-example figure { margin: 0; width: 160px; text-align: center; font-size: 16px; line-height: 1.2; }
.zb-example .zb-slide { aspect-ratio: 4 / 3; width: 100%; margin-bottom: 4px; }
.zb-example figcaption b { display: block;  }
.zb-ex-arrow { font-size: 26px; font-weight: 800; color: #2f5d8a; }
.ps-brief--drawer .zb-example figure { width: 120px; }

/* The assignment card sits in the customer column so the rail's last slot stays clear. */
@media (min-width: 901px) {
  html.ps-locked:has(.zb) .lga-card { right: auto; left: 12px; }
  html.ps-locked:has(.zb):has(.lga-card) .ps-side { padding-bottom: 84px; }
}

@media (max-width: 1100px) {
  .zb-main--inspect { grid-template-columns: minmax(0, 1fr) 320px; }
  .zb-main--order { grid-template-columns: minmax(0, 1fr) 340px; }
  .zb-tray { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .zb { position: static; overflow: visible; }
  .zb-studio { display: none; }
  .zb-main, .zb-main--inspect, .zb-main--order { grid-template-columns: minmax(0, 1fr); height: auto; padding: 8px 0; }
  .zb-bezel { min-height: 360px; }
  .zb-screen.is-revealed { grid-template-columns: minmax(0, 1fr); }
  .zb-left { overflow: visible; }
  .zb-tray { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .zb-emerge .zb-chips { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .zb-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .zb-tray { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .zb-chips { grid-template-columns: minmax(0, 1fr); }
  .zb-slide--tour { width: 100%; height: auto; aspect-ratio: 4 / 3; }
}
@media (prefers-reduced-motion: reduce) {
  .zb-screen, .zb .zb-card { transition: none; }
  .zb-rung, .zb-strip li, .zb-tour-frame .zb-slide, .zb-slot.is-ok, .zb-slot.is-bad { animation: none; }
}

/* sentence case for level names (the model keeps them lower case) */
.zb-rung-t b::first-letter, .zb-tour-cap b::first-letter, .zb-strip li b::first-letter, .zb-example figcaption b::first-letter, .zb-slot-mark::first-letter { text-transform: uppercase; }

.zb-rung-ico { width: 40px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 8px; background: #fffaf0; color: #2f5d8a; box-shadow: inset 0 0 0 1px rgba(90, 74, 54, .25); }
.zb-rung-ico .zb-ico { width: 24px; height: 24px; }
.zb--emergent .zb-rung { padding: 5px 8px; }
/* AP order: the placard and its chips share the left column with the light table, so the card pictures get shorter. */
.zb--emerge .zb-card .zb-slide { aspect-ratio: 2 / 1; }
.zb--emerge .zb-card-name { min-height: 0; }
.zb--emerge .zb-table-k { margin-bottom: 6px !important; }
.zb--emerge .zb-placard--small { padding: 6px 12px; }
.zb--emerge .zb-emerge { gap: 6px; padding: 8px 10px; }
.zb--emerge .zb-emerge .zb-field-k { margin-bottom: 4px !important; }
.zb--emerge .zb-strip { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.zb--emerge .zb-strip li { padding: 3px; }
.zb--emerge .zb-strip li .zb-slide { aspect-ratio: 1 / 1; }
.zb--emerge .zb-strip-name { display: none; }

/* after Check (practice): the right chip and a wrong pick are marked with a symbol as well as a color */
.zb .zb-chip.is-right { border-color: #1f7a44; box-shadow: 0 0 0 2px #1f7a44; }
.zb .zb-chip.is-wrong { border-style: dashed; border-color: #b42318; }
.zb .zb-chip.is-right::after, .zb .zb-chip.is-wrong::after { margin-left: auto; padding-left: 6px; font-weight: 800; }
.zb .zb-chip.is-right::after { content: "✓"; }
.zb .zb-chip.is-wrong::after { content: "✗"; }
.zb .zb-chip:disabled { opacity: 1; }
