:root {
  --ink: #3d2f26;
  --paper: #f7eedd;
  --stage: #f1e3cc;
  --clay: #ffdbac;
  --coral: #e8735a;
  --sky: #2c6c91;
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --out: cubic-bezier(0.23, 1, 0.32, 1);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.5 system-ui, -apple-system, sans-serif;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 90;
  opacity: 0.16;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 .55 0 0 0 0 .45 0 0 0 0 .35 0 0 0 .06 0'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
}
header {
  max-width: 1600px;
  margin: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 32px; /* 20px: whole opener rests inside the viewport at 800/900px-tall desktop (gate Nov 21: 1px stage overflow) */
  gap: 16px;
}
header #brand {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -1px;
  color: var(--ink);
  text-decoration: none;
}
header #brand span { color: #a5422c; margin-left: 8px; }
.header-tools { display: flex; gap: 8px; align-items: center; }
button, summary { font: inherit; color: inherit; }
button {
  cursor: pointer;
  border: 2px solid var(--ink);
  border-radius: 17px;
  padding: 12px 18px;
  min-height: 48px;
  background: var(--clay);
  box-shadow: 3px 4px 0 var(--ink);
  transition: transform 120ms var(--spring), box-shadow 120ms var(--out), background 180ms var(--out);
  touch-action: manipulation;
}
button:hover { background: #ffe4c3; }
button:active { transform: translate(2px, 3px) scale(0.97); box-shadow: 1px 1px 0 var(--ink); }
button:disabled { opacity: 0.4; cursor: default; box-shadow: none; }
button:focus-visible, summary:focus-visible, a:focus-visible {
  outline: 3px solid var(--sky);
  outline-offset: 5px;
}
[hidden] { display: none !important; }
#workshop {
  max-width: 1600px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(350px, 1fr);
  min-height: calc(100svh - 145px);
  padding: 0 32px;
  gap: clamp(24px, 4vw, 64px);
}
#workshop { position: relative; }
#cue {
  position: absolute;
  pointer-events: none;
  z-index: 30;
}
#cue path {
  stroke: var(--ink);
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.zone-label { font-size: 14px; opacity: 0.72; margin: 0 0 10px; }

