@font-face { font-family: "Black Ops One"; src: url("public/assets/BlackOpsOne-Regular.282a825b5f29.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url("public/assets/BarlowCondensed-Medium.262bd143292c.ttf") format("truetype"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url("public/assets/BarlowCondensed-Bold.e476562ec9c1.ttf") format("truetype"); font-weight: 700; font-style: normal; font-display: swap; }
:root {
  color-scheme: dark;
  --charcoal: #152c35; --ink: #10232b; --ivory: #eee0b9;
  --teal: #275761; --jade: #4e8685;
  --muted: #b8ccca; --amber: #eda649; --line: #49636a; --danger: #ffad92;
  --safe-top: max(8px, env(safe-area-inset-top));
  --safe-bottom: max(8px, env(safe-area-inset-bottom));
  /* ---- Visual system v2: one teal-tinted OKLCH surface ramp around the
     existing brand tokens (ink #10232b / charcoal #152c35 are steps 1-2). ---- */
  --ink-0: oklch(0.175 0.026 226);          /* deepest: page, wells, veils */
  --ink-3: oklch(0.305 0.036 222);          /* raised surface */
  --ink-4: oklch(0.355 0.04 219);           /* hover surface */
  --line-soft: oklch(0.47 0.032 214 / .5);  /* quiet dividers */
  --hairline-hi: oklch(0.96 0.03 90 / .08); /* top-light edge on panels */
  --amber-hi: oklch(0.84 0.125 74);
  --amber-lo: oklch(0.66 0.14 62);
  --teal-hi: oklch(0.49 0.058 208);
  --uplink: #8cddd5;                         /* friendly / restored / shielded */
  --ember: #ff7a4f;                          /* hostile / danger accent */
  --panel-bg: linear-gradient(180deg, var(--ink-3) 0, var(--charcoal) 64px, oklch(0.25 0.031 225) 100%);
  --panel-depth: inset 0 1px 0 var(--hairline-hi), 0 22px 56px -20px oklch(0.1 0.02 230 / .85);
  --ease-out: cubic-bezier(.23, 1, .32, 1);
  --dur-press: 140ms; --dur-ui: 180ms;
  /* Semantic stacking scale (values and order match the existing layers). */
  --z-hud: 5; --z-prompt: 7; --z-coach: 8; --z-touch: 10; --z-screen: 20; --z-tools: 24;
  --z-scene: 25; --z-dialog: 30; --z-toast: 40; --z-overlay: 45; --z-boot: 60;
  font: 500 18px/1.4 "Barlow Condensed", "Arial Narrow", sans-serif;
  background: var(--ink-0); color: var(--ivory);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; height: 100vh; height: 100dvh; padding: var(--safe-top) max(8px, env(safe-area-inset-right)) var(--safe-bottom) max(8px, env(safe-area-inset-left)); display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(120% 90% at 50% 38%, var(--charcoal) 0%, oklch(0.215 0.03 225) 48%, var(--ink-0) 100%) fixed; }
button, input, select { font: inherit; }
button, select, summary { cursor: pointer; }
button { min-height: 44px; min-width: 44px; border-radius: 2px; -webkit-tap-highlight-color: transparent; }
button:disabled { opacity: .42; cursor: default; }
button, select, input, summary { touch-action: manipulation; }
button:focus-visible, select:focus-visible, input:focus-visible, summary:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }
svg { display: block; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: square; stroke-linejoin: round; }
kbd { font: 700 12px/1 "Barlow Condensed", sans-serif; border: 1px solid #6f7f7a; border-bottom-width: 2px; border-bottom-color: #4a5a58; padding: 3px 5px; border-radius: 2px; white-space: nowrap; background: oklch(0.2 0.028 225 / .7); box-shadow: inset 0 1px 0 var(--hairline-hi); }
h1, h2, p, dl { margin: 0; }
h1, h2, h3 { text-wrap: balance; }
button, select { transition: background-color var(--dur-ui) ease, color var(--dur-ui) ease, border-color var(--dur-ui) ease, box-shadow var(--dur-ui) var(--ease-out), transform var(--dur-press) var(--ease-out); }
::selection { background: oklch(0.77 0.14 70 / .35); color: var(--ivory); }
#shell { --chrome-height: 100px; width: min(1536px, 100%, calc((100dvh - var(--safe-top) - var(--safe-bottom) - var(--chrome-height)) * 16 / 9)); display: grid; gap: 6px; min-width: 0; }
.toolbar, .control-strip { height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.toolbar-title { display: flex; align-items: baseline; gap: 14px; white-space: nowrap; }
.toolbar-title strong { font-size: 18px; font-weight: 700; letter-spacing: .02em; }
.toolbar-title > span { color: var(--muted); font-size: 14px; }
.toolbar-actions { display: flex; align-items: center; gap: 2px; }
.icon-button, .quiet-button, .text-button { border: 1px solid transparent; background: transparent; color: var(--muted); }
.icon-button { width: 44px; padding: 11px; display: grid; place-items: center; flex: 0 0 44px; }
.quiet-button { display: flex; gap: 7px; align-items: center; padding: 8px 10px; }
.text-button { padding: 8px 12px; }
button:not(:disabled):hover { color: var(--ivory); }
.icon-button:not(:disabled):hover, .quiet-button:not(:disabled):hover, .text-button:not(:disabled):hover { background: oklch(0.96 0.03 90 / .06); border-color: var(--line); }
.icon-button:not(:disabled):active, .quiet-button:not(:disabled):active { transform: scale(.94); }
.sound-slash { display: none; }
.sound-button[aria-pressed="true"] { color: var(--amber); }
.sound-button[aria-pressed="true"] .sound-waves { display: none; }
.sound-button[aria-pressed="true"] .sound-slash { display: block; }

#stage { position: relative; width: 100%; aspect-ratio: 16 / 9; background: var(--ink); isolation: isolate; box-shadow: 0 0 0 1px var(--line), 0 0 0 4px oklch(0.2 0.028 225 / .6), 0 30px 80px -30px oklch(0.08 0.02 230 / .9); }
#stage-surface { position: absolute; inset: 0; overflow: hidden; isolation: isolate; container: battlefield / inline-size; background: var(--charcoal); }
.scene-backdrop { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: left bottom; image-rendering: pixelated; pointer-events: none; user-select: none; }
#game { position: absolute; inset: 0; display: grid; place-items: center; z-index: 1; touch-action: none; }
#game canvas { display: block !important; width: 100% !important; height: 100% !important; max-width: 100%; max-height: 100%; margin: 0 !important; object-fit: contain; image-rendering: crisp-edges; image-rendering: pixelated; }
#game:focus-visible { outline-offset: -3px; }
.screen { position: absolute; inset: 0; z-index: var(--z-screen); }
.title-screen { display: flex; align-items: center; background: linear-gradient(90deg, #10232bf2 0%, #152c35cf 30%, #152c3530 57%, transparent 76%); }
.title-layout { width: min(43%, 480px); margin-left: 6%; padding-block: 24px; }
.field-badge { display: inline-flex; align-items: center; gap: clamp(10px, 1.15cqw, 16px); font-size: clamp(11px, 1.15cqw, 16px); font-weight: 700; }
.field-badge > span { color: var(--ivory); border-left: 1px solid #f4efdf66; padding: 5px 0 5px clamp(10px, 1.15cqw, 16px); letter-spacing: .09em; text-transform: uppercase; font-size: .85em; line-height: 1.1; white-space: nowrap; }
.aws-logo { display: block; flex: 0 0 auto; width: clamp(42px, 4.3cqw, 60px); height: auto; aspect-ratio: 109 / 64; object-fit: contain; image-rendering: auto; }
h1 { font: 400 clamp(40px, 6.8cqw, 98px)/.94 "Black Ops One", Impact, sans-serif; text-transform: uppercase; letter-spacing: -.035em; margin: 20px 0 14px; }
.operation-name { font-weight: 700; font-size: clamp(14px, 1.65cqw, 23px); letter-spacing: .13em; text-transform: uppercase; color: var(--amber); }
.briefing { max-width: 33ch; margin-top: 18px; color: var(--ivory); font-size: clamp(16px, 1.55cqw, 22px); line-height: 1.4; text-wrap: pretty; }
.briefing strong { color: var(--amber); font-weight: 700; }
.title-controls { max-width: 350px; margin-top: 24px; }
.first-controls { font-size: 16px; color: var(--ivory); margin-bottom: 16px; }
.portrait-advice, .portrait-play-note { display: none; }
.difficulty-control { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 0 10px; margin-bottom: 13px; }
.difficulty-control > label { color: var(--muted); font-size: 15px; }
.difficulty-control select { min-height: 44px; min-width: 125px; padding: 5px 30px 5px 12px; border: 1px solid var(--line); border-radius: 2px; background: var(--ink); color: var(--ivory); }
#difficulty-note { grid-column: 1 / -1; color: var(--muted); font-size: 14px; padding-top: 6px; }
.primary-button, .secondary-button { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 18px; width: 100%; font-weight: 700; font-size: 19px; }
/* Primary: a lit amber slab. Top light + bottom lip give it a physical key feel;
   the press squashes it slightly so every confirm feels heard. */
.primary-button { background: var(--amber) linear-gradient(180deg, var(--amber-hi) 0%, var(--amber) 52%, var(--amber-lo) 100%); color: var(--ink); border: 1px solid oklch(0.58 0.12 60); box-shadow: inset 0 1px 0 oklch(0.95 0.07 85 / .7), inset 0 -2px 0 oklch(0.45 0.1 55 / .35), 0 1px 0 oklch(0.12 0.02 230 / .6); text-shadow: 0 1px 0 oklch(0.92 0.08 85 / .35); }
.primary-button:not(:disabled):hover { background: #f8bd6c linear-gradient(180deg, oklch(0.88 0.11 78) 0%, var(--amber-hi) 50%, var(--amber) 100%); color: var(--ink); }
.primary-button:not(:disabled):active { transform: scale(.97); box-shadow: inset 0 2px 3px oklch(0.45 0.1 55 / .45), 0 0 0 oklch(0 0 0 / 0); }
.primary-button kbd { color: inherit; border: 0; font-size: 20px; padding: 0; opacity: .75; background: none; box-shadow: none; }
.primary-button .primary-key { flex-shrink: 0; }
#shell[data-ui-input-mode="gamepad"] .primary-key { font-size: 12px; letter-spacing: 0; opacity: 1; }
#shell.gamepad-navigation :focus { outline: 2px solid var(--amber); outline-offset: 3px; }
#shell.gamepad-navigation .toggle-setting input:focus + .switch { outline: 2px solid var(--amber); outline-offset: 4px; }
.secondary-button { justify-content: center; background: var(--teal) linear-gradient(180deg, var(--teal-hi) 0%, var(--teal) 60%, oklch(0.37 0.047 212) 100%); color: var(--ivory); border: 1px solid var(--jade); font-size: 18px; box-shadow: inset 0 1px 0 oklch(0.8 0.06 190 / .25), 0 1px 0 oklch(0.12 0.02 230 / .6); }
.secondary-button:not(:disabled):hover { background: #356b74 linear-gradient(180deg, oklch(0.53 0.06 205) 0%, #356b74 100%); }
.secondary-button:not(:disabled):active { transform: scale(.97); box-shadow: inset 0 2px 3px oklch(0.15 0.03 225 / .5); }
/* Hover glow only where a real pointer can hover (no sticky glow on touch). */
@media (hover: hover) and (pointer: fine) {
  .primary-button:not(:disabled):hover { box-shadow: inset 0 1px 0 oklch(0.97 0.06 88 / .8), inset 0 -2px 0 oklch(0.45 0.1 55 / .3), 0 0 0 3px oklch(0.77 0.14 70 / .18), 0 6px 20px -8px oklch(0.77 0.14 70 / .55); }
  .secondary-button:not(:disabled):hover { box-shadow: inset 0 1px 0 oklch(0.8 0.06 190 / .3), 0 0 0 3px oklch(0.57 0.06 195 / .2), 0 6px 18px -8px oklch(0.57 0.06 195 / .5); }
}
.menu-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.menu-actions .text-button { padding-inline: 0; border: 0; border-radius: 0; }
.menu-actions .text-button:not(:disabled):hover { background: transparent; text-decoration: underline; text-underline-offset: 4px; }

/* HUD occupies the sky band. No bottom panels across the ground or actors. */
.hud { --status-inner: clamp(170px, 18cqw, 240px); position: absolute; inset: 0; z-index: var(--z-hud); pointer-events: none; font-size: clamp(14px, 1.3cqw, 18px); font-variant-numeric: tabular-nums; }
.hud-top { position: absolute; top: 16px; left: 16px; right: 16px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.player-status { display: flex; gap: 9px; align-items: center; background: #10232bf0; padding: 8px 12px; border-left: 3px solid var(--jade); }
.player-mark { display: none; }
.health-status { width: var(--status-inner); }
.health-heading { display: flex; align-items: baseline; gap: 6px; line-height: 1; margin-bottom: 8px; }
.health-heading > span:first-child { color: var(--muted); }
.health-heading > strong { font-weight: 700; }
.health-pips { display: flex; align-items: center; gap: 4px; height: 6px; }
.health-pips i { display: block; flex: 1; min-width: 1px; height: 6px; background: var(--ivory); }
.health-pips i.empty { background: #4a636b; }
.health-pips[data-low="true"] i:not(.empty) { background: var(--danger); border-color: #ffcfbe; }
.reserve-label { display: block; margin-left: auto; font-size: .9em; color: var(--muted); }
.reserve-label strong { margin-left: 4px; }
.score-status { text-align: right; display: flex; gap: 10px; align-items: baseline; background: #10232bf0; padding: 8px 12px; }
.score-status > span { font-size: .8em; }
.score-status strong { font-size: 1.35em; font-variant-numeric: tabular-nums; letter-spacing: .07em; line-height: 1; }
.hud-equipment { position: absolute; top: 74px; left: 16px; display: flex; gap: 16px; align-items: center; font-size: 15px; background: #10232be8; padding: 6px 10px; }
.hud-equipment strong { margin-left: 4px; }
.weapon-status { color: var(--amber); font-weight: 700; max-width: 18ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lambda-status { white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--ivory); border-bottom: 2px solid var(--jade); }
.lambda-status[data-ending="true"] { color: var(--amber); border-bottom-color: var(--amber); }
.replay-status { position: absolute; top: 108px; right: 16px; display: flex; align-items: center; gap: 14px; padding: 5px 10px; font-size: 15px; line-height: 1.2; background: #10232bf0; border-left: 2px solid var(--jade); }
.replay-status strong { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.replay-status[data-state="missed"] strong { color: var(--amber); }
#shield-status[data-ready="true"] strong { color: var(--amber); }
.objective-status { position: absolute; right: 16px; top: 66px; max-width: 42%; display: grid; grid-template-columns: auto minmax(0,1fr); column-gap: 8px; align-items: center; font-size: 15px; line-height: 1.2; background: #10232be8; padding: 8px 10px; }
.hud:has(.boss-status:not([hidden])) .objective-status { display: none; }
.objective-service { color: var(--ivory); background: var(--teal); padding: 3px 5px; font-size: .85em; font-weight: 700; line-height: 1; letter-spacing: .035em; }
.objective-service[data-service="MAINFRAME"] { color: var(--ivory); border-color: #f2b64a80; }
.weapon-status[data-service="lambda"] { text-decoration: underline; text-underline-offset: 3px; }
#hud-objective { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
progress, meter { display: block; width: 100%; height: 5px; appearance: none; border: 0; background: #101a13e6; border-radius: 0; overflow: hidden; }
progress::-webkit-progress-bar { background: #101a13e6; }
progress::-webkit-progress-value { background: var(--amber); }
progress::-moz-progress-bar { background: var(--amber); }
meter::-webkit-meter-bar { background: #101a13e6; border: 0; border-radius: 0; }
meter::-webkit-meter-optimum-value { background: var(--amber); }
meter::-moz-meter-bar { background: var(--amber); }
#mission-progress { grid-column: 2; margin-top: 6px; height: 3px; box-shadow: 0 1px 1px #0008; }
.vehicle-status { position: absolute; left: 16px; top: 16px; display: grid; grid-template-columns: 1fr auto auto; gap: 6px 8px; width: calc(var(--status-inner) + 27px); padding: 8px 12px; border-left: 3px solid var(--amber); background: #10232bf0; font-size: inherit; line-height: 1; }
.vehicle-exit { grid-column: 2; font-size: 12px; color: var(--muted); align-self: center; white-space: nowrap; }
.vehicle-status meter { grid-row: 2; grid-column: 1 / -1; }
.vehicle-status strong { grid-row: 1; grid-column: 3; }
.vehicle-status meter { height: 6px; }
.vehicle-status[data-low="true"] strong { color: var(--danger); }
.vehicle-status[data-low="true"] meter::-webkit-meter-optimum-value { background: var(--danger); }
.vehicle-status[data-low="true"] meter::-moz-meter-bar { background: var(--danger); }
.vehicle-status[data-hit="true"] { box-shadow: inset 0 0 0 1px var(--danger); }
.hud[data-vehicle="true"] .player-status { margin-top: 48px; padding-block: 4px; border-color: transparent; font-size: 14px; }
.hud[data-vehicle="true"] .health-heading { margin-bottom: 0; }
.hud[data-vehicle="true"] .health-pips { display: none; }
.hud[data-vehicle="true"] .hud-equipment { top: 90px; }
.boss-status { position: absolute; top: 16px; left: 36%; width: 28%; font-size: 15px; padding: 8px 12px; background: #10232bf0; }
.boss-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; line-height: 1.1; }
.boss-status strong { color: var(--ivory); font-size: max(14px, 1.05em); letter-spacing: .065em; white-space: nowrap; }
#boss-phase { color: var(--muted); font-size: max(11px, .8em); white-space: nowrap; }
#boss-subtitle { display: block; margin-top: 3px; font-size: clamp(11px, 1.05cqw, 13px); line-height: 1.15; letter-spacing: .055em; color: var(--ivory); }
.boss-status progress { height: 6px; margin-top: 4px; box-shadow: 0 0 0 1px #07100bb3; }
.boss-status progress::-webkit-progress-value { background: var(--amber); }
.boss-status progress::-moz-progress-bar { background: var(--amber); }
.boss-tip { display: block; margin-top: 6px; color: var(--ivory); font-size: 15px; line-height: 18px; }
.boss-tip[data-urgent="true"] { color: #ffd498; border-left: 2px solid #ee956e; padding-left: 6px; font-weight: 700; }
.boss-status[data-shielded="true"] #boss-phase { color: var(--amber); }
.boss-status[data-shielded="true"] .boss-tip { white-space: pre-line; }
.boss-status[data-shielded="true"] progress::-webkit-progress-value { background: repeating-linear-gradient(135deg, #efc888 0 4px, #836446 4px 8px); }
.boss-status[data-shielded="true"] progress::-moz-progress-bar { background: repeating-linear-gradient(135deg, #efc888 0 4px, #836446 4px 8px); }
.stage-tools { position: absolute; top: 6px; right: 6px; z-index: var(--z-tools); display: none; gap: 2px; }
.stage-tools .icon-button { background: #10232be8; color: var(--ivory); }
.stage-tools[inert] { visibility: hidden; }
.toolbar[inert], .control-strip[inert] { opacity: .45; }
#stage[data-view="paused"] .hud { visibility: hidden; }
#stage:not([data-view="playing"]) .stage-tools [data-action="pause"] { display: none; }

/* Veils darken toward the edges so the paused battlefield recedes and the panel
   reads as the single focal point. No blur: the pixel art stays crisp. */
.veil-screen { display: grid; place-items: center; background: radial-gradient(90% 85% at 50% 45%, oklch(0.22 0.03 225 / .72) 0%, oklch(0.16 0.026 226 / .9) 100%); padding: 24px; overflow: auto; }
.menu-panel { width: min(370px, 100%); text-align: left; margin: auto; }
.panel-eyebrow { color: var(--amber); font-size: 14px; letter-spacing: .08em; }
h2 { font-weight: 700; font-size: clamp(26px, 3.5cqw, 44px); line-height: 1.05; }
.menu-panel h2 { margin: 7px 0 8px; }
.panel-description { color: var(--muted); font-size: 18px; line-height: 1.4; }
.pause-panel > .primary-button { margin-top: 24px; }
.pause-panel > .secondary-button { margin-top: 12px; }
.result-panel { width: min(430px, 100%); }
.result-score { display: grid; gap: 2px; margin: 20px 0 14px; }
.result-score > span { color: var(--muted); font-size: 15px; }
.result-score > strong { color: var(--amber); font-size: clamp(32px, 5cqw, 58px); font-weight: 700; letter-spacing: .07em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.result-score b { color: var(--ivory); margin-left: 6px; font-weight: 500; }
.result-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 18px 0 22px; }
.result-stats dt { color: var(--muted); font-size: 14px; }
.result-stats dd { margin: 2px 0 0; font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.result-panel > .text-button { margin-top: 6px; }
.dialog-screen { display: grid; place-items: center; padding: clamp(8px, 3cqw, 36px); background: radial-gradient(90% 85% at 50% 45%, oklch(0.22 0.03 225 / .7) 0%, oklch(0.16 0.026 226 / .88) 100%); z-index: var(--z-dialog); }
.document-panel { width: min(590px, 100%); max-height: 100%; min-height: 0; display: flex; flex-direction: column; background: var(--charcoal) var(--panel-bg); border: 1px solid var(--line); box-shadow: var(--panel-depth); }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 18px 22px 14px; flex-shrink: 0; border-bottom: 1px solid var(--line-soft); box-shadow: 0 1px 0 oklch(0.12 0.02 230 / .5); }
.panel-header .panel-eyebrow { font-size: 12px; margin-bottom: 5px; }
.panel-header h2 { font-size: 30px; }
.panel-header .icon-button { color: var(--ivory); }
.panel-scroll { overflow-y: auto; overscroll-behavior: contain; padding: 16px 22px; min-height: 0; scrollbar-width: thin; scrollbar-color: #6f8a8a transparent; }
.panel-scroll:focus-visible { outline-offset: -3px; }
.manual-brief, .manual-note, .credits p { font-size: 16px; line-height: 1.4; color: var(--muted); }
.mission-route { display: grid; grid-template-columns: 1fr 1fr 1.2fr; gap: 16px; list-style: none; padding: 0; margin: 16px 0 12px; }
.mission-route li { position: relative; min-width: 0; border-top: 2px solid var(--amber); padding-top: 6px; }
.mission-route li:not(:last-child)::after { content: "›"; position: absolute; right: -12px; top: 8px; color: var(--muted); }
.mission-route strong { display: block; font-size: clamp(16px, 2.5cqw, 21px); line-height: 1.1; color: var(--amber); }
.mission-route span { display: block; font-size: 14px; line-height: 1.25; margin-top: 3px; color: var(--ivory); }
.mission-route [data-service="MAINFRAME"] { border-color: var(--ivory); }
.mission-route [data-service="MAINFRAME"] strong { color: var(--ivory); }
.service-kit { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 16px 0; }
.service-kit > div { border-left: 2px solid var(--amber); background: #f4efdf05; padding: 8px 10px; min-width: 0; }
.service-kit dt { color: var(--ivory); font-size: 17px; }
.service-kit dt strong { color: var(--amber); }
.service-kit dd { color: var(--muted); font-size: 14px; line-height: 1.35; margin: 4px 0 0; }
.unit-notes { border-block: 1px solid var(--line); padding: 12px 0; margin-bottom: 16px; }
.unit-notes h3 { color: var(--ivory); font-size: 16px; font-weight: 700; margin: 0 0 8px; }
.unit-notes p { color: var(--muted); font-size: 14px; line-height: 1.4; margin-top: 8px; }
.unit-notes strong { color: var(--ivory); }
.unit-notes .kiro-name { color: #dbc8ed; }
.unit-notes .peccy-name { color: var(--amber); }
.manual-pad, .manual-touch { display: none; font-size: 16px; line-height: 1.4; color: var(--muted); margin: 16px 0; }
#shell[data-ui-input-mode="gamepad"] .manual-pad, #shell[data-ui-input-mode="touch"] .manual-touch { display: block; }
#shell[data-ui-input-mode="gamepad"] .manual-controls, #shell[data-ui-input-mode="touch"] .manual-controls { display: none; }
.manual-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 24px; margin: 20px 0; }
.manual-controls > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.manual-controls dt { font-size: 16px; }
.manual-controls dd { margin: 0; white-space: nowrap; color: var(--muted); font-size: 12px; }
.manual-controls kbd { display: inline-block; color: var(--ivory); font-size: 13px; min-width: 19px; text-align: center; }
.credits { margin-top: 14px; border-top: 1px solid var(--line); }
.credits summary { min-height: 44px; padding: 12px 0; color: var(--ivory); }
.credits p { font-size: 14px; margin-bottom: 10px; }
.license-notices { border-top: 1px solid var(--line); }
.license-copy h4 { margin: 16px 0 8px; font-size: 15px; }
.license-copy pre { margin: 0 0 20px; white-space: pre-wrap; overflow-wrap: anywhere; font: 12px/1.5 monospace; color: var(--muted); }
.panel-footer { flex-shrink: 0; padding: 12px 22px; border-top: 1px solid var(--line-soft); background: oklch(0.2 0.028 225 / .55); }
.panel-footer > button { font-size: 17px; min-height: 44px; padding-block: 8px; }
.settings-panel { width: min(420px, 100%); }
.volume-setting > label { display: flex; justify-content: space-between; font-size: 18px; }
#volume-value { color: var(--amber); font-variant-numeric: tabular-nums; }
#setting-volume { width: 100%; min-height: 44px; margin: 0; accent-color: var(--amber); cursor: pointer; }
.toggle-setting { position: relative; min-height: 66px; padding: 10px 0; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 16px; cursor: pointer; font-size: 18px; }
.toggle-setting small { display: block; color: var(--muted); font-size: 14px; margin-top: 2px; }
.toggle-setting input { position: absolute; right: 0; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; margin: 0; opacity: 0; cursor: pointer; }
.switch { position: relative; width: 40px; height: 22px; border: 1px solid #8fa3a0; background: var(--ink-0); border-radius: 12px; flex-shrink: 0; pointer-events: none; box-shadow: inset 0 1px 2px oklch(0.08 0.02 230 / .8); transition: background-color var(--dur-ui) ease, border-color var(--dur-ui) ease, box-shadow var(--dur-ui) ease; }
.switch::before { content: ""; position: absolute; width: 14px; height: 14px; top: 3px; left: 3px; background: var(--muted); border-radius: 50%; box-shadow: 0 1px 1px oklch(0.08 0.02 230 / .7); transition: transform var(--dur-ui) var(--ease-out), background-color var(--dur-ui) ease; }
.toggle-setting input:checked + .switch { background: var(--amber); border-color: var(--amber); box-shadow: inset 0 1px 0 oklch(0.95 0.07 85 / .5), 0 0 10px -2px oklch(0.77 0.14 70 / .55); }
.toggle-setting input:checked + .switch::before { transform: translateX(18px); background: var(--ink); }
.toggle-setting input:focus-visible + .switch { outline: 2px solid var(--amber); outline-offset: 4px; }
.settings-note { font-size: 14px; color: var(--muted); margin-top: 12px; }
#settings-save-note[data-saved="false"] { color: var(--amber); }
.keyboard-settings { border-top: 1px solid var(--line); margin-top: 2px; }
.keyboard-settings > summary { padding: 14px 0; min-height: 48px; font-weight: 700; font-size: 18px; }
.binding-instructions, .binding-status { font-size: 14px; line-height: 1.35; color: var(--muted); }
.binding-instructions { margin-bottom: 14px; }
.binding-column-labels, .binding-row { display: grid; grid-template-columns: minmax(75px,1fr) 68px 68px; gap: 6px; align-items: center; }
.binding-column-labels { font-size: 12px; color: var(--muted); margin-bottom: 5px; }
.binding-column-labels span:not(:first-child) { text-align: center; }
.binding-row { border-top: 1px solid #49636a66; padding: 4px 0; font-size: 16px; }
.binding-key { min-width: 0; min-height: 44px; width: 68px; padding: 6px 3px; background: var(--ink); color: var(--ivory); border: 1px solid var(--line); font-size: 14px; font-weight: 700; }
.binding-key:hover { border-color: var(--amber); }
.binding-key[aria-pressed="true"] { background: var(--amber); color: var(--ink); border-color: var(--amber); }
.binding-status { min-height: 3.1em; margin-top: 10px; color: var(--ivory); }
.reset-keys { padding-left: 0; color: var(--amber); }
.manual-controls [data-control-help="move"] dd { white-space: normal; max-width: 11em; text-align: right; }
.mission-toast { position: absolute; top: 142px; left: 16px; z-index: var(--z-toast); max-width: min(60%, 360px); padding: 9px 14px; border-left: 3px solid var(--amber); background: #10232bf5; pointer-events: none; }
.mission-toast strong { display: block; color: var(--ivory); font-size: clamp(14px, 1.65cqw, 20px); }
.mission-toast span { display: block; color: var(--muted); font-size: clamp(13px, 1.35cqw, 16px); }
#stage:not([data-view="playing"]) .mission-toast { top: auto; bottom: 10px; }
.interaction-prompt { position: absolute; left: 50%; bottom: 9%; transform: translateX(-50%); z-index: var(--z-prompt); max-width: 65%; padding: 6px 12px; background: #10232bf5; border: 1px solid var(--jade); color: var(--ivory); font-size: clamp(14px, 1.6cqw, 20px); text-align: center; pointer-events: none; }
.mission-coach { position: absolute; left: 16px; top: 142px; display: flex; align-items: center; width: min(390px, 48%); padding: 8px 8px 8px 12px; background: #10232be8; border-left: 2px solid var(--jade); z-index: var(--z-coach); }
.mission-coach strong { font-size: 16px; font-weight: 700; }
.mission-coach p { font-size: 15px; color: var(--muted); line-height: 1.3; margin-top: 3px; }
.mission-coach .icon-button { align-self: flex-start; }
.coach-compact { display: none; }
.hud:has(.vehicle-status:not([hidden])) ~ :is(.mission-coach, .mission-toast) { margin-top: 32px; }

/* =====================================================================
   HUD v2 — purely presentational. Every rule here changes paint only
   (background, box-shadow, colour, text-shadow); no width, padding, border
   width, position or font-size changes, so the HUD / coach / toast / prompt
   boxes keep their exact tested geometry. Former thick side stripes keep
   their border WIDTH but go transparent, and the accent moves into a 1px
   tinted inset ring + top light.
   ===================================================================== */
:root {
  --hud-bg: linear-gradient(180deg, oklch(0.275 0.034 223 / .95) 0%, oklch(0.215 0.03 225 / .95) 100%);
  --hud-ring: oklch(0.47 0.032 214 / .6);
  --hud-drop: 0 6px 16px -8px oklch(0.08 0.02 230 / .85);
}
:is(.player-status, .score-status, .hud-equipment, .objective-status, .vehicle-status, .boss-status, .replay-status, .mission-toast, .mission-coach, .interaction-prompt, .co-op-player) {
  background: var(--hud-bg); border-radius: 3px;
  box-shadow: inset 0 0 0 1px var(--hud-ring), inset 0 1px 0 var(--hairline-hi), var(--hud-drop);
}
:is(.player-status, .vehicle-status, .replay-status, .mission-toast, .mission-coach) { border-left-color: transparent; }
.player-status, .mission-coach, .replay-status { box-shadow: inset 0 0 0 1px oklch(0.57 0.06 195 / .55), inset 0 1px 0 var(--hairline-hi), var(--hud-drop); }
.vehicle-status { box-shadow: inset 0 0 0 1px oklch(0.77 0.14 70 / .5), inset 0 1px 0 var(--hairline-hi), var(--hud-drop); }
.vehicle-status[data-hit="true"] { box-shadow: inset 0 0 0 1px var(--danger), 0 0 14px -4px oklch(0.8 0.12 35 / .7), var(--hud-drop); }
.mission-toast { box-shadow: inset 0 0 0 1px oklch(0.77 0.14 70 / .5), inset 0 1px 0 var(--hairline-hi), 0 0 22px -10px oklch(0.77 0.14 70 / .6), var(--hud-drop); }
.mission-toast strong { color: var(--amber-hi); }
.interaction-prompt { box-shadow: inset 0 1px 0 var(--hairline-hi), 0 0 18px -6px oklch(0.57 0.06 195 / .7), var(--hud-drop); }
.boss-status { box-shadow: inset 0 0 0 1px oklch(0.72 0.15 40 / .45), inset 0 1px 0 oklch(0.8 0.13 45 / .35), 0 0 22px -8px oklch(0.72 0.15 40 / .45), var(--hud-drop); }
.boss-status strong { text-shadow: 0 0 10px oklch(0.72 0.15 40 / .45); }
.boss-tip[data-urgent="true"] { border-left-color: transparent; background: oklch(0.72 0.15 40 / .14); }
.score-status strong { text-shadow: 0 1px 0 var(--ink-0), 0 0 12px oklch(0.77 0.14 70 / .2); }
.objective-service { border-radius: 2px; box-shadow: inset 0 1px 0 oklch(0.8 0.06 190 / .3); }
.stage-tools .icon-button { background: var(--hud-bg); box-shadow: inset 0 0 0 1px var(--hud-ring); }

/* Health pips: lit cells with a hairline, recessed when empty, glowing red when low. */
.health-pips i { background: linear-gradient(180deg, #fff6dc 0%, var(--ivory) 55%, #c9bb93 100%); box-shadow: 0 0 0 1px oklch(0.12 0.02 230 / .55); }
.health-pips i.empty { background: #243a41; box-shadow: inset 0 1px 1px oklch(0.08 0.02 230 / .8), 0 0 0 1px oklch(0.12 0.02 230 / .4); }
.health-pips[data-low="true"] i:not(.empty) { background: linear-gradient(180deg, #ffd9cc 0%, var(--danger) 60%, #d9694e 100%); box-shadow: 0 0 0 1px oklch(0.2 0.05 30 / .7), 0 0 6px oklch(0.8 0.12 35 / .7); }

/* Bars: recessed track, lit value with a top highlight and soft bloom. */
progress, meter { background: var(--ink-0); box-shadow: inset 0 1px 1px oklch(0.06 0.02 230 / .9); }
progress::-webkit-progress-bar { background: var(--ink-0); }
progress::-webkit-progress-value { background: linear-gradient(180deg, var(--amber-hi), var(--amber) 55%, var(--amber-lo)); box-shadow: 0 0 6px oklch(0.77 0.14 70 / .6); }
progress::-moz-progress-bar { background: linear-gradient(180deg, var(--amber-hi), var(--amber) 55%, var(--amber-lo)); }
meter::-webkit-meter-bar { background: var(--ink-0); }
meter::-webkit-meter-optimum-value { background: linear-gradient(180deg, var(--amber-hi), var(--amber) 55%, var(--amber-lo)); }
meter::-moz-meter-bar { background: linear-gradient(180deg, var(--amber-hi), var(--amber) 55%, var(--amber-lo)); }
.boss-status progress::-webkit-progress-value { background: linear-gradient(180deg, #ffd08a, #f0934f 55%, #c4583a); box-shadow: 0 0 8px oklch(0.72 0.15 40 / .7); }
.boss-status progress::-moz-progress-bar { background: linear-gradient(180deg, #ffd08a, #f0934f 55%, #c4583a); }
/* Shielded: uplink-cyan hazard stripes (the same cyan as the boss Toolkit case). */
.boss-status[data-shielded="true"] progress::-webkit-progress-value { background: repeating-linear-gradient(135deg, #d4f7ee 0 4px, #3e8a86 4px 8px); box-shadow: 0 0 8px oklch(0.85 0.08 180 / .6); }
.boss-status[data-shielded="true"] progress::-moz-progress-bar { background: repeating-linear-gradient(135deg, #d4f7ee 0 4px, #3e8a86 4px 8px); }
.boss-status[data-shielded="true"] #boss-phase { color: var(--uplink); }
.vehicle-status[data-low="true"] meter::-webkit-meter-optimum-value, .co-op-player[data-low="true"] meter::-webkit-meter-optimum-value { background: linear-gradient(180deg, #ffd9cc, var(--danger) 60%, #d9694e); }
.vehicle-status[data-low="true"] meter::-moz-meter-bar, .co-op-player[data-low="true"] meter::-moz-meter-bar { background: linear-gradient(180deg, #ffd9cc, var(--danger) 60%, #d9694e); }
.co-op-player meter::-webkit-meter-optimum-value { background: var(--player-color); box-shadow: 0 0 6px var(--player-color); }
.co-op-player meter::-moz-meter-bar { background: var(--player-color); }

@media (prefers-reduced-motion: no-preference) {
  /* Toast slides in from its own edge; coach fades. Shown only occasionally. */
  .mission-toast:not([hidden]) { animation: hud-slide-in .22s var(--ease-out) both; }
  .mission-coach:not([hidden]) { animation: launch-reveal .2s ease-out both; }
  /* Low health: a slow warning pulse on the lit pips only. */
  .health-pips[data-low="true"] i:not(.empty) { animation: pip-warn 1.2s ease-in-out infinite; }
  /* Shield stripes crawl so "shielded" reads as an active state. */
  .boss-status[data-shielded="true"] progress::-webkit-progress-value { animation: shield-crawl .9s linear infinite; }
  @keyframes hud-slide-in { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }
  @keyframes pip-warn { 0%, 100% { opacity: 1; } 50% { opacity: .62; } }
  @keyframes shield-crawl { from { background-position: 0 0; } to { background-position: 11.31px 0; } }
}
.confirm-panel { width: min(430px, 100%); }
.confirm-panel h2 { font-size: 30px; margin: 10px 0 12px; }
.confirm-panel .panel-scroll { padding: 24px; }
.confirm-actions { display: grid; gap: 10px; }
.boot-status { position: absolute; inset: 0; z-index: var(--z-boot); display: grid; place-items: center; padding: 24px; background: var(--charcoal); }
.boot-panel { width: min(380px, 100%); }
.boot-panel h2 { font-size: 32px; line-height: 1.1; margin: 10px 0 16px; }
.boot-panel > p:not(.panel-eyebrow) { font-size: 18px; line-height: 1.4; color: var(--muted); }
.boot-panel .primary-button { margin-top: 24px; }

.control-strip { color: var(--muted); font-size: 14px; container: controls / inline-size; }
.keyboard-hints { display: flex; align-items: center; flex-wrap: nowrap; gap: clamp(10px, 1.5vw, 20px); }
.keyboard-hints > span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.keyboard-hints kbd { font-size: 11px; color: var(--ivory); border-color: #606555; padding: 3px 4px; }
.control-strip > .text-button { padding-inline: 8px; white-space: nowrap; }
.control-strip > .text-button > span { display: inline-grid; place-items: center; border: 1px solid #727866; width: 17px; height: 17px; margin-left: 5px; border-radius: 50%; font-size: 12px; }
.touch-hint { display: none; font-size: 13px; }
.gamepad-hint { display: none; font-size: 13px; }
#shell[data-ui-input-mode="keyboard"] .keyboard-hints { display: flex; }
#shell[data-ui-input-mode="gamepad"] .keyboard-hints, #shell[data-ui-input-mode="touch"] .keyboard-hints { display: none; }
#shell[data-ui-input-mode="keyboard"] .touch-hint, #shell[data-ui-input-mode="gamepad"] .touch-hint { display: none; }
#shell[data-ui-input-mode="touch"] .touch-hint, #shell[data-ui-input-mode="gamepad"] .gamepad-hint { display: block; }
#shell[data-ui-input-mode="keyboard"] .touch-controls, #shell[data-ui-input-mode="gamepad"] .touch-controls { display: none; }
#shell[data-ui-input-mode="keyboard"] .interaction-prompt, #shell[data-ui-input-mode="gamepad"] .interaction-prompt { bottom: 9%; }
@container controls (max-width: 850px) {
  .keyboard-hints > .optional-hint { display: none; }
  .keyboard-hints { gap: 12px; }
}
.touch-controls { position: absolute; left: 12px; right: 12px; bottom: 10px; z-index: var(--z-touch); display: none; justify-content: space-between; align-items: flex-end; pointer-events: none; }
.touch-controls button { min-width: 44px; min-height: 44px; padding: 4px; border: 1px solid #89a8aa; background: #152c35e8; color: var(--ivory); font-size: 16px; font-weight: 700; touch-action: none; pointer-events: auto; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.touch-controls button.is-down { background: var(--amber); color: var(--ink); border-color: #ffe2a0; }
.touch-movement { display: grid; grid-template: repeat(2, 44px) / repeat(3, 44px); gap: 4px; }
.touch-up { grid-column: 2; grid-row: 1; line-height: .8; }
.touch-up span { display: block; font-size: 11px; margin-top: 4px; }
.touch-left { grid-column: 1; grid-row: 2; }
.touch-crouch { grid-column: 2; grid-row: 2; }
.touch-right { grid-column: 3; grid-row: 2; }
.touch-actions { display: grid; grid-template: repeat(2, 44px) / repeat(3, 52px); gap: 4px; }
.touch-actions button { font-size: 14px; }
.touch-jump { grid-column: 1; grid-row: 2; }
.touch-fire { grid-column: 2 / 4; grid-row: 2; border-color: var(--amber) !important; background: #593e20ed !important; font-size: 19px !important; }
.touch-fire.is-down { background: var(--amber) !important; }
.force-touch .touch-controls { display: flex; }
.force-touch .keyboard-hints { display: none; }
.force-touch .touch-hint { display: block; }
.force-touch #stage[data-view="playing"] .interaction-prompt { bottom: 110px; }

/* Black bars belong to the fullscreen root, never to the scene-aligned UI. */
#stage:fullscreen, #stage.is-fullscreen { width: 100vw; width: 100dvw; height: 100vh; height: 100dvh; aspect-ratio: auto; box-shadow: none; background: #080b09; }
#stage:fullscreen #stage-surface, #stage.is-fullscreen #stage-surface { inset: auto; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(calc(100dvw - env(safe-area-inset-left) - env(safe-area-inset-right)), calc((100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom)) * 16 / 9)); aspect-ratio: 16 / 9; }
#stage:fullscreen .stage-tools, #stage.is-fullscreen .stage-tools { display: flex; }
#stage:fullscreen .score-status, #stage.is-fullscreen .score-status { margin-right: 138px; }
.noscript-note, .load-error { position: fixed; inset: auto 12px 12px; padding: 12px; background: var(--ink); text-align: center; z-index: 50; }
@media (pointer: coarse) {
  .touch-controls { display: flex; }
  .keyboard-hints { display: none; }
  .touch-hint { display: block; }
  #stage[data-view="playing"] .interaction-prompt { bottom: 110px; }
}
@media (max-width: 800px) {
  .toolbar-title > span, .optional-hint { display: none !important; }
  .toolbar-title { gap: 0; }
  .keyboard-hints { gap: 12px; }
}
@media (max-width: 450px) {
  .toolbar-title strong { font-size: 15px; }
  .toolbar-actions .quiet-button > span { display: none; }
  .toolbar, .control-strip { gap: 6px; }
  .keyboard-hints > span { font-size: 12px; gap: 3px; }
  .keyboard-hints { gap: 7px; }
  .touch-hint { max-width: 23ch; line-height: 1.2; }
}
@media (max-height: 520px) and (orientation: landscape) {
  #shell { --chrome-height: 0px; gap: 0; }
  .toolbar, .control-strip { display: none; }
  .stage-tools { display: flex; }
  .score-status { display: none; }
}
@container battlefield (max-width: 950px) {
  .title-layout { width: 44%; margin-left: 5%; padding-block: 10px; }
  h1 { margin-top: 10px; margin-bottom: 8px; font-size: 7.1cqw; }
  .briefing { margin-top: 10px; font-size: 15px; }
  .title-controls { margin-top: 12px; max-width: 270px; }
  .difficulty-control { margin-bottom: 8px; }
  .primary-button { padding: 9px 14px; font-size: 18px; }
  .menu-actions { margin-top: 4px; }
  .hud-top { top: 10px; left: 10px; right: 10px; }
  .hud-equipment { top: 64px; left: 10px; gap: 12px; }
  .objective-status { top: 60px; right: 10px; }
  .vehicle-status { top: 10px; left: 10px; }
  .hud[data-vehicle="true"] .hud-equipment { top: 84px; }
  .mission-coach, .mission-toast { top: 132px; left: 10px; }
  .result-score { margin: 12px 0; }
  .result-stats { margin: 12px 0 16px; }
}
@container battlefield (max-width: 680px) {
  .title-screen { background: linear-gradient(90deg, #10232be8, #152c35b8 65%, #152c3570); }
  .title-layout { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 20px; width: calc(100% - 48px); margin: 0 24px; padding: 8px 0; }
  .title-copy { min-width: 0; }
  h1 { font-size: 8cqw; margin: 10px 0; }
  .operation-name { font-size: 15px; letter-spacing: .075em; }
  .briefing { font-size: 16px; max-width: 28ch; line-height: 1.3; }
  .title-controls { margin-top: 0; }
  .difficulty-control { column-gap: 6px; }
  .difficulty-control select { min-width: 106px; }
  #difficulty-note { font-size: 14px; }
  .first-controls { font-size: 15px; margin-bottom: 10px; }
  .hud-top { top: 8px; left: 8px; right: 8px; }
  .score-status { display: none; }
  .player-status { padding: 7px 9px; }
  .hud-equipment { top: 55px; left: 8px; font-size: 14px; gap: 10px; padding: 5px 8px; }
  .objective-status { right: 8px; top: 60px; max-width: 44%; font-size: 14px; }
  .vehicle-status { top: 8px; left: 8px; padding: 7px 9px; width: calc(var(--status-inner) + 21px); font-size: 14px; }
  .hud[data-vehicle="true"] .player-status { margin-top: 42px; }
  .hud[data-vehicle="true"] .hud-equipment { top: 73px; }
  .boss-status { top: 8px; left: 34%; width: 30%; font-size: 13px; }
  .boss-status strong { font-size: 14px; }
  .boss-status #boss-subtitle { font-size: 11px; }
  .mission-coach { width: min(360px, 60%); top: 112px; }
  .mission-toast { top: 112px; max-width: 62%; }
  .panel-header { padding: 10px 14px; }
  .panel-header h2 { font-size: 25px; }
  .panel-header .panel-eyebrow { display: none; }
  .panel-scroll { padding: 12px 14px; }
  .panel-footer { padding: 8px 14px; }
  .manual-controls { gap: 10px 20px; }
  .manual-controls dt, .manual-brief, .manual-note { font-size: 16px; }
  .result-panel { display: grid; grid-template-columns: 1fr 1fr; align-items: center; column-gap: 24px; width: min(550px, 100%); }
  .result-panel .panel-eyebrow, .result-panel h2, .result-panel .panel-description { grid-column: 1; }
  .result-panel .panel-eyebrow { align-self: end; }
  .result-panel h2 { margin: 4px 0; }
  .result-panel .panel-description { font-size: 14px; align-self: start; }
  .result-score { grid-column: 2; grid-row: 1 / 4; margin: 0; }
  .result-stats { grid-column: 1 / -1; margin: 12px 0; }
  .result-stats dd { font-size: 19px; }
  .result-panel .primary-button { grid-column: 2; grid-row: 5; }
  .result-panel > .text-button { grid-column: 1; grid-row: 5; margin: 0; }
  .pause-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 20px; align-items: center; width: min(490px, 100%); }
  .pause-panel .panel-eyebrow, .pause-panel h2, .pause-panel .panel-description { grid-column: 1; margin: 0; }
  .pause-panel .panel-eyebrow { align-self: end; }
  .pause-panel .panel-description { font-size: 15px; align-self: start; }
  .pause-panel > .primary-button { grid-column: 2; grid-row: 1 / 3; margin: 0; }
  .pause-panel > .secondary-button { grid-column: 2; grid-row: 3; margin: 0; }
  .pause-panel .menu-actions { grid-column: 1 / -1; justify-content: center; gap: 24px; }
}
@container battlefield (max-width: 450px) {
  .title-layout { gap: 12px; margin-inline: 12px; width: calc(100% - 24px); }
  .field-badge { font-size: 12px; gap: 10px; }
  .field-badge > span { padding-left: 10px; letter-spacing: .025em; }
  h1 { font-size: 8.5cqw; margin: 8px 0; }
  .operation-name { font-size: 12px; letter-spacing: .055em; }
  .briefing { font-size: 16px; line-height: 1.4; margin-top: 8px; }
  .difficulty-control { grid-template-columns: 1fr; gap: 0; margin-bottom: 7px; }
  .difficulty-control > label { font-size: 15px; margin-bottom: 2px; }
  .difficulty-control select { width: 100%; font-size: 15px; }
  #difficulty-note { font-size: 14px; }
  .primary-button { padding: 10px 14px; font-size: 18px; }
  .menu-actions { gap: 4px; }
  .menu-actions .text-button { font-size: 16px; }
  .stage-tools { top: 3px; right: 3px; gap: 0; }
  #stage.is-fullscreen[data-view="title"] .title-layout { padding-block: 0; }
  #stage.is-fullscreen[data-view="title"] .title-controls { margin-top: 44px; }
  #stage.is-fullscreen[data-view="title"] .difficulty-control > label { display: none; }
  .touch-controls { left: 6px; right: 6px; bottom: 6px; }
  .touch-movement { gap: 2px; }
  .touch-actions { grid-template-columns: repeat(3, 44px); gap: 2px; }
  .touch-actions button { font-size: 12px; }
  .interaction-prompt { max-width: 70%; padding: 3px 7px; font-size: 12px; }
  .mission-toast { padding: 6px 9px; max-width: 90%; }
  .manual-controls { grid-template-columns: 1fr; }
  .veil-screen { padding: 10px; }
  .pause-panel { gap: 6px 12px; }
  .pause-panel h2 { font-size: 25px; }
  .pause-panel .secondary-button { font-size: 15px; padding-inline: 6px; }
  .result-panel { column-gap: 10px; }
  .result-panel h2 { font-size: 24px; }
  .result-panel .panel-description { font-size: 16px; }
  .result-stats { gap: 5px; margin: 8px 0; }
  .result-stats dt { font-size: 12px; }
  .result-stats dd { font-size: 17px; }
}
/* Portrait is a deliberate console layout: status, unobstructed 16:9 world,
   contextual guidance, then controls. The game and its coordinates are untouched. */
@media (orientation: portrait) and (max-width: 800px) {
  body { display: block; height: auto; min-height: 100dvh; overflow: auto; }
  #shell { width: 100%; max-width: 100%; gap: 6px; margin-inline: auto; }
  #stage, #stage.is-fullscreen, #stage:fullscreen { width: 100%; height: max(620px, calc(100dvh - 116px)); aspect-ratio: auto; }
  #stage-surface, #stage.is-fullscreen #stage-surface, #stage:fullscreen #stage-surface { inset: 0; width: 100%; height: 100%; margin-inline: auto; aspect-ratio: auto; transform: none; }
  #stage.is-fullscreen, #stage:fullscreen { height: 100dvh; }
  #game { inset: 104px 0 auto; height: 56.25cqw; }
  .scene-backdrop { top: 104px; height: 56.25cqw; }
  #stage[data-view="title"] #game, #stage[data-view="title"] .scene-backdrop { top: 0; }
  .title-screen { align-items: flex-start; overflow-y: auto; background: linear-gradient(180deg, #10232b10 0, #152c3599 105px, var(--charcoal) 200px); }
  .title-layout { display: block; width: calc(100% - 40px); margin: 120px 20px 24px; padding: 0; }
  .field-badge { font-size: 13px; }
  h1 { font-size: clamp(48px, 12cqw, 72px); margin: 12px 0; line-height: .95; }
  .operation-name { font-size: 16px; }
  .briefing { max-width: 40ch; font-size: 18px; margin-top: 14px; }
  .title-controls { margin-top: 20px; max-width: none; }
  .first-controls { font-size: 16px; margin-bottom: 12px; }
  .difficulty-control { grid-template-columns: 1fr auto; gap: 0 10px; margin-bottom: 12px; }
  .difficulty-control select { font-size: 17px; min-width: 130px; }
  #difficulty-note { font-size: 14px; padding-top: 6px; }
  .title-controls .primary-button { min-height: 48px; }
  .portrait-advice { display: block; color: var(--muted); font-size: 15px; line-height: 1.35; margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
  .hud { inset: 0 0 auto; height: 104px; background: var(--ink); }
  .hud-top { top: 10px; left: 10px; right: 10px; }
  .player-status { border: 0; padding: 0; background: transparent; }
  .health-status { width: 172px; }
  .health-heading { margin-bottom: 6px; }
  .hud-equipment { top: 44px; left: 10px; right: 10px; padding: 0; background: transparent; gap: 14px; font-size: 15px; }
  .objective-status { top: 73px; left: 10px; right: 10px; max-width: none; padding: 0; background: transparent; font-size: 14px; }
  #mission-progress { display: none; }
  .score-status { display: flex; background: transparent; padding: 0; gap: 6px; }
  .score-status strong { font-size: 18px; }
  .score-status > span { font-size: 13px; }
  .hud:has(.vehicle-status:not([hidden])) .score-status { display: none; }
  .vehicle-status { top: 10px; left: 10px; right: auto; width: 172px; padding: 0; border: 0; background: transparent; font-size: 16px; }
  .hud[data-vehicle="true"] .player-status { position: absolute; right: 0; margin: 0; padding: 0; }
  .hud[data-vehicle="true"] .health-status { width: 126px; }
  .hud[data-vehicle="true"] .health-heading { flex-wrap: wrap; gap: 3px 6px; }
  .hud[data-vehicle="true"] .reserve-label { flex-basis: 100%; margin: 0; font-size: 12px; }
  .hud[data-vehicle="true"] .hud-equipment { top: 44px; }
  .boss-status { top: 69px; left: 10px; right: 10px; width: auto; padding: 0; background: transparent; }
  .boss-status #boss-subtitle { display: none; }
  .boss-status progress { height: 4px; margin-top: 4px; }
  .mission-coach, .mission-toast, #stage .interaction-prompt { top: calc(104px + 56.25cqw + 10px); bottom: auto; left: 10px; right: 10px; width: auto; max-width: none; transform: none; font-size: 15px; margin: 0; }
  .mission-coach, .mission-toast { padding: 6px 8px 6px 12px; background: transparent; }
  .mission-coach { display: block; min-height: 66px; }
  .mission-coach .coach-details > strong { display: block; padding-right: 38px; }
  .mission-coach .icon-button { position: absolute; right: 0; top: 0; }
  .mission-coach p { font-size: 15px; }
  .hud:has(.vehicle-status:not([hidden])) ~ :is(.mission-coach, .mission-toast) { margin-top: 0; }
  #stage .interaction-prompt { padding: 10px; text-align: left; }
  #shell #stage .interaction-prompt { bottom: auto; }
  #stage:has(.interaction-prompt:not([hidden])) .mission-toast { display: none; }
  #stage:not([data-view="playing"]) .mission-toast { top: auto; bottom: 12px; background: var(--ink); }
  .touch-controls { left: 12px; right: 12px; top: auto; bottom: 24px; gap: 12px; }
  .touch-movement { grid-template: repeat(2, 52px) / repeat(3, minmax(44px, 1fr)); gap: 5px; }
  .touch-actions { grid-template: repeat(2, 52px) / repeat(3, minmax(44px, 1fr)); gap: 5px; }
  .touch-movement, .touch-actions { flex: 1; min-width: 0; max-width: 248px; }
  .touch-actions button { font-size: 14px; }
  .touch-controls button { background: var(--teal); }
  .portrait-play-note { position: absolute; bottom: 150px; left: 12px; right: 12px; text-align: center; font-size: 15px; color: var(--muted); }
  #stage[data-view="playing"] .portrait-play-note { display: block; }
  .veil-screen { padding: 24px; }
  .pause-panel, .result-panel { display: block; width: min(400px, 100%); }
  .pause-panel h2, .result-panel h2 { font-size: 36px; margin: 10px 0 14px; }
  .pause-panel .panel-description, .result-panel .panel-description { font-size: 18px; }
  .pause-panel > .primary-button { margin-top: 28px; }
  .pause-panel > .secondary-button { margin-top: 12px; font-size: 18px; }
  .pause-panel .menu-actions { justify-content: space-between; margin-top: 12px; }
  .result-score { margin: 24px 0 20px; }
  .result-score > strong { font-size: 52px; }
  .result-stats { margin: 24px 0; gap: 10px; }
  .result-stats dt { font-size: 16px; }
  .result-stats dd { font-size: 24px; }
  .result-panel > .text-button { margin-top: 10px; }
  .dialog-screen { padding: 12px; }
  .panel-header { padding: 14px 16px; }
  .panel-scroll { padding: 16px; }
  .panel-header h2 { font-size: 30px; }
  .manual-controls { grid-template-columns: 1fr; }
  .stage-tools { display: none; }
  #stage.is-fullscreen .stage-tools, #stage:fullscreen .stage-tools { display: flex; }
  #stage.is-fullscreen .hud-top, #stage:fullscreen .hud-top { right: 148px; }
  #stage.is-fullscreen .score-status, #stage:fullscreen .score-status { display: none; }
}
@media (orientation: portrait) and (max-width: 800px) and (max-height: 740px) {
  /* Keep title dialogs inside the viewport, including their return action. */
  #stage[data-view="title"]:not(.is-fullscreen):not(:fullscreen):has(.dialog-screen:not([hidden])) { height: calc(100dvh - var(--safe-top) - var(--safe-bottom) - 100px); }
  #stage[data-view="playing"], #stage[data-view="paused"], #stage[data-view="result"] { height: max(490px, calc(100dvh - 66px)); }
  #shell:has(#stage:not([data-view="title"])) .control-strip { display: none; }
  .title-layout { margin-top: 24px; }
  .title-screen { background: #152c35e8; }
  .title-layout h1 { font-size: 44px; }
  .title-layout .briefing { font-size: 16px; }
  .title-controls { margin-top: 14px; }
  .touch-controls { bottom: 12px; }
  .touch-movement, .touch-actions { grid-template-rows: repeat(2, 48px); }
  .portrait-play-note { display: none !important; }
  #stage.is-fullscreen, #stage:fullscreen { height: 100dvh; }
}
@media (max-width: 359px) and (orientation: portrait) {
  .touch-controls { left: 6px; right: 6px; gap: 6px; }
  .touch-movement, .touch-actions { gap: 2px; }
  .touch-actions button { font-size: 12px; }
  .hud-equipment { gap: 8px; font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
  .primary-button:active { transform: none; }
}
html.reduced-motion *, html.reduced-motion *::before, html.reduced-motion *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
html.reduced-motion .primary-button:active { transform: none; }
html.reduced-motion :is(.primary-button, .secondary-button, .icon-button, .quiet-button):active { transform: none; }
@media (prefers-reduced-motion: reduce) {
  :is(.primary-button, .secondary-button, .icon-button, .quiet-button):active { transform: none; }
}
/* Dialog entrances: the veil fades while the panel rises a few pixels into
   place. Short (<=220ms) and opted in only when motion is welcome; the global
   reduced-motion switches above also cancel them. */
@media (prefers-reduced-motion: no-preference) {
  .dialog-screen:not([hidden]), #pause-screen:not([hidden]) { animation: veil-in 160ms ease-out both; }
  .dialog-screen:not([hidden]) .document-panel, #pause-screen:not([hidden]) .menu-panel { animation: panel-in 220ms var(--ease-out) both; }
  @keyframes veil-in { from { opacity: 0; } to { opacity: 1; } }
  @keyframes panel-in { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
}

/* Results keep the advertised retry cost beside its action. Details can scroll
   on short screens while keyboard/controller focus still reaches every item. */
.result-panel { display: flex; flex-direction: column; align-items: stretch; gap: 0; width: min(680px, 100%); max-height: 100%; min-height: 0; background: #10232bef; border-top: 2px solid var(--jade); }
.result-content { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px 24px; padding: 24px; min-height: 0; text-align: left; }
.result-heading, .result-ledger { min-width: 0; }
.result-heading .panel-eyebrow { display: flex; flex-wrap: wrap; gap: 8px 12px; margin: 0; letter-spacing: .04em; font-size: 14px; }
#result-difficulty { color: var(--muted); border-left: 1px solid var(--line); padding-left: 12px; }
.result-heading h2 { font-size: 34px; line-height: 1.05; margin: 10px 0 14px; }
.result-heading .panel-description { font-size: 17px; line-height: 1.4; }
.result-ledger .result-score { display: grid; margin: 0; gap: 3px; }
.result-ledger .result-score > strong { font-size: 48px; }
.result-ledger .result-score > span { font-size: 15px; }
.result-delta { margin-top: 8px; font-size: 15px; color: var(--muted); }
.result-delta[data-record="true"] { color: var(--amber); }
.result-breakdown { display: grid; gap: 4px; font-size: 16px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.result-breakdown > div { display: flex; justify-content: space-between; gap: 10px; }
.result-breakdown dt { color: var(--muted); }
.result-breakdown dd { margin: 0; font-variant-numeric: tabular-nums; }
.result-content .result-stats { grid-column: 1 / -1; margin: 0; padding-top: 14px; border-top: 1px solid var(--line); gap: 12px; }
.result-content .result-stats dt { font-size: 15px; }
.result-content .result-stats dd { font-size: 23px; }
.result-target { grid-column: 1 / -1; font-size: 17px; line-height: 1.3; color: var(--ivory); border-left: 2px solid var(--jade); padding-left: 10px; }
.result-replay { grid-column: 1 / -1; padding: 8px 10px; border-left: 2px solid var(--amber); background: #27576140; font-size: 16px; line-height: 1.3; }
.result-replay[data-state="met"] { border-left-color: var(--jade); }
.result-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding: 14px 24px; border-top: 1px solid var(--line); flex-shrink: 0; }
.result-actions .primary-button { grid-column: 1; grid-row: auto; margin: 0; font-size: 18px; }
.result-actions .text-button { grid-column: 2; grid-row: auto; margin: 0; font-size: 16px; padding-inline: 8px; }
.retry-cost { grid-column: 1 / -1; font-size: 16px; line-height: 1.35; color: var(--ivory); white-space: pre-line; margin: 0 0 2px; }
@container battlefield (max-width: 680px) {
  .result-content { padding: 14px; gap: 14px 18px; }
  .result-heading h2 { font-size: 28px; margin: 8px 0 10px; }
  .result-heading .panel-description { font-size: 16px; }
  .result-ledger .result-score > strong { font-size: 38px; letter-spacing: .03em; }
  .result-breakdown { font-size: 15px; margin-top: 8px; padding-top: 8px; }
  .result-actions { padding: 10px 14px; gap: 8px; }
  .result-content .result-stats { padding-top: 10px; }
  .result-content .result-stats dd { font-size: 20px; }
  .result-target { font-size: 16px; }
}
@media (orientation: portrait) and (min-height: 741px) and (max-width: 800px) {
  .result-content { grid-template-columns: 1fr; gap: 18px; }
  .result-heading h2 { font-size: 32px; }
  .result-ledger .result-score > strong { font-size: 46px; }
}
@media (orientation: portrait) and (max-height: 740px) and (max-width: 450px) {
  .result-content { gap: 12px; padding: 12px; }
  .result-heading h2 { font-size: 25px; }
  .result-heading .panel-eyebrow { font-size: 13px; gap: 4px; }
  #result-difficulty { padding-left: 0; border-left: 0; width: 100%; }
  .result-ledger .result-score > strong { font-size: 32px; }
  .result-breakdown { font-size: 14px; gap: 3px; }
  .result-actions { padding: 10px; }
  .result-actions .primary-button { padding-inline: 10px; font-size: 17px; }
  .retry-cost { font-size: 15px; }
}
@media (orientation: landscape) and (max-height: 520px) {
  #result-screen { padding: 12px 18px; }
  .hud { --status-inner: min(170px, 24cqw); }
  .health-status { width: var(--status-inner); }
  /* A short bearing/action card uses the sky beside the equipment. Keep the
     original canvas size and the actor/gantry area clear. */
  .mission-coach {
    left: auto; right: 8px; top: 52px; width: calc(100% - 352px);
    padding: 4px 6px 4px 8px; align-items: flex-start; gap: 4px;
  }
  .mission-coach .coach-details { display: none; }
  .coach-compact { display: block; flex: 1; min-width: 0; }
  .mission-coach strong { display: block; font-size: 14px; line-height: 16px; }
  .mission-coach p { font-size: 14px; line-height: 16px; margin-top: 2px; white-space: pre-line; }
  .mission-coach .icon-button { flex: 0 0 44px; }
  .hud:has(.vehicle-status:not([hidden])) ~ .mission-coach { margin-top: 0; }
  #stage[data-compact-coach="true"] .objective-status { display: none; }
  .boss-status { padding-block: 3px; left: 34%; width: 36%; }
  .boss-status progress { height: 5px; margin-top: 3px; }
  .boss-tip { margin-top: 3px; font-size: 13px; line-height: 14px; white-space: nowrap; }
  .boss-status #boss-subtitle { display: none; }
  .hud:has(.boss-status:not([hidden])) ~ .mission-toast {
    left: auto; right: 8px; top: 52px; max-width: calc(100% - 352px);
    margin-top: 0; padding: 6px 8px;
  }
  .hud:has(.boss-status:not([hidden])) ~ .mission-toast :is(strong, span) { font-size: 14px; line-height: 16px; }
  .replay-status { top: 120px; right: 8px; }
  .hud:has(.boss-status:not([hidden])) .replay-status {
    top: 56px; padding: 4px 8px; gap: 8px; font-size: 13px; line-height: 14px;
  }
}

/* Boss cues occupy the left side of the arena. Keep the reusable defense
   instructions in the upper-right sky, including desktop fit scaling. */
@media (orientation: landscape) and (min-height: 521px), (min-width: 801px) and (min-height: 521px) {
  .hud:has(.boss-status:not([hidden])) ~ .mission-coach {
    left: auto; right: 16px; top: 76px; width: min(350px, 36%);
    margin-top: 0; padding: 4px 6px 4px 8px; align-items: flex-start; gap: 4px;
  }
  .hud:has(.boss-status:not([hidden])) ~ .mission-coach .coach-details { display: none; }
  .hud:has(.boss-status:not([hidden])) ~ .mission-coach .coach-compact { display: block; flex: 1; min-width: 0; }
  .hud:has(.boss-status:not([hidden])) ~ .mission-coach strong { display: block; font-size: 14px; line-height: 16px; }
  .hud:has(.boss-status:not([hidden])) ~ .mission-coach p { font-size: 14px; line-height: 16px; margin-top: 2px; white-space: pre-line; }
  .hud:has(.boss-status:not([hidden])) ~ .mission-coach .icon-button { flex: 0 0 44px; }
  .hud:has(.boss-status:not([hidden])) ~ .mission-toast {
    left: auto; right: 16px; top: 76px; max-width: min(350px, 36%);
    margin-top: 0; padding: 6px 8px;
  }
  .hud:has(.boss-status:not([hidden])) ~ .mission-toast :is(strong, span) { font-size: 14px; line-height: 16px; }
}

/* Keep optional run feedback in the portrait HUD, above the full battlefield. */
@media (orientation: portrait) and (max-width: 800px) {
  .hud-equipment { gap: 8px; font-size: 14px; white-space: nowrap; }
  .hud-equipment strong { margin-left: 1px; }
  .replay-status { top: 102px; left: 10px; right: 10px; padding: 4px 0; border: 0; border-top: 1px solid var(--line); justify-content: space-between; gap: 6px; font-size: 14px; }
  #stage:has(#hud-replay:not([hidden])) .hud { height: 130px; }
  #stage:not([data-view="title"]):has(#hud-replay:not([hidden])) :is(#game, .scene-backdrop) { top: 130px; }
  #stage:has(#hud-replay:not([hidden])) :is(.mission-coach, .mission-toast, .interaction-prompt) { top: calc(130px + 56.25cqw + 10px); }
}
@media (orientation: portrait) and (max-width: 359px) {
  .hud[data-vehicle="true"] .health-status { width: 108px; }
}
@media (orientation: landscape) and (max-width: 600px) {
  .vehicle-service { display: none; }
}

/* Entry and scores use the same field-console palette as the mission. */
.title-screen { overflow-y: auto; align-items: safe center; }
.title-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, .8fr); align-items: center; gap: 10%; width: 88%; max-width: 1200px; margin: auto 6%; padding-block: 24px; }
.title-controls { width: 100%; max-width: 370px; margin: 0 0 0 auto; padding: 22px; background: #10232bf2; border: 1px solid var(--line); border-top: 3px solid var(--amber); box-shadow: 0 8px 24px #07181c40; }
.entry-eyebrow { color: var(--amber); font-size: 14px; letter-spacing: .07em; text-transform: uppercase; font-weight: 700; margin-bottom: 16px; }
.player-entry { display: grid; gap: 6px; margin-bottom: 18px; }
.player-entry label { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-weight: 700; }
.player-entry label > span { font-size: 13px; font-weight: 500; color: var(--muted); }
.player-entry input { width: 100%; min-width: 0; min-height: 46px; padding: 8px 12px; border: 1px solid #718b90; border-radius: 2px; color: var(--ivory); background: #091c24; font-size: 19px; }
.player-entry input::placeholder { color: #acbdbc; opacity: 1; }
.player-entry input[aria-invalid="true"] { border-color: var(--danger); }
#player-name-note, #player-name-error { font-size: 14px; line-height: 1.3; }
#player-name-note { color: var(--muted); }
#player-name-error { color: var(--danger); }
.title-controls .difficulty-control { grid-template-columns: minmax(0, 1fr) auto; margin-bottom: 16px; }
.title-controls .difficulty-control select { min-width: 170px; }
.title-controls .first-controls { margin: 12px 0 0; font-size: 14px; line-height: 1.3; color: var(--muted); }
.leaderboard-button { margin-top: 8px; justify-content: space-between; }
.result-player { margin-top: 12px; font-size: 20px; font-weight: 700; overflow-wrap: anywhere; }
.result-multiplier { color: var(--amber); font-size: 15px; margin-top: 5px; }
.result-ranking { color: var(--muted); font-size: 15px; margin-top: 6px; }
.result-actions > .primary-button, .result-links { grid-column: 1 / -1; }
.result-links { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 2px 12px; }
.result-links .text-button { flex: 1; padding-inline: 4px; }
.result-links .secondary-button { flex: 2; width: auto; min-height: 44px; padding: 8px 14px; font-size: 18px; }
.leaderboard-panel { width: min(740px, 100%); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.leaderboard-toolbar { display: flex; align-items: center; flex-shrink: 0; gap: 12px; padding: 12px 22px; border-bottom: 1px solid var(--line); }
.leaderboard-toolbar label { font-size: 15px; color: var(--muted); }
.leaderboard-toolbar select { min-height: 44px; border: 1px solid var(--line); background: var(--ink); color: var(--ivory); padding: 6px 12px; border-radius: 2px; }
#leaderboard-count { margin-left: auto; color: var(--muted); font-size: 15px; white-space: nowrap; }
.leaderboard-scroll { padding: 0; min-height: 44px; }
.leaderboard-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-variant-numeric: tabular-nums; }
.leaderboard-table th { position: sticky; top: 0; z-index: 1; background: #1b333c; font-weight: 500; color: var(--muted); font-size: 14px; text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.leaderboard-table th:first-child { width: 12%; }
.leaderboard-table th:nth-child(2) { width: 40%; }
.leaderboard-table th:nth-child(3) { width: 23%; }
.leaderboard-table th:last-child { width: 25%; text-align: right; }
.leaderboard-table td { border-bottom: 1px solid #49636a70; padding: 12px; font-size: 17px; vertical-align: middle; overflow-wrap: anywhere; }
.leaderboard-table td:first-child { color: var(--muted); }
.leaderboard-table td:last-child { text-align: right; font-weight: 700; font-size: 21px; }
.leaderboard-table td strong { display: block; font-weight: 700; }
.leaderboard-table td small { display: block; font-size: 13px; line-height: 1.3; color: var(--muted); margin-top: 3px; }
.leaderboard-table td[data-mode="hard"] { color: var(--amber); }
.leaderboard-table tr:first-child td:first-child { color: var(--amber); font-weight: 700; }
.leaderboard-table tr[data-current="true"] { background: #eda64912; box-shadow: inset 3px 0 var(--amber); }
.leaderboard-empty { padding: 32px 22px; font-size: 17px; color: var(--muted); text-align: center; }
.leaderboard-empty strong { display: block; color: var(--ivory); margin-bottom: 8px; font-size: 24px; }
.leaderboard-footer { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; column-gap: 16px; }
.leaderboard-footer p { grid-column: 1; font-size: 14px; line-height: 1.35; color: var(--muted); }
#leaderboard-storage { margin-top: 6px; }
#leaderboard-storage[data-saved="false"] { color: var(--amber); }
.leaderboard-footer button { grid-column: 2; grid-row: 1 / span 2; margin: 0; width: auto; }
#pause-context { white-space: pre-line; overflow-wrap: anywhere; }
@container battlefield (max-width: 950px) {
  .title-layout { grid-template-columns: minmax(0, 1fr) minmax(260px, .9fr); width: 92%; gap: 5%; margin-inline: 4%; padding-block: 14px; }
  .title-controls { padding: 14px; }
  .entry-eyebrow { margin-bottom: 10px; }
  .player-entry { margin-bottom: 12px; }
}
@container battlefield (max-width: 680px) {
  .title-layout { grid-template-columns: minmax(0, 1fr) minmax(250px, 1fr); gap: 16px; margin-inline: 14px; width: calc(100% - 28px); align-items: start; }
  .title-copy { padding-top: 12px; }
  .title-controls { padding: 12px; }
  .title-controls .difficulty-control { grid-template-columns: 1fr; gap: 4px; margin-bottom: 10px; }
  .title-controls .difficulty-control select { width: 100%; font-size: 17px; }
  .leaderboard-toolbar { padding: 8px 12px; gap: 8px; }
  .leaderboard-footer { padding: 10px 12px; }
}
@media (orientation: landscape) and (max-height: 520px) {
  .title-layout { padding-block: 16px; }
  .title-controls .first-controls { display: none; }
  .entry-eyebrow { display: none; }
  .title-copy .briefing { font-size: 15px; }
  .title-controls { margin-top: 0; }
  .leaderboard-footer p { font-size: 13px; }
}
@media (orientation: portrait) and (max-width: 800px) {
  .title-layout { display: block; width: calc(100% - 32px); margin: 100px 16px 20px; padding: 0; }
  .title-controls { max-width: none; margin: 20px 0 0; padding: 18px; }
  .title-controls .difficulty-control { grid-template-columns: minmax(0,1fr) auto; }
  .title-controls .difficulty-control select { width: auto; }
  .leaderboard-table th, .leaderboard-table td { padding-inline: 8px; }
  .leaderboard-table td { font-size: 15px; }
  .leaderboard-table td:last-child { font-size: 18px; }
  .leaderboard-table td small { font-size: 12px; }
  .leaderboard-empty { padding-inline: 16px; }
  .result-links { gap: 0; }
}
@media (orientation: portrait) and (max-width: 800px) and (max-height: 740px) {
  .title-layout { margin-top: 16px; }
  .title-controls { margin-top: 16px; }
}
@media (orientation: portrait) and (max-width: 359px) {
  .title-controls { padding: 12px; }
  .title-controls .difficulty-control { grid-template-columns: 1fr; }
  .title-controls .difficulty-control select { width: 100%; }
  .leaderboard-toolbar label { display: none; }
  .leaderboard-table th:first-child { width: 11%; }
  .leaderboard-table th:nth-child(2) { width: 37%; }
  .leaderboard-table th:nth-child(3) { width: 25%; }
  .leaderboard-table th:last-child { width: 27%; }
}

/* Shared-keyboard co-op. Solo selectors and HUD geometry remain independent. */
:root { --p1: #ffb260; --p2: #78dce8; }
.p1-color, [data-player="0"] { --player-color: var(--p1); }
.p2-color, [data-player="1"] { --player-color: var(--p2); }
.p1-color { color: var(--p1); }
.p2-color { color: var(--p2); }
.player-count-control { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; }
.player-count-control label { font-weight: 700; }
.player-count-control select { min-height: 44px; min-width: 170px; padding: 6px 10px; background: var(--ink); color: var(--ivory); border: 1px solid var(--line); border-radius: 2px; }
.party-note { color: var(--muted); font-size: 14px; line-height: 1.3; margin: 6px 0 16px; }
.player-entry label > .name-label { font: inherit; color: inherit; }
#shell[data-player-count="2"] #player-one-label { color: var(--p1); }
#player-two-entry .name-label { color: var(--p2); }
#player-two-name-error { color: var(--danger); font-size: 14px; line-height: 1.3; }
.co-op-start-help { padding: 10px 0; margin-bottom: 12px; border-block: 1px solid var(--line); font-size: 14px; line-height: 1.35; }
.co-op-start-help p + p { margin-top: 7px; }
.co-op-start-help p:last-child { color: var(--muted); }
.co-op-start-help :is(.p1-color, .p2-color) { font-weight: 700; margin-right: 4px; }
.co-op-manual { margin: 14px 0 20px; }
.co-op-manual h3 { font-size: 22px; margin: 0 0 8px; }
.co-op-manual p { color: var(--muted); font-size: 16px; line-height: 1.4; }
.co-op-control-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 14px 0; }
.co-op-control-card { border-top: 3px solid var(--player-color); padding: 10px; background: var(--ink); min-width: 0; }
.co-op-control-card h4 { color: var(--player-color); margin: 0 0 10px; font-size: 17px; }
.co-op-control-card dl { display: grid; gap: 12px; }
.co-op-control-card dt { color: var(--muted); font-size: 14px; margin-bottom: 5px; }
.co-op-control-card dd { margin: 0; font-size: 12px; white-space: nowrap; }
#shell[data-player-count="2"] :is(.manual-controls, .manual-pad, .manual-touch, .keyboard-hints, .touch-hint, .gamepad-hint, .portrait-advice, .portrait-play-note) { display: none; }
#shell[data-player-count="2"] #touch-controls { display: none; }
.co-op-quick-controls { font-size: 14px; line-height: 1.3; }
.co-op-quick-controls > span { margin-left: 10px; }
.co-op-quick-controls > span:first-child { margin-left: 0; }
.co-op-quick-controls > span:last-child { color: var(--muted); }
.result-player > span { display: block; }
.leaderboard-toolbar { flex-wrap: wrap; }
.leaderboard-toolbar > div { display: flex; align-items: center; gap: 8px; min-width: 0; }
.leaderboard-toolbar select { min-width: 0; max-width: 100%; }

/* Natural grid rows separate both actor cards, shared status and live guidance.
   Long names truncate inside cards, while full names remain in their titles. */
#shell[data-player-count="2"] #stage-surface { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: max-content max-content 1fr; align-content: start; }
.hud[data-player-count="2"] { position: relative; inset: auto; height: auto; min-width: 0; grid-row: 1; grid-column: 1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr) minmax(0, 1fr); grid-template-rows: auto auto; align-items: start; align-content: start; gap: 4px 8px; padding: 8px; font-size: 14px; }
.hud[data-player-count="2"] .co-op-hud { display: contents; }
.co-op-player { min-width: 0; padding: 7px 9px; border-top: 3px solid var(--player-color); background: #10232bf5 var(--hud-bg); grid-row: 1 / span 2; }
#co-op-player-0 { grid-column: 1; }
#co-op-player-1 { grid-column: 3; }
.co-op-heading { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: baseline; gap: 2px 6px; font-size: 15px; line-height: 18px; }
.co-op-mark { color: var(--player-color); font-weight: 700; }
.co-op-heading > strong { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.co-op-state { grid-column: 1 / -1; color: var(--player-color); font-size: 12px; line-height: 14px; }
.co-op-state:empty { display: none; }
.co-op-health-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 6px; font-size: 13px; line-height: 16px; margin-top: 4px; }
.co-op-health-row span { white-space: nowrap; color: var(--muted); }
.co-op-health-row strong { color: var(--ivory); }
.co-op-player meter { height: 4px; margin: 4px 0 5px; }
.co-op-player meter::-webkit-meter-optimum-value { background: var(--player-color); }
.co-op-player meter::-moz-meter-bar { background: var(--player-color); }
.co-op-player[data-low="true"] meter::-webkit-meter-optimum-value { background: var(--danger); }
.co-op-player[data-low="true"] meter::-moz-meter-bar { background: var(--danger); }
.co-op-player[data-out="true"] { border-top-style: dashed; }
.co-op-player[data-out="true"] .co-op-equipment, .co-op-player[data-dead="true"] .co-op-equipment { opacity: .65; }
.co-op-equipment { display: flex; flex-wrap: wrap; gap: 2px 9px; font-size: 13px; line-height: 16px; }
.co-op-equipment > span { overflow-wrap: anywhere; }
.co-op-equipment > span:first-child { color: var(--player-color); font-weight: 700; }
.hud[data-player-count="2"] :is(.player-status, .hud-equipment, .vehicle-status) { display: none; }
.hud[data-player-count="2"] :is(.hud-top, .objective-status, .boss-status) { position: static; inset: auto; width: auto; max-width: none; min-width: 0; margin: 0; grid-column: 2; }
.hud[data-player-count="2"] .hud-top { grid-row: 1; display: block; }
.hud[data-player-count="2"] .score-status { display: flex; justify-content: space-between; flex-wrap: wrap; margin: 0; padding: 5px 8px; gap: 2px 6px; text-align: left; }
/* Outrank solo fullscreen tool clearance and solo rover score suppression. */
#shell[data-player-count="2"] #stage .score-status { display: flex; margin: 0; min-width: 0; }
.hud[data-player-count="2"] .score-status strong { font-size: 18px; overflow-wrap: anywhere; min-width: 0; letter-spacing: .03em; }
.co-op-keyboard-note { display: block; padding: 3px 8px; color: var(--muted); background: #10232bf5; font-size: 12px; line-height: 14px; }
.hud[data-player-count="2"] .objective-status { grid-row: 2; padding: 6px 8px; font-size: 14px; }
.hud[data-player-count="2"] #hud-objective { white-space: normal; }
.hud[data-player-count="2"] .boss-status { grid-row: 2; padding: 5px 8px; font-size: 13px; }
.hud[data-player-count="2"] #boss-subtitle { display: none; }
.hud[data-player-count="2"] .boss-tip { font-size: 13px; line-height: 16px; white-space: pre-line; overflow-wrap: anywhere; }
.hud[data-player-count="2"] .replay-status { position: static; inset: auto; grid-column: 2; grid-row: 3; min-width: 0; margin: 0; padding: 5px 8px; flex-wrap: wrap; gap: 2px 6px; font-size: 13px; line-height: 16px; }
.hud[data-player-count="2"] .replay-status strong { white-space: normal; }
#shell[data-player-count="2"] #stage[data-view="playing"] :is(.mission-coach, .mission-toast, .interaction-prompt) { position: relative; inset: auto; transform: none; grid-column: 1; grid-row: 2; align-self: start; justify-self: start; width: auto; max-width: min(500px, calc(100% - 16px)); margin: 2px 8px 0; padding: 5px 8px; background: #10232bf5; }
#shell[data-player-count="2"] #stage[data-view="playing"] .interaction-prompt { justify-self: center; text-align: center; }
#shell[data-player-count="2"] .mission-coach .coach-details { display: none; }
#shell[data-player-count="2"] .mission-coach .coach-compact { display: block; flex: 1; min-width: 0; }
#shell[data-player-count="2"] .mission-coach :is(strong, p) { font-size: 14px; line-height: 16px; white-space: pre-line; }
#shell[data-player-count="2"] .stage-tools { top: auto; bottom: 6px; }

@container battlefield (max-width: 680px) {
  .co-op-control-cards { grid-template-columns: 1fr; }
  .co-op-control-card dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .co-op-player { padding: 5px 6px; }
  .co-op-heading { font-size: 13px; }
  .co-op-equipment { font-size: 12px; gap: 2px 6px; }
  .co-op-quick-controls > span:last-child { display: none; }
  .leaderboard-toolbar > div { flex: 1; flex-direction: column; align-items: stretch; gap: 3px; }
  .leaderboard-toolbar select { padding-inline: 6px; font-size: 16px; }
  #leaderboard-count { flex-basis: 100%; text-align: right; font-size: 13px; }
}
@media (orientation: landscape) and (max-height: 520px) {
  #shell[data-player-count="2"] .title-copy { align-self: start; }
  #shell[data-player-count="2"] .title-controls { padding-block: 10px; }
  .hud[data-player-count="2"] { gap: 3px 6px; padding: 6px; }
  .hud[data-player-count="2"] .boss-heading { flex-wrap: wrap; gap: 0 6px; }
  #shell[data-player-count="2"] .mission-coach { max-width: calc(100% - 160px); }
}
@media (orientation: portrait) and (max-width: 800px) {
  /* Co-op status is an intrinsic-height band above the unchanged 16:9 world.
     Guidance has its own row below it; no absolute HUD offsets to collide. */
  #shell[data-player-count="2"] #stage-surface { grid-template-rows: max-content 56.25cqw 1fr; }
  .hud[data-player-count="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: auto auto auto; background: var(--ink); }
  .hud[data-player-count="2"] .co-op-player { grid-row: 1; }
  #co-op-player-1 { grid-column: 2; }
  .hud[data-player-count="2"] .hud-top { grid-column: 1; grid-row: 2; }
  .hud[data-player-count="2"] .objective-status { grid-column: 2; grid-row: 2; }
  .hud[data-player-count="2"] .boss-status { grid-column: 1 / -1; grid-row: 3; }
  .hud[data-player-count="2"] .replay-status { grid-column: 1 / -1; grid-row: 4; }
  #shell[data-player-count="2"] #stage .hud { height: auto; }
  .hud[data-player-count="2"] .score-status { display: flex; margin: 0; }
  #shell[data-player-count="2"] #stage:not([data-view="title"]) #game { position: relative; inset: auto; grid-column: 1; grid-row: 2; height: 56.25cqw; width: 100%; }
  #shell[data-player-count="2"] #stage:not([data-view="title"]) .scene-backdrop { display: none; }
  #shell[data-player-count="2"] #stage[data-view="playing"] :is(.mission-coach, .mission-toast, .interaction-prompt) { grid-row: 3; max-width: calc(100% - 16px); justify-self: stretch; }
  #shell[data-player-count="2"] .mission-coach .coach-details { display: block; }
  #shell[data-player-count="2"] .mission-coach .coach-compact { display: none; }
  #shell[data-player-count="2"] #stage.is-fullscreen .hud-top, #shell[data-player-count="2"] #stage:fullscreen .hud-top { right: auto; }
  .co-op-control-card dl { grid-template-columns: 1fr; }
}

/* Compact quiz cards keep the paused battlefield visible. The body can scroll
   on short viewports while Skip / Continue remains reachable. */
.toolkit-screen { display: grid; place-items: center; padding: clamp(8px, 2cqw, 20px); background: #10232b9c; z-index: var(--z-overlay); }
.toolkit-panel { width: min(540px, 100%); min-width: 0; min-height: 0; max-height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; background: var(--charcoal); border: 1px solid var(--line); border-top: 3px solid var(--amber); box-shadow: 0 12px 36px #06131888; }
.toolkit-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); min-width: 0; }
.toolkit-header h2 { font-size: 24px; line-height: 1.1; }
.toolkit-collector { min-width: 0; text-align: right; max-width: 48%; font-size: 15px; line-height: 1.2; }
#toolkit-player { display: block; color: var(--player-color); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#toolkit-pause { display: block; margin-top: 2px; color: var(--muted); font-size: 13px; }
.toolkit-content { display: block; min-height: 0; padding: 16px 18px; overflow-wrap: break-word; }
.toolkit-reward { display: flex; align-items: baseline; gap: 10px; border-left: 2px solid var(--amber); padding-left: 8px; margin-bottom: 12px; }
.toolkit-reward-label { color: var(--muted); font-size: 14px; }
#toolkit-reward-detail { font-size: 18px; color: var(--amber); line-height: 1.2; }
.toolkit-question-area { min-width: 0; }
#toolkit-question { font-size: 26px; line-height: 1.2; margin: 0 0 12px; font-weight: 700; }
/* Reading anchors keep programmatic focus; only interactive choices need a ring. */
#toolkit-screen #toolkit-title:focus, #toolkit-screen #toolkit-question:focus, #toolkit-screen #toolkit-outcome:focus { outline: none; }
.toolkit-placeholder-line { display: block; width: 76%; height: 18px; margin: 7px 0 19px; background: #b8ccca18; border-radius: 2px; }
.toolkit-placeholder-answers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.toolkit-placeholder-answers > span { height: 48px; border: 1px solid #49636a80; background: #10232b80; border-radius: 2px; }
.toolkit-answers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.toolkit-answer { display: grid; grid-template-columns: 22px minmax(0, 1fr); align-items: center; gap: 3px 8px; min-width: 0; min-height: 48px; width: 100%; padding: 10px; color: var(--ivory); background: var(--ink); border: 1px solid var(--line); text-align: left; font-size: 21px; font-weight: 700; line-height: 1.15; }
.toolkit-letter { color: var(--muted); font-size: 13px; border: 1px solid var(--line); text-align: center; padding-block: 1px; }
.toolkit-answer:not(:disabled):hover { border-color: var(--amber); background: #25434a; }
.toolkit-answer-result { grid-column: 2; font-size: 13px; font-weight: 700; }
.toolkit-answer-result:empty { display: none; }
.toolkit-answer:disabled { opacity: 1; cursor: default; }
.toolkit-answer[data-result="correct"] { border-color: var(--jade); background: #234b4c; }
.toolkit-answer[data-result="wrong"] { border-color: var(--danger); }
.toolkit-answer[data-result="wrong"] .toolkit-answer-result { color: var(--danger); }
.toolkit-result { padding-block: 8px; }
#toolkit-outcome { font-size: 28px; line-height: 1.2; margin: 0 0 6px; }
.toolkit-screen[data-outcome="correct"] #toolkit-outcome { color: #bcebd1; }
.toolkit-screen[data-outcome="wrong"] #toolkit-outcome { color: var(--danger); }
#toolkit-correct-answer { color: var(--ivory); font-weight: 700; margin-bottom: 8px; font-size: 21px; line-height: 1.2; }
#toolkit-explanation { color: var(--muted); font-size: 18px; line-height: 1.3; }
.toolkit-footer { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px 12px; padding: 10px 18px; border-top: 1px solid var(--line); }
.toolkit-footer > button { grid-column: 2; grid-row: 1 / span 2; width: auto; min-width: 100px; padding: 9px 14px; font-size: 18px; }
#toolkit-skip { background: transparent; border-color: var(--line); color: var(--muted); }
#toolkit-skip:hover { border-color: var(--amber); color: var(--ivory); }
#toolkit-input-note, #toolkit-action-status { grid-column: 1; font-size: 14px; color: var(--muted); line-height: 1.3; }
#toolkit-action-status[data-state="error"] { color: var(--danger); }
#toolkit-action-status[data-state="loading"]::before { content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 8px; vertical-align: -2px; border: 2px solid var(--line); border-top-color: var(--muted); border-radius: 50%; animation: toolkit-wait .9s linear infinite; }
@keyframes toolkit-wait { to { transform: rotate(360deg); } }
.toolkit-manual { border-block: 1px solid var(--line); margin: 16px 0; padding: 12px 0; }
.toolkit-manual h3 { margin: 0 0 8px; font-size: 18px; }
.toolkit-manual p { color: var(--muted); font-size: 15px; line-height: 1.4; }
.toolkit-manual p + p { margin-top: 8px; }
@container battlefield (max-width: 560px) {
  .toolkit-header { padding: 10px 12px; }
  .toolkit-header h2 { font-size: 22px; }
  .toolkit-content { padding: 12px; }
  #toolkit-question { font-size: 22px; }
  .toolkit-answer { font-size: 19px; }
  .toolkit-footer { padding: 8px 12px; gap: 6px 10px; }
  .toolkit-footer > button { min-width: 90px; padding-inline: 10px; font-size: 17px; }
}
@media (orientation: landscape) and (max-height: 520px) {
  .toolkit-screen { padding: 6px; }
  .toolkit-header, .toolkit-footer { padding-block: 7px; }
  .toolkit-content { padding-block: 10px; }
  .toolkit-collector { font-size: 14px; }
}

/* A single clear stakes line for the three mandatory boss defenses. */
.toolkit-reward .toolkit-stakes { flex-basis: 100%; margin: 4px 0 0; color: #ffc48b; font-size: 17px; line-height: 1.3; }
.toolkit-screen[data-kind="boss"] .toolkit-panel { border-top-color: #8cddd5; }

.toolkit-screen[data-kind="boss"] .toolkit-reward { flex-wrap: wrap; row-gap: 0; border-left-color: #8cddd5; }

/* =====================================================================
   TOOLKIT v2 (AWS Toolkit + boss shield quiz) — paint only. No sizes,
   paddings, border widths or grid changes, so every answer/footer box keeps
   its geometry. Amber = standard Toolkit; uplink cyan = boss defense.
   ===================================================================== */
.toolkit-screen { background: radial-gradient(80% 80% at 50% 45%, oklch(0.2 0.03 225 / .45) 0%, oklch(0.14 0.026 226 / .78) 100%); }
.toolkit-panel { --tk-accent: var(--amber); --tk-glow: oklch(0.77 0.14 70 / .35);
  background: var(--charcoal) var(--panel-bg); border-radius: 3px;
  box-shadow: var(--panel-depth), 0 -10px 36px -18px var(--tk-glow); }
.toolkit-screen[data-kind="boss"] .toolkit-panel { --tk-accent: var(--uplink); --tk-glow: oklch(0.85 0.08 180 / .45); }
.toolkit-header { border-bottom-color: var(--line-soft); box-shadow: 0 1px 0 oklch(0.12 0.02 230 / .5); }
.toolkit-header h2 { color: var(--ivory); text-shadow: 0 0 18px var(--tk-glow); }
.toolkit-reward { border-left-color: transparent; background: linear-gradient(90deg, color-mix(in oklch, var(--tk-accent) 16%, transparent), transparent 80%); box-shadow: inset 2px 0 0 var(--tk-accent); border-radius: 2px; }
.toolkit-screen[data-kind="boss"] .toolkit-reward { border-left-color: transparent; }
.toolkit-screen[data-kind="boss"] #toolkit-reward-detail { color: var(--uplink); }
#toolkit-reward-detail { text-shadow: 0 0 12px var(--tk-glow); }
.toolkit-letter { border-radius: 2px; background: var(--ink-0); box-shadow: inset 0 1px 0 var(--hairline-hi); }
.toolkit-answer { border-radius: 3px; background: linear-gradient(180deg, oklch(0.24 0.03 224) 0%, var(--ink) 100%);
  box-shadow: inset 0 1px 0 var(--hairline-hi), 0 2px 0 oklch(0.1 0.02 230 / .55); }
.toolkit-answer:not(:disabled):hover { border-color: var(--tk-accent); background: linear-gradient(180deg, oklch(0.32 0.038 218) 0%, #25434a 100%); }
.toolkit-answer:not(:disabled):hover .toolkit-letter { color: var(--ink); background: var(--tk-accent); border-color: var(--tk-accent); }
.toolkit-answer:not(:disabled):active { transform: scale(.98); }
.toolkit-answer:focus-visible { outline-color: var(--tk-accent); }
.toolkit-answer[data-result="correct"] { background: linear-gradient(180deg, #2d5f5e 0%, #234b4c 100%); box-shadow: inset 0 0 0 1px #8fe0c2, 0 0 16px -4px oklch(0.8 0.1 170 / .6); }
.toolkit-answer[data-result="correct"] .toolkit-letter { color: var(--ink); background: #bcebd1; border-color: #bcebd1; }
.toolkit-answer[data-result="correct"] .toolkit-answer-result { color: #bcebd1; }
.toolkit-answer[data-result="wrong"] { background: linear-gradient(180deg, oklch(0.27 0.04 25) 0%, oklch(0.21 0.03 20) 100%); box-shadow: inset 0 0 0 1px oklch(0.75 0.1 35 / .5); }
.toolkit-answer[data-result="wrong"] .toolkit-letter { color: var(--ink); background: var(--danger); border-color: var(--danger); }
.toolkit-answer[data-pending="true"] { box-shadow: inset 0 0 0 1px var(--tk-accent), 0 0 12px -4px var(--tk-glow); }
.toolkit-answer:disabled:not([data-result]) { opacity: .6; }
.toolkit-screen[data-outcome="correct"] #toolkit-outcome { text-shadow: 0 0 16px oklch(0.8 0.1 170 / .5); }
.toolkit-screen[data-outcome="wrong"] #toolkit-outcome { text-shadow: 0 0 16px oklch(0.75 0.12 35 / .45); }
.toolkit-footer { border-top-color: var(--line-soft); background: oklch(0.2 0.028 225 / .55); }
.toolkit-placeholder-line, .toolkit-placeholder-answers > span { background: linear-gradient(90deg, #b8ccca10 0%, #b8ccca24 50%, #b8ccca10 100%) 0 0 / 200% 100%; }
.toolkit-stakes { text-shadow: 0 0 10px oklch(0.8 0.1 60 / .35); }
@media (prefers-reduced-motion: no-preference) {
  .toolkit-screen:not([hidden]) { animation: veil-in 160ms ease-out both; }
  .toolkit-screen:not([hidden]) .toolkit-panel { animation: panel-in 240ms var(--ease-out) both; }
  /* Answers stagger in (30-40ms apart); they are clickable immediately. */
  .toolkit-screen:not([hidden]) .toolkit-answer { animation: launch-rise .3s var(--ease-out) both; }
  .toolkit-screen:not([hidden]) .toolkit-answer:nth-child(2) { animation-delay: 35ms; }
  .toolkit-screen:not([hidden]) .toolkit-answer:nth-child(3) { animation-delay: 70ms; }
  .toolkit-screen:not([hidden]) .toolkit-answer:nth-child(4) { animation-delay: 105ms; }
  .toolkit-result:not([hidden]) { animation: launch-rise .26s var(--ease-out) both; }
  .toolkit-answer[data-result="correct"] { animation: answer-confirm .36s var(--ease-out) both; }
  .toolkit-placeholder-line, .toolkit-placeholder-answers > span { animation: tk-shimmer 1.4s linear infinite; }
  /* Boss defense: the cyan top edge breathes to signal the high-stakes quiz. */
  .toolkit-screen[data-kind="boss"]:not([hidden]) .toolkit-panel { animation: panel-in 240ms var(--ease-out) both, boss-breathe 2.8s ease-in-out .3s infinite; }
  @keyframes answer-confirm { 0% { transform: scale(1); } 40% { transform: scale(1.02); } 100% { transform: scale(1); } }
  @keyframes tk-shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
  @keyframes boss-breathe { 0%, 100% { box-shadow: var(--panel-depth), 0 -10px 36px -18px oklch(0.85 0.08 180 / .35); } 50% { box-shadow: var(--panel-depth), 0 -10px 44px -12px oklch(0.85 0.08 180 / .65); } }
}

/* Hosted setup extends the scrollable title card; offline geometry is unchanged. */
#shell[data-hosted="true"] .title-layout { align-items: start; }
#shell[data-hosted="true"] .title-controls { max-width: 410px; }
#shell[data-hosted="true"] .control-strip > .text-button { flex-shrink: 0; }
#shell[data-hosted="true"] .co-op-quick-controls { min-width: 0; }
.online-mode-entry { display: grid; gap: 6px; margin-bottom: 16px; }
.online-mode-entry > label { font-weight: 700; }
.online-mode-entry select { width: 100%; min-width: 0; min-height: 44px; padding: 7px 10px; border: 1px solid var(--amber); border-radius: 2px; background: var(--ink); color: var(--ivory); }
.online-mode-entry p, #participant-code-note, .online-recovery p { color: var(--muted); font-size: 15px; line-height: 1.35; }
.online-event-fields { border-top: 1px solid var(--line); padding-top: 12px; margin-bottom: 16px; }
#participant-code-note { margin-bottom: 12px; }
.online-event-fields .player-entry { margin-bottom: 12px; }
.online-event-fields .player-entry input { font-family: monospace; font-size: 16px; }
.online-recovery { border-left: 2px solid var(--amber); padding-left: 10px; margin: 12px 0; }
.online-recovery button { margin-top: 8px; width: 100%; }
.online-recovery .discard-result-note { margin-top: 14px; }
.online-recovery .discard-result { color: var(--danger); border-color: var(--line); }
.online-status { color: var(--amber); font-size: 16px; line-height: 1.35; margin: 10px 0; overflow-wrap: anywhere; }
#result-save-retry { grid-column: 1 / -1; width: 100%; min-height: 44px; margin: 0; }
#leaderboard-refresh { margin-left: auto; border-color: var(--line); flex-shrink: 0; }
.toolkit-remote-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; }
.toolkit-remote-actions button { flex: 1 1 auto; min-height: 44px; margin: 0; padding: 8px 12px; font-size: 17px; }
.toolkit-answer[data-pending="true"] { border-color: var(--amber); background: #eda6490c; }
#toolkit-action-status { overflow-wrap: anywhere; }
@container battlefield (max-width: 560px) {
  #shell[data-hosted="true"] .title-controls { max-width: none; }
  #shell[data-hosted="true"] .leaderboard-toolbar label { display: block; }
}

/* Launch screen: the illustration and setup own separate columns.
   These rules are scoped to the title so the playable viewport stays 16:9. */
#shell:has(#stage[data-view="title"]) { width: min(1480px, 100%); }
#shell:has(#stage[data-view="title"]) > .control-strip { display: none; }
#stage[data-view="title"] {
  --launch-panel: clamp(360px, 34%, 448px);
  height: min(840px, calc(100dvh - var(--safe-top) - var(--safe-bottom) - 56px));
  aspect-ratio: auto;
}
#stage[data-view="title"] #stage-surface { inset: 0; width: 100%; height: 100%; transform: none; display: block; }
#stage[data-view="title"] :is(#game, .scene-backdrop) {
  position: absolute; inset: 0 var(--launch-panel) 0 0;
  width: auto; height: 100%; max-height: none; transform: none;
}
#stage[data-view="title"] .scene-backdrop { width: calc(100% - var(--launch-panel)); object-position: center; }
#stage[data-view="title"] #game canvas { object-fit: cover; object-position: center; }
#shell #title-screen { display: block; overflow: hidden; background: none; padding: 0; scroll-padding-block: 16px 136px; }
#shell #title-screen .title-layout {
  display: grid; grid-template-columns: minmax(0, 1fr) var(--launch-panel);
  align-items: stretch; gap: 0; width: 100%; height: 100%; max-width: none; margin: 0; padding: 0;
}
#shell #title-screen .title-copy {
  position: relative; align-self: stretch; min-width: 0; padding: clamp(24px, 3cqw, 44px);
  background: linear-gradient(180deg, #10232bd9, #10232b80 32%, transparent 65%, #10232ba8);
  isolation: isolate; overflow: hidden;
}
#title-screen .field-badge { font-size: 14px; gap: 14px; }
#title-screen .aws-logo { width: 52px; }
#title-screen .field-badge > span { padding-left: 14px; letter-spacing: .09em; }
#title-screen h1 {
  font-size: clamp(58px, min(6.8cqw, 12vh), 98px); line-height: .96;
  margin: 22px 0 14px; letter-spacing: -.04em;
  /* Stamped lockup: a hard ink offset (pixel-print depth) plus a faint warm bloom. */
  color: var(--ivory); text-shadow: 3px 3px 0 var(--ink-0), 0 0 42px oklch(0.77 0.14 70 / .16);
}
#title-screen h1 span { color: var(--amber); text-shadow: 3px 3px 0 var(--ink-0), 0 0 36px oklch(0.77 0.14 70 / .32); }
#title-screen h1 span { display: block; }
#title-screen .operation-name { display: flex; align-items: center; gap: 12px; font-size: clamp(16px, 1.5cqw, 20px); letter-spacing: .15em; color: var(--ivory); }
#title-screen .operation-name::before { content: ""; flex: 0 0 auto; width: 28px; height: 2px; background: var(--amber); box-shadow: 0 0 8px oklch(0.77 0.14 70 / .6); }
#title-screen .briefing { margin-top: 12px; font-size: clamp(17px, 1.6cqw, 21px); max-width: 32ch; line-height: 1.35; text-shadow: 0 1px 2px var(--ink-0); }
#title-screen .title-scene-caption { position: absolute; bottom: 26px; left: clamp(24px, 3cqw, 44px); right: 24px; text-shadow: 0 1px 2px var(--ink-0); }
#title-screen .first-controls { margin: 0; color: var(--ivory); font-size: 16px; line-height: 1.4; }
#title-screen .co-op-start-help { margin: 0; padding: 0; border: 0; font-size: 16px; line-height: 1.5; }
#title-screen .co-op-start-help p { color: var(--ivory); margin: 0; }
#title-screen .co-op-start-help :is(.p1-color, .p2-color) { display: inline-block; min-width: 24px; }
#shell[data-player-count="2"] #title-screen .first-controls { display: none; }
#shell #title-screen .title-controls {
  display: flex; flex-direction: column; justify-content: safe center; gap: 18px;
  width: 100%; max-width: none; min-height: 0; margin: 0; padding: 32px;
  background: var(--ink) linear-gradient(180deg, oklch(0.265 0.033 223) 0%, var(--ink) 34%, var(--ink) 100%);
  border: 0; border-left: 1px solid var(--line); box-shadow: inset 1px 0 0 var(--hairline-hi), -24px 0 48px -24px oklch(0.1 0.02 230 / .8);
  overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--line) transparent; scroll-padding-block: 16px 136px;
}
#title-screen .setup-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex: 0 0 auto; }
#title-screen .setup-heading h2 { font-size: 32px; line-height: 1.1; font-weight: 700; letter-spacing: -.015em; }
#title-screen .setup-heading { padding-bottom: 14px; border-bottom: 1px solid var(--line-soft); }
#title-screen .setup-fields { display: grid; gap: 18px; min-height: 0; flex: 0 0 auto; }
#title-screen .setup-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
#shell[data-hosted="false"] #title-screen .setup-options { grid-template-columns: 1fr; }
#title-screen :is(.online-mode-entry, .player-count-control) { display: grid; grid-template-columns: 1fr; gap: 6px; margin: 0; }
#title-screen :is(.player-entry, .online-mode-entry, .player-count-control) > label { font-size: 17px; font-weight: 500; line-height: 1.2; color: var(--muted); }
#title-screen :is(select, .player-entry input) {
  width: 100%; min-width: 0; min-height: 46px; padding: 9px 12px;
  border: 1px solid var(--line); border-radius: 3px; background: #18313a;
  color: var(--ivory); font-size: 18px; line-height: 1.25;
  box-shadow: inset 0 1px 0 var(--hairline-hi);
  transition: border-color var(--dur-ui) ease, box-shadow var(--dur-ui) var(--ease-out), background-color var(--dur-ui) ease;
}
#title-screen :is(select, .player-entry input):focus-visible { border-color: var(--amber); box-shadow: 0 0 0 3px oklch(0.77 0.14 70 / .18); }
#title-screen .player-entry input::placeholder { color: #8ea5a3; }
#title-screen select { padding-right: 6px; }
#title-screen :is(select, input):hover:not(:disabled) { border-color: #8da5a5; }
#title-screen .player-entry input { background: var(--ink-0); box-shadow: inset 0 2px 3px oklch(0.08 0.02 230 / .7); }
#title-screen .player-entry input[aria-invalid="true"] { border-color: var(--danger); }
#title-screen .setup-names, #title-screen .online-event-fields { display: grid; grid-template-columns: 1fr; gap: 6px 14px; }
#shell[data-player-count="2"] #title-screen .setup-names { grid-template-columns: repeat(2, minmax(0, 1fr)); }
#title-screen .player-entry { min-width: 0; display: grid; align-content: start; gap: 6px; margin: 0; }
#title-screen :is(#player-name-note, #participant-code-note) { grid-column: 1 / -1; margin: 0; font-size: 14px; line-height: 1.3; color: var(--muted); }
#title-screen :is(#player-name-error, #player-two-name-error) { font-size: 14px; line-height: 1.3; color: var(--danger); }
#shell #title-screen .difficulty-control { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 12px; margin: 0; }
#shell #title-screen .difficulty-control label { display: block; font-size: 17px; color: var(--muted); }
#shell #title-screen .difficulty-control select { width: auto; min-width: 176px; }
#title-screen #difficulty-note { padding-top: 6px; font-size: 14px; line-height: 1.3; }
#title-screen .online-event-fields { border: 0; padding: 0; margin: 0; }
#title-screen .online-event-fields input { font-family: "Barlow Condensed", sans-serif; font-size: 18px; }
#title-screen .online-status, #title-screen .online-recovery { margin: 0; }
#title-screen .setup-actions {
  position: sticky; bottom: -32px; z-index: 1; flex: 0 0 auto;
  margin-top: 2px; padding: 8px 0 0; background: var(--ink);
}
#title-screen #start-button { min-height: 52px; font-size: 20px; padding: 12px 16px; letter-spacing: .02em; }
#title-screen .menu-actions { display: flex; flex-wrap: wrap; gap: 4px 16px; justify-content: space-between; margin-top: 8px; }
#title-screen .menu-actions .text-button { width: auto; margin: 0; min-height: 44px; padding: 8px 0; font-size: 16px; font-weight: 500; }
#title-screen .leaderboard-button { display: flex; align-items: center; gap: 7px; color: var(--ivory); }
#title-screen .leaderboard-button span { color: var(--amber); }
#stage.is-fullscreen[data-view="title"], #stage:fullscreen[data-view="title"] { width: 100%; height: 100dvh; }
@media (max-height: 780px) {
  #shell #title-screen .title-controls { padding: 24px; gap: 14px; }
  #title-screen .setup-fields { gap: 14px; }
  #title-screen .setup-heading h2 { font-size: 30px; }
  #title-screen .setup-actions { bottom: -24px; }
}
@media (max-height: 660px) and (orientation: landscape) {
  #shell #title-screen .title-controls { padding: 16px 24px; gap: 12px; justify-content: safe center; }
  #title-screen .setup-fields { gap: 10px; }
  #title-screen .setup-heading h2 { font-size: 26px; }
  #title-screen .setup-actions { bottom: -16px; }
  #title-screen :is(select, .player-entry input) { min-height: 44px; padding-block: 8px; }
  #title-screen .title-scene-caption { bottom: 18px; }
  #title-screen .briefing { margin-top: 8px; font-size: 16px; }
  #title-screen h1 { margin-block: 12px 10px; }
}
@media (orientation: landscape) and (max-height: 520px) {
  #stage[data-view="title"] { height: calc(100dvh - var(--safe-top) - var(--safe-bottom)); --launch-panel: max(360px, 47%); }
  #shell #title-screen .title-copy { padding: 20px; }
  #title-screen .title-scene-caption { left: 20px; right: 12px; }
  #title-screen :is(.first-controls, .co-op-start-help) { font-size: 14px; }
  #title-screen .briefing { display: none; }
  #stage[data-view="title"] .stage-tools { display: none; }
}
@media (max-width: 760px) and (orientation: portrait) {
  #stage[data-view="title"]:not(.is-fullscreen):not(:fullscreen) { height: calc(100dvh - var(--safe-top) - var(--safe-bottom) - 56px); }
  #shell #title-screen { overflow-y: auto; }
  #shell #title-screen .title-layout { display: flex; flex-direction: column; height: auto; min-height: 100%; }
  #shell #title-screen .title-copy { flex: 0 0 210px; padding: 22px 24px; background: linear-gradient(90deg, #10232bd9, #10232b50); }
  #stage[data-view="title"] :is(#game, .scene-backdrop) { inset: 0 0 auto; width: 100%; height: 210px; }
  #stage[data-view="title"] #game canvas { object-position: center 62%; }
  #title-screen .aws-logo { width: 36px; }
  #title-screen .field-badge { font-size: 12px; }
  #title-screen h1 { font-size: clamp(40px, 10cqw, 64px); margin-block: 16px 8px; }
  #title-screen h1 span { display: inline; }
  #title-screen .operation-name { font-size: 14px; }
  #title-screen .briefing, #title-screen .title-scene-caption { display: none; }
  #shell #title-screen .title-controls { flex: 1 0 auto; overflow: visible; padding: 22px 24px 14px; gap: 18px; border: 0; border-top: 1px solid var(--line); }
  #title-screen .setup-fields { gap: 16px; }
  #title-screen .setup-heading h2 { font-size: 28px; }
  #title-screen .setup-actions { position: sticky; bottom: -14px; margin-top: auto; }
}
@media (max-width: 760px) and (orientation: portrait) and (max-height: 740px) {
  #shell #title-screen .title-copy { flex-basis: 156px; padding-block: 16px; }
  #stage[data-view="title"] :is(#game, .scene-backdrop) { height: 156px; }
  #title-screen h1 { margin-block: 12px 6px; }
}
/* Launch atmosphere over the illustration column (title only; gameplay art is
   untouched). ::before = a soft warm morning light raking in from the upper
   right; ::after = sparse floating dust motes. Both sit behind the copy
   (isolated stacking, z-index -1) and never take pointer input. */
#shell #title-screen .title-copy::before, #shell #title-screen .title-copy::after { content: ""; position: absolute; pointer-events: none; z-index: -1; }
#shell #title-screen .title-copy::before { inset: 0;
  background:
    linear-gradient(118deg, transparent 38%, oklch(0.9 0.08 80 / .07) 52%, transparent 64%),
    linear-gradient(118deg, transparent 58%, oklch(0.9 0.08 80 / .05) 66%, transparent 74%),
    radial-gradient(70% 55% at 88% 0%, oklch(0.85 0.1 75 / .1), transparent 70%);
  mix-blend-mode: screen; }
#shell #title-screen .title-copy::after { inset: 0 -60px -240px 0;
  background:
    radial-gradient(1.5px 1.5px at 12% 18%, oklch(0.95 0.05 88 / .55) 50%, transparent 55%),
    radial-gradient(1px 1px at 34% 62%, oklch(0.95 0.05 88 / .4) 50%, transparent 55%),
    radial-gradient(2px 2px at 58% 30%, oklch(0.92 0.08 80 / .35) 50%, transparent 55%),
    radial-gradient(1px 1px at 76% 78%, oklch(0.95 0.05 88 / .45) 50%, transparent 55%),
    radial-gradient(1.5px 1.5px at 90% 44%, oklch(0.88 0.08 175 / .35) 50%, transparent 55%);
  background-size: 320px 240px; opacity: .8; }
#title-screen .setup-actions { box-shadow: 0 -14px 14px -6px var(--ink); }
@media (prefers-reduced-motion: no-preference) {
  /* Staggered launch: lockup pieces rise in sequence, the setup panel slides
     in from its own edge. Short and ease-out; cancelled by reduced motion. */
  #title-screen:not([hidden]) .title-copy > :not(.title-scene-caption) { animation: launch-rise .5s var(--ease-out) both; }
  #title-screen:not([hidden]) .title-copy > .field-badge { animation-delay: 40ms; }
  #title-screen:not([hidden]) .title-copy > h1 { animation-delay: 100ms; }
  #title-screen:not([hidden]) .title-copy > .operation-name { animation-delay: 170ms; }
  #title-screen:not([hidden]) .title-copy > .briefing { animation-delay: 230ms; }
  #title-screen:not([hidden]) .title-scene-caption { animation: launch-reveal .5s ease-out .32s both; }
  #title-screen:not([hidden]) .title-controls { animation: launch-panel .45s var(--ease-out) 60ms both; }
  #shell #title-screen:not([hidden]) .title-copy::after { animation: motes-drift 48s linear infinite; }
  #shell #title-screen:not([hidden]) .title-copy::before { animation: light-breathe 9s ease-in-out infinite; }
  @keyframes launch-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
  @keyframes launch-panel { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
  @keyframes motes-drift { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(-40px, -240px, 0); } }
  @keyframes light-breathe { 0%, 100% { opacity: 1; } 50% { opacity: .7; } }
  @keyframes launch-reveal { from { opacity: 0; } to { opacity: 1; } }
}

/* Story Mode intro. Reuses .screen/.veil-screen/.menu-panel; palette + fonts unchanged. */
.story-panel { width: min(560px, 100%); }
.story-briefing { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: start; }
.story-speech { min-width: 0; }
.story-speech .panel-eyebrow { display: block; margin-bottom: 4px; font-size: 20px; }
.story-speech h2 { margin: 0 0 10px; font-size: clamp(34px, 4.4cqw, 46px); }
.story-dialog { min-height: 3.6em; text-wrap: pretty; font-size: clamp(20px, 2.4cqw, 28px); line-height: 1.4; }
.story-dialog::after { content: "▊"; color: var(--amber); margin-left: 1px; opacity: 0; }
.story-dialog[data-typing="true"]::after { opacity: 1; animation: story-caret 1s steps(1) infinite; }

/* PATCH: an in-engine CSS pixel-art robot. No external asset. One cohesive
   figure on an 84x108 stage; parts are positioned relative to that box so the
   head, antenna, eyes, mouth and body stay aligned at this enlarged size. */
.story-bot { position: relative; width: 84px; height: 108px; flex: 0 0 auto; image-rendering: pixelated; }
.story-bot > span { position: absolute; display: block; }
/* Antenna rises from the top-centre of the head; the amber bulb sits on its tip. */
.story-bot-antenna { top: 4px; left: 50%; width: 6px; height: 16px; margin-left: -3px; background: var(--line); }
.story-bot-antenna::before { content: ""; position: absolute; top: -12px; left: -5px; width: 16px; height: 16px; background: var(--amber); box-shadow: 0 0 0 3px var(--ink); }
/* Head centred; worn off-white face plate with a lit crown band + teal frame. */
.story-bot-head { top: 18px; left: 12px; width: 60px; height: 46px; background: #d8cba6; box-shadow: inset 0 8px 0 #eee0b9, inset 0 0 0 4px var(--teal), inset 0 -6px 0 #b7ab84, 0 0 0 4px var(--ink); }
.story-bot-eye { position: absolute; top: 14px; width: 11px; height: 14px; background: var(--teal); box-shadow: inset 0 0 0 2px #16303a, 2px 2px 0 #6f9b98; }
.story-bot-eye:first-of-type { left: 12px; }
.story-bot-eye:last-of-type { right: 12px; }
.story-bot-mouth { position: absolute; bottom: 8px; left: 15px; width: 30px; height: 7px; background: var(--jade); box-shadow: inset 0 0 0 1px #16303a; }
/* Body: dark shaded base with a lit upper band + jade collar; ink outline. */
.story-bot-body { top: 60px; left: 6px; width: 72px; height: 44px; background: #1b3a41; box-shadow: inset 0 8px 0 var(--teal), inset 0 3px 0 #6f9b98, inset 0 11px 0 var(--jade), 0 0 0 4px var(--ink); }
.story-bot-body::after { content: ""; position: absolute; top: 18px; left: 50%; width: 18px; height: 13px; margin-left: -9px; background: var(--amber); box-shadow: 0 0 0 2px var(--ink); }

.story-overview { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; list-style: none; padding: 0; margin: 24px 0 22px; }
.story-overview li { min-width: 0; border-top: 2px solid var(--amber); padding-top: 8px; }
.story-overview strong { display: block; font-size: clamp(22px, 3cqw, 28px); line-height: 1.1; color: var(--amber); }
.story-overview span { display: block; font-size: clamp(17px, 1.9cqw, 20px); line-height: 1.3; margin-top: 5px; color: var(--ivory); }

.story-check { display: flex; align-items: center; gap: 13px; padding: 12px 0; margin-bottom: 16px; cursor: pointer; color: var(--ivory); font-size: clamp(18px, 2cqw, 24px); }
.story-check input { position: absolute; opacity: 0; width: 0; height: 0; }
.story-check-box { flex: 0 0 auto; width: 28px; height: 28px; border: 2px solid var(--line); background: var(--ink); display: grid; place-items: center; }
.story-check input:checked + .story-check-box { border-color: var(--amber); background: var(--amber); }
.story-check input:checked + .story-check-box::after { content: ""; width: 13px; height: 8px; border: 3px solid var(--ink); border-top: 0; border-right: 0; transform: translateY(-1px) rotate(-45deg); }
.story-check input:focus-visible + .story-check-box { outline: 2px solid var(--amber); outline-offset: 3px; }
.story-check-copy { color: var(--muted); }
.story-check:hover .story-check-copy { color: var(--ivory); }
.story-panel > .primary-button { margin-top: 4px; }

@keyframes story-caret { 50% { opacity: 0; } }

/* =====================================================================
   BRIEFING + CONSOLE v2 (PATCH story intro, Mission Console) — paint only
   for the console; the story panel gains a card surface. Typing/gating/
   generator logic and every id/data hook are untouched.
   ===================================================================== */
/* Story briefing reads as a lit dossier card instead of floating text. */
.story-panel { padding: clamp(18px, 2.4cqw, 28px); background: var(--charcoal) var(--panel-bg); border: 1px solid var(--line); border-radius: 3px; box-shadow: var(--panel-depth), 0 -12px 40px -22px oklch(0.77 0.14 70 / .4); }
.story-speech h2 { text-shadow: 0 0 22px oklch(0.77 0.14 70 / .18); }
.story-dialog { color: var(--ivory); }
.story-overview li { border-top-color: transparent; box-shadow: inset 0 2px 0 var(--amber); padding-top: 10px; }
.story-overview strong { text-shadow: 0 0 12px oklch(0.77 0.14 70 / .3); }
.story-check-box { border-radius: 3px; box-shadow: inset 0 2px 3px oklch(0.08 0.02 230 / .7); transition: background-color var(--dur-ui) ease, border-color var(--dur-ui) ease, box-shadow var(--dur-ui) ease; }
.story-check input:checked + .story-check-box { box-shadow: inset 0 1px 0 oklch(0.95 0.07 85 / .5), 0 0 12px -2px oklch(0.77 0.14 70 / .6); }

/* PATCH polish (same 84x108 footprint): floor shadow, glowing chest lamp and
   antenna bulb, a faint visor glint across the face plate. */
.story-bot::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -8px; height: 6px; border-radius: 50%; background: radial-gradient(closest-side, oklch(0.08 0.02 230 / .7), transparent); pointer-events: none; }
.story-bot-antenna::before { box-shadow: 0 0 0 3px var(--ink), 0 0 12px 2px oklch(0.77 0.14 70 / .55); }
.story-bot-body::after { box-shadow: 0 0 0 2px var(--ink), 0 0 10px 1px oklch(0.77 0.14 70 / .6); }
.story-bot-head::after { content: ""; position: absolute; top: 8px; left: 8px; width: 10px; height: 3px; background: #fff6dc; opacity: .55; pointer-events: none; }
.story-bot-eye { box-shadow: inset 0 0 0 2px #16303a, 2px 2px 0 #6f9b98, 0 0 6px oklch(0.6 0.07 195 / .5); }
/* The original :last-of-type matched the mouth (also a span), so the right eye
   never got its offset and sat beside the left one. Position it explicitly. */
.story-bot-head .story-bot-eye:nth-of-type(2) { left: auto; right: 12px; }

/* Mission Console cards: lit tiles with a lip; selected = amber-tinted, not olive. */
.mc-card { border-radius: 3px; background: linear-gradient(180deg, oklch(0.29 0.035 222) 0%, var(--charcoal) 100%); box-shadow: inset 0 1px 0 var(--hairline-hi), 0 2px 0 oklch(0.1 0.02 230 / .55);
  transition: border-color var(--dur-ui) ease, background-color var(--dur-ui) ease, box-shadow var(--dur-ui) var(--ease-out), transform var(--dur-press) var(--ease-out); }
.mc-card:hover { background: linear-gradient(180deg, oklch(0.33 0.04 218) 0%, #1c3a44 100%); }
.mc-card:active { transform: scale(.98); }
.mc-card .mc-card-emoji { filter: drop-shadow(0 2px 0 oklch(0.1 0.02 230 / .6)); }
.mc-card[aria-checked="true"] { background: linear-gradient(180deg, oklch(0.36 0.06 72 / .55) 0%, oklch(0.26 0.035 222) 100%); box-shadow: inset 0 0 0 1px var(--amber), inset 0 1px 0 oklch(0.95 0.07 85 / .3), 0 0 16px -4px var(--glow-amber); }
@media (hover: hover) and (pointer: fine) {
  .mc-card:hover { transform: translateY(-1px); box-shadow: inset 0 1px 0 var(--hairline-hi), 0 4px 10px -4px oklch(0.08 0.02 230 / .8); }
  .mc-card:hover:active { transform: scale(.98); }
}
.mc-chip { border-radius: 999px; box-shadow: inset 0 1px 0 var(--hairline-hi); transition: background-color var(--dur-ui) ease, border-color var(--dur-ui) ease, color var(--dur-ui) ease, transform var(--dur-press) var(--ease-out); }
.mc-chip:active { transform: scale(.96); }
.mc-chip[aria-checked="true"] { background: var(--amber) linear-gradient(180deg, var(--amber-hi), var(--amber) 60%, var(--amber-lo)); box-shadow: inset 0 1px 0 oklch(0.95 0.07 85 / .6), 0 0 12px -3px var(--glow-amber); }
.mc-legend { display: flex; align-items: center; gap: 10px; }
.mc-legend::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line-soft), transparent); }
.mc-desc, .mc-output { border-radius: 3px; background: var(--ink-0); box-shadow: inset 0 2px 4px oklch(0.06 0.02 230 / .8); transition: border-color var(--dur-ui) ease, box-shadow var(--dur-ui) var(--ease-out); }
.mc-desc:focus-visible, .mc-output:focus-visible { outline-offset: 0; border-color: var(--amber); box-shadow: inset 0 2px 4px oklch(0.06 0.02 230 / .8), 0 0 0 3px oklch(0.77 0.14 70 / .16); }
.mc-output { border-color: var(--jade); color: #d9ecd9; }
.mc-checklist { border-radius: 3px; background: var(--ink-0); box-shadow: inset 0 1px 0 var(--hairline-hi); }
.mc-copied { text-shadow: 0 0 10px oklch(0.6 0.07 195 / .6); }
.mc-built { background: var(--jade) linear-gradient(180deg, #6aa6a3, var(--jade) 60%, #3b6d6c); box-shadow: inset 0 1px 0 oklch(0.85 0.05 190 / .4), 0 1px 0 oklch(0.12 0.02 230 / .6); }
.mc-built:not(:disabled):hover { background: #5a9a98 linear-gradient(180deg, #78b3b0, #5a9a98 100%); }
/* Softer, calmer starfield/scanlines behind the console. */
.mission-builder-screen::before { opacity: .55; }
.mission-builder-panel::before { background: #10232b66 repeating-linear-gradient(180deg, #ffffff04 0 1px, transparent 1px 4px); }
@media (prefers-reduced-motion: no-preference) {
  /* Reveal each console step as it is un-hidden (short rise). */
  .mc-step:not([hidden]) { animation: launch-rise .32s var(--ease-out) both; }
  .mc-cards .mc-card { animation: launch-rise .3s var(--ease-out) both; }
  .mc-cards .mc-card:nth-child(2) { animation-delay: 35ms; } .mc-cards .mc-card:nth-child(3) { animation-delay: 70ms; }
  .mc-cards .mc-card:nth-child(4) { animation-delay: 105ms; } .mc-cards .mc-card:nth-child(n+5) { animation-delay: 140ms; }
  #story-screen:not([hidden]) .story-overview li { animation: launch-rise .4s var(--ease-out) both; }
  #story-screen:not([hidden]) .story-overview li:nth-child(1) { animation-delay: 180ms; }
  #story-screen:not([hidden]) .story-overview li:nth-child(2) { animation-delay: 240ms; }
  #story-screen:not([hidden]) .story-overview li:nth-child(3) { animation-delay: 300ms; }
  #story-screen:not([hidden]) #story-bot { animation: story-hover 3.2s ease-in-out infinite; }
}

@media (prefers-reduced-motion: no-preference) {
  #story-screen:not([hidden]) .menu-panel { animation: launch-reveal .35s ease-out both; }
  #story-screen:not([hidden]) .story-bot-antenna::before { animation: story-blink 2.4s steps(1) infinite; }
  @keyframes story-blink { 0%, 82% { background: var(--amber); } 83%, 100% { background: var(--jade); } }
}

/* ===== Mission Builder (stub). Graduation console shown after the send-off.
   Reuses .veil-screen/.menu-panel + the PATCH story-bot; palette/fonts unchanged. ===== */
.mission-builder-screen { z-index: var(--z-scene); }
.mission-builder-panel { width: min(760px, 100%); max-height: 92vh; display: flex; flex-direction: column; }
.mission-builder-briefing { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: start; margin-bottom: 16px; flex: 0 0 auto; }
.mission-builder-speech { min-width: 0; }
.mission-builder-speech .panel-eyebrow { display: block; margin-bottom: 4px; font-size: 18px; }
.mission-builder-speech h2 { margin: 0 0 8px; font-size: clamp(30px, 3.8cqw, 42px); }
.mission-builder-speech .mc-intro { font-size: clamp(15px, 1.7cqw, 19px); min-height: 2.6em; text-wrap: pretty; }
.mission-builder-speech .mc-intro::after { content: "\258A"; color: var(--amber); margin-left: 1px; opacity: 0; }
.mission-builder-speech .mc-intro[data-typing="true"]::after { opacity: 1; animation: story-caret 1s steps(1) infinite; }

/* Scrolling body so the full console fits any viewport. */
.mc-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding-right: 6px; scrollbar-width: thin; scrollbar-color: #90957e var(--ink); }
.mc-step { border: 0; margin: 0 0 18px; padding: 0; }
.mc-legend { padding: 0; margin-bottom: 10px; color: var(--amber); font-weight: 700; font-size: 15px; letter-spacing: .06em; text-transform: uppercase; }

/* Cards grid — reuses the ink/teal palette. Selectable + keyboard accessible. */
.mc-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.mc-card { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; text-align: left; padding: 12px 14px; background: var(--charcoal); border: 2px solid var(--line); color: var(--ivory); cursor: pointer; min-height: 66px; }
.mc-card:hover { border-color: var(--jade); background: #1c3a44; }
.mc-card:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.mc-card .mc-card-emoji { grid-row: 1 / 3; font-size: 26px; line-height: 1; }
.mc-card .mc-card-title { font-weight: 700; font-size: 16px; letter-spacing: .02em; }
.mc-card .mc-card-desc { grid-column: 2; font-size: 13px; color: var(--muted); line-height: 1.25; }
.mc-card[aria-checked="true"] { border-color: var(--amber); background: #2a2a1c; box-shadow: inset 0 0 0 1px var(--amber); }
.mc-card[aria-checked="true"] .mc-card-title { color: var(--amber); }

/* Describe step. */
.mc-desc-label { display: block; margin-bottom: 8px; font-size: clamp(16px, 1.8cqw, 20px); color: var(--ivory); }
.mc-desc { width: 100%; min-height: 96px; resize: vertical; padding: 10px 12px; font: inherit; font-size: 16px; line-height: 1.4; color: var(--ivory); background: var(--ink); border: 1px solid var(--line); border-radius: 2px; }
.mc-desc:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.mc-desc::placeholder { color: #8ba3a1; }

.mc-options { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: center; margin: 14px 0 4px; }
.mc-theme { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mc-options-label { color: var(--muted); font-size: 14px; text-transform: uppercase; letter-spacing: .06em; }
.mc-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.mc-chip { padding: 7px 14px; background: var(--ink); border: 1px solid var(--line); color: var(--ivory); font-weight: 600; font-size: 14px; cursor: pointer; }
.mc-chip:hover { border-color: var(--jade); }
.mc-chip:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.mc-chip[aria-checked="true"] { background: var(--amber); border-color: var(--amber); color: var(--ink); }
.mc-bonus { min-height: 48px; padding: 6px 0; border-top: 0; flex: 1 1 220px; font-size: 16px; }
.mc-bonus small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }

.mc-generate { margin-top: 16px; }
.mc-nudge { margin-top: 10px; color: var(--amber); font-size: 15px; }

/* Result step. */
.mc-output { width: 100%; min-height: 150px; resize: vertical; padding: 12px 14px; font-family: "Barlow Condensed", monospace; font-size: 15px; line-height: 1.45; color: var(--ivory); background: #0b1a20; border: 1px solid var(--jade); border-radius: 2px; }
.mc-output:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.mc-result-actions { display: flex; align-items: center; gap: 14px; margin: 12px 0 6px; }
.mc-copy { width: auto; padding: 9px 20px; }
.mc-copied { color: var(--jade); font-weight: 700; font-size: 15px; }
.mc-guide { color: var(--muted); font-size: 15px; line-height: 1.4; margin: 6px 0 14px; }
.mc-guide strong, .mc-guide b { color: var(--amber); }
.mc-built { background: var(--jade); border-color: var(--jade); color: var(--ivory); }
.mc-built:not(:disabled):hover { background: #5a9a98; color: var(--ivory); }

/* Celebration confetti for "I built it!" — pixel flecks bursting up + falling. */
.mc-confetti { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 30; }
.mc-confetti i { position: absolute; top: -12px; width: 8px; height: 8px; will-change: transform, opacity; }

@media (prefers-reduced-motion: no-preference) {
  #mission-builder-screen:not([hidden]) .menu-panel { animation: launch-reveal .35s ease-out both; }
  #mission-builder-screen:not([hidden]) .story-bot { animation: story-hover 3.2s ease-in-out infinite; }
  #mission-builder-screen:not([hidden]) .story-bot-antenna::before { animation: story-blink 2.4s steps(1) infinite; }
  @keyframes story-hover { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
  .mc-confetti i { animation: mc-fall var(--mc-dur, 1.5s) ease-in var(--mc-delay, 0s) forwards; }
  @keyframes mc-fall {
    0% { transform: translateY(0) rotate(0); opacity: 1; }
    100% { transform: translateY(105vh) rotate(540deg); opacity: 0; }
  }
  #mission-builder-screen.mc-celebrate .story-bot { animation: mc-cheer .6s ease-out 3; }
  @keyframes mc-cheer { 0%, 100% { transform: translateY(0) rotate(0); } 30% { transform: translateY(-10px) rotate(-4deg); } 60% { transform: translateY(-6px) rotate(4deg); } }
}
@media (prefers-reduced-motion: reduce) {
  .mc-confetti { display: none; }
}

/* ===== Developer contact scene (post-MAINFRAME). Additive; reuses palette/fonts. ===== */
.devscene-screen { display: grid; background: var(--ink); z-index: var(--z-scene); }
.devscene-split { display: grid; grid-template-columns: 1fr 236px 1fr; width: 100%; height: 100%; min-height: 0; }
/* Cinematic MAINFRAME->dev-scene transition: fade to black, hold on a
   SECTOR RESTORED title, then fade in to the developer scene (~1.8s total).
   The black cover is driven by data-state set from ui.js; palette-consistent. */
.scene-transition { position: absolute; inset: 0; z-index: 40; display: grid; place-items: center; background: var(--ink); opacity: 0; pointer-events: none; }
.scene-transition[data-state="in"] { opacity: 1; transition: opacity .7s ease-in; }
.scene-transition[data-state="hold"] { opacity: 1; }
.scene-transition[data-state="out"] { opacity: 0; transition: opacity .7s ease-out; }
.scene-transition-title { font: 400 clamp(20px, 4cqw, 40px)/1 "Black Ops One", Impact, sans-serif; letter-spacing: .12em; text-transform: uppercase; color: var(--amber); opacity: 0; text-shadow: 0 2px 0 #0008; }
.scene-transition[data-state="in"] .scene-transition-title,
.scene-transition[data-state="hold"] .scene-transition-title { opacity: 1; transition: opacity .4s ease-out; }
@media (prefers-reduced-motion: reduce) {
  .scene-transition, .scene-transition[data-state] { transition: none; }
}

/* LEFT — Commander Waterfall's station. Shared shell (nameplate + floor) kept;
   the redesigned scene/character live in the STATION REDESIGN block near EOF. */
.devscene-station { position: relative; overflow: hidden; image-rendering: pixelated; container: station / inline-size; }
.devscene-nameplate { position: absolute; left: 16px; bottom: 14px; z-index: 6; margin: 0; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ivory); font-size: clamp(13px, 2.2cqw, 18px); background: #10232bcc; border-left: 3px solid var(--amber); padding: 6px 10px; }

/* (Old Waterfall decor + astronaut CSS removed — redesigned in STATION REDESIGN near EOF.) */

/* RIGHT — WhatsApp-style messenger, game palette. */
.devscene-chat { display: flex; flex-direction: column; min-height: 0; background: #0e1f26; border-left: 2px solid var(--line); }
.devchat-header { display: flex; align-items: center; gap: 12px; padding: 14px 18px; background: var(--teal); border-bottom: 2px solid var(--ink); flex: 0 0 auto; }
.devchat-avatar { width: 40px; height: 40px; flex: 0 0 auto; background: var(--ivory); border-radius: 44% 44% 40% 40%; box-shadow: inset 0 0 0 4px var(--jade); }
.devchat-who { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.devchat-who strong { font-weight: 700; font-size: 18px; color: var(--ivory); }
.devchat-who small { font-size: 13px; color: #cfe0dd; }
.devchat-log { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 10px; padding: 16px; scrollbar-width: thin; scrollbar-color: #90957e #10232b; }
.devchat-msg { max-width: 78%; padding: 9px 12px; font-size: clamp(15px, 1.6cqw, 18px); line-height: 1.35; text-wrap: pretty; white-space: pre-line; box-shadow: 0 1px 2px #0006; }
.devchat-msg.in { align-self: flex-start; background: var(--charcoal); color: var(--ivory); border-left: 3px solid var(--jade); }
.devchat-msg.out { align-self: flex-end; background: var(--amber); color: var(--ink); font-weight: 500; }
.devchat-msg .devchat-meta { display: block; margin-top: 4px; font-size: 12px; opacity: .7; }
.devchat-compose { display: flex; gap: 8px; padding: 12px 14px; background: #0b1a20; border-top: 2px solid var(--line); flex: 0 0 auto; }
.devchat-compose input { flex: 1 1 auto; min-width: 0; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 2px; background: var(--ink); color: var(--ivory); }
.devchat-compose input::placeholder { color: #8ba3a1; }
.devchat-send { flex: 0 0 auto; padding: 8px 18px; font-weight: 700; background: var(--teal); color: var(--ivory); border: 1px solid var(--jade); }
.devchat-send:not(:disabled):hover { background: #356b74; }
.devscene-proceed { margin: 0 14px 14px; width: calc(100% - 28px); }

/* Portrait / narrow: stack the station above the chat. */
@media (max-width: 1024px) and (orientation: landscape) {
  /* Tighter guide column on smaller landscape screens. */
  .devscene-split { grid-template-columns: 1fr 200px 1.1fr; }
}
@media (max-width: 720px), (orientation: portrait) {
  /* Stack: station, then the checklist, then the chat. The chat keeps the most
     room; the checklist stays visible so the safety net is never lost. */
  .devscene-split { grid-template-columns: 1fr; grid-template-rows: auto auto 1fr; }
  .devscene-chat { border-left: 0; border-top: 2px solid var(--line); min-height: 46vh; }
  .devscene-station { min-height: 26vh; }
  .scene-guide { border-left: 0; border-top: 2px solid var(--line); max-height: 30vh; overflow-y: auto; }
}

/* ===== Task 2: CHIEF OXWELL life-support scene. Additive; reuses the
   dev-scene split/chat skeleton + palette. Reskinned to a red-alert bay
   with a NEW pixel-art engineer, distinct from PATCH and Waterfall. ===== */
.oxwell-screen { z-index: 25; }
/* LEFT bay: darker, red-alert lit rather than the dev station's teal glow. */
.oxwell-nameplate { border-left-color: var(--danger); }
/* (Old Oxwell bay + engineer CSS removed — redesigned in STATION REDESIGN near EOF.) */

/* Reskinned chat header for Oxwell (danger-red comms). */
.oxwell-header { background: #7d3720; }
.oxwell-avatar { background: var(--danger); box-shadow: inset 0 0 0 4px #7d3720; }

/* Chat file-attachment bubble ("broken app.zip" download). */
.devchat-attachment { align-self: flex-start; max-width: 78%; display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--charcoal); color: var(--ivory); border-left: 3px solid var(--amber); text-decoration: none; box-shadow: 0 1px 2px #0006; }
.devchat-attachment:hover, .devchat-attachment:focus-visible { background: #1c3a44; }
.devchat-attachment .att-icon { flex: 0 0 auto; width: 34px; height: 40px; position: relative; background: var(--ivory); box-shadow: 0 0 0 2px var(--ink); clip-path: polygon(0 0, 72% 0, 100% 24%, 100% 100%, 0 100%); }
.devchat-attachment .att-icon::after { content: "ZIP"; position: absolute; bottom: 5px; left: 0; right: 0; text-align: center; font: 700 10px/1 "Barlow Condensed", sans-serif; letter-spacing: .06em; color: var(--ink); }
.devchat-attachment .att-body { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.devchat-attachment .att-name { font-weight: 700; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.devchat-attachment .att-hint { font-size: 12px; color: var(--amber); letter-spacing: .04em; }
.devchat-attachment .att-arrow { margin-left: auto; flex: 0 0 auto; font-weight: 700; color: var(--amber); }

/* =====================================================================
   STORY-SCENE GLOW-UP (Waterfall / Oxwell / Mission Console).
   Purely presentational: living backgrounds, animated chat bubbles + typing
   indicator, neon panel/button accents, expressive NPC states and a punchy
   entrance. Palette-only (amber/ivory/teal/jade/ink). Every animation lives
   under prefers-reduced-motion: no-preference; the global reduced-motion
   rules above also switch everything off, leaving crisp static fallbacks.
   ===================================================================== */
:root { --glow-amber: #eda64966; --glow-jade: #4e868566; --glow-red: #ff5a4466; }

/* --- Chat bubbles: crisp neon rim; entrance handled below. --- */
.devchat-msg.in { box-shadow: 0 1px 2px #0006, inset 0 0 0 1px #4e868533; }
.devchat-msg.out { box-shadow: 0 1px 2px #0006, 0 0 0 1px #eda64955; }
/* Typing indicator bubble: three ivory dots. */
.devchat-typing { min-width: 58px; padding: 11px 14px; }
.devchat-dots { display: inline-flex; gap: 5px; align-items: flex-end; height: 10px; }
.devchat-dots i { display: block; width: 6px; height: 6px; background: var(--ivory); opacity: .55; }
.devchat-dots i:nth-child(2) { opacity: .75; }
.devchat-dots i:nth-child(3) { opacity: .95; }

/* --- Glowing panel borders (hard 1px neon ring + soft low-alpha bloom). --- */
.devscene-chat { box-shadow: inset 1px 0 0 var(--jade), inset 0 0 0 1px #4e868522, -6px 0 22px -12px var(--glow-jade); }
.devchat-header { box-shadow: inset 0 -1px 0 #6f9b98, 0 2px 12px -4px var(--glow-jade); }
.oxwell-screen .devscene-chat { box-shadow: inset 1px 0 0 var(--danger), inset 0 0 0 1px #ffad9222, -6px 0 22px -12px var(--glow-red); }
.oxwell-header { box-shadow: inset 0 -1px 0 #ffad92, 0 2px 12px -4px var(--glow-red); }
.devchat-compose input:focus-visible { outline: 2px solid var(--amber); outline-offset: 1px; box-shadow: 0 0 0 1px var(--ink), 0 0 10px -2px var(--glow-amber); }
/* Ring drawn 14px outside the (padding-less) panel so PATCH's outline/antenna
   never get clipped; soft bloom via box-shadow, no overflow clipping. */
.mission-builder-panel { position: relative; outline: 1px solid #4e8685aa; outline-offset: 14px; box-shadow: 0 0 34px -4px var(--glow-jade), 0 18px 40px -20px #000; }

/* --- Juicy buttons: hover glow ring, satisfying press squash. --- */
.devchat-send, .devscene-proceed, .mc-generate, .mc-copy, .mc-built { position: relative; transition: box-shadow .16s ease-out, transform .12s ease-out, background-color .16s ease-out; }
.devchat-send:not(:disabled):hover, .mc-copy:not(:disabled):hover { box-shadow: 0 0 0 1px var(--jade), 0 0 0 3px #4e868544, 0 0 16px -2px var(--glow-jade); }
.devscene-proceed:not(:disabled):hover, .mc-generate:not(:disabled):hover { box-shadow: 0 0 0 1px var(--amber), 0 0 0 3px #eda64955, 0 0 18px -2px var(--glow-amber); }
.mc-built:not(:disabled):hover { box-shadow: 0 0 0 1px var(--jade), 0 0 0 3px #4e868655, 0 0 18px -2px var(--glow-jade); }
.devchat-send:active, .devscene-proceed:active, .mc-generate:active, .mc-copy:active, .mc-built:active { transform: translateY(1px) scale(.965); }
.oxwell-screen .devchat-send:not(:disabled):hover { box-shadow: 0 0 0 1px var(--danger), 0 0 0 3px #ffad9244, 0 0 16px -2px var(--glow-red); }
.mc-copied-pop { display: inline-block; }

/* --- Waterfall station: static extras that the animations bring to life. --- */
/* (Old Waterfall/Oxwell station glow-up rules removed — the redesigned scenes,
   characters and their reactive/stable states live in STATION REDESIGN near EOF.) */

/* --- Mission Console: starfield + scanlines + PATCH glow. --- */
.mission-builder-screen::before { content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(1px 1px at 8% 12%, #eee0b9cc 50%, transparent 51%), radial-gradient(1px 1px at 22% 68%, #eee0b988 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 35% 28%, #eee0b9cc 50%, transparent 51%), radial-gradient(1px 1px at 48% 84%, #eee0b988 50%, transparent 51%),
    radial-gradient(1px 1px at 61% 16%, #eee0b9cc 50%, transparent 51%), radial-gradient(1.5px 1.5px at 74% 56%, #eee0b988 50%, transparent 51%),
    radial-gradient(1px 1px at 88% 34%, #eee0b9cc 50%, transparent 51%), radial-gradient(1px 1px at 93% 78%, #eee0b988 50%, transparent 51%),
    radial-gradient(1px 1px at 15% 44%, #7fe6c888 50%, transparent 51%), radial-gradient(1px 1px at 68% 92%, #7fe6c888 50%, transparent 51%);
  opacity: .8; }
.mission-builder-panel::before { content: ""; position: absolute; inset: -14px; pointer-events: none; z-index: 0; background: #10232b66 repeating-linear-gradient(180deg, #ffffff05 0 1px, transparent 1px 3px); mix-blend-mode: normal; }
.mission-builder-panel > * { position: relative; z-index: 1; }
.mission-builder-panel .story-bot { filter: drop-shadow(0 0 6px #4e868566); }
.mc-card[aria-checked="true"] { box-shadow: inset 0 0 0 1px var(--amber), 0 0 14px -4px var(--glow-amber); }

/* --- Entrance: hidden start state; the motion block animates from it. --- */

@media (prefers-reduced-motion: no-preference) {
  /* Chat bubbles pop in: slide-up + soft scale from the bubble's own side. */
  .devchat-msg, .devchat-attachment { animation: bubble-in .26s cubic-bezier(.23, 1, .32, 1) both; }
  .devchat-msg.in, .devchat-attachment { transform-origin: left bottom; }
  .devchat-msg.out { transform-origin: right bottom; }
  @keyframes bubble-in { from { opacity: 0; transform: translateY(10px) scale(.94); } to { opacity: 1; transform: translateY(0) scale(1); } }
  .devchat-dots i { animation: dot-bounce 1s ease-in-out infinite; }
  .devchat-dots i:nth-child(2) { animation-delay: .15s; }
  .devchat-dots i:nth-child(3) { animation-delay: .3s; }
  @keyframes dot-bounce { 0%, 60%, 100% { transform: translateY(0); opacity: .55; } 30% { transform: translateY(-5px); opacity: 1; } }
  .mc-copied.mc-copied-pop { animation: copied-pop .4s cubic-bezier(.23, 1, .32, 1); }
  @keyframes copied-pop { 0% { transform: scale(.7); opacity: 0; } 60% { transform: scale(1.12); opacity: 1; } 100% { transform: scale(1); } }

  /* Pulsing neon rims on the panels + primary buttons. */
  .devscene-chat { animation: rim-pulse-jade 3.2s ease-in-out infinite; }
  @keyframes rim-pulse-jade { 0%, 100% { box-shadow: inset 1px 0 0 var(--jade), inset 0 0 0 1px #4e868522, -6px 0 22px -12px #4e868544; } 50% { box-shadow: inset 1px 0 0 #6f9b98, inset 0 0 0 1px #4e868544, -6px 0 26px -10px #4e8685aa; } }
  .oxwell-screen .devscene-chat { animation: rim-pulse-red 1.6s ease-in-out infinite; }
  .oxwell-station[data-o2="stable"] ~ .devscene-chat { animation: rim-pulse-jade 3.2s ease-in-out infinite; }
  @keyframes rim-pulse-red { 0%, 100% { box-shadow: inset 1px 0 0 var(--danger), inset 0 0 0 1px #ffad9222, -6px 0 22px -12px #ff5a4444; } 50% { box-shadow: inset 1px 0 0 #ffd0c4, inset 0 0 0 1px #ffad9255, -6px 0 28px -10px #ff5a44bb; } }
  .mission-builder-panel { animation: rim-pulse-panel 3.6s ease-in-out infinite; }
  @keyframes rim-pulse-panel { 0%, 100% { outline-color: #4e868588; box-shadow: 0 0 30px -6px #4e868555, 0 18px 40px -20px #000; } 50% { outline-color: #6f9b98; box-shadow: 0 0 40px -2px #4e8685aa, 0 18px 40px -20px #000; } }
  .devscene-proceed:not([hidden]), .mc-generate, .mc-built { animation: btn-breathe 2.2s ease-in-out infinite; }
  @keyframes btn-breathe { 0%, 100% { box-shadow: 0 0 0 1px #eda64900, 0 0 12px -6px #eda64900; } 50% { box-shadow: 0 0 0 1px #eda64966, 0 0 16px -4px #eda64988; } }
  .mc-built { animation-name: btn-breathe-jade; }
  @keyframes btn-breathe-jade { 0%, 100% { box-shadow: 0 0 0 1px #4e868500, 0 0 12px -6px #4e868500; } 50% { box-shadow: 0 0 0 1px #4e868699, 0 0 16px -4px #4e868699; } }
  .devchat-send:active, .devscene-proceed:active, .mc-generate:active, .mc-copy:active, .mc-built:active { animation: btn-press .18s cubic-bezier(.23, 1, .32, 1); }
  @keyframes btn-press { 0% { transform: translateY(1px) scale(.965); } 100% { transform: translateY(1px) scale(.965); } }

  /* (Old Waterfall/Oxwell station + character animations removed — the redesigned
     versions live in the STATION REDESIGN block near EOF.) */

  /* Mission Console: drifting stars, scanline roll, lively PATCH. */
  .mission-builder-screen::before { animation: star-drift 60s linear infinite; }
  @keyframes star-drift { from { background-position: 0 0; } to { background-position: -60px 40px; } }
  .mission-builder-panel::before { animation: scan-roll 6s linear infinite; }
  @keyframes scan-roll { from { background-position: 0 0; } to { background-position: 0 30px; } }
  #mission-builder-bot { animation: bot-bob 2.6s ease-in-out infinite; }
  @keyframes bot-bob { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-4px) rotate(-1.5deg); } }
  #mission-builder-bot .story-bot-eye { animation: bot-blink 3.8s steps(1) infinite; transform-origin: center; }
  #mission-builder-bot .story-bot-eye:last-of-type { animation-delay: .07s; }
  @keyframes bot-blink { 0%, 93%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.15); } }
  #mission-builder-bot .story-bot-antenna::before { animation: story-blink 2.4s steps(1) infinite; }
  #mission-builder-bot .story-bot-body::after { animation: astro-blink 1.6s steps(1) infinite; }
  #mission-builder-bot.bot-nod { animation: bot-nod .5s ease-out; }
  @keyframes bot-nod { 0%, 100% { transform: translateY(0) rotate(0); } 40% { transform: translateY(4px) rotate(2deg); } }
  #mission-builder-bot.bot-cheer { animation: bot-cheer .9s cubic-bezier(.23, 1, .32, 1); }
  @keyframes bot-cheer { 0% { transform: translateY(0) rotate(0); } 30% { transform: translateY(-12px) rotate(-4deg); } 55% { transform: translateY(0) rotate(3deg); } 75% { transform: translateY(-5px) rotate(0); } 100% { transform: translateY(0) rotate(0); } }
  #mission-builder-bot.bot-cheer .story-bot-eye { animation: bot-spark .9s ease-out; }
  @keyframes bot-spark { 35% { background: var(--amber); box-shadow: inset 0 0 0 2px #16303a, 0 0 8px var(--amber); } }
  #mission-builder-bot.bot-hmm { animation: bot-hmm .7s ease-in-out; }
  @keyframes bot-hmm { 0%, 100% { transform: rotate(0); } 35%, 65% { transform: rotate(5deg) translateY(2px); } }

  /* Punchy entrance (~0.5s): panels slide/scale in as the black lifts, then a
     quick amber glow sweep crosses the scene. Toggled by ui.js for ~1.2s. */
  .scene-enter .devscene-station { animation: enter-left .55s cubic-bezier(.23, 1, .32, 1) .2s both; }
  .scene-enter .devscene-chat { animation: enter-right .55s cubic-bezier(.23, 1, .32, 1) .28s both; }
  .scene-enter .mission-builder-panel { animation: enter-pop .5s cubic-bezier(.23, 1, .32, 1) .2s both; }
  @keyframes enter-left { from { opacity: 0; transform: translateX(-6%) scale(.97); } to { opacity: 1; transform: none; } }
  @keyframes enter-right { from { opacity: 0; transform: translateX(6%) scale(.97); } to { opacity: 1; transform: none; } }
  @keyframes enter-pop { from { opacity: 0; transform: translateY(18px) scale(.94); } to { opacity: 1; transform: none; } }
  .scene-enter::after { content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 30; mix-blend-mode: screen;
    background: linear-gradient(105deg, transparent 40%, #eda64955 50%, transparent 60%); background-size: 260% 100%; background-repeat: no-repeat;
    animation: glow-sweep .6s cubic-bezier(.23, 1, .32, 1) .5s both; }
  @keyframes glow-sweep { from { background-position: 130% 0; opacity: 1; } to { background-position: -30% 0; opacity: 0; } }
  .scene-enter .devchat-header { animation: enter-flash .5s ease-out .55s both; }
  @keyframes enter-flash { 0% { filter: brightness(1); } 30% { filter: brightness(1.45); } 100% { filter: brightness(1); } }
}

/* =====================================================================
   BEGINNER GUIDANCE LAYERS (Waterfall / Oxwell / Mission Console).
   Additive UI only — intro card (A), persistent checklist (B), NPC copy (C,
   in the chat modules), and a "?" help overlay (D). Palette-only; all motion
   is gated by prefers-reduced-motion / the global reduced-motion switch.
   ===================================================================== */

/* --- (B) Persistent step checklist column beside the chat. --- */
.scene-guide { display: flex; flex-direction: column; min-height: 0; background: #0b1a20; border-left: 2px solid var(--line); box-shadow: inset 1px 0 0 #4e868522; }
.scene-guide-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px; background: var(--teal); border-bottom: 2px solid var(--ink); flex: 0 0 auto; }
.scene-guide-head h3 { margin: 0; font-weight: 700; font-size: 15px; letter-spacing: .08em; text-transform: uppercase; color: var(--ivory); }
.oxwell-guide .scene-guide-head { background: #7d3720; }
.scene-checklist { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; list-style: none; counter-reset: step; margin: 0; padding: 12px; display: flex; flex-direction: column; gap: 8px; scrollbar-width: thin; scrollbar-color: #90957e var(--ink); }
.scene-checklist li { counter-increment: step; position: relative; padding: 9px 10px 9px 34px; background: var(--charcoal); border: 1px solid var(--line); border-left: 3px solid var(--line); color: var(--ivory); font-size: 14px; line-height: 1.3; }
.scene-checklist li::before { content: counter(step); position: absolute; left: 8px; top: 8px; width: 18px; height: 18px; display: grid; place-items: center; font-weight: 700; font-size: 12px; color: var(--ivory); background: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.scene-checklist li b { display: block; font-weight: 700; }
.scene-checklist li small { display: block; margin-top: 2px; color: var(--muted); font-size: 12.5px; line-height: 1.25; }
.scene-checklist li code { font-family: "Barlow Condensed", monospace; color: var(--amber); font-size: 13px; }
/* Current step: amber-highlighted. Done steps: jade tick, dimmed. */
.scene-checklist li[data-state="current"] { border-left-color: var(--amber); background: #2a2a1c; box-shadow: inset 0 0 0 1px #eda64955; }
.scene-checklist li[data-state="current"]::before { color: var(--ink); background: var(--amber); box-shadow: none; }
.scene-checklist li[data-state="done"] { border-left-color: var(--jade); opacity: .72; }
.scene-checklist li[data-state="done"] b { text-decoration: line-through; text-decoration-color: #4e868588; }
.scene-checklist li[data-state="done"]::before { content: "\2713"; color: var(--ink); background: var(--jade); box-shadow: none; }
.scene-guide-tip { flex: 0 0 auto; margin: 0; padding: 10px 14px; border-top: 1px solid var(--line); background: #0e1f26; color: var(--muted); font-size: 13px; line-height: 1.35; }
.scene-guide-tip b { color: var(--amber); }

/* Mission Console checklist sits inside its scrolling panel body. */
.mc-checklist { border: 1px solid var(--line); background: #0b1a20; margin: 0 0 18px; padding: 12px; border-radius: 2px; }
.mission-builder-briefing { position: relative; }
.mc-help-btn { position: absolute; top: 0; right: 0; }

/* --- Shared "?" help button. --- */
.scene-help-btn { flex: 0 0 auto; width: 28px; height: 28px; display: grid; place-items: center; font-weight: 700; font-size: 17px; line-height: 1; color: var(--ink); background: var(--amber); border: 1px solid var(--amber); border-radius: 50%; box-shadow: 0 0 0 2px var(--ink); }
.scene-help-btn:hover { background: #f8bd6c; }
.scene-help-btn:focus-visible { outline: 2px solid var(--ivory); outline-offset: 2px; }

/* --- (A) Intro card + (D) Help overlay: dim scrim + centered pixel card. --- */
.scene-intro, .scene-help { position: absolute; inset: 0; z-index: 45; display: grid; place-items: center; padding: 24px; background: #08141acc; overflow-y: auto; }
.scene-intro-card, .scene-help-card { width: min(560px, 100%); max-height: 92%; overflow-y: auto; background: var(--charcoal); color: var(--ivory); border: 2px solid var(--jade); box-shadow: 0 0 0 1px var(--ink), 0 0 30px -6px #4e868566, 0 18px 40px -18px #000; padding: 22px 24px; scrollbar-width: thin; scrollbar-color: #90957e var(--ink); }
.oxwell-screen .scene-intro-card, .oxwell-screen .scene-help-card { border-color: var(--danger); box-shadow: 0 0 0 1px var(--ink), 0 0 30px -6px #ff5a4455, 0 18px 40px -18px #000; }
.scene-intro-card .panel-eyebrow { display: block; margin-bottom: 4px; }
.scene-intro-card h2, .scene-help-card h2 { margin: 0 0 12px; font-size: clamp(24px, 3.4cqw, 34px); line-height: 1.06; }
.scene-intro-card > p { margin: 0 0 12px; color: var(--muted); font-size: 16px; line-height: 1.4; }
.scene-intro-card > p b, .scene-intro-note b { color: var(--ivory); }
.scene-intro-steps, .scene-help-steps { margin: 0 0 14px; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; font-size: 15.5px; line-height: 1.4; }
.scene-intro-steps li, .scene-help-steps li { padding-left: 4px; }
.scene-intro-steps b, .scene-help-steps b { color: var(--amber); }
.scene-intro-steps code, .scene-help-steps code, .scene-intro-note code { font-family: "Barlow Condensed", monospace; color: var(--amber); }
.scene-intro-note { margin: 0 0 16px; padding: 10px 12px; background: var(--ink); border-left: 3px solid var(--amber); color: var(--muted); font-size: 14.5px; line-height: 1.4; }
.scene-intro-ok { width: auto; min-width: 160px; margin-top: 4px; }

.scene-help-cardhead { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.scene-help-cardhead h2 { margin: 0; }
.scene-help-close { flex: 0 0 auto; width: 32px; height: 32px; display: grid; place-items: center; font-size: 16px; color: var(--ivory); background: var(--ink); border: 1px solid var(--line); }
.scene-help-close:hover { border-color: var(--danger); color: var(--danger); }
.scene-help-close:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.scene-help-warn { display: block; margin-top: 3px; color: var(--danger); font-size: 13.5px; font-weight: 600; }
/* Screenshot / arrow slot in the help overlay (space for a future capture). */
.scene-help-shot { display: flex; align-items: center; gap: 12px; margin: 0; padding: 16px; background: var(--ink); border: 1px dashed var(--line); }
.scene-help-shot .scene-help-arrow { font-size: 28px; color: var(--amber); line-height: 1; }
.scene-help-shot figcaption { color: var(--muted); font-size: 14px; line-height: 1.35; }

/* Reduced-motion / narrow: overlays already static; nothing else needed. */
@media (prefers-reduced-motion: no-preference) {
  .scene-intro-card, .scene-help-card { animation: scene-card-in .28s cubic-bezier(.23, 1, .32, 1) both; }
  @keyframes scene-card-in { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }
  .scene-checklist li[data-state="current"] { animation: guide-focus 2.4s ease-in-out infinite; }
  @keyframes guide-focus { 0%, 100% { box-shadow: inset 0 0 0 1px #eda64955; } 50% { box-shadow: inset 0 0 0 1px #eda649, 0 0 10px -3px var(--amber); } }
  .scene-help-btn { animation: help-breathe 2.6s ease-in-out infinite; }
  @keyframes help-breathe { 0%, 100% { box-shadow: 0 0 0 2px var(--ink); } 50% { box-shadow: 0 0 0 2px var(--ink), 0 0 10px -1px var(--amber); } }
}

/* =====================================================================
   STATION REDESIGN — brand-new Commander Waterfall (dev "process hell" den)
   and Chief Oxwell (red-alert life-support bay), bigger and full of
   personality, plus the cosmetic NPC speech bubble. Purely LEFT-panel art;
   the chat/guidance columns are untouched. Palette: amber/ivory/teal/jade/ink.
   Character container hooks (#waterfall.astronaut, #oxwell.engineer,
   .oxwell-station[data-o2], astro-*/eng-* reaction classes) are preserved so
   the existing chat-progress reactions keep driving these figures.
   ===================================================================== */

/* ---------- COMMANDER WATERFALL — process-hell den ---------- */
.wf-den { background:
    radial-gradient(140% 110% at 50% 8%, #33414f 0%, #23303c 40%, #141d27 78%, var(--ink) 100%);
  --paper: #d8cba6; --paper-dark: #a89a76; }
/* Wood-ish desk band + floor shadow along the bottom. */
.wf-den::before { content: ""; position: absolute; inset: auto 0 0 0; height: 26%; background: linear-gradient(180deg, #2a2117 0%, #1c160f 60%, #12100b 100%); box-shadow: inset 0 3px 0 #3f3320, inset 0 6px 0 #14100a; }
.wf-den > * { z-index: 2; }
.wf-den::before { z-index: 1; }
/* The living-office layer sits BEHIND the wall props; the astronaut sits above
   everything so he stays the biggest, most-forward figure. */
.wf-den .wf-office { z-index: 1; }
.wf-den .wf-astro { z-index: 6; }

/* (Old flat office shapes replaced by the pixel-art OFFICE scene near EOF.) */

/* Huge printed GANTT chart, pinned high-left on the wall. */
.wf-gantt { position: absolute; top: 6%; left: 5%; width: 33%; aspect-ratio: 4 / 3; background: var(--paper); box-shadow: inset 0 0 0 3px #b7ab84, 0 0 0 3px var(--ink), 4px 5px 0 #0b110a55; padding: 12% 7% 7%; display: grid; grid-template-rows: repeat(6, 1fr); gap: 6%; transform: rotate(-1.5deg); }
.wf-gantt-title { position: absolute; top: 4%; left: 6%; right: 6%; height: 7%; background: #7c3620; }
.wf-gantt-bar { display: block; height: 100%; background: var(--teal); box-shadow: inset 0 0 0 1px #10232b33; }
.wf-gantt-bar.b1 { width: 88%; }
.wf-gantt-bar.b2 { width: 52%; margin-left: 14%; background: var(--jade); }
.wf-gantt-bar.b3 { width: 70%; margin-left: 26%; background: var(--amber); }
.wf-gantt-bar.b4 { width: 40%; margin-left: 44%; }
.wf-gantt-bar.b5 { width: 62%; margin-left: 20%; background: var(--jade); }
.wf-gantt-bar.b6 { width: 34%; margin-left: 55%; background: var(--amber); }
.wf-gantt-now { position: absolute; top: 12%; bottom: 8%; left: 62%; width: 2px; background: #b3502f; box-shadow: 0 0 0 1px #7c362066; }

/* CRT with a little WATERFALL process diagram. */
.wf-crt { position: absolute; top: 8%; right: 6%; width: 26%; aspect-ratio: 5 / 4; background: #14110c; box-shadow: inset 0 0 0 4px #2b2318, 0 0 0 3px var(--ink), 3px 4px 0 #0b110a66; padding: 8%; transform: rotate(1.5deg); }
.wf-crt-screen { position: relative; display: block; width: 100%; height: 100%; background: #0b1f1c; box-shadow: inset 0 0 0 2px #163a34, inset 0 0 22px #0006; overflow: hidden; }
.wf-wf { position: absolute; height: 12%; background: var(--jade); box-shadow: 0 0 0 1px #0006; }
.wf-wf.s1 { top: 14%; left: 10%; width: 34%; background: var(--teal); }
.wf-wf.s2 { top: 34%; left: 28%; width: 34%; }
.wf-wf.s3 { top: 54%; left: 46%; width: 34%; background: var(--amber); }
.wf-wf.s4 { top: 74%; left: 62%; width: 30%; background: var(--jade); }
.wf-crt-scan { position: absolute; inset: 0; background: repeating-linear-gradient(180deg, #ffffff10 0 1px, transparent 1px 3px); }

/* Red-marked DEADLINE wall calendar. */
.wf-calendar { position: absolute; top: 5%; left: 42%; width: 15%; aspect-ratio: 4 / 5; background: var(--ivory); box-shadow: inset 0 0 0 2px #b7ab84, 0 0 0 3px var(--ink), 3px 4px 0 #0b110a55; transform: rotate(2.5deg); display: flex; flex-direction: column; }
.wf-cal-head { display: block; background: #b3502f; color: var(--ivory); font: 700 clamp(7px, 1.5cqw, 11px)/1.6 "Barlow Condensed", sans-serif; letter-spacing: .08em; text-align: center; }
.wf-cal-grid { flex: 1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8%; padding: 10%; }
.wf-cal-grid i { background: #cbd6d0; box-shadow: inset 0 0 0 1px #10232b22; }
.wf-cal-grid i.x { position: relative; background: #e9b7a6; }
.wf-cal-grid i.x::before, .wf-cal-grid i.x::after { content: ""; position: absolute; inset: 12%; background: #b3502f; height: 20%; top: 40%; transform: rotate(45deg); }
.wf-cal-grid i.x::after { transform: rotate(-45deg); }

/* Towering stacks of binders/printed docs on the desk/floor. */
.wf-stack { position: absolute; bottom: 20%; display: flex; flex-direction: column-reverse; align-items: center; }
.wf-stack.s-a { left: 3%; width: 15%; }
.wf-stack.s-b { right: 4%; width: 13%; bottom: 19%; }
.wf-stack span { width: 100%; height: clamp(7px, 2cqw, 15px); margin-top: -1px; box-shadow: inset 0 2px 0 #ffffff22, inset 0 -3px 0 #0006, 0 0 0 2px var(--ink); }
.wf-stack span:nth-child(1) { background: #7c3620; width: 96%; }
.wf-stack span:nth-child(2) { background: var(--teal); width: 104%; }
.wf-stack span:nth-child(3) { background: var(--paper-dark); width: 92%; }
.wf-stack span:nth-child(4) { background: var(--jade); width: 100%; }

/* Sticky notes scattered at angles on the wall. */
.wf-notes span { position: absolute; width: clamp(20px, 5.5cqw, 40px); aspect-ratio: 1; background: var(--amber); box-shadow: 2px 3px 0 #0b110a55, inset 0 0 0 1px #00000010;
  background-image: linear-gradient(#00000012 0 1px, transparent 1px), linear-gradient(180deg, #ffffff22, transparent 40%); background-size: 100% 22%, 100% 100%; }
.wf-notes span:nth-child(1) { top: 40%; left: 40%; transform: rotate(-7deg); }
.wf-notes span:nth-child(2) { top: 52%; left: 25%; transform: rotate(5deg); background: #e6c98a; }
.wf-notes span:nth-child(3) { top: 30%; right: 32%; transform: rotate(-5deg); background: #e08a8a; }
.wf-notes span:nth-child(4) { top: 58%; right: 24%; transform: rotate(8deg); background: #9fd0c6; }
.wf-notes span:nth-child(5) { top: 44%; left: 56%; transform: rotate(3deg); background: #e6c98a; }

/* Coffee cups on the desk shelf. */
.wf-coffee { position: absolute; bottom: 20%; width: clamp(12px, 3cqw, 22px); aspect-ratio: 4 / 5; background: var(--ivory); box-shadow: inset 0 -30% 0 #cbd6d0, 0 0 0 2px var(--ink); }
.wf-coffee::before { content: ""; position: absolute; top: 12%; left: 12%; right: 12%; height: 24%; background: #4a2f22; box-shadow: 0 0 0 1px #0004; }
.wf-coffee::after { content: ""; position: absolute; top: 30%; right: -34%; width: 34%; height: 46%; border: 2px solid var(--ink); border-left: 0; border-radius: 0 60% 60% 0; }
.wf-coffee.c1 { left: 22%; }
.wf-coffee.c2 { left: 34%; bottom: 21%; transform: scale(.85); }

/* --- The astronaut developer: bigger, blockier, expressive. --- */
.wf-astro { position: absolute; left: 52%; bottom: 8%; width: clamp(150px, 50cqw, 280px); aspect-ratio: 3 / 4; transform: translateX(-50%); image-rendering: pixelated;
  --suit: #d8cba6; --suit-dk: #a89a76; --shell: #2f6d6a; --shell-dk: #1b3a41; --shell-hi: #63a89f; }
.wf-astro > span { position: absolute; display: block; }
.wf-shadow { bottom: -2%; left: 12%; width: 76%; height: 6%; background: #0b110a66; border-radius: 50%; filter: blur(1px); z-index: 0; }
.wf-pack { top: 20%; left: 20%; width: 60%; height: 42%; background: var(--shell-dk); box-shadow: inset 0 8% 0 var(--shell), 0 0 0 5px var(--ink); }
.wf-body { top: 50%; left: 18%; width: 64%; height: 44%; background: var(--suit); box-shadow: inset 0 -34% 0 var(--suit-dk), inset 0 0 0 6px var(--shell), 0 0 0 5px var(--ink); }
.wf-chest { position: absolute; top: 16%; left: 12%; right: 12%; height: 4px; background: var(--ink); opacity: .4; }
.wf-badge { position: absolute; top: 22%; left: 18%; width: 20%; aspect-ratio: 1; background: var(--amber); box-shadow: 0 0 0 3px var(--ink); }
.wf-light { position: absolute; top: 24%; right: 18%; width: 15%; aspect-ratio: 1; background: var(--jade); box-shadow: 0 0 0 3px var(--ink); }
.wf-collar { position: absolute; top: -6%; left: 24%; right: 24%; height: 12%; background: var(--shell); box-shadow: inset 0 0 0 3px var(--shell-dk), 0 0 0 4px var(--ink); }
.wf-head { top: 4%; left: 24%; width: 52%; height: 46%; z-index: 3; }
.wf-helmet { position: absolute; inset: 0; background: var(--shell-dk); border-radius: 20% 20% 12% 12%; box-shadow: inset 0 12% 0 var(--shell), inset 0 0 0 5px var(--shell), 0 0 0 5px var(--ink); }
.wf-antenna { position: absolute; top: -18%; left: 46%; width: 8%; height: 22%; background: var(--ink); }
.wf-antenna::after { content: ""; position: absolute; top: -40%; left: -60%; width: 220%; aspect-ratio: 1; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 3px var(--ink); }
.wf-visor { position: absolute; top: 24%; left: 12%; width: 76%; height: 58%; background: #0b1f22; border-radius: 12%; box-shadow: inset 0 0 0 4px #14413f, inset 0 -20% 0 #081619; overflow: hidden; }
.wf-visor-glint { position: absolute; top: 6%; left: 8%; width: 40%; height: 12%; background: var(--shell-hi); opacity: .55; transform: skewX(-18deg); z-index: 3; pointer-events: none; }
/* FIX 2: his FACE reads WHITE/ivory (a light skin plate inside the visor), not
   the dark visor glass. The visor rim still frames it. Features are darkened
   below so eyes/brows/mouth/sweat stay readable against the light face. */
.wf-face { position: absolute; inset: 10% 8%; background: var(--ivory); border-radius: 14%; box-shadow: inset 0 -22% 0 #d8cba6, inset 0 0 0 3px #b7ab84; z-index: 2; }
.wf-brow { position: absolute; top: 18%; width: 30%; height: 9%; background: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.wf-brow-l { left: 12%; transform-origin: center; }
.wf-brow-r { right: 12%; transform-origin: center; }
.wf-eye { position: absolute; top: 30%; width: 28%; height: 34%; background: #f6efd6; box-shadow: 0 0 0 3px var(--ink); overflow: hidden; }
.wf-eye-l { left: 12%; }
.wf-eye-r { right: 12%; }
.wf-pupil { position: absolute; top: 26%; left: 30%; width: 42%; height: 52%; background: var(--shell-dk); }
.wf-shine { position: absolute; top: 12%; left: 16%; width: 26%; height: 22%; background: #dff3f0; }
.wf-mouth { position: absolute; bottom: 12%; left: 50%; width: 34%; height: 9%; margin-left: -17%; background: var(--amber); box-shadow: 0 -2px 0 var(--ink); border-radius: 0 0 40% 40%; }
.wf-sweat { position: absolute; top: 30%; right: 6%; width: 7%; aspect-ratio: 3 / 4; background: #bfe4ff; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; box-shadow: 0 0 0 1px #4a8bb0; opacity: 0; }
.wf-arm { top: 52%; width: 18%; height: 40%; background: var(--shell-dk); box-shadow: inset 3px 0 0 var(--shell), 0 0 0 5px var(--ink); z-index: 4; }
.wf-arm-l { left: 0; transform-origin: top center; }
.wf-arm-r { right: 0; transform-origin: top center; }
.wf-hand { position: absolute; bottom: -6%; left: -10%; width: 120%; height: 22%; background: var(--suit); box-shadow: inset 0 0 0 2px var(--suit-dk), 0 0 0 4px var(--ink); }
/* A crumpled printout clutched in his right hand. */
.wf-paper { position: absolute; bottom: -10%; left: -40%; width: 90%; aspect-ratio: 3 / 4; background: var(--paper); box-shadow: inset 0 0 0 2px var(--paper-dark), 0 0 0 3px var(--ink); transform: rotate(-10deg);
  background-image: repeating-linear-gradient(#a89a7688 0 1px, transparent 1px 4px); }

/* ---------- CHIEF OXWELL — red-alert life-support bay ---------- */
.ox-bay { background:
    repeating-linear-gradient(180deg, #ffffff05 0 2px, transparent 2px 4px),
    radial-gradient(140% 110% at 60% 24%, #4a1c22 0%, #2a1216 55%, #160c10 82%, var(--ink) 100%);
  --steel: #2a3f47; --steel-hi: #4e6f79; --skin: #c98d63; --skin-dk: #9c6a48; --hair: #241c18;
  --vest: #b7532f; --vest-dk: #7d3720; --gear: #2f6d6a; --gear-hi: #63a89f; }
.ox-bay::before { content: ""; position: absolute; inset: auto 0 0 0; height: 22%; background: linear-gradient(180deg, transparent, #1a0c0e 70%); box-shadow: inset 0 3px 0 #ff6a5522; z-index: 1; }
.ox-bay > * { z-index: 2; }
/* Factory layer sits behind the alert props; Oxwell stays biggest/forward. */
.ox-bay .ox-factory { z-index: 1; }
.ox-bay .ox-eng { z-index: 6; }

/* (Old flat factory shapes replaced by the pixel-art FACTORY scene near EOF.) */
/* Red-alert strobe strip. */
.ox-strip { position: absolute; top: 0; left: 0; right: 0; height: 5%; display: flex; z-index: 3; }
.ox-strip span { flex: 1; background: #401318; box-shadow: inset 0 0 0 1px #0006; }
/* Rotating warning beacons (dome + rotating light wedge). */
.ox-beacon { position: absolute; top: 7%; width: clamp(22px, 6cqw, 40px); aspect-ratio: 1; }
.ox-beacon-l { left: 5%; } .ox-beacon-r { right: 5%; }
.ox-beacon::before { content: ""; position: absolute; inset: 30% 0 0 0; border-radius: 50% 50% 40% 40%; background: radial-gradient(circle at 40% 30%, #ffb0a0, var(--danger) 60%, #7a1f1f); box-shadow: 0 0 14px #ff5a44aa, 0 0 0 3px var(--ink); }
.ox-beacon span { position: absolute; top: 34%; left: 50%; width: 120%; height: 26%; margin-left: -6%; background: linear-gradient(90deg, #ff6a55aa, transparent 70%); transform-origin: left center; opacity: .7; }
/* Large O2 gauge dropping into the red. */
.ox-gauge2 { position: absolute; top: 14%; left: 7%; width: 30%; max-width: 210px; padding: 6% 5%; background: #10232bdd; box-shadow: inset 0 0 0 1px #0006, 0 0 0 2px #6b2b2b, 3px 4px 0 #0b060688; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 0 8px; font: 700 clamp(11px, 2.4cqw, 17px)/1 "Barlow Condensed", sans-serif; letter-spacing: .06em; color: var(--danger); }
.ox-g2-label { color: #ffd0c4; font-size: 1.3em; }
.ox-g2-label sub { font-size: .7em; }
.ox-g2-pct { font-variant-numeric: tabular-nums; text-align: right; }
.ox-g2-track { position: relative; height: clamp(8px, 2cqw, 13px); background: #2a1315; box-shadow: inset 0 0 0 1px #000; overflow: hidden; }
.ox-g2-redzone { position: absolute; inset: 0 70% 0 0; background: repeating-linear-gradient(45deg, #7a1f1f 0 4px, #521616 4px 8px); opacity: .8; }
.ox-g2-fill { position: absolute; inset: 0 auto 0 0; width: 8%; background: var(--danger); box-shadow: 0 0 8px #ff5a4488; }
/* Cracked wall monitor: OXYGEN CRITICAL. */
.ox-monitor { position: absolute; top: 12%; right: 6%; width: 28%; aspect-ratio: 5 / 4; background: #0a1518; box-shadow: inset 0 0 0 3px #22333a, 0 0 0 3px var(--ink), inset 0 0 26px #ff5a4422; display: grid; place-items: center; transform: rotate(1deg); }
.ox-mon-text { color: #ff6a55; font: 700 clamp(9px, 2.2cqw, 16px)/1.15 "Barlow Condensed", sans-serif; letter-spacing: .12em; text-align: center; text-shadow: 0 0 6px #ff5a4488; }
.ox-mon-crack { position: absolute; top: 8%; left: 20%; width: 60%; height: 70%; pointer-events: none;
  background:
    linear-gradient(28deg, transparent 48%, #9fc4cc55 49% 50%, transparent 51%),
    linear-gradient(-52deg, transparent 60%, #9fc4cc44 61% 62%, transparent 63%),
    linear-gradient(78deg, transparent 40%, #9fc4cc33 41% 42%, transparent 43%); }
/* Hissing steam pipes down the left wall + valve. */
.ox-pipes2 { position: absolute; inset: 0; pointer-events: none; }
.ox-pipes2 span { position: absolute; background: var(--steel); box-shadow: inset 0 2px 0 var(--steel-hi), 0 0 0 2px var(--ink); }
.ox-pipes2 .p-v { left: 1%; top: 42%; width: 5%; height: 44%; }
.ox-pipes2 .p-h { left: 1%; top: 82%; width: 26%; height: 5%; }
.ox-pipes2 .p-valve { left: 22%; top: 79%; width: 7%; aspect-ratio: 1; border-radius: 50%; background: #7d3720; box-shadow: inset 0 0 0 2px #b7532f, 0 0 0 2px var(--ink); }
.ox-steam { position: absolute; left: 4%; top: 40%; width: 14%; height: 24%; background: radial-gradient(60% 100% at 50% 100%, #cfe6e455 0%, transparent 70%); opacity: 0; }
/* Damaged conduit sparks. */
.ox-sparks { position: absolute; right: 30%; top: 42%; width: 12%; height: 3%; }
.ox-sparks span { position: absolute; width: 3px; height: 3px; background: #ffe29a; box-shadow: 0 0 5px #ffd07a; opacity: 0; }
.ox-sparks span:nth-child(1) { left: 0; } .ox-sparks span:nth-child(2) { left: 45%; } .ox-sparks span:nth-child(3) { left: 90%; }

/* --- Chief Oxwell: bigger, more detailed, frantic. --- */
.ox-eng { position: absolute; left: 50%; bottom: 8%; width: clamp(150px, 50cqw, 280px); aspect-ratio: 3 / 4; transform: translateX(-50%); image-rendering: pixelated; }
.ox-eng > span { position: absolute; display: block; }
.ox-shadow { bottom: -2%; left: 12%; width: 76%; height: 6%; background: #0b060688; border-radius: 50%; filter: blur(1px); z-index: 0; }
.ox-body { top: 48%; left: 16%; width: 68%; height: 48%; background: var(--vest); box-shadow: inset 0 -34% 0 var(--vest-dk), inset 0 0 0 6px var(--gear), 0 0 0 5px var(--ink); }
.ox-vest { position: absolute; top: 8%; left: 44%; width: 12%; height: 84%; background: var(--vest-dk); }
.ox-o2tank { position: absolute; top: 14%; left: 16%; width: 22%; aspect-ratio: 1; background: var(--gear); box-shadow: inset 0 0 0 4px var(--gear-hi), 0 0 0 3px var(--ink); }
.ox-o2tank::after { content: ""; position: absolute; inset: 34%; background: #cfe6e4; box-shadow: 0 0 0 1px var(--ink); }
.ox-strap { position: absolute; top: 6%; left: 66%; width: 9%; height: 88%; background: #3a2f28; box-shadow: 0 0 0 2px var(--ink); }
.ox-collar { position: absolute; top: -5%; left: 26%; right: 26%; height: 12%; background: var(--gear); box-shadow: inset 0 0 0 3px var(--gear-hi), 0 0 0 4px var(--ink); }
.ox-head { top: 6%; left: 27%; width: 46%; height: 44%; z-index: 3; }
.ox-hair { position: absolute; top: -6%; left: -8%; width: 116%; height: 32%; background: var(--hair); box-shadow: 0 0 0 5px var(--ink); border-radius: 30% 30% 0 0; }
.ox-headset { position: absolute; top: 2%; left: 14%; width: 72%; height: 26%; border: 5px solid var(--gear); border-bottom: 0; border-radius: 50% 50% 0 0 / 100% 100% 0 0; box-shadow: 0 0 0 2px var(--ink); }
.ox-headset::before, .ox-headset::after { content: ""; position: absolute; bottom: -34%; width: 22%; height: 48%; background: var(--gear); box-shadow: inset 0 0 0 2px var(--gear-hi), 0 0 0 2px var(--ink); }
.ox-headset::before { left: -8%; } .ox-headset::after { right: -8%; }
.ox-face { position: absolute; top: 16%; left: 8%; width: 84%; height: 80%; background: var(--skin); box-shadow: inset 0 -24% 0 var(--skin-dk), 0 0 0 5px var(--ink); }
.ox-brow { position: absolute; top: 20%; width: 28%; height: 8%; background: var(--hair); }
.ox-brow-l { left: 12%; transform: rotate(14deg); transform-origin: center; }
.ox-brow-r { right: 12%; transform: rotate(-14deg); transform-origin: center; }
.ox-eye { position: absolute; top: 30%; width: 26%; height: 24%; background: var(--ivory); box-shadow: 0 0 0 3px var(--ink); overflow: hidden; }
.ox-eye-l { left: 12%; } .ox-eye-r { right: 12%; }
.ox-pupil { position: absolute; top: 26%; left: 34%; width: 40%; height: 58%; background: #1a2b30; }
.ox-nose { position: absolute; top: 54%; left: 45%; width: 10%; height: 16%; background: var(--skin-dk); }
.ox-mouth { position: absolute; bottom: 8%; left: 50%; width: 32%; height: 15%; margin-left: -16%; background: #5a2733; box-shadow: inset 0 -36% 0 #7d3a44, 0 0 0 3px var(--ink); border-radius: 40% 40% 45% 45%; }
.ox-stubble { position: absolute; bottom: 2%; left: 8%; width: 84%; height: 20%; background: repeating-linear-gradient(90deg, transparent 0 2px, #00000022 2px 3px); }
.ox-mic { position: absolute; top: 46%; left: 6%; width: 24%; height: 5%; background: var(--gear); box-shadow: 0 0 0 2px var(--ink); transform-origin: right center; transform: rotate(16deg); z-index: 4; }
.ox-mic::before { content: ""; position: absolute; left: -14%; top: -80%; width: 28%; aspect-ratio: 1; border-radius: 50%; background: #1a2b30; box-shadow: 0 0 0 2px var(--ink); }
.ox-sweat { position: absolute; width: 7%; aspect-ratio: 3 / 4; background: #bfe4ff; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; box-shadow: 0 0 0 1px #4a8bb0; opacity: .9; z-index: 5; }
.ox-sweat-1 { top: 22%; left: 76%; } .ox-sweat-2 { top: 34%; left: 16%; } .ox-sweat-3 { top: 16%; left: 50%; }
.ox-arm { top: 50%; width: 18%; height: 40%; background: var(--vest-dk); box-shadow: inset 3px 0 0 var(--vest), 0 0 0 5px var(--ink); z-index: 4; }
.ox-arm-l { left: 0; transform-origin: top center; }
.ox-arm-r { right: 0; transform-origin: top center; }
.ox-hand { position: absolute; bottom: -6%; left: -10%; width: 120%; height: 22%; background: var(--skin); box-shadow: inset 0 0 0 2px var(--skin-dk), 0 0 0 4px var(--ink); }
/* Stable state (fix accepted): bay calms to teal, gauge fills, alarms stand down. */
.ox-bay[data-o2="stable"] { background: repeating-linear-gradient(180deg, #ffffff05 0 2px, transparent 2px 4px), radial-gradient(140% 110% at 60% 24%, #1c3a44 0%, #16282e 60%, var(--ink) 100%); }
.ox-bay[data-o2="stable"] .ox-strip span { background: #1d3a34; }
.ox-bay[data-o2="stable"] .ox-beacon::before { background: radial-gradient(circle at 40% 30%, #cfe6e4, var(--jade) 60%, #1b3a41); box-shadow: 0 0 10px #4e868588, 0 0 0 3px var(--ink); }
.ox-bay[data-o2="stable"] .ox-g2-fill { width: 96%; background: var(--jade); box-shadow: 0 0 8px #4e868588; }
.ox-bay[data-o2="stable"] .ox-g2-pct { color: #cfe6e4; }
.ox-bay[data-o2="stable"] .ox-g2-pct { visibility: hidden; }
.ox-bay[data-o2="stable"] .ox-g2-pct::after { content: "96%"; visibility: visible; }
.ox-bay[data-o2="stable"] .ox-gauge2 { box-shadow: inset 0 0 0 1px #0006, 0 0 0 2px var(--jade), 3px 4px 0 #0b060688; color: #cfe6e4; }
.ox-bay[data-o2="stable"] .ox-mon-text { color: var(--jade); text-shadow: none; }
.ox-bay[data-o2="stable"] .ox-monitor { box-shadow: inset 0 0 0 3px #22333a, 0 0 0 3px var(--ink), inset 0 0 26px #4e868533; }
/* Calm Oxwell: brows level, relieved smile, sweat gone. */
.ox-eng.eng-calm .ox-brow-l, .ox-eng.eng-calm .ox-brow-r { transform: rotate(0); top: 22%; }
.ox-eng.eng-calm .ox-mouth { background: var(--jade); box-shadow: inset 0 -36% 0 #6f9b98, 0 0 0 3px var(--ink); height: 9%; border-radius: 0 0 45% 45%; }
.ox-eng.eng-calm .ox-sweat { display: none; }
.ox-eng.eng-calm .ox-eye { height: 18%; top: 34%; }

/* ---------- NPC speech bubble (cosmetic) ---------- */
.npc-bubble { position: absolute; left: 50%; bottom: 62%; transform: translateX(-50%); z-index: var(--z-prompt); max-width: 66%; padding: 8px 11px; background: var(--ivory); color: var(--ink); border: 3px solid var(--ink); box-shadow: 3px 4px 0 #0b110a55; font: 700 clamp(11px, 2.1cqw, 16px)/1.2 "Barlow Condensed", sans-serif; letter-spacing: .01em; text-align: center; text-wrap: balance; pointer-events: none; }
.npc-bubble::after { content: ""; position: absolute; bottom: -11px; left: 50%; margin-left: -7px; width: 0; height: 0; border: 8px solid transparent; border-top-color: var(--ink); }
.npc-bubble::before { content: ""; position: absolute; bottom: -6px; left: 50%; margin-left: -5px; width: 0; height: 0; border: 6px solid transparent; border-top-color: var(--ivory); z-index: 1; }
.ox-bubble { background: #ffe6de; }
.ox-bubble::before { border-top-color: #ffe6de; }
/* Bubble sits high-left of Oxwell so it never covers the monitor or chat. */

/* ---------- Motion (idle + reactions + ambience). Reduced-motion opts out. ---------- */
@media (prefers-reduced-motion: no-preference) {
  /* Waterfall idle: bob + subtle brow-furrow, blink, occasional brow-wipe. */
  .wf-astro { animation: wf-bob 3.4s ease-in-out infinite; }
  @keyframes wf-bob { 0%, 100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(-2%); } }
  .wf-astro[data-step="1"]:not(.astro-react):not(.astro-cheer):not(.astro-hmm) { animation-duration: 3s; }
  .wf-astro[data-step="2"]:not(.astro-react):not(.astro-cheer):not(.astro-hmm) { animation-duration: 2.5s; }
  .wf-light { animation: wf-blinklight 2.2s steps(1) infinite; }
  @keyframes wf-blinklight { 0%, 80% { background: var(--jade); } 81%, 100% { background: var(--amber); } }
  .wf-eye { animation: wf-eye-blink 4.4s ease-in-out infinite; transform-origin: center; }
  .wf-eye-r { animation-delay: .07s; }
  @keyframes wf-eye-blink { 0%, 92%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.1); } }
  .wf-pupil { animation: wf-look 5.4s ease-in-out infinite; }
  @keyframes wf-look { 0%, 40%, 100% { transform: translate(0,0); } 55%, 78% { transform: translate(26%, -8%); } }
  /* Frustrated brow furrow on a loop + the left arm wiping his brow occasionally. */
  .wf-brow-l { animation: wf-furrow 6s ease-in-out infinite; }
  .wf-brow-r { animation: wf-furrow 6s ease-in-out infinite; }
  @keyframes wf-furrow { 0%, 55%, 100% { transform: rotate(0) translateY(0); } 65%, 85% { transform: rotate(var(--f, 8deg)) translateY(18%); } }
  .wf-brow-r { --f: -8deg; }
  .wf-arm-l { animation: wf-wipe 7.5s ease-in-out infinite; }
  @keyframes wf-wipe { 0%, 62%, 100% { transform: rotate(0); } 72% { transform: rotate(-52deg); } 82% { transform: rotate(-46deg); } 90% { transform: rotate(0); } }
  .wf-sweat { animation: wf-sweat 7.5s ease-in infinite; }
  @keyframes wf-sweat { 0%, 40% { opacity: 0; transform: translateY(0); } 48% { opacity: .9; } 60% { opacity: .9; transform: translateY(120%); } 66%, 100% { opacity: 0; transform: translateY(160%); } }
  .wf-crt-scan { animation: wf-scan 5s steps(1) infinite; }
  @keyframes wf-scan { 0%, 88%, 100% { opacity: 1; } 90% { opacity: .4; } 92% { opacity: .9; } }
  .wf-notes span:nth-child(1) { animation: wf-note 5.4s ease-in-out infinite; }
  .wf-notes span:nth-child(3) { animation: wf-note 6.4s ease-in-out infinite reverse; }
  @keyframes wf-note { 0%, 100% { rotate: -7deg; } 50% { rotate: -4deg; } }
  .wf-gantt-now { animation: wf-nowline 2.4s steps(1) infinite; }
  @keyframes wf-nowline { 50% { opacity: .35; } }
  /* (Old office-worker motion replaced by the pixel-art office scene near EOF.) */
  /* Reactions (JS toggles astro-react / astro-cheer / astro-hmm on #waterfall). */
  .wf-astro.astro-react { animation: wf-nod .6s ease-out; }
  @keyframes wf-nod { 0% { transform: translateX(-50%) translateY(0) rotate(0); } 30% { transform: translateX(-50%) translateY(3%) rotate(-2deg); } 100% { transform: translateX(-50%) translateY(0) rotate(0); } }
  .wf-astro.astro-react .wf-arm-r { animation: wf-wave .6s ease-out; }
  @keyframes wf-wave { 0%, 100% { transform: rotate(0); } 40% { transform: rotate(-26deg); } }
  .wf-astro.astro-react .wf-pupil { animation: wf-spark .6s ease-out; }
  @keyframes wf-spark { 0% { background: var(--shell); } 35% { background: var(--amber); box-shadow: 0 0 6px var(--amber); transform: scale(1.25); } 100% { background: var(--shell); } }
  .wf-astro.astro-cheer { animation: wf-cheer .9s cubic-bezier(.23,1,.32,1); }
  @keyframes wf-cheer { 0% { transform: translateX(-50%) translateY(0) rotate(0); } 30% { transform: translateX(-50%) translateY(-8%) rotate(-3deg); } 55% { transform: translateX(-50%) translateY(0) rotate(2deg); } 78% { transform: translateX(-50%) translateY(-4%); } 100% { transform: translateX(-50%) translateY(0) rotate(0); } }
  .wf-astro.astro-cheer .wf-arm-l { animation: wf-armup .9s ease-out; }
  .wf-astro.astro-cheer .wf-arm-r { animation: wf-armup .9s ease-out; }
  @keyframes wf-armup { 0%, 100% { transform: rotate(0); } 45% { transform: rotate(-40deg); } }
  .wf-astro.astro-cheer .wf-arm-r { --s: 1; animation-name: wf-armup-r; }
  @keyframes wf-armup-r { 0%, 100% { transform: rotate(0); } 45% { transform: rotate(40deg); } }
  .wf-astro.astro-cheer .wf-mouth { animation: wf-grin .9s ease-out; }
  @keyframes wf-grin { 0%, 100% { transform: scaleX(1); } 40% { transform: scaleX(1.35); } }
  .wf-astro.astro-hmm { animation: wf-tilt .8s ease-in-out; }
  @keyframes wf-tilt { 0%, 100% { transform: translateX(-50%) rotate(0); } 35%, 65% { transform: translateX(-50%) rotate(4deg) translateY(1%); } }
  .wf-astro.astro-hmm .wf-mouth { animation: wf-flat .8s ease-in-out; }
  @keyframes wf-flat { 0%, 100% { transform: scaleX(1); } 40%, 70% { transform: scaleX(.6) translateY(30%); } }

  /* Oxwell bay ambience: strobe strip, rotating beacons, wavering gauge, steam, sparks. */
  .ox-bay[data-o2="critical"] .ox-strip span { animation: ox-strobe 1s steps(1) infinite; }
  .ox-bay[data-o2="critical"] .ox-strip span:nth-child(even) { animation-delay: .5s; }
  @keyframes ox-strobe { 0%, 50% { background: #401318; } 51%, 100% { background: var(--danger); } }
  .ox-bay[data-o2="critical"] .ox-beacon span { animation: ox-rotate 1.6s linear infinite; }
  .ox-beacon-r span { animation-delay: .8s; }
  @keyframes ox-rotate { to { transform: rotate(360deg); } }
  .ox-bay[data-o2="critical"] .ox-beacon::before { animation: ox-beacon-glow 1.4s ease-in-out infinite; }
  @keyframes ox-beacon-glow { 0%, 100% { box-shadow: 0 0 8px #ff5a4466, 0 0 0 3px var(--ink); } 50% { box-shadow: 0 0 22px #ff5a44dd, 0 0 0 3px var(--ink); } }
  .ox-bay[data-o2="critical"] .ox-g2-fill { animation: ox-waver 1.1s ease-in-out infinite; }
  @keyframes ox-waver { 0%, 100% { width: 7%; } 30% { width: 11%; background: #ff8f7c; } 60% { width: 6%; } 80% { width: 9%; background: #ff8f7c; } }
  .ox-bay[data-o2="critical"] .ox-gauge2 { animation: ox-gauge-flash 1s steps(1) infinite; }
  @keyframes ox-gauge-flash { 0%, 60% { color: var(--danger); } 61%, 100% { color: #fff; } }
  .ox-bay[data-o2="critical"] .ox-monitor { animation: ox-mon-flicker 2.4s steps(1) infinite; }
  @keyframes ox-mon-flicker { 0%, 90%, 100% { opacity: 1; } 93% { opacity: .55; } 96% { opacity: 1; } }
  .ox-bay[data-o2="critical"] .ox-steam { animation: ox-steam 3.4s ease-out infinite; }
  @keyframes ox-steam { 0% { opacity: 0; transform: translateY(0) scaleX(.7); } 20% { opacity: .55; } 100% { opacity: 0; transform: translateY(-80%) scaleX(1.5); } }
  .ox-bay[data-o2="critical"] .ox-sparks span { animation: ox-spark 2.8s steps(1) infinite; }
  .ox-bay[data-o2="critical"] .ox-sparks span:nth-child(2) { animation-delay: .9s; }
  .ox-bay[data-o2="critical"] .ox-sparks span:nth-child(3) { animation-delay: 1.7s; }
  @keyframes ox-spark { 0%, 88%, 100% { opacity: 0; transform: translateY(0); } 90% { opacity: 1; } 96% { opacity: .6; transform: translateY(140%); } }
  /* (Old conveyor/worker motion replaced by the pixel-art factory scene near EOF.) */
  /* Oxwell figure: frantic fret + darting eyes + dripping sweat + flailing arm. */
  .ox-eng { animation: ox-fret 1.15s ease-in-out infinite; }
  @keyframes ox-fret { 0%, 100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(-1.8%); } }
  .ox-pupil { animation: ox-dart 1.4s steps(1) infinite; }
  @keyframes ox-dart { 0%, 40% { transform: translate(0,0); } 45%, 70% { transform: translate(-32%,0); } 75%, 100% { transform: translate(32%,0); } }
  .ox-eye { animation: ox-blink 3s ease-in-out infinite; transform-origin: center; }
  .ox-eye-r { animation-delay: .06s; }
  @keyframes ox-blink { 0%, 90%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.15); } }
  .ox-sweat { animation: ox-drip 2.2s ease-in infinite; }
  .ox-sweat-2 { animation-delay: .9s; } .ox-sweat-3 { animation-delay: 1.5s; }
  @keyframes ox-drip { 0% { transform: translateY(0); opacity: 0; } 12% { opacity: .95; } 82% { transform: translateY(180%); opacity: .85; } 100% { transform: translateY(220%); opacity: 0; } }
  .ox-arm-r { animation: ox-flail 1.15s ease-in-out infinite; }
  @keyframes ox-flail { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-16deg); } }
  /* Reactions (JS toggles eng-relieved / eng-spike / eng-calm on #oxwell). */
  .ox-eng.eng-spike { animation: ox-spike .55s cubic-bezier(.23,1,.32,1); }
  @keyframes ox-spike { 0%, 100% { transform: translateX(-50%) translateY(0); } 20% { transform: translateX(-52%) translateY(-5%); } 40% { transform: translateX(-48%) translateY(-5%); } 60% { transform: translateX(-51%) translateY(-2%); } }
  .ox-eng.eng-relieved { animation: ox-relief .7s ease-out; }
  @keyframes ox-relief { 0% { transform: translateX(-50%) translateY(0) rotate(0); } 40% { transform: translateX(-50%) translateY(-4%) rotate(2deg); } 100% { transform: translateX(-50%) translateY(0) rotate(0); } }
  .ox-eng.eng-relieved .ox-arm-r { animation: ox-thumbs .7s ease-out; }
  @keyframes ox-thumbs { 0%, 100% { transform: rotate(0); } 45% { transform: rotate(-30deg); } }
  /* Calm: slow easy sway, no darting/flailing. */
  .ox-eng.eng-calm { animation: ox-easy 3.6s ease-in-out infinite; }
  @keyframes ox-easy { 0%, 100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(-2%); } }
  .ox-eng.eng-calm .ox-pupil, .ox-eng.eng-calm .ox-arm-r { animation: none; }
  .ox-eng.eng-calm.eng-relieved { animation: ox-relief .7s ease-out, ox-easy 3.6s ease-in-out .7s infinite; }

  /* Speech bubble pop-in + drift-out. */
  .npc-bubble { animation: npc-bubble-in .32s cubic-bezier(.23,1,.32,1); }
  @keyframes npc-bubble-in { 0% { opacity: 0; transform: translateX(-50%) translateY(8px) scale(.85); } 100% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); } }
  .npc-bubble[data-leaving="true"] { animation: npc-bubble-out .3s ease-in forwards; }
  @keyframes npc-bubble-out { 0% { opacity: 1; transform: translateX(-50%) translateY(0); } 100% { opacity: 0; transform: translateX(-50%) translateY(-8px); } }
}
/* Reduced-motion: keep readable static cues, no movement. */
@media (prefers-reduced-motion: reduce) {
  .wf-astro.astro-react .wf-pupil, .wf-astro.astro-cheer .wf-pupil { background: var(--amber); }
  .ox-bay[data-o2="stable"] .ox-mouth { background: var(--jade); }
}

/* Portrait / narrow: the redesigned characters may be tall; keep them clear of
   the chat by capping their height and re-anchoring, mirroring the split stack. */
@media (max-width: 720px), (orientation: portrait) {
  .wf-astro, .ox-eng { width: clamp(120px, 44cqw, 200px); bottom: 4%; }
  .npc-bubble { bottom: 70%; font-size: clamp(10px, 2cqw, 14px); }
}

/* =====================================================================
   SCENE ENVIRONMENTS v2 — pixel-art OFFICE (Waterfall) + FACTORY (Oxwell).
   Static SVG in index.html (.wf-office / .ox-factory); this block only sizes,
   dims and animates it. Purely decorative: no chat/validator/gating/guidance
   hooks. The environments sit behind every wall prop and the characters
   (z-index 0 < desk band/props 1-2 < NPC 6); dimmed so the NPC stays the
   brightest, most-forward figure. Under reduced motion every animation is
   cancelled and each scene rests on its complete still frame.
   ===================================================================== */
.wf-den .wf-office, .ox-bay .ox-factory { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.wf-den .wf-office { filter: brightness(.78) saturate(.85); }
.ox-bay .ox-factory { filter: brightness(.74) saturate(.9); }
/* stroke:none cancels the global icon-SVG stroke (svg { stroke: currentColor }). */
.scene-art { display: block; width: 100%; height: 100%; image-rendering: pixelated; stroke: none; stroke-width: 1; }
.scene-art .wk-stride { opacity: 0; }
.scene-art :is(.wk-face, .tend-arm, .ox-roller) { transform-box: fill-box; }
.scene-art .wk-face { transform-origin: 50% 100%; }
.scene-art .tend-arm { transform-origin: 50% 0; }
.scene-art .ox-roller { transform-origin: 50% 50%; }
.scene-art .ox-needle, .scene-art .wf-clock-hand { transform-box: fill-box; transform-origin: 0 50%; }
/* Waterfall wall props now pin to the boards instead of floating over the office. */
.wf-den .wf-notes span { width: clamp(14px, 4cqw, 28px); left: auto; right: auto; }
.wf-den .wf-notes span:nth-child(1) { top: 20%; left: 30%; }
.wf-den .wf-notes span:nth-child(2) { top: 3%; left: 36%; }
.wf-den .wf-notes span:nth-child(3) { top: 21%; right: 30%; }
.wf-den .wf-notes span:nth-child(4) { top: 25%; right: 4%; }
.wf-den .wf-notes span:nth-child(5) { top: 19%; left: 56%; }
.wf-den::before { z-index: 1; box-shadow: inset 0 3px 0 #3f3320, inset 0 6px 0 #14100a, 0 -10px 24px -6px oklch(0.1 0.02 230 / .7); }
/* Critical vs stable factory lighting follows the existing data-o2 hook. */
.ox-bay[data-o2="stable"] .ox-factory { filter: brightness(.78) saturate(.8); }
.ox-bay[data-o2="stable"] .scene-art :is(.ox-warn, .ox-lamp) { fill: #63a89f; }
.ox-bay[data-o2="stable"] .scene-art .ox-cone { fill: #9fd6cc; }

/* Shared side-stripe clean-up: nameplate, incoming chat bubbles, checklist. */
.devscene-nameplate { border-left-color: transparent; border-radius: 3px; background: var(--hud-bg); box-shadow: inset 0 0 0 1px oklch(0.77 0.14 70 / .5), inset 0 1px 0 var(--hairline-hi), 0 6px 16px -8px oklch(0.08 0.02 230 / .85); }
.devchat-msg.in { border-left-color: transparent; border-radius: 3px 10px 10px 10px; box-shadow: 0 1px 2px #0006, inset 0 0 0 1px #4e868566, inset 0 1px 0 var(--hairline-hi); }
.devchat-msg.out { border-radius: 10px 3px 10px 10px; box-shadow: 0 1px 2px #0006, inset 0 1px 0 oklch(0.95 0.07 85 / .5); }
.scene-checklist li { border-left-color: transparent; border-radius: 3px; background: linear-gradient(180deg, oklch(0.28 0.034 222) 0%, var(--charcoal) 100%); box-shadow: inset 0 1px 0 var(--hairline-hi); }
.scene-checklist li[data-state="current"] { border-color: oklch(0.77 0.14 70 / .7); border-left-color: transparent; background: linear-gradient(90deg, oklch(0.77 0.14 70 / .18), oklch(0.77 0.14 70 / .05) 70%), var(--charcoal); box-shadow: inset 2px 0 0 var(--amber), 0 0 14px -6px var(--glow-amber); }
.scene-checklist li[data-state="done"] { background: linear-gradient(90deg, oklch(0.57 0.06 195 / .16), transparent 70%), var(--charcoal); box-shadow: inset 2px 0 0 var(--jade); }
.scene-checklist li::before { border-radius: 2px; }

@media (prefers-reduced-motion: no-preference) {
  .scene-checklist li[data-state="current"] { animation: guide-focus-v2 2.4s ease-in-out infinite; }
  @keyframes guide-focus-v2 { 0%, 100% { box-shadow: inset 2px 0 0 var(--amber), 0 0 10px -6px var(--glow-amber); } 50% { box-shadow: inset 2px 0 0 var(--amber), 0 0 18px -4px var(--glow-amber); } }
  /* Office life: screens flicker, clock ticks, far coworkers type. */
  .scene-art .wf-scr { animation: wf-scr 4.2s steps(1) infinite; }
  .scene-art .wf-scr:nth-of-type(3n) { animation-delay: -1.4s; }
  .scene-art .wf-scr:nth-of-type(3n+1) { animation-delay: -2.8s; }
  @keyframes wf-scr { 0%, 90%, 100% { opacity: 1; } 93% { opacity: .55; } 96% { opacity: .9; } }
  .scene-art .wf-clock-hand { animation: wf-tick 60s steps(60) infinite; }
  @keyframes wf-tick { to { transform: rotate(360deg); } }
  .scene-art .wf-lamp { animation: wf-lamp 7s steps(1) infinite; }
  @keyframes wf-lamp { 0%, 96%, 100% { opacity: .6; } 97% { opacity: .15; } 98% { opacity: .6; } }
  .scene-art [class^="wk-type"] { animation: wf-typing .5s steps(1) infinite; }
  .scene-art .wk-type2 { animation-delay: -.2s; } .scene-art .wk-type4 { animation-delay: -.35s; }
  @keyframes wf-typing { 50% { transform: translateY(.6px); } }
  /* Factory life: press ram slams, crew member works the panel, gauge needle quivers. */
  .scene-art .ox-ram { animation: ox-ram 1.8s cubic-bezier(.7, 0, .84, 0) infinite; }
  @keyframes ox-ram { 0%, 40% { transform: translateY(0); } 55%, 68% { transform: translateY(8px); } 100% { transform: translateY(0); } }
  .scene-art .tend-arm { animation: ox-tend 1.4s ease-in-out infinite; }
  @keyframes ox-tend { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-70deg); } }
  .scene-art .ox-needle { animation: ox-needle 1.1s ease-in-out infinite; }
  @keyframes ox-needle { 0%, 100% { transform: rotate(-20deg); } 50% { transform: rotate(25deg); } }
  .ox-bay[data-o2="stable"] .scene-art .ox-needle { animation: ox-needle-calm 4s ease-in-out infinite; }
  @keyframes ox-needle-calm { 0%, 100% { transform: rotate(-40deg); } 50% { transform: rotate(-34deg); } }
  .ox-bay[data-o2="critical"] .scene-art :is(.ox-warn, .ox-lamp) { animation: ox-warn 1s steps(1) infinite; }
  .ox-bay[data-o2="critical"] .scene-art .ox-cone { animation: ox-cone 1s steps(1) infinite; }
  @keyframes ox-warn { 50% { fill: #4a1a1c; } }
  @keyframes ox-cone { 50% { opacity: .015; } }
  @keyframes oxr { to { transform: rotate(360deg); } }
  /* Generated walker / conveyor timelines. */
  .wk-a1{animation:wkm-a1 20.40s linear infinite}@keyframes wkm-a1{0.00%{transform:translateX(0.0px)}19.61%{transform:translateX(46.0px)}50.98%{transform:translateX(110.0px)}57.84%{transform:translateX(110.0px)}92.16%{transform:translateX(0.0px)}}
  .wk-a1 .wk-face{animation:wkf-a1 20.40s linear infinite}@keyframes wkf-a1{0%{transform:scaleX(1)}57.84%{transform:scaleX(1)}57.89%{transform:scaleX(-1)}100%{transform:scaleX(-1)}}
  .wk-a1 .wk-stride{animation:wks-a1 20.40s linear infinite}@keyframes wks-a1{0.00%{opacity:1}1.54%{opacity:1}1.57%{opacity:0}3.11%{opacity:0}3.14%{opacity:1}4.68%{opacity:1}4.71%{opacity:0}6.25%{opacity:0}6.27%{opacity:1}7.82%{opacity:1}7.84%{opacity:0}9.39%{opacity:0}9.41%{opacity:1}10.96%{opacity:1}10.98%{opacity:0}12.52%{opacity:0}12.55%{opacity:1}14.09%{opacity:1}14.12%{opacity:0}15.66%{opacity:0}15.69%{opacity:1}17.23%{opacity:1}17.25%{opacity:0}18.80%{opacity:0}18.82%{opacity:1}19.58%{opacity:1}19.61%{opacity:0}30.37%{opacity:0}30.39%{opacity:1}31.94%{opacity:1}31.96%{opacity:0}33.50%{opacity:0}33.53%{opacity:1}35.07%{opacity:1}35.10%{opacity:0}36.64%{opacity:0}36.67%{opacity:1}38.21%{opacity:1}38.24%{opacity:0}39.78%{opacity:0}39.80%{opacity:1}41.35%{opacity:1}41.37%{opacity:0}42.92%{opacity:0}42.94%{opacity:1}44.49%{opacity:1}44.51%{opacity:0}46.05%{opacity:0}46.08%{opacity:1}47.62%{opacity:1}47.65%{opacity:0}49.19%{opacity:0}49.22%{opacity:1}50.76%{opacity:1}50.78%{opacity:0}57.82%{opacity:0}57.84%{opacity:1}59.39%{opacity:1}59.41%{opacity:0}60.96%{opacity:0}60.98%{opacity:1}62.52%{opacity:1}62.55%{opacity:0}64.09%{opacity:0}64.12%{opacity:1}65.66%{opacity:1}65.69%{opacity:0}67.23%{opacity:0}67.25%{opacity:1}68.80%{opacity:1}68.82%{opacity:0}70.37%{opacity:0}70.39%{opacity:1}71.94%{opacity:1}71.96%{opacity:0}73.50%{opacity:0}73.53%{opacity:1}75.07%{opacity:1}75.10%{opacity:0}76.64%{opacity:0}76.67%{opacity:1}78.21%{opacity:1}78.24%{opacity:0}79.78%{opacity:0}79.80%{opacity:1}81.35%{opacity:1}81.37%{opacity:0}82.92%{opacity:0}82.94%{opacity:1}84.49%{opacity:1}84.51%{opacity:0}86.05%{opacity:0}86.08%{opacity:1}87.62%{opacity:1}87.65%{opacity:0}89.19%{opacity:0}89.22%{opacity:1}90.76%{opacity:1}90.78%{opacity:0}100%{opacity:0}}
  .wk-a1 .wk-stand{animation:wkt-a1 20.40s linear infinite}@keyframes wkt-a1{0.00%{opacity:0}1.54%{opacity:0}1.57%{opacity:1}3.11%{opacity:1}3.14%{opacity:0}4.68%{opacity:0}4.71%{opacity:1}6.25%{opacity:1}6.27%{opacity:0}7.82%{opacity:0}7.84%{opacity:1}9.39%{opacity:1}9.41%{opacity:0}10.96%{opacity:0}10.98%{opacity:1}12.52%{opacity:1}12.55%{opacity:0}14.09%{opacity:0}14.12%{opacity:1}15.66%{opacity:1}15.69%{opacity:0}17.23%{opacity:0}17.25%{opacity:1}18.80%{opacity:1}18.82%{opacity:0}19.58%{opacity:0}19.61%{opacity:1}30.37%{opacity:1}30.39%{opacity:0}31.94%{opacity:0}31.96%{opacity:1}33.50%{opacity:1}33.53%{opacity:0}35.07%{opacity:0}35.10%{opacity:1}36.64%{opacity:1}36.67%{opacity:0}38.21%{opacity:0}38.24%{opacity:1}39.78%{opacity:1}39.80%{opacity:0}41.35%{opacity:0}41.37%{opacity:1}42.92%{opacity:1}42.94%{opacity:0}44.49%{opacity:0}44.51%{opacity:1}46.05%{opacity:1}46.08%{opacity:0}47.62%{opacity:0}47.65%{opacity:1}49.19%{opacity:1}49.22%{opacity:0}50.76%{opacity:0}50.78%{opacity:1}57.82%{opacity:1}57.84%{opacity:0}59.39%{opacity:0}59.41%{opacity:1}60.96%{opacity:1}60.98%{opacity:0}62.52%{opacity:0}62.55%{opacity:1}64.09%{opacity:1}64.12%{opacity:0}65.66%{opacity:0}65.69%{opacity:1}67.23%{opacity:1}67.25%{opacity:0}68.80%{opacity:0}68.82%{opacity:1}70.37%{opacity:1}70.39%{opacity:0}71.94%{opacity:0}71.96%{opacity:1}73.50%{opacity:1}73.53%{opacity:0}75.07%{opacity:0}75.10%{opacity:1}76.64%{opacity:1}76.67%{opacity:0}78.21%{opacity:0}78.24%{opacity:1}79.78%{opacity:1}79.80%{opacity:0}81.35%{opacity:0}81.37%{opacity:1}82.92%{opacity:1}82.94%{opacity:0}84.49%{opacity:0}84.51%{opacity:1}86.05%{opacity:1}86.08%{opacity:0}87.62%{opacity:0}87.65%{opacity:1}89.19%{opacity:1}89.22%{opacity:0}90.76%{opacity:0}90.78%{opacity:1}100%{opacity:1}}
  .wk-a2{animation:wkm-a2 18.80s linear infinite}@keyframes wkm-a2{0.00%{transform:translateX(0.0px)}13.83%{transform:translateX(-36.0px)}51.06%{transform:translateX(-102.0px)}57.45%{transform:translateX(-102.0px)}92.55%{transform:translateX(0.0px)}}
  .wk-a2 .wk-face{animation:wkf-a2 18.80s linear infinite}@keyframes wkf-a2{0%{transform:scaleX(-1)}57.45%{transform:scaleX(-1)}57.50%{transform:scaleX(1)}100%{transform:scaleX(1)}}
  .wk-a2 .wk-stride{animation:wks-a2 18.80s linear infinite}@keyframes wks-a2{0.00%{opacity:1}1.68%{opacity:1}1.70%{opacity:0}3.38%{opacity:0}3.40%{opacity:1}5.08%{opacity:1}5.11%{opacity:0}6.78%{opacity:0}6.81%{opacity:1}8.48%{opacity:1}8.51%{opacity:0}10.19%{opacity:0}10.21%{opacity:1}11.89%{opacity:1}11.91%{opacity:0}13.59%{opacity:0}13.62%{opacity:1}13.80%{opacity:1}13.83%{opacity:0}27.63%{opacity:0}27.66%{opacity:1}29.34%{opacity:1}29.36%{opacity:0}31.04%{opacity:0}31.06%{opacity:1}32.74%{opacity:1}32.77%{opacity:0}34.44%{opacity:0}34.47%{opacity:1}36.14%{opacity:1}36.17%{opacity:0}37.85%{opacity:0}37.87%{opacity:1}39.55%{opacity:1}39.57%{opacity:0}41.25%{opacity:0}41.28%{opacity:1}42.95%{opacity:1}42.98%{opacity:0}44.65%{opacity:0}44.68%{opacity:1}46.36%{opacity:1}46.38%{opacity:0}48.06%{opacity:0}48.09%{opacity:1}49.76%{opacity:1}49.79%{opacity:0}57.42%{opacity:0}57.45%{opacity:1}59.12%{opacity:1}59.15%{opacity:0}60.82%{opacity:0}60.85%{opacity:1}62.53%{opacity:1}62.55%{opacity:0}64.23%{opacity:0}64.26%{opacity:1}65.93%{opacity:1}65.96%{opacity:0}67.63%{opacity:0}67.66%{opacity:1}69.34%{opacity:1}69.36%{opacity:0}71.04%{opacity:0}71.06%{opacity:1}72.74%{opacity:1}72.77%{opacity:0}74.44%{opacity:0}74.47%{opacity:1}76.14%{opacity:1}76.17%{opacity:0}77.85%{opacity:0}77.87%{opacity:1}79.55%{opacity:1}79.57%{opacity:0}81.25%{opacity:0}81.28%{opacity:1}82.95%{opacity:1}82.98%{opacity:0}84.65%{opacity:0}84.68%{opacity:1}86.36%{opacity:1}86.38%{opacity:0}88.06%{opacity:0}88.09%{opacity:1}89.76%{opacity:1}89.79%{opacity:0}91.46%{opacity:0}91.49%{opacity:1}92.53%{opacity:1}92.55%{opacity:0}100%{opacity:0}}
  .wk-a2 .wk-stand{animation:wkt-a2 18.80s linear infinite}@keyframes wkt-a2{0.00%{opacity:0}1.68%{opacity:0}1.70%{opacity:1}3.38%{opacity:1}3.40%{opacity:0}5.08%{opacity:0}5.11%{opacity:1}6.78%{opacity:1}6.81%{opacity:0}8.48%{opacity:0}8.51%{opacity:1}10.19%{opacity:1}10.21%{opacity:0}11.89%{opacity:0}11.91%{opacity:1}13.59%{opacity:1}13.62%{opacity:0}13.80%{opacity:0}13.83%{opacity:1}27.63%{opacity:1}27.66%{opacity:0}29.34%{opacity:0}29.36%{opacity:1}31.04%{opacity:1}31.06%{opacity:0}32.74%{opacity:0}32.77%{opacity:1}34.44%{opacity:1}34.47%{opacity:0}36.14%{opacity:0}36.17%{opacity:1}37.85%{opacity:1}37.87%{opacity:0}39.55%{opacity:0}39.57%{opacity:1}41.25%{opacity:1}41.28%{opacity:0}42.95%{opacity:0}42.98%{opacity:1}44.65%{opacity:1}44.68%{opacity:0}46.36%{opacity:0}46.38%{opacity:1}48.06%{opacity:1}48.09%{opacity:0}49.76%{opacity:0}49.79%{opacity:1}57.42%{opacity:1}57.45%{opacity:0}59.12%{opacity:0}59.15%{opacity:1}60.82%{opacity:1}60.85%{opacity:0}62.53%{opacity:0}62.55%{opacity:1}64.23%{opacity:1}64.26%{opacity:0}65.93%{opacity:0}65.96%{opacity:1}67.63%{opacity:1}67.66%{opacity:0}69.34%{opacity:0}69.36%{opacity:1}71.04%{opacity:1}71.06%{opacity:0}72.74%{opacity:0}72.77%{opacity:1}74.44%{opacity:1}74.47%{opacity:0}76.14%{opacity:0}76.17%{opacity:1}77.85%{opacity:1}77.87%{opacity:0}79.55%{opacity:0}79.57%{opacity:1}81.25%{opacity:1}81.28%{opacity:0}82.95%{opacity:0}82.98%{opacity:1}84.65%{opacity:1}84.68%{opacity:0}86.36%{opacity:0}86.38%{opacity:1}88.06%{opacity:1}88.09%{opacity:0}89.76%{opacity:0}89.79%{opacity:1}91.46%{opacity:1}91.49%{opacity:0}92.53%{opacity:0}92.55%{opacity:1}100%{opacity:1}}
  .wk-f1{animation:wkm-f1 9.40s linear infinite}@keyframes wkm-f1{0.00%{transform:translateX(0.0px)}46.81%{transform:translateX(22.0px)}72.34%{transform:translateX(22.0px)}100.00%{transform:translateX(0.0px)}}
  .wk-f1 .wk-face{animation:wkf-f1 9.40s linear infinite}@keyframes wkf-f1{0%{transform:scaleX(1)}72.34%{transform:scaleX(1)}72.45%{transform:scaleX(-1)}100%{transform:scaleX(-1)}}
  .wk-f1 .wk-stride{animation:wks-f1 9.40s linear infinite}@keyframes wks-f1{0.00%{opacity:0}19.10%{opacity:0}19.15%{opacity:1}22.50%{opacity:1}22.55%{opacity:0}25.90%{opacity:0}25.96%{opacity:1}29.31%{opacity:1}29.36%{opacity:0}32.71%{opacity:0}32.77%{opacity:1}36.12%{opacity:1}36.17%{opacity:0}39.52%{opacity:0}39.57%{opacity:1}42.93%{opacity:1}42.98%{opacity:0}46.33%{opacity:0}46.38%{opacity:1}46.76%{opacity:1}46.81%{opacity:0}72.29%{opacity:0}72.34%{opacity:1}75.69%{opacity:1}75.74%{opacity:0}79.10%{opacity:0}79.15%{opacity:1}82.50%{opacity:1}82.55%{opacity:0}85.90%{opacity:0}85.96%{opacity:1}89.31%{opacity:1}89.36%{opacity:0}92.71%{opacity:0}92.77%{opacity:1}96.12%{opacity:1}96.17%{opacity:0}99.52%{opacity:0}99.57%{opacity:1}99.95%{opacity:1}100.00%{opacity:0}100%{opacity:0}}
  .wk-f1 .wk-stand{animation:wkt-f1 9.40s linear infinite}@keyframes wkt-f1{0.00%{opacity:1}19.10%{opacity:1}19.15%{opacity:0}22.50%{opacity:0}22.55%{opacity:1}25.90%{opacity:1}25.96%{opacity:0}29.31%{opacity:0}29.36%{opacity:1}32.71%{opacity:1}32.77%{opacity:0}36.12%{opacity:0}36.17%{opacity:1}39.52%{opacity:1}39.57%{opacity:0}42.93%{opacity:0}42.98%{opacity:1}46.33%{opacity:1}46.38%{opacity:0}46.76%{opacity:0}46.81%{opacity:1}72.29%{opacity:1}72.34%{opacity:0}75.69%{opacity:0}75.74%{opacity:1}79.10%{opacity:1}79.15%{opacity:0}82.50%{opacity:0}82.55%{opacity:1}85.90%{opacity:1}85.96%{opacity:0}89.31%{opacity:0}89.36%{opacity:1}92.71%{opacity:1}92.77%{opacity:0}96.12%{opacity:0}96.17%{opacity:1}99.52%{opacity:1}99.57%{opacity:0}99.95%{opacity:0}100.00%{opacity:1}100%{opacity:1}}
  .wk-f2{animation:wkm-f2 10.20s linear infinite}@keyframes wkm-f2{0.00%{transform:translateX(0.0px)}49.02%{transform:translateX(-22.0px)}76.47%{transform:translateX(-22.0px)}100.00%{transform:translateX(0.0px)}}
  .wk-f2 .wk-face{animation:wkf-f2 10.20s linear infinite}@keyframes wkf-f2{0%{transform:scaleX(-1)}76.47%{transform:scaleX(-1)}76.57%{transform:scaleX(1)}100%{transform:scaleX(1)}}
  .wk-f2 .wk-stride{animation:wks-f2 10.20s linear infinite}@keyframes wks-f2{0.00%{opacity:0}25.44%{opacity:0}25.49%{opacity:1}28.58%{opacity:1}28.63%{opacity:0}31.72%{opacity:0}31.76%{opacity:1}34.85%{opacity:1}34.90%{opacity:0}37.99%{opacity:0}38.04%{opacity:1}41.13%{opacity:1}41.18%{opacity:0}44.26%{opacity:0}44.31%{opacity:1}47.40%{opacity:1}47.45%{opacity:0}76.42%{opacity:0}76.47%{opacity:1}79.56%{opacity:1}79.61%{opacity:0}82.70%{opacity:0}82.75%{opacity:1}85.83%{opacity:1}85.88%{opacity:0}88.97%{opacity:0}89.02%{opacity:1}92.11%{opacity:1}92.16%{opacity:0}95.25%{opacity:0}95.29%{opacity:1}98.38%{opacity:1}98.43%{opacity:0}100%{opacity:0}}
  .wk-f2 .wk-stand{animation:wkt-f2 10.20s linear infinite}@keyframes wkt-f2{0.00%{opacity:1}25.44%{opacity:1}25.49%{opacity:0}28.58%{opacity:0}28.63%{opacity:1}31.72%{opacity:1}31.76%{opacity:0}34.85%{opacity:0}34.90%{opacity:1}37.99%{opacity:1}38.04%{opacity:0}41.13%{opacity:0}41.18%{opacity:1}44.26%{opacity:1}44.31%{opacity:0}47.40%{opacity:0}47.45%{opacity:1}76.42%{opacity:1}76.47%{opacity:0}79.56%{opacity:0}79.61%{opacity:1}82.70%{opacity:1}82.75%{opacity:0}85.83%{opacity:0}85.88%{opacity:1}88.97%{opacity:1}89.02%{opacity:0}92.11%{opacity:0}92.16%{opacity:1}95.25%{opacity:1}95.29%{opacity:0}98.38%{opacity:0}98.43%{opacity:1}100%{opacity:1}}
  .wk-c1{animation:wkm-c1 20.00s linear infinite}@keyframes wkm-c1{0.00%{transform:translateX(0.0px)}17.00%{transform:translateX(52.0px)}47.00%{transform:translateX(124.0px)}56.00%{transform:translateX(124.0px)}94.00%{transform:translateX(0.0px)}}
  .wk-c1 .wk-face{animation:wkf-c1 20.00s linear infinite}@keyframes wkf-c1{0%{transform:scaleX(1)}56.00%{transform:scaleX(1)}56.05%{transform:scaleX(-1)}100%{transform:scaleX(-1)}}
  .wk-c1 .wk-stride{animation:wks-c1 20.00s linear infinite}@keyframes wks-c1{0.00%{opacity:1}1.57%{opacity:1}1.60%{opacity:0}3.17%{opacity:0}3.20%{opacity:1}4.78%{opacity:1}4.80%{opacity:0}6.38%{opacity:0}6.40%{opacity:1}7.98%{opacity:1}8.00%{opacity:0}9.58%{opacity:0}9.60%{opacity:1}11.18%{opacity:1}11.20%{opacity:0}12.78%{opacity:0}12.80%{opacity:1}14.37%{opacity:1}14.40%{opacity:0}15.97%{opacity:0}16.00%{opacity:1}16.98%{opacity:1}17.00%{opacity:0}24.98%{opacity:0}25.00%{opacity:1}26.58%{opacity:1}26.60%{opacity:0}28.18%{opacity:0}28.20%{opacity:1}29.78%{opacity:1}29.80%{opacity:0}31.38%{opacity:0}31.40%{opacity:1}32.98%{opacity:1}33.00%{opacity:0}34.58%{opacity:0}34.60%{opacity:1}36.18%{opacity:1}36.20%{opacity:0}37.78%{opacity:0}37.80%{opacity:1}39.38%{opacity:1}39.40%{opacity:0}40.97%{opacity:0}41.00%{opacity:1}42.57%{opacity:1}42.60%{opacity:0}44.17%{opacity:0}44.20%{opacity:1}45.77%{opacity:1}45.80%{opacity:0}55.97%{opacity:0}56.00%{opacity:1}57.57%{opacity:1}57.60%{opacity:0}59.17%{opacity:0}59.20%{opacity:1}60.77%{opacity:1}60.80%{opacity:0}62.38%{opacity:0}62.40%{opacity:1}63.98%{opacity:1}64.00%{opacity:0}65.58%{opacity:0}65.60%{opacity:1}67.18%{opacity:1}67.20%{opacity:0}68.78%{opacity:0}68.80%{opacity:1}70.38%{opacity:1}70.40%{opacity:0}71.97%{opacity:0}72.00%{opacity:1}73.58%{opacity:1}73.60%{opacity:0}75.17%{opacity:0}75.20%{opacity:1}76.77%{opacity:1}76.80%{opacity:0}78.38%{opacity:0}78.40%{opacity:1}79.97%{opacity:1}80.00%{opacity:0}81.58%{opacity:0}81.60%{opacity:1}83.18%{opacity:1}83.20%{opacity:0}84.78%{opacity:0}84.80%{opacity:1}86.38%{opacity:1}86.40%{opacity:0}87.98%{opacity:0}88.00%{opacity:1}89.58%{opacity:1}89.60%{opacity:0}91.18%{opacity:0}91.20%{opacity:1}92.78%{opacity:1}92.80%{opacity:0}100%{opacity:0}}
  .wk-c1 .wk-stand{animation:wkt-c1 20.00s linear infinite}@keyframes wkt-c1{0.00%{opacity:0}1.57%{opacity:0}1.60%{opacity:1}3.17%{opacity:1}3.20%{opacity:0}4.78%{opacity:0}4.80%{opacity:1}6.38%{opacity:1}6.40%{opacity:0}7.98%{opacity:0}8.00%{opacity:1}9.58%{opacity:1}9.60%{opacity:0}11.18%{opacity:0}11.20%{opacity:1}12.78%{opacity:1}12.80%{opacity:0}14.37%{opacity:0}14.40%{opacity:1}15.97%{opacity:1}16.00%{opacity:0}16.98%{opacity:0}17.00%{opacity:1}24.98%{opacity:1}25.00%{opacity:0}26.58%{opacity:0}26.60%{opacity:1}28.18%{opacity:1}28.20%{opacity:0}29.78%{opacity:0}29.80%{opacity:1}31.38%{opacity:1}31.40%{opacity:0}32.98%{opacity:0}33.00%{opacity:1}34.58%{opacity:1}34.60%{opacity:0}36.18%{opacity:0}36.20%{opacity:1}37.78%{opacity:1}37.80%{opacity:0}39.38%{opacity:0}39.40%{opacity:1}40.97%{opacity:1}41.00%{opacity:0}42.57%{opacity:0}42.60%{opacity:1}44.17%{opacity:1}44.20%{opacity:0}45.77%{opacity:0}45.80%{opacity:1}55.97%{opacity:1}56.00%{opacity:0}57.57%{opacity:0}57.60%{opacity:1}59.17%{opacity:1}59.20%{opacity:0}60.77%{opacity:0}60.80%{opacity:1}62.38%{opacity:1}62.40%{opacity:0}63.98%{opacity:0}64.00%{opacity:1}65.58%{opacity:1}65.60%{opacity:0}67.18%{opacity:0}67.20%{opacity:1}68.78%{opacity:1}68.80%{opacity:0}70.38%{opacity:0}70.40%{opacity:1}71.97%{opacity:1}72.00%{opacity:0}73.58%{opacity:0}73.60%{opacity:1}75.17%{opacity:1}75.20%{opacity:0}76.77%{opacity:0}76.80%{opacity:1}78.38%{opacity:1}78.40%{opacity:0}79.97%{opacity:0}80.00%{opacity:1}81.58%{opacity:1}81.60%{opacity:0}83.18%{opacity:0}83.20%{opacity:1}84.78%{opacity:1}84.80%{opacity:0}86.38%{opacity:0}86.40%{opacity:1}87.98%{opacity:1}88.00%{opacity:0}89.58%{opacity:0}89.60%{opacity:1}91.18%{opacity:1}91.20%{opacity:0}92.78%{opacity:0}92.80%{opacity:1}100%{opacity:1}}
  .wk-t1{animation:wkm-t1 4.00s linear infinite}@keyframes wkm-t1{0.00%{transform:translateX(0.0px)}}
  .wk-t1 .wk-face{animation:wkf-t1 4.00s linear infinite}@keyframes wkf-t1{0%{transform:scaleX(-1)}100%{transform:scaleX(-1)}}
  .wk-t1 .wk-stride{animation:wks-t1 4.00s linear infinite}@keyframes wks-t1{0.00%{opacity:0}100%{opacity:0}}
  .wk-t1 .wk-stand{animation:wkt-t1 4.00s linear infinite}@keyframes wkt-t1{0.00%{opacity:1}100%{opacity:1}}
  .ox-cargo-hi{animation:oxc-hi 3.2s linear infinite}@keyframes oxc-hi{from{transform:translateX(0)}to{transform:translateX(32px)}}
  .ox-tread-hi{animation:oxt-hi .4s linear infinite}@keyframes oxt-hi{to{stroke-dashoffset:-4}}
  .ox-roller-hi{animation:oxr .6s linear infinite}
  .ox-cargo-lo{animation:oxc-lo 2.8s linear infinite}@keyframes oxc-lo{from{transform:translateX(0)}to{transform:translateX(-28px)}}
  .ox-tread-lo{animation:oxt-lo .4s linear infinite}@keyframes oxt-lo{to{stroke-dashoffset:4}}
  .ox-roller-lo{animation:oxr .6s reverse linear infinite}
  .wk-w1{animation:wkm-w1 9.40s linear infinite}@keyframes wkm-w1{0.00%{transform:translateX(0.0px)}44.68%{transform:translateX(22.0px)}72.34%{transform:translateX(22.0px)}100.00%{transform:translateX(0.0px)}}
  .wk-w1 .wk-face{animation:wkf-w1 9.40s linear infinite}@keyframes wkf-w1{0%{transform:scaleX(1)}72.34%{transform:scaleX(1)}72.45%{transform:scaleX(-1)}100%{transform:scaleX(-1)}}
  .wk-w1 .wk-stride{animation:wks-w1 9.40s linear infinite}@keyframes wks-w1{0.00%{opacity:0}16.97%{opacity:0}17.02%{opacity:1}20.37%{opacity:1}20.43%{opacity:0}23.78%{opacity:0}23.83%{opacity:1}27.18%{opacity:1}27.23%{opacity:0}30.59%{opacity:0}30.64%{opacity:1}33.99%{opacity:1}34.04%{opacity:0}37.39%{opacity:0}37.45%{opacity:1}40.80%{opacity:1}40.85%{opacity:0}44.20%{opacity:0}44.26%{opacity:1}44.63%{opacity:1}44.68%{opacity:0}72.29%{opacity:0}72.34%{opacity:1}75.69%{opacity:1}75.74%{opacity:0}79.10%{opacity:0}79.15%{opacity:1}82.50%{opacity:1}82.55%{opacity:0}85.90%{opacity:0}85.96%{opacity:1}89.31%{opacity:1}89.36%{opacity:0}92.71%{opacity:0}92.77%{opacity:1}96.12%{opacity:1}96.17%{opacity:0}99.52%{opacity:0}99.57%{opacity:1}99.95%{opacity:1}100.00%{opacity:0}100%{opacity:0}}
  .wk-w1 .wk-stand{animation:wkt-w1 9.40s linear infinite}@keyframes wkt-w1{0.00%{opacity:1}16.97%{opacity:1}17.02%{opacity:0}20.37%{opacity:0}20.43%{opacity:1}23.78%{opacity:1}23.83%{opacity:0}27.18%{opacity:0}27.23%{opacity:1}30.59%{opacity:1}30.64%{opacity:0}33.99%{opacity:0}34.04%{opacity:1}37.39%{opacity:1}37.45%{opacity:0}40.80%{opacity:0}40.85%{opacity:1}44.20%{opacity:1}44.26%{opacity:0}44.63%{opacity:0}44.68%{opacity:1}72.29%{opacity:1}72.34%{opacity:0}75.69%{opacity:0}75.74%{opacity:1}79.10%{opacity:1}79.15%{opacity:0}82.50%{opacity:0}82.55%{opacity:1}85.90%{opacity:1}85.96%{opacity:0}89.31%{opacity:0}89.36%{opacity:1}92.71%{opacity:1}92.77%{opacity:0}96.12%{opacity:0}96.17%{opacity:1}99.52%{opacity:1}99.57%{opacity:0}99.95%{opacity:0}100.00%{opacity:1}100%{opacity:1}}
  .wk-w2{animation:wkm-w2 9.80s linear infinite}@keyframes wkm-w2{0.00%{transform:translateX(0.0px)}48.98%{transform:translateX(-20.0px)}73.47%{transform:translateX(-20.0px)}100.00%{transform:translateX(4.0px)}}
  .wk-w2 .wk-face{animation:wkf-w2 9.80s linear infinite}@keyframes wkf-w2{0%{transform:scaleX(-1)}73.47%{transform:scaleX(-1)}73.57%{transform:scaleX(1)}100%{transform:scaleX(1)}}
  .wk-w2 .wk-stride{animation:wks-w2 9.80s linear infinite}@keyframes wks-w2{0.00%{opacity:0}22.40%{opacity:0}22.45%{opacity:1}25.66%{opacity:1}25.71%{opacity:0}28.93%{opacity:0}28.98%{opacity:1}32.19%{opacity:1}32.24%{opacity:0}35.46%{opacity:0}35.51%{opacity:1}38.72%{opacity:1}38.78%{opacity:0}41.99%{opacity:0}42.04%{opacity:1}45.26%{opacity:1}45.31%{opacity:0}48.52%{opacity:0}48.57%{opacity:1}48.93%{opacity:1}48.98%{opacity:0}73.42%{opacity:0}73.47%{opacity:1}76.68%{opacity:1}76.73%{opacity:0}79.95%{opacity:0}80.00%{opacity:1}83.21%{opacity:1}83.27%{opacity:0}86.48%{opacity:0}86.53%{opacity:1}89.74%{opacity:1}89.80%{opacity:0}93.01%{opacity:0}93.06%{opacity:1}96.28%{opacity:1}96.33%{opacity:0}99.54%{opacity:0}99.59%{opacity:1}99.95%{opacity:1}100.00%{opacity:0}100%{opacity:0}}
  .wk-w2 .wk-stand{animation:wkt-w2 9.80s linear infinite}@keyframes wkt-w2{0.00%{opacity:1}22.40%{opacity:1}22.45%{opacity:0}25.66%{opacity:0}25.71%{opacity:1}28.93%{opacity:1}28.98%{opacity:0}32.19%{opacity:0}32.24%{opacity:1}35.46%{opacity:1}35.51%{opacity:0}38.72%{opacity:0}38.78%{opacity:1}41.99%{opacity:1}42.04%{opacity:0}45.26%{opacity:0}45.31%{opacity:1}48.52%{opacity:1}48.57%{opacity:0}48.93%{opacity:0}48.98%{opacity:1}73.42%{opacity:1}73.47%{opacity:0}76.68%{opacity:0}76.73%{opacity:1}79.95%{opacity:1}80.00%{opacity:0}83.21%{opacity:0}83.27%{opacity:1}86.48%{opacity:1}86.53%{opacity:0}89.74%{opacity:0}89.80%{opacity:1}93.01%{opacity:1}93.06%{opacity:0}96.28%{opacity:0}96.33%{opacity:1}99.54%{opacity:1}99.59%{opacity:0}99.95%{opacity:0}100.00%{opacity:1}100%{opacity:1}}
}

/* =====================================================================
   WATERFALL GUIDANCE — copyable Kiro starter prompt + a prominent
   "Stuck? Tap here" help button. Presentation only.
   ===================================================================== */
.kiro-prompt { position: relative; margin: 8px 0 4px; padding: 8px 10px 10px; border: 1px dashed oklch(0.77 0.14 70 / .75); border-radius: 3px;
  background: linear-gradient(180deg, oklch(0.77 0.14 70 / .14), oklch(0.77 0.14 70 / .05)), var(--ink-0);
  box-shadow: inset 0 1px 0 var(--hairline-hi), 0 0 16px -8px var(--glow-amber); }
.kiro-prompt-label { display: flex; align-items: center; gap: 6px; margin-bottom: 5px; color: var(--amber); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.kiro-prompt-label::before { content: "▸"; font-size: 11px; }
.kiro-prompt-text { margin: 0; padding-right: 58px; color: var(--ivory); font: 500 14px/1.4 "Barlow Condensed", monospace; user-select: all; -webkit-user-select: all; cursor: text; text-wrap: pretty; }
.kiro-prompt-copy { position: absolute; top: 6px; right: 6px; min-width: 52px; min-height: 30px; padding: 4px 10px; font-size: 13px; font-weight: 700;
  color: var(--ink); background: var(--amber) linear-gradient(180deg, var(--amber-hi), var(--amber) 60%, var(--amber-lo)); border: 1px solid oklch(0.58 0.12 60); border-radius: 2px;
  box-shadow: inset 0 1px 0 oklch(0.95 0.07 85 / .6); }
.kiro-prompt-copy:not(:disabled):hover { color: var(--ink); filter: brightness(1.06); }
.kiro-prompt-copy:active { transform: scale(.96); }
.kiro-prompt[data-copied="true"] { border-style: solid; border-color: var(--jade); }
.kiro-prompt[data-copied="true"] .kiro-prompt-copy { background: var(--jade); border-color: var(--jade); color: var(--ivory); }
.scene-checklist li .kiro-prompt { margin-top: 7px; }
.scene-checklist li .kiro-prompt-text { font-size: 12.5px; padding-right: 0; padding-bottom: 30px; }
.scene-checklist li .kiro-prompt-copy { top: auto; bottom: 6px; }
.scene-intro-steps .kiro-prompt, .scene-help-steps .kiro-prompt { margin-left: -4px; }

/* The Waterfall help button: big, amber, labelled — clearly the rescue button. */
.devscene-screen:not(.oxwell-screen) .scene-guide-head { flex-wrap: wrap; row-gap: 8px; }
.scene-stuck-btn { flex: 1 1 100%; width: auto; height: auto; min-height: 44px; display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 6px 12px; border-radius: 3px; font-size: 16px; letter-spacing: .04em; text-transform: uppercase;
  background: var(--amber) linear-gradient(180deg, var(--amber-hi), var(--amber) 55%, var(--amber-lo)); border: 1px solid oklch(0.58 0.12 60);
  box-shadow: 0 0 0 2px var(--ink), 0 0 16px -2px oklch(0.77 0.14 70 / .7), inset 0 1px 0 oklch(0.95 0.07 85 / .6); }
.scene-stuck-q { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: var(--amber); font-size: 18px; line-height: 1; box-shadow: inset 0 0 0 2px var(--amber); }
.scene-stuck-label { font-weight: 700; }
.scene-stuck-btn:hover { background: #f8bd6c linear-gradient(180deg, oklch(0.88 0.11 78), var(--amber-hi) 55%, var(--amber)); }
.scene-stuck-btn:active { transform: scale(.97); }
@media (prefers-reduced-motion: no-preference) {
  .scene-stuck-btn { animation: stuck-pulse 1.8s ease-in-out infinite; }
  @keyframes stuck-pulse {
    0%, 100% { box-shadow: 0 0 0 2px var(--ink), 0 0 12px -4px oklch(0.77 0.14 70 / .6), inset 0 1px 0 oklch(0.95 0.07 85 / .6); }
    50% { box-shadow: 0 0 0 2px var(--ink), 0 0 0 5px oklch(0.77 0.14 70 / .28), 0 0 24px 0 oklch(0.77 0.14 70 / .8), inset 0 1px 0 oklch(0.95 0.07 85 / .6); }
  }
}