.dock-label { flex-basis: 100%; text-align: center; font-size: 14px; opacity: 0.72; }
#next:disabled { opacity: 0.7; box-shadow: none; cursor: default; }
.away { visibility: hidden !important; }
#model-stage {
  position: relative;
  min-width: 0;
  min-height: 520px;
  border-radius: 36px;
  background: var(--stage);
  overflow: hidden;
  align-self: stretch;
}
#scene { display: block; width: 100%; height: 100%; position: absolute; inset: 0; }
#ground {
  position: absolute;
  right: 14px;
  top: 14px;
  width: clamp(96px, 26%, 180px);
  aspect-ratio: 1;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 18px;
  box-shadow: 2px 3px 0 var(--ink);
  box-shadow: 2px 3px 0 var(--ink);
}
#scene-dock {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  max-width: calc(100% - 20px);
}
#scene-dock button {
  min-height: 46px;
  padding: 9px 14px;
  font-size: 16px;
  background: #fff8ed;
  box-shadow: 2px 3px 0 var(--ink);
}
#scene-dock button[aria-pressed="true"] { background: var(--coral); color: #2a1b14; }
#guide {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 28px 4px;
  min-width: 0;
}
h1 { font-size: clamp(28px, 3vw, 46px); line-height: 1.14; letter-spacing: -0.035em; margin: 0 0 22px; font-weight: 780; }
#step-copy { font-size: clamp(18px, 1.65vw, 23px); line-height: 1.5; margin: 0 0 22px; }
#answers { display: grid; gap: 12px; }
#answers button { text-align: left; font-size: 18px; line-height: 1.3; padding: 15px 17px; }
#answers button[aria-pressed="true"] { background: var(--coral); color: #2a1b14; }
#answers button.correct { border-color: #3f7d46; animation: correctPop 420ms var(--spring); }
@keyframes correctPop { 0% { transform: scale(1); } 40% { transform: scale(1.045); } 100% { transform: scale(1); } }
#feedback { font-size: 20px; line-height: 1.5; margin: 20px 0 0; }
#feedback:empty { display: none; }
details { margin-top: 22px; }
summary {
  cursor: pointer;
  min-height: 44px;
  display: flex;
  align-items: center;
  text-decoration: underline;
  text-underline-offset: 4px;
  color: #6d5545;
}
details p { font-size: 18px; line-height: 1.55; }
#journey-controls { margin-top: 32px; }
#progress { display: flex; gap: 9px; align-items: center; margin-bottom: 20px; height: 12px; }
#progress i { display: block; width: 9px; height: 9px; background: #cbbba4; border-radius: 50%; transition: width 300ms var(--out), background 300ms var(--out); }
#progress i.active { background: #a94a34; width: 26px; border-radius: 8px; }
.actions { display: flex; align-items: center; gap: 12px; }
#next {
  background: #a5422c;
  color: #fffaf0;
  font-size: 20px;
  font-weight: 700;
  min-height: 58px;
  flex: 1;
  max-width: 290px;
}
#next:hover { background: #8c3625; }
#next span { margin-left: 10px; }
.icon {
  min-width: 45px;
  min-height: 45px;
  padding: 0;
  background: transparent;
  box-shadow: none;
  border-color: transparent;
  font-size: 22px;
}
.icon:hover { background: #ecdac0; }
dialog {
  max-width: 550px;
  width: calc(100% - 32px);
  border: 2px solid var(--ink);
  border-radius: 26px;
  padding: 28px;
  background: #fff5e5;
  color: var(--ink);
}
dialog::backdrop { background: #3d2f2688; }
dialog h2 { line-height: 1.2; }
.answer-enter { animation: answer-in 240ms var(--spring); }
@keyframes answer-in {
  from { opacity: 0.4; transform: translateY(7px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
@media (max-width: 760px) {
  html, body { height: 100%; overflow: hidden; }
  header { height: 88px; padding: 12px 18px; align-items: flex-start; }
  header #brand { font-size: 20px; white-space: nowrap; }
  #workshop {
    display: flex;
    flex-direction: column;
    min-height: 0;
    gap: 0;
    padding: 0 14px max(12px, env(safe-area-inset-bottom));
    height: calc(100svh - 88px);
  }
  #model-stage { height: 42%; min-height: 230px; flex: none; border-radius: 27px; }
  #guide { flex: 1; min-height: 0; padding: 18px 10px 10px; justify-content: flex-start; }
  #guide-content { overflow: auto; min-height: 0; overscroll-behavior: contain; padding: 0 7px 3px 0; scrollbar-width: thin; }
  #journey-controls { flex: none; margin-top: 15px; margin-bottom: 72px; } /* 72px: clear the 196x64 publish badge bottom-right (gate Nov 21) */
  #progress { margin-bottom: 12px; }
  h1 { font-size: 27px; }
  #step-copy { font-size: 18px; }
  #answers button { font-size: 17px; padding: 12px 14px; min-height: 48px; }
  #next { min-height: 52px; font-size: 17px; padding: 10px 8px; }
  #feedback { font-size: 19px; }
  .actions { gap: 7px; }
  #scene-dock { bottom: 10px; gap: 8px; }
  #scene-dock button { font-size: 15px; min-height: 46px; padding: 8px 11px; }
}
@media (max-width: 360px) {
  #ground { width: 64px; border-radius: 12px; }
  header { padding: 10px; gap: 8px; }
  header #brand { font-size: 15px; }
  header #brand span { display: none; }
  h1 { font-size: 22px; line-height: 1.15; margin-bottom: 14px; }
  .actions { gap: 6px; }
  .icon { width: 40px; min-width: 40px; padding: 0; }
  #next { font-size: 16px; line-height: 1.2; padding: 8px 6px; }
  #next span { display: none; }
  #guide { padding-top: 12px; }
  #journey-controls { margin-top: 10px; }
  #progress { margin-bottom: 8px; }
  #answers { gap: 8px; }
  #answers button { font-size: 16px; padding: 8px 10px; }
  #scene-dock button { font-size: 14px; padding: 7px 9px; }
}
@media (max-width: 760px) and (max-height: 650px) {
  #model-stage { height: 34%; min-height: 200px; }
  #model-stage:has([data-scene-id="cover"]) { height: 28%; min-height: 138px; } /* gate Nov 21: yield 11px so the opener copy is not clipped */
  #guide { padding: 10px 10px 6px; }
  #journey-controls { margin-top: 8px; margin-bottom: 68px; }
  #progress { margin-bottom: 6px; }
  #next { min-height: 46px; }
  h1 { font-size: 22px; margin-bottom: 8px; }
  #step-copy { font-size: 15px; line-height: 1.45; margin-bottom: 10px; }
  #answers { gap: 6px; }
  #answers button { font-size: 14px; line-height: 1.22; padding: 6px 10px; min-height: 34px; }
  .zone-label { font-size: 14px; margin: 0 0 4px; }
  #feedback { font-size: 16px; line-height: 1.45; margin-top: 12px; }
}
@media (min-width: 761px) and (max-height: 600px) {
  header { padding: 10px 24px; }
  #workshop { height: calc(100svh - 82px); min-height: 290px; padding: 0 24px 12px; gap: 24px; grid-template-columns: minmax(0, 1.1fr) minmax(330px, 1fr); }
  #model-stage { min-height: 0; }
  #guide { min-height: 0; padding: 8px 0 0; justify-content: flex-start; }
  #guide-content { min-height: 0; overflow: auto; padding: 0 7px 4px 0; scrollbar-width: thin; }
  h1 { font-size: 26px; margin-bottom: 12px; }
  #step-copy, #feedback { font-size: 18px; }
  #journey-controls { margin-top: 12px; flex: none; }
  #progress { margin-bottom: 10px; }
  #next { padding: 10px; font-size: 17px; }
  #scene-dock { bottom: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
:root[data-theme="dark"] { --paper: #232221; --stage: #26241f; --ink: #f1e4d0; --clay: #514238; --coral: #ed9979; --sky: #9ccce4; color-scheme: dark; }
:root[data-theme="dark"] body::after { opacity: 0.1; }
:root[data-theme="dark"] button { border-color: #bca48b; background: #514238; box-shadow: 2px 3px 0 #151310; }
:root[data-theme="dark"] button:hover { background: #655040; }
:root[data-theme="dark"] .icon { background: transparent; box-shadow: none; border-color: transparent; }
:root[data-theme="dark"] #next { background: #eaa07d; color: #2f221c; border-color: #eaa07d; }
:root[data-theme="dark"] #next:hover { background: #f2b798; }
:root[data-theme="dark"] summary { color: #d8bea0; }
:root[data-theme="dark"] dialog { background: #39312b; color: #f1e4d0; }
:root[data-theme="dark"] #progress i { background: #80705e; }
:root[data-theme="dark"] #progress i.active { background: #eaa07d; }
:root[data-theme="dark"] #ground { background: #2c2925; border-color: #bca48b; box-shadow: 2px 3px 0 #151310; }
:root[data-theme="dark"] #scene-dock button { background: #39312b; color: #f1e4d0; }
:root[data-theme="dark"] #scene-dock button[aria-pressed="true"] { background: #ed9979; color: #2a1b14; }
:root[data-theme="dark"] header #brand span { color: #ed9979; }

h1:focus { outline: none; }
#model-stage { touch-action: pan-y; }
@media (max-width: 760px) {
  #scene-dock { gap: 6px; bottom: 8px; }
  #scene-dock button { font-size: 14px; min-height: 42px; padding: 7px 10px; }
}

.answer-enter { animation: none; }

/* interaction cues: wrong-tap chip flash + idle zone pulse */
#scene-dock.chip-flash, #answers.chip-flash {
  animation: chipFlash 0.7s ease-out;
  border-radius: 12px;
}
@keyframes chipFlash {
  0% { background: rgba(232, 115, 90, 0.28); }
  100% { background: transparent; }
}
#scene-dock.cue-pulse, #answers.cue-pulse { animation: cuePulse 1.1s ease-out; border-radius: 12px; }
@keyframes cuePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(232, 115, 90, 0); }
  40% { box-shadow: 0 0 0 6px rgba(232, 115, 90, 0.35); }
}
.watch-slider { display: flex; flex-direction: column; gap: 6px; padding: 4px 2px; }
.watch-slider input[type=range] { width: 100%; accent-color: var(--coral, #e8735a); min-height: 32px; }
@media (prefers-reduced-motion: reduce) {
  #scene-dock.chip-flash, #answers.chip-flash { background: rgba(232, 115, 90, 0.18); border-radius: 12px; }
}

/* scroll cues: more content above/below the guide port */
#guide-content.has-above { box-shadow: inset 0 14px 10px -12px rgba(0, 0, 0, 0.35); }
#guide-content.has-below { box-shadow: inset 0 -14px 10px -12px rgba(0, 0, 0, 0.35); }
#guide-content.has-above.has-below { box-shadow: inset 0 14px 10px -12px rgba(0, 0, 0, 0.35), inset 0 -14px 10px -12px rgba(0, 0, 0, 0.35); }

#feedback p { margin: 0 0 8px; }
#feedback p:last-child { margin-bottom: 0; }

/* A snapped guide port must contain its children on desktop too. */
#guide-content { overflow: auto; min-height: 0; }
@media (min-width: 761px) and (min-height: 601px) {
  #workshop { height: calc(100svh - 88px); min-height: 0; }
  #model-stage, #guide { min-height: 0; }
}

/* hidden by default; the phone rules below open it in scene/question zones */
#zone-hint { display: none; }

/* Space Ripple pilot pattern: one thing at a time, one way forward (phone only) */
@media (max-width: 760px) {
  #guide-content { flex: 1; display: flex; flex-direction: column; max-height: none !important; } /* pin the bar: no bottom-snap on phone */
  /* cover: no dots, back, or reset yet; the opener centers in the space it has */
  #workshop.covering #progress, #workshop.covering #back, #workshop.covering #reset { display: none; }
  #workshop.covering #next { flex: 1; }
  #workshop.covering #step-title { margin-top: auto; }
  #workshop.covering #answers { margin-bottom: auto; }
  /* the served DOM carries no publish badge; the 72px floor guarded air */
  #journey-controls { margin-bottom: 14px; }
  /* the reset arrow leaves the phone bar; the last step's Begin again still serves */
  #reset { display: none; }
  /* a gated Next becomes a hint line, not a dead button */
  #zone-hint { margin: 0 0 10px; font-size: 15px; text-align: center; opacity: 0.78; }
  #workshop[data-zone="scene"] #zone-hint, #workshop[data-zone="question"] #zone-hint { display: block; }
  #workshop[data-zone="scene"] #next, #workshop[data-zone="question"] #next { display: none; }
  /* the picture is the whole moment: the stage takes the freed height */
  #workshop[data-zone="scene"] #model-stage { flex: 1 1 auto; height: auto; min-height: 230px; max-height: 470px; }
  #workshop[data-zone="scene"] #guide { flex: none; }
  #workshop[data-zone="scene"] #guide-content { flex: none; }
  /* the watch moment is the picture alone; copy and locked chips sleep until it is done */
  #workshop[data-zone="scene"] #step-copy, #workshop[data-zone="scene"] #answers { display: none; }
  /* the question is the work; the step title steps back to a kicker */
  #workshop[data-zone="question"] #step-title { font-size: 15px; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.72; }
  /* answered: unpicked choices fold away and the pick is the receipt */
  #workshop[data-zone="done"] #answers button:not(.picked):not(#teachback) { display: none; }
  #workshop[data-zone="done"] #answers button.picked { animation: chipPop 420ms var(--spring); }
  #workshop[data-zone="done"] #answers button.picked:not(.correct) { animation: chipShake 400ms ease; }
  @keyframes chipPop { 0% { transform: scale(1); } 40% { transform: scale(1.05); } 100% { transform: scale(1); } }
  @keyframes chipShake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 50% { transform: translateX(5px); } 75% { transform: translateX(-3px); } }
  @media (prefers-reduced-motion: reduce) {
    #workshop[data-zone="done"] #answers button.picked { animation: none; }
  }
}

/* gate lessons (Falling Satellite): short phones get a compact one-row dock; no dock while the question has the stage */
@media (max-width: 760px) {
  #workshop[data-zone="question"] #scene-dock { display: none; }
}
@media (max-width: 760px) and (max-height: 650px) {
  #model-stage #scene-dock { flex-wrap: nowrap; overflow-x: auto; gap: 3px; bottom: 6px; max-width: calc(100% - 12px); padding: 2px; scrollbar-width: none; justify-content: flex-start; }
  #model-stage #scene-dock button { font-size: 14px; min-height: 40px; min-width: 34px; padding: 4px 8px; white-space: nowrap; flex: none; }
}

/* gate round 2: 14px floor everywhere on phones; the watch label never wraps and never shrinks the map */
@media (max-width: 760px) {
  #scene-dock button, #model-stage #scene-dock button, #scene-dock .dock-label { font-size: 14px !important; }
  #scene-dock .watch-slider .dock-label { white-space: nowrap; opacity: 0.85; } /* visible instruction; the value rides in the canvas message and the slider's spoken value */
}

/* once answered on a short phone, the receipt and its feedback are the idea; the question copy has done its job */
@media (max-width: 760px) and (max-height: 700px) {
  #workshop[data-zone="done"] #step-copy { display: none; }
}
@media (max-width: 760px) { #guide-spacer { flex: none; } }

/* gate round 2: 44px touch targets on phones */
@media (max-width: 760px) {
  #theme, #about-open, #back { min-width: 44px; min-height: 44px; }
  #scene-dock button, #model-stage #scene-dock button { min-height: 44px !important; min-width: 44px; }
  #answers button { min-height: 44px !important; }
  .watch-slider input[type=range] { min-height: 44px; height: 44px; }
}
@media (max-width: 760px) and (max-height: 600px) {
  #workshop[data-zone="question"] #step-title { display: none; } /* the question is the first thing in the port */
}

/* gate round 3: answered states give the picture the dock's room; the first choice shows whole at 320 */
@media (max-width: 760px) {
  #workshop[data-zone="done"] #scene-dock { display: none; }
}
@media (max-width: 760px) and (max-height: 600px) {
  #workshop[data-zone="question"] #step-copy { font-size: 16px; line-height: 1.28; margin-bottom: 8px; }
  #workshop[data-zone="question"] #model-stage { height: 30%; min-height: 176px; }
}

/* gate cc2: desktop floors, plain title, credit */
header #brand { text-decoration: none; color: inherit; }
.dock-label, .watch-slider .dock-label, #scene-dock .dock-label { font-size: 14px; }
.watch-slider input[type=range] { min-height: 44px; height: 44px; }
.zone-label, #zone-hint { font-size: 14px; }
#credit { margin: 6px 0 0; font-size: 14px; opacity: 0.72; text-align: center; }
@media (max-width: 760px) and (max-height: 650px) {
  #workshop[data-last="true"][data-zone="done"] #scene-dock { display: none; }
  #workshop[data-last="true"][data-zone="done"] #model-stage { min-height: 74px; height: 13%; flex: none; }
}

/* gate cc3 */
#next:disabled { opacity: 1; background: transparent; color: var(--ink); border-style: dashed; box-shadow: none; }
#zone-hint { opacity: 1; color: var(--ink); }
#answers.locked button, #scene-dock.locked button { opacity: 0.75; }
@media (max-width: 760px) and (max-height: 650px) {
  /* the question is visible, so the hint line would repeat it: drop it and give the map the room */
  #workshop[data-zone="question"] #zone-hint { display: none; }
  #workshop[data-zone="question"] #model-stage { height: 36%; min-height: 214px; }
  /* last step, answered: only the teach-back prompt and its model answer stay in view */
  #workshop[data-last="true"][data-zone="done"] #feedback p:not(:nth-last-child(-n+2)) { display: none; }
  #workshop[data-last="true"][data-zone="done"] #feedback { margin-top: 6px; }
}
@media (max-width: 760px) and (max-height: 950px) {
  /* question zone: Back shares the row with the progress dots, so all the choices fit above the fold */
  #workshop[data-zone="question"] #journey-controls { display: flex; align-items: center; gap: 6px; margin-top: 2px; margin-bottom: 8px; }
  #workshop[data-zone="question"] #progress { flex: 1 1 auto; margin: 0; }
  #workshop[data-zone="question"] #journey-controls .actions { flex: none; margin: 0; }
  #workshop[data-zone="question"] #answers { gap: 5px; }
}
@media (max-width: 760px) and (max-height: 950px) {
  /* gate cc4: the title row was 88px with the title alone at the top; shrink it so the choices fit */
  header { height: 44px !important; padding: 8px 10px !important; }
  #workshop { height: calc(100svh - 44px) !important; }
}
@media (max-width: 760px) and (max-height: 950px) {
  #workshop[data-zone="question"] #model-stage { min-height: 226px; }
  #workshop[data-zone="question"] #guide { padding-bottom: 0; padding-top: 4px; }
  #workshop[data-zone="question"] #journey-controls { margin-bottom: 0; }
}
@media (max-width: 760px) and (max-height: 950px) {
  #workshop[data-zone="question"] #answers button { padding-top: 3px; padding-bottom: 3px; }
}
/* lesson-action tokens: Next and the finale are the sky blue of the satellite subject, local to this app */
:root { --lesson-action: #8a5a12; --lesson-action-ink: #f7f3ff; --lesson-action-shadow: #2e2358; --lesson-action-off: #e3ddf2; --lesson-action-off-ink: #4f4670; --lesson-action-off-shadow: #b6aad6; --lesson-action-focus: #3d2f26; }
:root[data-theme="dark"] { --lesson-action: #f0c46e; --lesson-action-ink: #1d1636; --lesson-action-shadow: #7d6fc0; --lesson-action-off: #2f2c28; --lesson-action-off-ink: #cdbfa9; --lesson-action-off-shadow: #151310; --lesson-action-focus: #e4defa; }
:root #next, :root[data-theme="dark"] #next { background: var(--lesson-action); color: var(--lesson-action-ink); border-color: var(--lesson-action-shadow); box-shadow: 2px 3px 0 var(--lesson-action-shadow); }
:root #next:hover, :root[data-theme="dark"] #next:hover { background: var(--lesson-action); filter: brightness(1.06); }
:root #next:active, :root[data-theme="dark"] #next:active { box-shadow: 1px 1px 0 var(--lesson-action-shadow); }
:root #next:focus-visible, :root[data-theme="dark"] #next:focus-visible { outline: 3px solid var(--lesson-action-focus); outline-offset: 4px; }
:root #next:disabled, :root[data-theme="dark"] #next:disabled { background: var(--lesson-action-off); color: var(--lesson-action-off-ink); border-color: var(--lesson-action-off-ink); border-style: dashed; box-shadow: none; opacity: 1; filter: none; }
@media (max-width: 760px) and (max-height: 650px) {
  /* gate cc6: the teach-back map stays a readable map on short phones (it had collapsed to one satellite mark) */
  #workshop[data-last="true"][data-zone="done"] #model-stage { min-height: 156px; height: 27%; flex: none; }
  #workshop[data-last="true"][data-zone="done"] #feedback p:not(:last-child) { display: none; }
  #workshop[data-last="true"][data-zone="done"] #step-title { font-size: 20px; margin: 4px 0; }
}
/* cc10: no faded text anywhere. Locked and disabled controls are solid, dashed, and 4.5:1 or better in both modes */
:root button:disabled, :root #answers.locked button, :root #scene-dock.locked button { opacity: 1; }
:root button:disabled:not([aria-pressed="true"]):not(.picked), :root #answers.locked button:not([aria-pressed="true"]), :root #scene-dock.locked button:not([aria-pressed="true"]) { background: var(--lesson-action-off); color: var(--lesson-action-off-ink); border-style: dashed; border-color: var(--lesson-action-off-ink); box-shadow: none; }
:root .icon:disabled { background: transparent; border-style: solid; border-color: transparent; color: var(--lesson-action-off-ink); }

/* gate Nov 25: short landscape - guide copy beside the stage in two columns,
   so the answered-state feedback keeps real height (was 3-28px at 568x320/740x360) */
/* short landscape (phones on their side): header is slim, dots live in it, the guide column gets the height */
@media (orientation: landscape) and (max-height: 450px) {
  header { height: 50px; padding: 0 18px; align-items: center; }
  header #brand { font-size: 18px; }
  #progress { position: fixed; top: 19px; right: 18px; margin: 0; z-index: 3; }
  #workshop { display: grid; height: calc(100svh - 50px); padding-bottom: max(12px, env(safe-area-inset-bottom)); gap: 18px; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.3fr); min-height: 0; }
  #guide { padding: 4px 0 0; }
  #guide-content { padding: 0 4px 0 0; flex: 1 1 auto; max-height: none; }
  #journey-controls { margin: 8px 0 0; }
  h1 { font-size: 20px; line-height: 1.15; margin-bottom: 6px; }
  #step-copy { font-size: 15px; line-height: 1.4; margin-bottom: 8px; }
  #answers { gap: 6px; }
  #answers button { font-size: 14px; line-height: 1.2; padding: 4px 10px; min-height: 44px; }
  .zone-label { font-size: 14px; margin: 0 0 4px; }
  #feedback { font-size: 15px; line-height: 1.4; margin-top: 8px; }
  #next { min-height: 46px; font-size: 16px; padding: 6px 10px; }
  #scene-dock button { min-height: 44px; font-size: 14px; }
}
@media (orientation: landscape) and (max-height: 450px) and (max-width: 700px) {
  #workshop { grid-template-columns: minmax(0, 0.55fr) minmax(0, 1.45fr); gap: 12px; padding-left: 10px; padding-right: 10px; }
  #step-copy { font-size: 14px; line-height: 1.3; margin-bottom: 6px; }
  h1 { font-size: 18px; margin-bottom: 4px; }
  #answers { gap: 4px; }
  #answers button { font-size: 14px; line-height: 1.15; padding: 2px 8px; }
  #next { min-height: 44px; }
}
@media (orientation: landscape) and (max-height: 450px) {
  #answers.has-fb button:not(.picked) { display: none; }
  #guide-content { scroll-padding: 0; }
}
@media (orientation: landscape) and (max-height: 450px) {
  #workshop[data-zone="question"] #step-copy, #workshop[data-zone="done"] #step-copy { font-size: 15px; line-height: 1.35; margin-bottom: 6px; }
  #workshop[data-zone="scene"] #guide-content { flex: 1 1 auto; }
}
@media (orientation: landscape) and (max-height: 450px) and (max-width: 700px) {
  #workshop { grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); }
  #workshop[data-zone="question"] #step-copy, #workshop[data-zone="done"] #step-copy { font-size: 14px; line-height: 1.3; margin-bottom: 4px; }
}
#theme { margin-left: auto; width: 44px; min-width: 44px; height: 44px; min-height: 44px; padding: 0; font-size: 21px; }
@media (orientation: landscape) and (max-height: 450px) { #progress { right: 74px; } header { padding-right: 14px; } }
@media (orientation: landscape) and (max-height: 450px) { header { height: 50px !important; padding: 0 14px 0 18px !important; } #theme { margin-top: 0; } }
@media (orientation: landscape) and (max-height: 450px) {
  #workshop { grid-template-rows: minmax(0, 1fr); }
  #guide, #model-stage { min-height: 0; height: 100%; max-height: 100%; }
}
@media (orientation: landscape) and (max-height: 450px) {
  #workshop { box-sizing: border-box; height: calc(100svh - 50px) !important; min-height: 0 !important; max-height: calc(100svh - 50px); overflow: hidden; }
}
@media (min-width: 761px) { #guide-content { padding-bottom: 12px; } }
.zone-label, #zone-hint { font-size: 15px !important; font-weight: 600; opacity: 1 !important; color: var(--ink); }
@media (orientation: landscape) and (max-height: 450px) {
  #guide-content, #workshop[data-zone="scene"] #guide-content { flex: 0 1 auto !important; }
  #journey-controls { margin-top: 10px; }
  #zone-hint { display: block !important; margin: 8px 0 0; text-align: left; }
}
@media (orientation: landscape) and (max-height: 450px) {
  #answers button.away { display: none; }
  #workshop[data-zone="scene"] #zone-hint { display: none !important; }
  #workshop[data-zone="scene"] #answers { display: block !important; }
}
@media (orientation: landscape) and (max-height: 450px) {
  #zone-hint { display: none !important; }
  #guide-content, #workshop[data-zone="question"] #guide-content { flex: 1 1 auto !important; min-height: 0; }
  #workshop[data-zone="scene"] #guide-content { flex: 0 1 auto !important; }
}
@media (max-width: 760px) and (orientation: portrait) {
  #model-stage, #workshop[data-zone] #model-stage { height: auto !important; flex: 1 1 auto !important; min-height: 200px; max-height: none !important; }
  #guide { flex: 0 1 auto !important; }
  #guide-content, #workshop[data-zone] #guide-content { flex: 0 1 auto !important; max-height: 48svh; }
  #journey-controls { margin-top: 12px; }
}
#workshop[data-zone="scene"] #zone-hint { display: none !important; }
#scene-dock button { white-space: nowrap; }
@media (orientation: landscape) and (max-height: 450px) {
  #scene-dock { width: max-content; max-width: calc(100% - 12px); flex-wrap: nowrap; }
  #scene-dock button { padding: 6px 12px; font-size: 14px; }
}
@media (orientation: landscape) and (max-height: 450px) {
  #guide { justify-content: center; }
  #workshop:not([data-zone="question"]):not([data-zone="done"]) #guide-content { flex: 0 1 auto !important; }
}
#answers .zone-label { display: none !important; }
#back { border-radius: 50%; border: 2px solid var(--ink); background: #fff8ed; box-shadow: 2px 3px 0 var(--ink); width: 44px; min-width: 44px; height: 44px; min-height: 44px; padding: 0; font-size: 22px; }
:root[data-theme="dark"] #back { background: #3a352d; }
#progress i { background: #8b7a68 !important; opacity: 1; }
:root[data-theme="dark"] #progress i { background: #b3a28f !important; }
#progress i.active { background: #a5422c !important; }
:root[data-theme="dark"] #progress i.active { background: #ed9979 !important; }
@media (max-width: 760px) and (orientation: portrait) and (max-height: 640px) {
  #model-stage, #workshop[data-zone] #model-stage { min-height: 140px; }
}
@media (orientation: landscape) and (max-height: 450px) {
  .watch-slider .dock-label { display: none; }
  #scene-dock .watch-slider { min-width: 150px; }
}

/* v7: map message rides in the guide in short landscape so the map fills the card; slider and cue restyled */
#stage-msg { display: none; margin: 0 0 8px; font-size: 15px; font-weight: 600; line-height: 1.3; }
@media (orientation: landscape) and (max-height: 450px) { #stage-msg:not(:empty) { display: block; } .watch-slider .dock-label { display: none; } }
.watch-slider { width: min(300px, calc(100vw - 72px)); max-width: 100%; box-sizing: border-box; min-width: 0; }
.watch-slider .dock-label, #scene-dock .watch-slider .dock-label { white-space: normal; text-align: center; }
.watch-slider input[type=range] { width: 100%; min-width: 0; box-sizing: border-box; margin: 0; }
@media (orientation: landscape) and (max-height: 450px) { #scene-dock .watch-slider { width: 190px; min-width: 150px; } }
@keyframes cuePulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(60, 40, 30, 0); } 40% { box-shadow: 0 0 0 5px rgba(60, 40, 30, 0.18); } }
@keyframes chipFlash { 0% { background: rgba(60, 40, 30, 0.14); } 100% { background: transparent; } }
@media (orientation: landscape) and (max-height: 450px) { #workshop[data-zone="question"] #stage-msg, #workshop[data-zone="done"] #stage-msg { display: none !important; } }

/* v8: short landscape: the card is square and holds only the map; the dock rides in the text column */
@media (orientation: landscape) and (max-height: 450px) {
  #workshop { grid-template-columns: calc(100svh - 62px) minmax(0, 1fr) !important; }
  #model-stage { justify-self: stretch; }
  #guide-content > #scene-dock { position: static; transform: none; width: auto; max-width: 100%; margin: 4px 0 8px; justify-content: flex-start; flex-wrap: wrap; overflow: visible; padding: 0; bottom: auto; }
  #workshop[data-zone="question"] #scene-dock, #workshop[data-zone="done"] #scene-dock { display: none; }
  #guide-content > #scene-dock .watch-slider { width: min(230px, 100%); min-width: 0; } #guide-content > #scene-dock .dock-label { text-align: left !important; padding: 0 !important; }
  .watch-slider .dock-label { display: block; }
  #stage-msg { margin-bottom: 4px; }
}
/* v8: range control with a visible track in both themes */
.watch-slider input[type=range] { -webkit-appearance: none; appearance: none; background: transparent; accent-color: auto; }
.watch-slider input[type=range]::-webkit-slider-runnable-track { height: 8px; border-radius: 4px; background: #8b7a68; border: 1px solid var(--ink); }
.watch-slider input[type=range]::-moz-range-track { height: 8px; border-radius: 4px; background: #8b7a68; border: 1px solid var(--ink); }
.watch-slider input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; margin-top: -11px; border-radius: 50%; background: var(--coral, #e8735a); border: 2px solid var(--ink); }
.watch-slider input[type=range]::-moz-range-thumb { width: 24px; height: 24px; border-radius: 50%; background: var(--coral, #e8735a); border: 2px solid var(--ink); }
:root[data-theme="dark"] .watch-slider input[type=range]::-webkit-slider-runnable-track { background: #cdbca7; border-color: #f1e4d0; }
:root[data-theme="dark"] .watch-slider input[type=range]::-moz-range-track { background: #cdbca7; border-color: #f1e4d0; }
:root[data-theme="dark"] .watch-slider input[type=range]::-webkit-slider-thumb { background: #ed9979; border-color: #f1e4d0; }
:root[data-theme="dark"] .watch-slider input[type=range]::-moz-range-thumb { background: #ed9979; border-color: #f1e4d0; }
/* v8: 320 breathing room for the title */
@media (max-width: 400px) { header { padding: 12px 14px 8px 16px !important; } }
@media (orientation: landscape) and (max-height: 450px) and (max-width: 700px) {
  #workshop[data-zone="question"], #workshop[data-zone="done"] { grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr) !important; }
}
@media (orientation: landscape) and (max-height: 450px) { #feedback { margin-top: 5px; } #answers { gap: 5px; } }
.dock-label, .watch-slider .dock-label, #scene-dock .dock-label { opacity: 1 !important; }
#credit { opacity: 0.88; font-size: 14px; }
/* v10: a correct pick reads green, a wrong pick reads warm amber; the source line gets room in short landscape */
#answers button.picked.correct[aria-pressed="true"] { background: #cfe8cf; color: #1d2b1d; border-color: #3f7d46; }
#answers button.picked:not(.correct)[aria-pressed="true"] { background: #f6d9a8; color: #2a1b14; }
:root[data-theme="dark"] #answers button.picked.correct[aria-pressed="true"] { background: #2f5a36; color: #f1e4d0; border-color: #8cc79a; }
:root[data-theme="dark"] #answers button.picked:not(.correct)[aria-pressed="true"] { background: #6b4a22; color: #f1e4d0; }
@media (orientation: landscape) and (max-height: 450px) { #workshop[data-zone="done"] #step-copy { display: none; } #credit { margin-top: 4px; } }
/* v10: the 44px theme button gets its own row height in portrait phones so it never overlaps the card */
@media (max-width: 760px) and (orientation: portrait) {
  header { height: 58px !important; padding: 7px 14px 7px 16px !important; align-items: center !important; }
  #workshop { height: calc(100svh - 58px) !important; }
}

/* Black-Hole Observatory shell additions */
.header-tools { display: flex; gap: 8px; align-items: center; margin-left: auto; }
.header-tools #theme { margin-left: 0; }
#theme, #about-open { width: 44px; min-width: 44px; height: 44px; min-height: 44px; padding: 0; font-size: 21px; border-radius: 50%; }
#about-open { font-size: 20px; }
:root[data-theme="dark"] #about-open { background: #3a352d; }
#about-close { min-height: 48px; }
header #brand { flex: 1 1 auto; min-width: 0; font-size: 16px; line-height: 1.15; }
.header-tools { flex: 0 0 auto; }
header #brand { white-space: normal; overflow-wrap: anywhere; letter-spacing: -0.5px; }
@media (max-width: 360px) { header { gap: 8px !important; padding-left: 12px !important; padding-right: 10px !important; } header #brand { font-size: 15px; } .header-tools { gap: 6px; } }
@media (orientation: landscape) and (max-height: 450px) {
  #progress { right: 122px !important; }
  #workshop[data-zone="question"] #guide-content { font-size: 14px; line-height: 1.25; }
  #workshop[data-zone="question"] #guide-content p { margin: 0 0 4px; font-size: 14px; line-height: 1.25; }
  #workshop[data-zone="question"] #answers { gap: 4px; }
  #workshop[data-zone="question"] #answers button { min-height: 44px; padding-top: 4px; padding-bottom: 4px; margin: 0; }
  #workshop[data-zone="question"] #journey-controls { margin-top: 4px; }
}
@media (orientation: landscape) and (max-height: 450px) and (max-width: 700px) {
  #workshop[data-zone="question"] { position: relative; }
  #workshop[data-zone="question"] #journey-controls { position: absolute; left: 10px; bottom: 2px; margin: 0; z-index: 2; }
  #workshop[data-zone="question"] #guide { padding-bottom: 0; }
}
@media (orientation: landscape) and (max-height: 450px) { #scene-dock .watch-slider .dock-label { display: none; } }
#answers button { line-height: 1.3; padding-top: 9px; padding-bottom: 9px; height: auto; }
/* bho2: picked receipt never leaves a half-cut title above it */
#guide-content #step-title { scroll-margin-top: 0; }
@media (orientation: landscape) and (max-height: 450px) and (max-width: 700px) {
  #workshop[data-zone="question"] #guide-content, #workshop[data-zone="question"] #guide-content p, #workshop[data-zone="question"] #answers button { font-size: 14px !important; }
  #workshop[data-zone="question"] #journey-controls { bottom: 12px; }
}

/* cond2: label air, desktop text scale, finale card */
.watch-slider .dock-label { margin-bottom: 8px; font-size: 15px; opacity: 1; }
#finale { margin-top: 18px; padding: 16px 18px; border: 2px solid var(--ink); border-radius: 18px; background: #fff3d6; box-shadow: 3px 4px 0 var(--ink); }
#finale h2 { margin: 0 0 8px; font-size: 22px; line-height: 1.2; }
#finale p { margin: 0 0 6px; font-size: 17px; line-height: 1.45; }
#finale .finale-credit { font-size: 14px; opacity: 0.8; margin: 10px 0 0; }
@media (min-width: 1000px) {
  header #brand { font-size: 26px; }
  #progress { gap: 11px; height: 16px; }
  #progress i { width: 12px; height: 12px; }
  #progress i.active { width: 34px; }
  #model-stage #scene-dock button { font-size: 19px; min-height: 56px; padding: 10px 22px; }
  .watch-slider .dock-label { font-size: 21px; margin-bottom: 12px; }
  #stage-msg { font-size: 20px; }
  #finale h2 { font-size: 28px; }
  #finale p { font-size: 20px; }
  #finale .finale-credit { font-size: 16px; }
}

/* cond3: finale is a clean full panel; celebration; desktop body copy; bottom air */
#workshop[data-finale="true"] #answers,
#workshop[data-finale="true"] #step-copy,
#workshop[data-finale="true"] #step-title,
#workshop[data-finale="true"] #stage-msg,
#workshop[data-finale="true"] #feedback > p { display: none !important; }
#workshop[data-finale="true"] #feedback { margin-top: 0; }
#workshop[data-finale="true"] #finale { margin-top: 4px; }
#finale { position: relative; overflow: hidden; animation: finale-pop 520ms var(--spring) both; }
#finale > :not(.spark) { position: relative; z-index: 1; }
#finale .spark { position: absolute; top: 50%; left: 50%; width: 10px; height: 10px; border-radius: 50%; background: #e8735a; opacity: 0; animation: finale-spark 1300ms ease-out calc(var(--k) * 60ms) 1 both; }
#finale .spark:nth-of-type(3n) { background: #d9a62b; }
#finale .spark:nth-of-type(3n+1) { background: #2c6c91; }
@keyframes finale-pop { from { transform: scale(0.88); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes finale-spark { 0% { opacity: 1; transform: translate(-50%, -50%) rotate(calc(var(--k) * 36deg)) translateY(0); } 100% { opacity: 0; transform: translate(-50%, -50%) rotate(calc(var(--k) * 36deg)) translateY(120px); } }
@media (prefers-reduced-motion: reduce) { #finale, #finale .spark { animation: none; } #finale .spark { display: none; } }
@media (min-width: 1000px) {
  #step-copy { font-size: 26px; line-height: 1.5; }
  #feedback { font-size: 24px; }
  #answers button { font-size: 22px; }
  .watch-slider .dock-label { font-size: 22px; }
}
@media (max-width: 400px) and (min-height: 500px) {
  #journey-controls { padding-bottom: 8px; }
}

@media (max-width: 760px) {
  #workshop[data-finale="true"] #model-stage { flex: none !important; height: 0 !important; min-height: 0 !important; overflow: hidden; visibility: hidden; margin: 0 !important; padding: 0 !important; border: 0 !important; }
  #workshop[data-finale="true"] #guide-content { max-height: none !important; flex: 1 1 auto !important; height: auto !important; overflow-y: auto; }
}
@media (max-width: 760px) {
  #workshop[data-finale="true"] #feedback { max-height: none !important; height: auto !important; overflow: visible !important; flex: none !important; }
  #workshop[data-finale="true"] #finale { height: auto !important; max-height: none !important; flex: none !important; min-height: min-content; }
}
@media (max-width: 760px) and (orientation: portrait) {
  #workshop[data-finale="true"] { display: flex !important; flex-direction: column; }
  #workshop[data-finale="true"] #guide { flex: 1 1 auto !important; min-height: 0; height: auto !important; display: flex; flex-direction: column; }
  #workshop[data-finale="true"] #guide-content { flex: 1 1 auto !important; min-height: 0; }
  #workshop[data-finale="true"] #finale { overflow: visible !important; }
  #workshop[data-finale="true"] #journey-controls { margin-top: auto; }
}
#workshop #feedback #finale p { display: block !important; }
#answers.has-fb button#teachback { display: inline-flex !important; align-items: center; justify-content: center; min-height: 44px; }
@media (orientation: landscape) and (max-height: 450px) {
  #workshop[data-finale="true"] #model-stage { flex: none !important; width: 0 !important; min-width: 0 !important; height: 0 !important; overflow: hidden; visibility: hidden; margin: 0 !important; padding: 0 !important; }
  #workshop[data-finale="true"] #guide { width: 100% !important; max-width: none !important; flex: 1 1 100% !important; }
  #finale h2 { font-size: 19px; margin-bottom: 4px; }
  #finale p { font-size: 15px; margin-bottom: 3px; line-height: 1.3; }
  #finale .finale-credit { font-size: 14px; margin-top: 4px; }
  #finale { padding: 10px 14px; }
  #journey-controls { padding-bottom: 6px; }
}
@media (orientation: landscape) and (max-height: 450px) {
  #workshop[data-finale="true"] { display: block !important; }
  #workshop[data-finale="true"] #guide { padding-left: 16px; padding-right: 16px; }
  #finale { padding: 8px 14px; }
  #finale h2 { font-size: 18px; margin-bottom: 3px; }
  #finale p { font-size: 14px; margin-bottom: 2px; line-height: 1.25; }
}
@media (min-width: 1000px) {
  #scene-dock .dock-label, .watch-slider .dock-label { font-size: 22px !important; }
  #scene-dock button, #model-stage #scene-dock button { font-size: 21px !important; min-height: 56px !important; padding: 10px 24px !important; }
}

/* cond4: confetti sits behind an opaque card; dark card; centred finale */
#finale-wrap { position: relative; margin: auto 0; padding: 8px 0; display: flex; flex-direction: column; justify-content: center; }
#finale-wrap > #finale { position: relative; z-index: 1; overflow: visible; margin: 0; }
#finale-wrap > .spark { position: absolute; z-index: 0; top: 50%; left: 50%; width: 10px; height: 10px; border-radius: 50%; background: #e8735a; opacity: 0; animation: finale-spark 1300ms ease-out calc(var(--k) * 60ms) forwards; }
#finale-wrap > .spark:nth-of-type(3n) { background: #d9a62b; }
#finale-wrap > .spark:nth-of-type(3n+1) { background: #2c6c91; }
@media (prefers-reduced-motion: reduce) { #finale-wrap > .spark { display: none; animation: none; } }
#finale .spark { display: none !important; }
:root[data-theme="dark"] #finale { background: #2f2a24; color: #f6ecd9; border-color: #f1e4d0; box-shadow: 3px 4px 0 #0e0d0c; }
:root[data-theme="dark"] #finale h2, :root[data-theme="dark"] #finale p { color: #f6ecd9; opacity: 1; }
:root[data-theme="dark"] #finale .finale-credit { color: #d9cbb4; }
#workshop[data-finale="true"] #feedback { display: flex !important; flex-direction: column; flex: 1 1 auto !important; min-height: 0; }
#workshop[data-finale="true"] #finale-wrap { flex: 1 1 auto; }
@media (max-width: 700px) and (orientation: portrait) {
  #finale { padding: 22px 20px; }
  #finale h2 { font-size: 26px; margin-bottom: 12px; }
  #finale p { font-size: 19px; line-height: 1.45; margin-bottom: 10px; }
  #finale .finale-credit { font-size: 14px; }
}
/* header title stays on one line */
@media (max-width: 420px) { header #brand { white-space: nowrap !important; overflow: hidden; text-overflow: clip; font-size: 15px !important; letter-spacing: -0.4px; } }
@media (max-width: 340px) {
  header #brand { font-size: 14px !important; letter-spacing: -0.3px; }
  #finale { padding: 14px 14px !important; }
  #finale h2 { font-size: 21px !important; margin-bottom: 8px !important; }
  #finale p { font-size: 16px !important; margin-bottom: 6px !important; }
  #finale .finale-credit { font-size: 14px !important; }
}

/* cond4: cover art fills its stage with no dead gap; landscape cover card matches the square stage */
#workshop.covering #step-title { margin-top: 10px !important; }
#workshop.covering #answers { margin-bottom: 0 !important; }
@media (orientation: landscape) and (max-height: 450px) {
  #model-stage:has([data-scene-id="cover"]) { height: auto !important; min-height: calc(100svh - 62px) !important; max-height: none !important; }
}
@media (max-width: 340px) { #scene-dock button, #model-stage #scene-dock button, #answers button, #teachback, #next { font-size: 15px !important; } }

/* cond5: quiet replay, 14px credit, centred landscape finale, bottom air, no resting dots */
#replay { align-self: center; margin-top: 12px; min-height: 44px; min-width: 120px; padding: 8px 18px; font-size: 15px; font-weight: 600; background: transparent; color: var(--ink); border: 2px solid var(--ink); border-radius: 22px; box-shadow: none; cursor: pointer; }
#finale-wrap > .spark { opacity: 0; }
#finale .finale-credit { font-size: 14px !important; }
#workshop[data-finale="true"] #guide-content { display: flex !important; flex-direction: column; }
@media (orientation: landscape) and (max-height: 450px) {
  #workshop[data-finale="true"] #journey-controls { margin-bottom: 8px; padding-bottom: 6px; }
  #workshop[data-finale="true"] #finale-wrap { margin: auto 0; }
  #replay { min-height: 44px; margin-top: 8px; }
  #step-copy { font-size: 14px; }
  #finale .finale-credit { font-size: 14px !important; }
}
#finale-box { margin: auto 0; display: flex; flex-direction: column; align-items: stretch; flex: 0 0 auto; }
#finale-box > #finale-wrap { margin: 0; flex: 0 0 auto; }
#workshop[data-finale="true"] #finale-wrap { flex: 0 0 auto; }
#replay { position: relative; z-index: 2; }

/* cond5b: sparks off; finale fills the guide so the card centres with Play again visible */
#finale-wrap > .spark, #finale .spark { display: none !important; }
#workshop[data-finale="true"][data-zone] #guide-content, #workshop[data-finale="true"]:not([data-zone="question"]):not([data-zone="done"]) #guide-content { flex: 1 1 auto !important; min-height: 0; overflow-y: auto; }
#workshop[data-finale="true"] #guide { justify-content: stretch !important; }
@media (orientation: landscape) and (max-height: 450px) {
  #workshop[data-finale="true"] #replay { position: fixed; right: 18px; bottom: 16px; margin: 0; background: var(--paper); z-index: 5; }
}
@media (orientation: landscape) and (max-height: 340px) { #workshop[data-finale="true"] #replay { bottom: 40px; } }
@media (orientation: landscape) and (min-height: 341px) and (max-height: 450px) { #workshop[data-finale="true"] #replay { bottom: 27px; } }
@media (max-width: 340px) and (orientation: portrait) { #model-stage, #workshop[data-zone] #model-stage { min-height: 178px !important; } #workshop[data-finale="true"] #model-stage { min-height: 0 !important; } }

/* cond6: 320 feedback fits without a scroll fade; desktop finale is a full-width centred card; bigger desktop cover type */
@media (max-width: 340px) and (orientation: portrait) {
  #workshop[data-zone="done"]:not([data-finale="true"]) #model-stage { min-height: 162px !important; }
  #workshop #feedback > p:first-child { margin-bottom: 4px; }
  #workshop[data-zone="done"]:not([data-finale="true"]) #feedback p { line-height: 1.32; margin-bottom: 5px; font-size: 15px; }
  #workshop[data-zone="done"]:not([data-finale="true"]) #guide-content { max-height: 56svh !important; }
  #workshop[data-zone="done"] #answers button { min-height: 44px; }
}
@media (min-width: 761px) and (min-height: 451px) {
  #workshop[data-finale="true"] { display: flex !important; flex-direction: column; align-items: center; }
  #workshop[data-finale="true"] #model-stage { display: none !important; }
  #workshop[data-finale="true"] #guide { width: min(860px, 100%) !important; max-width: 860px !important; flex: 1 1 auto !important; margin: 0 auto; }
  #workshop[data-finale="true"] #finale-box { margin: auto 0; }
  #workshop[data-finale="true"] #finale { padding: 34px 40px; }
  #workshop[data-finale="true"] #finale h2 { font-size: 40px !important; margin-bottom: 16px; }
  #workshop[data-finale="true"] #finale p { font-size: 24px !important; line-height: 1.45; margin-bottom: 12px; }
  #workshop[data-finale="true"] #finale .finale-credit { font-size: 16px !important; }
  #workshop[data-finale="true"] #replay { font-size: 18px; min-height: 52px; margin-top: 18px; }
}
@media (min-width: 1000px) {
  #workshop.covering h1, #workshop.covering #step-title { font-size: 52px !important; }
  #workshop.covering #step-copy { font-size: 28px !important; line-height: 1.5; }
  #workshop.covering #next { font-size: 24px !important; min-height: 64px; }
}
@media (max-width: 340px) and (orientation: portrait) { #workshop[data-zone="done"]:not([data-finale="true"]) #guide-content.has-above, #workshop[data-zone="done"]:not([data-finale="true"]) #guide-content.has-below { box-shadow: none; } }

/* cond7 */
.finale-art { display: none; }
@media (min-width: 761px) and (min-height: 451px) {
  #workshop[data-finale="true"] .finale-art { display: block; width: 150px; margin: 0 auto 10px; }
  #workshop[data-finale="true"] .finale-art svg { width: 100%; height: auto; display: block; }
  #workshop[data-finale="true"] #journey-controls, #workshop[data-finale="true"] #progress { align-self: center; justify-content: center; margin-left: auto; margin-right: auto; width: min(860px, 100%); }
  #workshop[data-finale="true"] #journey-controls { display: flex; justify-content: center; }
  #workshop[data-finale="true"] #progress { display: flex; justify-content: center; position: static; }
}
@media (min-width: 1000px) { #workshop.covering #next { align-self: flex-start; margin-left: 0 !important; margin-right: auto; } #workshop.covering #progress { justify-content: flex-start; } }
@media (max-width: 340px) and (orientation: portrait) { #replay { margin-top: 14px; } #finale-box { padding-bottom: 14px; } }
@media (min-width: 761px) and (min-height: 451px) {
  #workshop[data-finale="true"] #journey-controls { justify-content: center !important; width: min(760px, 100%) !important; }
  #workshop[data-finale="true"] #next { flex: 0 1 340px !important; white-space: nowrap; min-width: 240px; }
  #workshop[data-finale="true"] #progress { align-self: center; }
}
@media (min-width: 1000px) {
  #workshop.covering #journey-controls { justify-content: flex-start !important; padding-left: 0 !important; margin-left: 0 !important; }
  #workshop.covering #next { margin: 0 !important; }
}
@media (min-width: 761px) and (min-height: 451px) {
  #workshop[data-finale="true"] #journey-controls { flex-direction: column !important; align-items: center !important; gap: 14px !important; }
  #workshop[data-finale="true"] #journey-controls .actions { display: flex; justify-content: center; align-items: center; gap: 10px; }
  #workshop[data-finale="true"] #progress { width: auto !important; margin: 0 !important; }
}
@media (min-width: 1000px) {
  #workshop.covering #back { display: none !important; }
}
@media (orientation: portrait) and (max-width: 380px) and (max-height: 700px) {
  #workshop[data-finale="true"] #finale h2, #workshop[data-finale="true"] #finale h3 { font-size: 22px !important; line-height: 1.2 !important; }
  #workshop[data-finale="true"] #finale p { font-size: 15px !important; line-height: 1.4 !important; }
  #workshop[data-finale="true"] #finale .credit, #workshop[data-finale="true"] #finale p:last-child { font-size: 14px !important; }
  #workshop[data-finale="true"] #finale { padding: 14px 16px !important; }
  #workshop[data-finale="true"] #replay { margin-top: 12px !important; margin-bottom: 14px !important; }
}
@media (min-width: 1000px) and (min-height: 600px) {
  #model-stage, #guide { max-height: calc(100% - 24px) !important; height: calc(100% - 24px) !important; align-self: start; }
}
@media (min-width: 1000px) and (min-height: 600px) { #model-stage, #guide { margin-top: -14px !important; height: calc(100% - 10px) !important; max-height: calc(100% - 10px) !important; } }
@media (orientation: portrait) and (min-height: 700px) and (max-width: 760px) {
  #workshop[data-zone="question"]:not([data-finale="true"]) #model-stage { height: 330px !important; min-height: 0 !important; flex: none !important; }
  #workshop[data-zone="question"] #answers { gap: 8px !important; }
  #workshop[data-zone="question"] #answers button { min-height: 48px !important; margin: 0 !important; }
  #workshop[data-zone="question"] #zone-hint { margin-top: 12px !important; }
}
#progress, #progress i { pointer-events: none; }
@media (max-width: 760px) and (orientation: portrait) {
  #workshop[data-finale="true"] #finale, #workshop[data-finale="true"] #finale-wrap, #workshop[data-finale="true"] #finale-box { width: 100% !important; max-width: 100% !important; margin-right: 0 !important; box-sizing: border-box; }
  #workshop[data-finale="true"] #finale { width: calc(100% - 7px) !important; }
}
@media (min-width: 761px) and (min-height: 451px) {
  #workshop[data-finale="true"] #finale-box { margin-top: auto !important; }
  #workshop[data-finale="true"] #journey-controls { margin-top: 18px !important; margin-bottom: auto !important; }
}
@media (orientation: landscape) and (max-height: 450px) {
  #guide-content, #feedback { scroll-padding-bottom: 24px; }
  #feedback { padding-bottom: 28px !important; }
}
@media (min-width: 761px) and (min-height: 451px) { #workshop[data-finale="true"] #feedback { padding-bottom: 0 !important; margin-bottom: 0 !important; } #workshop[data-finale="true"] #guide-content { flex: 0 1 auto !important; } }
@media (max-width: 760px) and (orientation: portrait) { #workshop[data-finale="true"] #finale-box { margin-right: -7px !important; width: calc(100% + 7px) !important; } #workshop[data-finale="true"] #finale { width: calc(100% - 7px) !important; } }
@media (orientation: portrait) and (min-height: 760px) and (max-width: 760px) {
  #workshop[data-zone="done"]:not([data-finale="true"]):not([data-last="true"]) #model-stage { height: 258px !important; min-height: 258px !important; flex: none !important; }
  #workshop[data-zone="done"] #progress { margin-top: 10px !important; }
}
@media (orientation: portrait) and (max-width: 340px) {
  #workshop[data-finale="true"] #finale h2, #workshop[data-finale="true"] #finale h3 { font-size: 19px !important; }
  #workshop[data-finale="true"] #finale p { line-height: 1.32 !important; }
  #workshop[data-finale="true"] #replay { margin-top: 8px !important; margin-bottom: 12px !important; }
}

#answers button.picked::before { content: "Your answer: "; font-weight: 700; }
@media (orientation: portrait) and (min-height: 800px) and (max-width: 760px) { #workshop[data-zone="question"]:not([data-finale="true"]) #model-stage { height: 372px !important; } }
/* phone finale art */
@media (orientation: portrait) and (max-width: 760px) {
  #workshop[data-finale="true"] .finale-art { display: block; width: 72px; margin: 0 auto 6px; }
  #workshop[data-finale="true"] .finale-art svg { width: 100%; height: auto; display: block; }
}
@media (orientation: portrait) and (max-width: 760px) and (min-height: 800px) { #workshop[data-finale="true"] .finale-art { width: 112px; margin-bottom: 10px; } }
@media (orientation: portrait) and (max-width: 340px) { #workshop[data-finale="true"] .finale-art { width: 44px; margin-bottom: 2px; } }
@keyframes artPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.07); } }
#workshop[data-finale="true"] .finale-art svg { animation: artPulse 2.4s ease-in-out infinite; transform-origin: 50% 45%; }
@media (prefers-reduced-motion: reduce) { #workshop[data-finale="true"] .finale-art svg { animation: none; } }
@media (min-width: 1000px) and (min-height: 600px) { #workshop[data-finale="true"] .finale-art { width: 230px !important; margin: 0 auto 14px !important; } }
@media (min-width: 1000px) and (min-height: 600px) { #workshop[data-finale="true"] .finale-art { width: 150px !important; margin: 0 auto 8px !important; } }
@media (orientation: portrait) and (max-width: 340px) and (max-height: 620px) {
  #workshop[data-finale="true"] .finale-art { width: 32px !important; margin: 0 auto 0 !important; }
  #workshop[data-finale="true"] #finale { padding: 8px 14px 10px !important; }
  #workshop[data-finale="true"] #finale h2, #workshop[data-finale="true"] #finale h3 { font-size: 18px !important; margin-bottom: 4px !important; }
  #workshop[data-finale="true"] #replay { margin-top: 6px !important; margin-bottom: 6px !important; }
  #workshop[data-zone="done"]:not([data-finale="true"]):not([data-last="true"]) #model-stage { height: 176px !important; min-height: 176px !important; }
}
@media (orientation: portrait) and (max-width: 340px) { #workshop[data-zone="done"] #feedback { padding-bottom: 14px !important; } }
@media (orientation: landscape) and (max-height: 450px) {
  #workshop[data-zone="done"] #answers button.picked { min-height: 44px !important; padding-top: 4px !important; padding-bottom: 4px !important; font-size: 14px !important; line-height: 1.2 !important; }
  #workshop[data-zone="done"] #feedback p { margin: 0 0 5px !important; line-height: 1.3 !important; font-size: 14px !important; }
  #workshop[data-zone="done"] #feedback { padding-bottom: 26px !important; }
}
/* cond11 */
@media (max-width: 340px) { header #brand { white-space: nowrap !important; overflow: hidden; text-overflow: clip; font-size: 14px !important; letter-spacing: -0.4px !important; } }
#back { width: 44px !important; min-width: 44px !important; height: 44px !important; min-height: 44px !important; }
#finale .finale-credit, #workshop[data-finale="true"] #finale .finale-credit { font-size: 14px !important; line-height: 1.3; }
#tray { display: flex; gap: 6px; justify-content: center; margin: 6px 8px 0; }
#tray[hidden] { display: none; }
.tray-chip { min-height: 44px; min-width: 44px; padding: 0 8px; display: inline-flex; align-items: center; font-size: 14px; border-radius: 12px; border: 2px solid var(--ink); background: #fff8ed; }
.tray-chip.on { background: #ffe28a; } .tray-chip.off { background: #e6dccb; } .tray-chip.unseen { opacity: 0.55; border-style: dashed; }
:root[data-theme="dark"] .tray-chip { background: #3a352d; color: #f0e6d6; }
#tray{margin-bottom:8px}
#tray { gap: 4px; margin-left: 8px; margin-right: 8px; }
.tray-chip { flex: 1 1 0; min-width: 0; padding: 2px 3px; flex-direction: column; justify-content: center; white-space: pre-line; text-align: center; line-height: 1.15; }
.tray-chip { padding: 2px 0 !important; letter-spacing: -0.2px; }
@media (orientation: landscape) and (max-height: 450px) {
  #tray { margin-top: 2px; margin-bottom: 4px; }
  #workshop[data-zone="done"] #answers button.picked { padding-top: 4px; padding-bottom: 4px; min-height: 44px; }
  #workshop[data-zone="done"]:not([data-finale="true"]) #guide-content p { margin-top: 4px; margin-bottom: 4px; }
}
@media (orientation: landscape) and (max-height: 450px) { #workshop[data-zone="done"]:not([data-finale="true"]) #tray { display: none; } }
@media (orientation: landscape) and (max-height: 340px) { #workshop[data-finale="true"] #replay { bottom: 27px !important; } }
@media (max-width: 340px) { .tray-chip { letter-spacing: -0.6px; } #tray { gap: 3px; margin-left: 4px; margin-right: 4px; } }
@media (max-width: 340px) and (orientation: portrait) {
  #model-stage, #workshop[data-zone] #model-stage { min-height: 204px !important; }
  #workshop[data-zone="done"]:not([data-finale="true"]) #model-stage { min-height: 204px !important; }
  #workshop[data-zone="question"]:not([data-finale="true"]) #model-stage { height: 204px !important; }
  .tray-chip { min-height: 44px; }
}
@media (max-width: 340px) and (orientation: portrait) { #tray { display: none !important; } }
@media (max-width: 340px) and (orientation: portrait) {
  #workshop[data-zone="done"]:not([data-finale="true"]):not([data-last="true"]) #model-stage, #workshop[data-zone="done"]:not([data-finale="true"]) #model-stage { height: 204px !important; min-height: 204px !important; }
  #workshop[data-finale="true"] #model-stage { min-height: 0 !important; height: 0 !important; }
}
@media (max-width: 340px) and (orientation: portrait) {
  #workshop[data-zone="done"]:not([data-finale="true"]) #model-stage { height: 190px !important; min-height: 190px !important; }
  #workshop[data-zone="done"]:not([data-finale="true"]) #answers button.picked { padding-top: 5px !important; padding-bottom: 5px !important; min-height: 44px; }
  #workshop[data-zone="done"]:not([data-finale="true"]) #guide-content p { margin-top: 3px !important; margin-bottom: 3px !important; }
}
@media (max-width: 340px) and (orientation: portrait) {
  #workshop[data-zone="done"]:not([data-finale="true"]) #answers button.picked { font-size: 14px !important; line-height: 1.2 !important; padding-left: 10px !important; padding-right: 8px !important; }
  #workshop[data-zone="done"]:not([data-finale="true"]) #model-stage { height: 180px !important; min-height: 180px !important; }
}
@media (min-width: 700px) { #workshop[data-zone="done"]:not([data-finale="true"]) #answers button:not(.picked):not(#teachback) { display: none !important; } }
@media (max-width: 380px) and (orientation: portrait) { #workshop[data-zone="done"]:not([data-finale="true"]) #step-copy, #workshop[data-zone="done"]:not([data-finale="true"]) #guide-content > h1, #workshop[data-zone="done"]:not([data-finale="true"]) #q-title { display: none !important; } }
@media (max-width: 420px) and (orientation: portrait) { #workshop[data-zone="done"]:not([data-finale="true"]) #tray { display: none !important; } }
@media (min-width: 341px) and (max-width: 380px) and (orientation: portrait) {
  #workshop[data-zone="question"]:not([data-finale="true"]) #model-stage { height: 262px !important; min-height: 0 !important; }
  #workshop[data-zone="question"]:not([data-finale="true"]) #tray { margin-bottom: 4px; }
}
/* cond12: setup line before the question, question line in feedback, no scroll shadows, no nag line */
#guide-content, #guide-content.has-above, #guide-content.has-below { box-shadow: none !important; }
#qline { margin: 0 0 8px; font-size: 16px; line-height: 1.3; font-weight: 600; }
#qline[hidden] { display: none; }
#workshop[data-zone="scene"] #step-copy, #workshop[data-zone="question"] #step-copy { display: block !important; font-size: 14px; line-height: 1.3; margin: 0 0 6px; }
#workshop[data-zone="done"]:not([data-finale="true"]) #step-copy { display: none !important; }
@media (min-width: 700px) and (min-height: 600px) { #qline { font-size: 22px; line-height: 1.4; margin-bottom: 14px; } #workshop[data-zone="scene"] #step-copy, #workshop[data-zone="question"] #step-copy { font-size: 20px; line-height: 1.45; margin-bottom: 12px; } }
@media (max-width: 340px) and (orientation: portrait) {
  #qline { font-size: 14px; line-height: 1.25; margin-bottom: 6px; }
  #workshop[data-zone="scene"] #step-copy, #workshop[data-zone="question"] #step-copy { font-size: 14px; line-height: 1.25; margin-bottom: 4px; }
}
@media (max-width: 340px) and (orientation: portrait) {
  #workshop[data-zone="question"] #step-copy { display: none !important; }
  #workshop[data-zone="question"]:not([data-finale="true"]) #model-stage { height: 190px !important; min-height: 190px !important; }
  #workshop[data-zone="done"]:not([data-finale="true"]) #model-stage { height: 168px !important; min-height: 168px !important; }
  #workshop[data-zone="done"]:not([data-finale="true"]) #feedback p { font-size: 14px !important; line-height: 1.25 !important; margin: 2px 0 !important; }
  #workshop[data-zone="done"]:not([data-finale="true"]) #qline { margin-bottom: 4px; }
}
@media (max-width: 430px) and (orientation: portrait) {
  #qline { font-size: 14px; line-height: 1.25; margin-bottom: 5px; }
  #workshop[data-zone="done"]:not([data-finale="true"]) #feedback p { font-size: 16px !important; line-height: 1.3 !important; margin: 4px 0 !important; }
  #workshop[data-zone="done"]:not([data-finale="true"]) #answers button.picked { font-size: 14px !important; line-height: 1.2 !important; padding-top: 5px !important; padding-bottom: 5px !important; }
}
@media (max-width: 340px) and (orientation: portrait) {
  #workshop[data-zone="done"]:not([data-finale="true"]) #model-stage { height: 138px !important; min-height: 138px !important; }
  #workshop[data-zone="done"]:not([data-finale="true"]) #feedback p { font-size: 14px !important; line-height: 1.22 !important; margin: 2px 0 !important; }
  #workshop[data-zone="done"]:not([data-finale="true"]) #answers button.picked { font-size: 14px !important; padding-top: 3px !important; padding-bottom: 3px !important; }
  #workshop[data-zone="done"]:not([data-finale="true"]) #qline { font-size: 14px; margin-bottom: 3px; }
}
@media (max-width: 340px) and (orientation: portrait) {
  html body #workshop[data-zone="done"]:not([data-finale="true"]):not([data-last="x"]) #model-stage { height: 196px !important; min-height: 196px !important; max-height: 196px !important; flex: none !important; }
}
@media (orientation: landscape) and (max-height: 450px) {
  #workshop[data-zone="question"] #step-copy { display: none !important; }
  #qline { font-size: 14px; line-height: 1.2; margin-bottom: 4px; }
  #workshop[data-zone="done"]:not([data-finale="true"]) #feedback p { font-size: 14px !important; line-height: 1.22 !important; margin: 2px 0 !important; }
  #workshop[data-zone="done"]:not([data-finale="true"]) #answers button.picked { font-size: 14px !important; padding-top: 3px !important; padding-bottom: 3px !important; min-height: 40px; }
  #workshop[data-zone="question"]:not([data-finale="true"]) #model-stage { height: calc(100% - 62px) !important; max-height: calc(100% - 62px) !important; min-height: 0 !important; }
  #tray { margin-bottom: 2px; }
}

/* cond13: Back and Next pinned to one fixed slot at phone and landscape sizes */
@media (max-width: 700px) and (orientation: portrait) {
  html body #workshop:not([data-finale="true"]):not(.covering) #journey-controls { min-height: 58px !important; }
  html body #workshop:not([data-finale="true"]):not(.covering) .actions { position: fixed !important; left: 24px !important; right: 24px !important; bottom: 24px !important; margin: 0 !important; display: flex !important; gap: 6px; z-index: 4; }
  html body #workshop:not([data-finale="true"]):not(.covering) .actions #next { flex: 1 1 auto; }
}
@media (orientation: landscape) and (max-height: 450px) {
  html body #workshop:not([data-finale="true"]):not(.covering) #journey-controls { min-height: 56px !important; }
  html body #workshop:not([data-finale="true"]):not(.covering) .actions { position: fixed !important; right: 10px !important; left: auto !important; bottom: 18px !important; margin: 0 !important; width: 321px; display: flex !important; flex-direction: row-reverse; gap: 6px; z-index: 4; }
  html body #workshop:not([data-finale="true"]):not(.covering) .actions #next { flex: 1 1 auto; }
}
@media (max-width: 700px) and (orientation: portrait) {
  html body #workshop:not([data-finale="true"]):not(.covering) #progress { position: fixed !important; left: 80px !important; right: auto !important; top: auto !important; bottom: 38px !important; margin: 0 !important; z-index: 3; }
  html body #workshop[data-zone="done"]:not([data-finale="true"]) #progress { display: none !important; }
}
@media (orientation: landscape) and (max-height: 450px) {
  html body #workshop:not([data-finale="true"]):not(.covering) #model-stage { height: calc(100% - 62px) !important; max-height: calc(100% - 62px) !important; min-height: 0 !important; }
  html body #workshop:not([data-finale="true"]):not(.covering) .actions { left: 10px !important; right: 10px !important; width: auto !important; flex-direction: row !important; justify-content: flex-start; }
  html body #workshop:not([data-finale="true"]):not(.covering) .actions #next { flex: 0 0 auto; width: 257px; margin-left: auto !important; }
  html body #workshop:not([data-finale="true"]):not(.covering) #guide-content { max-height: none !important; }
}
@media (orientation: landscape) and (max-height: 450px) {
  html body #workshop[data-zone="question"]:not([data-finale="true"]):not(.covering) #guide { justify-content: flex-start !important; }
  html body #workshop[data-zone="question"]:not([data-finale="true"]):not(.covering) #guide-content { justify-content: flex-start !important; margin-top: 0 !important; }
}
html body #workshop:not([data-finale="true"]):not(.covering) .actions { align-items: flex-end !important; }

/* cond14 */
#answers button, #step-copy, #qline, #feedback p, #step-title, #guide-content h1 { text-wrap: balance; }
html body .tray-chip { white-space: nowrap !important; flex-direction: row !important; font-size: 14px !important; letter-spacing: 0 !important; line-height: 1.1; padding: 0 6px !important; justify-content: center; }
html body #tray { display: grid !important; grid-template-columns: repeat(2, 1fr); gap: 4px 6px; }
html body .tray-chip { min-height: 34px !important; }
@media (min-width: 1000px) { html body #tray { grid-template-columns: repeat(4, 1fr); } }
html body #workshop .finale-credit, html body #workshop[data-finale="true"] #finale .finale-credit { font-size: 14px !important; opacity: 1 !important; color: #4a3b2c !important; }
:root[data-theme="dark"] body #workshop .finale-credit { color: #eadfca !important; }
@media (min-width: 700px) { html body #workshop[data-zone="done"] #scene-dock { display: none !important; } }
@media (min-width: 1000px) { html body .icon-btn, html body #theme, html body #about-open { width: 44px !important; height: 44px !important; min-width: 44px !important; min-height: 44px !important; } }
/* finale joins the pinned Back/Next slot */
@media (max-width: 700px) and (orientation: portrait) {
  html body #workshop[data-finale="true"] #journey-controls { min-height: 58px !important; }
  html body #workshop[data-finale="true"] .actions { position: fixed !important; left: 24px !important; right: 24px !important; bottom: 24px !important; margin: 0 !important; display: flex !important; gap: 6px; align-items: flex-end !important; width: auto !important; z-index: 4; }
  html body #workshop[data-finale="true"] .actions #next { flex: 1 1 auto !important; min-width: 0 !important; }
  html body #workshop[data-finale="true"] #back { display: block !important; }
}
@media (orientation: landscape) and (max-height: 450px) {
  html body #workshop[data-finale="true"] .actions { position: fixed !important; left: 10px !important; right: 10px !important; bottom: 18px !important; margin: 0 !important; width: auto !important; display: flex !important; align-items: flex-end !important; }
  html body #workshop[data-finale="true"] .actions #next { flex: 0 0 auto !important; width: 257px !important; margin-left: auto !important; min-width: 0 !important; }
}
/* desktop: pin Back/Next to the bottom of the guide column */
@media (min-width: 1000px) {
  html body #workshop:not(.covering) #guide { position: relative; }
  html body #workshop:not(.covering) #journey-controls { min-height: 84px; }
  html body #workshop:not(.covering) .actions { position: absolute !important; left: 0; bottom: 28px; margin: 0 !important; display: flex !important; align-items: flex-end; gap: 12px; }
}
@media (min-width: 1000px) {
  html body #workshop:not(.covering) .actions { position: fixed !important; left: 60.4vw; bottom: 28px; }
  html body #workshop[data-finale="true"] .actions { left: calc(50vw - 430px); }
  html body #workshop:not(.covering) .actions #next { min-width: 290px !important; flex: 0 0 290px !important; }
}
html body #guide p, html body #stage-msg, html body #guide-content p { text-wrap: balance; }
html body #tray[hidden], html body #workshop[data-finale="true"] #tray, html body #workshop[data-zone="done"] #tray, html body #workshop[data-zone="scene"] #tray:empty { display: none !important; }
@media (max-width: 340px) and (orientation: portrait) { html body #tray { display: none !important; } }
@media (min-width: 341px) and (max-width: 700px) and (orientation: portrait) and (min-height: 700px) {
  html body #workshop[data-zone="done"]:not([data-finale="true"]) #model-stage { height: min(calc(100svh - 400px), 400px) !important; min-height: 0 !important; max-height: none !important; }
  html body #workshop[data-zone="scene"]:not([data-finale="true"]):not(.covering) #model-stage { height: calc(100svh - 270px) !important; min-height: 0 !important; max-height: none !important; }
}
@media (orientation: landscape) and (max-height: 450px) { html body #workshop #scene-dock { margin-bottom: 12px !important; } }
/* cond14 specificity bumps */
@media (min-width: 341px) and (max-width: 700px) and (orientation: portrait) and (min-height: 700px) {
  html body #workshop[data-zone="done"][data-zone][data-zone]:not([data-finale="true"]):not([data-last="true"]):not(.covering) #model-stage { height: min(calc(100svh - 400px), 400px) !important; min-height: 0 !important; max-height: none !important; }
  html body #workshop[data-zone="scene"][data-zone][data-zone]:not([data-finale="true"]):not(.covering):not([data-last="true"]) #model-stage { height: calc(100svh - 270px) !important; min-height: 0 !important; max-height: none !important; }
}
/* finale landscape: Next left of Play again */
@media (orientation: landscape) and (max-height: 450px) {
  html body #workshop[data-finale="true"] .actions #next { margin-left: 0 !important; width: 230px !important; }
}
/* start card pinned to the same slot */
@media (max-width: 700px) and (orientation: portrait) {
  html body #workshop.covering .actions { position: fixed !important; left: 24px !important; right: 24px !important; bottom: 24px !important; margin: 0 !important; display: flex !important; align-items: flex-end !important; width: auto !important; z-index: 4; }
  html body #workshop.covering #next { min-height: 52px !important; font-size: 20px !important; flex: 1 1 auto !important; margin: 0 !important; }
}
@media (orientation: landscape) and (max-height: 450px) {
  html body #workshop.covering .actions { position: fixed !important; left: 10px !important; right: 10px !important; bottom: 18px !important; margin: 0 !important; width: auto !important; display: flex !important; align-items: flex-end !important; }
  html body #workshop.covering #next { flex: 0 0 auto !important; width: 257px !important; margin-left: auto !important; min-height: 44px !important; font-size: 18px !important; }
}
@media (min-width: 1000px) {
  html body #workshop.covering .actions { position: fixed !important; left: 60.4vw; bottom: 28px; margin: 0 !important; display: flex !important; align-items: flex-end; }
  html body #workshop.covering #next { min-width: 290px !important; flex: 0 0 290px !important; min-height: 58px !important; font-size: 20px !important; margin: 0 !important; align-self: auto !important; }
}
@media (min-width: 1000px) { html body #workshop[data-finale="true"] .actions { align-items: flex-end !important; } html body #workshop[data-finale="true"] .actions #back { align-self: flex-end !important; margin: 0 !important; } }
/* cond15 */
@media (max-width: 700px) and (orientation: portrait) { html body #workshop[data-finale="true"] #journey-controls { min-height: 84px !important; } html body #workshop[data-finale="true"] #progress { margin-bottom: 18px !important; } }
@media (orientation: landscape) and (max-height: 450px) {
  html body #workshop[data-finale="true"] #replay { position: fixed !important; left: 304px !important; right: auto !important; bottom: 18px !important; top: auto !important; margin: 0 !important; }
  html body #workshop #feedback { padding-bottom: 12px !important; }
}
/* cond15 desktop grouping */
@media (min-width: 1000px) {
  html body #workshop:not(.covering):not([data-finale="true"]) #guide { display: flex; flex-direction: column; justify-content: flex-end !important; }
  html body #workshop:not(.covering):not([data-finale="true"]) #guide-content { flex: 0 1 auto !important; margin-bottom: 8px; }
  html body #workshop:not(.covering):not([data-finale="true"]) #journey-controls { margin-top: 0 !important; }
  html body #workshop[data-zone="scene"]:not(.covering):not([data-finale="true"]) #scene-dock { position: fixed !important; left: 60.4vw; bottom: 156px; width: auto !important; max-width: 36vw; z-index: 5; margin: 0 !important; }
  html body #workshop[data-finale="true"] .actions { left: 60.4vw !important; }
}
@media (orientation: landscape) and (max-height: 450px) {
  html body #workshop[data-zone="done"] #feedback p { margin: 1px 0 !important; line-height: 1.15 !important; }
  html body #workshop[data-zone="done"] #qline { margin-bottom: 2px !important; }
}
@media (min-width: 1000px) { html body #workshop[data-zone="scene"]:not(.covering):not([data-finale="true"]) #scene-dock { transform: none !important; right: auto !important; translate: none !important; } }
@media (orientation: landscape) and (max-height: 450px) { html body #workshop[data-zone="done"] #feedback, html body #workshop[data-zone="done"] #guide-content { padding-bottom: 0 !important; margin-bottom: 0 !important; } }
@media (max-width: 340px) and (orientation: portrait) { html body #workshop[data-finale="true"] #journey-controls { min-height: 66px !important; } html body #workshop[data-finale="true"] #progress { margin-bottom: 8px !important; } }
/* cond16 */
@media (orientation: landscape) and (max-height: 450px) {
  html body #workshop[data-zone="scene"]:not([data-finale="true"]):not(.covering) #scene-dock { position: fixed !important; left: 284px !important; right: auto !important; bottom: 74px !important; width: auto !important; max-width: calc(100vw - 294px); margin: 0 !important; z-index: 5; }
}
@media (min-width: 1000px) {
  html body #workshop[data-zone="scene"]:not(.covering):not([data-finale="true"]) #guide-content { margin-bottom: 64px !important; }
}
@media (orientation: landscape) and (max-height: 450px) {
  html body #workshop[data-zone="scene"]:not([data-finale="true"]):not(.covering) #scene-dock { transform: none !important; translate: none !important; inset-inline: 284px auto !important; left: 284px !important; top: auto !important; }
}
@media (min-width: 1000px) { html body #workshop[data-zone="scene"]:not(.covering):not([data-finale="true"]) #guide-content { transform: translateY(176px); } }
@media (min-width: 341px) and (max-width: 700px) and (orientation: portrait) and (min-height: 700px) {
  html body #workshop[data-zone="done"][data-zone][data-zone]:not([data-finale="true"]):not([data-last="true"]):not(.covering) #model-stage { height: min(calc(100svh - 400px), 400px) !important; }
  html body #workshop[data-zone="scene"][data-zone][data-zone]:not([data-finale="true"]):not(.covering):not([data-last="true"]) #model-stage { height: calc(100svh - 218px) !important; }
}
/* cond17: feedback stage takes the free height */
@media (max-width: 700px) and (orientation: portrait) {
  html body #workshop[data-zone="done"][data-zone][data-zone]:not([data-finale="true"]):not(.covering) { display: flex !important; flex-direction: column !important; }
  html body #workshop[data-zone="done"][data-zone][data-zone]:not([data-finale="true"]):not(.covering) #model-stage { height: auto !important; min-height: 190px !important; max-height: none !important; flex: 1 1 0 !important; }
  html body #workshop[data-zone="done"][data-zone][data-zone]:not([data-finale="true"]):not(.covering) #guide { flex: 0 0 auto !important; }
}
html body #answers button.picked, html body #feedback p, html body #qline { text-wrap: balance; }
@media (max-width: 700px) and (orientation: portrait) {
  html body #workshop[data-zone="done"][data-zone][data-zone]:not([data-finale="true"]):not(.covering) #guide-content { height: auto !important; min-height: 0 !important; flex: 0 0 auto !important; justify-content: flex-start !important; }
}
@media (max-width: 700px) and (orientation: portrait) {
  html body #workshop[data-zone="done"][data-zone][data-zone]:not([data-finale="true"]):not(.covering) #step-title { position: absolute !important; width: 1px !important; height: 1px !important; min-height: 0 !important; margin: 0 !important; padding: 0 !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; clip-path: inset(50%); white-space: nowrap; }
}
html body #finale h2, html body #finale h3, html body #finale p, html body #stage-msg, html body .finale-credit { text-wrap: balance; }
@media (min-width: 341px) and (max-width: 380px) and (orientation: portrait) { html body #workshop[data-finale="true"] #finale h2, html body #workshop[data-finale="true"] #finale h3 { font-size: 23px !important; text-wrap: balance; } }
/* cond18 */
html body .tray-chip { font-size: 15px !important; }
html body #tray { margin-bottom: 12px !important; }
html body #workshop[data-finale="true"] #finale p, html body #workshop[data-finale="true"] #finale h2 { max-width: none !important; width: auto !important; }
html body #workshop[data-finale="true"] #finale { padding-right: 18px; }
html body #workshop[data-zone="question"] #qline, html body #workshop[data-zone="done"] #qline { margin-top: 12px !important; }
@media (min-width: 1000px) { html body #scene-dock .dock-label, html body #workshop:not([data-zone="scene"]) #scene-dock { display: none !important; } }
@media (orientation: landscape) and (max-height: 450px) {
  html body #workshop[data-finale="true"] #finale { padding: 8px 18px !important; }
  html body #workshop[data-finale="true"] #finale p { line-height: 1.28 !important; margin: 3px 0 !important; font-size: 14px !important; }
  html body #workshop[data-finale="true"] #finale h2 { margin: 2px 0 4px !important; }
  html body #workshop[data-finale="true"] #finale .finale-credit { font-size: 14px !important; margin-top: 4px !important; }
}
html body #workshop[data-finale="true"] #finale { width: 100% !important; box-sizing: border-box; }


@media (orientation: portrait) and (max-width: 339px) { html body #workshop.covering #next { min-height: 46px !important; height: 46px !important; font-size: 16px !important; } }
@media (orientation: portrait) and (min-width: 340px) and (max-width: 700px) { html body #workshop.covering #next { min-height: 52px !important; height: 52px !important; } }
html body #stage-msg, html body #step-copy, html body #guide-content p, html body #answers button { text-wrap: balance; }
@media (orientation: landscape) and (max-height: 450px) { html body .tray-chip { font-size: 14px !important; } html body #tray { margin-bottom: 2px !important; } }
@media (min-width: 1000px) { html body #workshop[data-zone][data-zone]:not([data-finale="true"]):not(.covering):not([data-zone="scene"]) #guide-content { transform: translateY(-80px); } }
@media (orientation: landscape) and (max-height: 450px) { html body #workshop[data-finale="true"] #finale { padding: 6px 18px !important; } html body #workshop[data-finale="true"] #finale p { margin: 2px 0 !important; } }
