/* ── Groundwork theme: DEAD ZONE terminal ─────────────────────────────────────
   The station at night. Dark world, phosphor accents, paper only for
   documents (they glow against the dark — you read by headlamp).
   One-file theme seam preserved. Legibility is law: high contrast, big
   targets, reduced-motion honored everywhere. */

:root {
  --gw-bg: #101411;            /* station dark */
  --gw-panel: #171c18;         /* card surface */
  --gw-panel-2: #1e241f;       /* raised card */
  --gw-ink: #d8e2d8;           /* phosphor-white text */
  --gw-dim: #7d8a7e;           /* muted text */
  --gw-accent: #57c787;        /* phosphor green */
  --gw-amber: #d8a04a;         /* caution amber (bar corridor, gates) */
  --gw-danger: #d4604f;
  --gw-rule: #2c342d;          /* hairlines */
  --gw-paper: #efe9da;         /* documents only */
  --gw-paper-ink: #25231d;
  --gw-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --gw-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --gw-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; background: var(--gw-bg); color: var(--gw-ink); font-family: var(--gw-body); }
#app { max-width: 560px; margin: 0 auto; padding: 10px 12px calc(76px + env(safe-area-inset-bottom)); min-height: 100dvh; }

/* ── Screen-as-card: every state slides in like a dealt card ── */
.gw-screen { animation: gw-deal 240ms var(--gw-ease); }
@keyframes gw-deal {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) { .gw-screen { animation: none; } }

.gw-header { padding: 10px 2px 6px; }
.gw-header h1 { font-family: var(--gw-mono); font-size: 1rem; letter-spacing: 0.1em; margin: 0 0 2px; color: var(--gw-ink); }
.gw-worldline, .gw-dim { color: var(--gw-dim); font-size: 0.82rem; }

.gw-panel { background: transparent; border: none; padding: 0; margin-top: 6px; }
.gw-panel h2 { font-size: 1rem; margin: 14px 0 6px; }
.gw-panel p { line-height: 1.55; }

/* ── Cards: the universal object ── */
.gw-card, .gw-hero, .gw-callout, .gw-resolution, .gw-item, .gw-preview, .gw-stat {
  background: var(--gw-panel);
  border: 1px solid var(--gw-rule);
  border-radius: 12px;
}
.gw-hero { padding: 16px; margin-bottom: 12px; box-shadow: 0 4px 0 #0b0e0c; }
.gw-hero-line { font-size: 1.1rem; font-weight: 650; margin: 4px 0; }
.gw-hero-hook { font-family: var(--gw-mono); font-size: 0.82rem; color: var(--gw-accent); border-top: 1px dashed var(--gw-rule); padding-top: 9px; margin-top: 9px; }
.gw-preview-title { font-family: var(--gw-mono); font-size: 0.7rem; letter-spacing: 0.16em; color: var(--gw-dim); margin-bottom: 4px; }
.gw-identity { margin-top: 14px; font-size: 0.78rem; line-height: 1.6; color: var(--gw-dim); }

button { font: inherit; padding: 12px 16px; margin: 6px 6px 0 0; border-radius: 10px; border: 1px solid var(--gw-rule); background: var(--gw-panel-2); color: var(--gw-ink); cursor: pointer; min-height: 48px; transition: transform 90ms var(--gw-ease), box-shadow 90ms var(--gw-ease); }
button:active { transform: translateY(2px) scale(0.99); }
.gw-primary { background: var(--gw-accent); border-color: var(--gw-accent); color: #0c130e; font-weight: 700; box-shadow: 0 4px 0 #2c6647; }
.gw-primary:active { box-shadow: 0 1px 0 #2c6647; }
.gw-big { width: 100%; font-size: 1.06rem; padding: 16px; }
.gw-danger { color: var(--gw-danger); border-color: var(--gw-danger); background: transparent; }
.gw-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.gw-even { justify-content: center; }
.gw-save-row { margin-top: 18px; border-top: 1px solid var(--gw-rule); padding-top: 12px; }
.gw-row-btn { display: block; width: 100%; text-align: left; padding: 16px; margin: 8px 0; }

.gw-list { padding-left: 20px; line-height: 1.65; }
.gw-callout { border-left: 3px solid var(--gw-accent); padding: 12px 14px; margin: 10px 0; font-size: 0.93rem; }
.gw-script { font-family: var(--gw-mono); font-size: 0.9rem; line-height: 1.6; white-space: pre-wrap; }
.gw-beat { font-style: italic; line-height: 1.55; border-top: 1px dashed var(--gw-rule); padding-top: 9px; color: var(--gw-ink); }
.gw-bigcue { font-size: 1.5rem; font-weight: 700; margin: 18px 0 6px; }
.gw-form summary { cursor: pointer; color: var(--gw-dim); padding: 8px 0; min-height: 32px; }
.gw-center { text-align: center; }
.gw-center .gw-form, .gw-center .gw-list, .gw-center .gw-callout, .gw-center .gw-document, .gw-center .gw-item, .gw-center .gw-resolution, .gw-center .gw-script { text-align: left; }

/* Intake */
.gw-test-name { font-size: 1.5rem; margin: 8px 0 2px; }
.gw-test-standard { font-size: 1.2rem; font-weight: 700; color: var(--gw-accent); margin: 4px 0 14px; }

/* ── Door cards (the navigation verb): two dealt cards ── */
.gw-doors { display: flex; gap: 10px; align-items: stretch; }
.gw-doors .gw-door { flex: 1; margin: 10px 0; }
.gw-door { display: block; text-align: left; padding: 16px 14px; border-radius: 14px;
  background: linear-gradient(180deg, var(--gw-panel-2), var(--gw-panel));
  border: 1px solid var(--gw-rule);
  box-shadow: 0 5px 0 #0b0e0c; min-height: 150px; width: 100%; }
.gw-door:active { transform: translateY(3px); box-shadow: 0 2px 0 #0b0e0c; }
.gw-doors .gw-door:first-child { animation: gw-deal-l 260ms var(--gw-ease); }
.gw-doors .gw-door:last-child { animation: gw-deal-r 260ms var(--gw-ease) 60ms backwards; }
@keyframes gw-deal-l { from { opacity: 0; transform: translateX(-18px) rotate(-1.5deg); } }
@keyframes gw-deal-r { from { opacity: 0; transform: translateX(18px) rotate(1.5deg); } }
@media (prefers-reduced-motion: reduce) { .gw-doors .gw-door { animation: none; } }
.gw-door-name { font-weight: 750; font-size: 1.05rem; }
.gw-door-bias { font-family: var(--gw-mono); font-size: 0.66rem; letter-spacing: 0.14em; color: var(--gw-amber); margin: 6px 0; }
.gw-door-desc { color: var(--gw-dim); font-size: 0.87rem; line-height: 1.4; }

/* Stepper */
.gw-stepper { display: flex; align-items: center; gap: 14px; justify-content: center; margin: 16px 0; }
.gw-step { width: 64px; height: 64px; font-size: 1.8rem; border-radius: 14px; }
.gw-step-num { font-family: var(--gw-mono); font-size: 2.6rem; font-weight: 700; min-width: 84px; text-align: center; }
.gw-step-unit { color: var(--gw-dim); }

/* ── Documents: paper, luminous against the dark ── */
.gw-document { background: var(--gw-paper); color: var(--gw-paper-ink); border: none; border-radius: 4px;
  padding: 14px 16px; margin: 12px 0; box-shadow: 0 6px 18px rgba(0,0,0,0.5), 0 1px 0 rgba(255,255,255,0.06);
  animation: gw-pullout 320ms var(--gw-ease); transform-origin: 50% 90%; }
@keyframes gw-pullout { from { opacity: 0; transform: translateY(22px) rotate(0.6deg); } }
@media (prefers-reduced-motion: reduce) { .gw-document { animation: none; } }
.gw-doc-type { font-family: var(--gw-mono); font-size: 0.66rem; letter-spacing: 0.16em; color: #6e6a5e; }
.gw-doc-title { font-weight: 750; margin: 5px 0 7px; }
.gw-doc-body { font-size: 0.93rem; line-height: 1.6; white-space: pre-wrap; }
.gw-doc-hook { font-family: var(--gw-mono); font-size: 0.8rem; color: #7a4a22; border-top: 1px dashed #cdc5b2; padding-top: 7px; margin-top: 9px; }
.gw-doc-entry summary { cursor: pointer; padding: 8px 0; font-size: 0.93rem; }

.gw-item { border-left: 3px solid var(--gw-amber); border-radius: 0 12px 12px 0; padding: 12px 14px; margin: 12px 0;
  animation: gw-stampin 260ms var(--gw-ease); }
@keyframes gw-stampin { from { opacity: 0; transform: scale(1.08); } }
@media (prefers-reduced-motion: reduce) { .gw-item { animation: none; } }
.gw-item-kind { font-family: var(--gw-mono); font-size: 0.66rem; letter-spacing: 0.16em; color: var(--gw-amber); }
.gw-item-name { font-weight: 750; margin: 3px 0 5px; }

/* ── Dice + resolution payoff ── */
.gw-dice-stage { display: flex; justify-content: center; padding: 22px 0 10px; }
.gw-die { font-family: var(--gw-mono); font-size: 2.8rem; font-weight: 700; width: 110px; height: 110px; display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--gw-accent); border-radius: 18px; background: var(--gw-panel-2); color: var(--gw-accent);
  box-shadow: 0 6px 0 #0b0e0c, 0 0 24px rgba(87,199,135,0.12); }
.gw-die-rolling { animation: gw-shake 0.12s infinite; }
@keyframes gw-shake { 0% { transform: rotate(-3deg) translateX(-2px); } 50% { transform: rotate(3deg) translateX(2px); } 100% { transform: rotate(-2deg); } }
@media (prefers-reduced-motion: reduce) { .gw-die-rolling { animation: none; } }

.gw-resolution { padding: 14px; margin: 12px 0; }
.gw-roll { font-family: var(--gw-mono); font-size: 1.4rem; font-weight: 700; }
.gw-kind { font-family: var(--gw-mono); font-size: 0.9rem; font-weight: 700; letter-spacing: 0.18em; color: var(--gw-accent); margin: 4px 0 8px;
  animation: gw-punch 300ms var(--gw-ease); display: inline-block; }
@keyframes gw-punch { 0% { transform: scale(1.6); opacity: 0; } 60% { transform: scale(0.95); opacity: 1; } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .gw-kind { animation: none; } }
.gw-res-crit { border-color: var(--gw-accent); border-width: 2px; box-shadow: 0 0 28px rgba(87,199,135,0.18); }
.gw-res-strong .gw-kind { color: var(--gw-accent); }
.gw-res-fail .gw-kind { color: var(--gw-dim); }
.gw-res-complication { border-color: var(--gw-danger); }
.gw-res-complication .gw-kind { color: var(--gw-danger); }
.gw-res-encounter { border-color: var(--gw-amber); }

/* ── Rest ring (circular countdown — the rest IS the play window) ── */
.gw-timer { margin: 14px 0; display: flex; flex-direction: column; align-items: center; }
.gw-ring-wrap { position: relative; width: 132px; height: 132px; }
.gw-ring { width: 132px; height: 132px; }
.gw-ring circle { fill: none; stroke-width: 8; }
.gw-ring .gw-ring-bg { stroke: var(--gw-rule); }
.gw-ring .gw-ring-fg { stroke: var(--gw-accent); stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 50%;
  transition: stroke-dashoffset 1s linear; }
.gw-ring-wrap .gw-timer-num { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-family: var(--gw-mono); font-size: 1.7rem; font-weight: 700; }

/* ── Session HUD strip + today's route instrument ── */
.gw-hudwrap { margin-bottom: 8px; }
.gw-hud { display: flex; justify-content: space-between; align-items: center; font-family: var(--gw-mono); font-size: 0.72rem;
  letter-spacing: 0.1em; color: var(--gw-dim); border: 1px solid var(--gw-rule); border-radius: 8px 8px 0 0; padding: 7px 12px; background: var(--gw-panel); }
.gw-hud .gw-hud-stat { color: var(--gw-accent); }
.gw-route { display: flex; align-items: center; padding: 10px 12px 8px; background: var(--gw-panel);
  border: 1px solid var(--gw-rule); border-top: none; border-radius: 0 0 8px 8px; }
.gw-route-entry { width: 4px; height: 15px; background: #3a453c; border-radius: 2px; flex: none; }
.gw-route-seg { flex: 1; height: 3px; background: #3a453c; min-width: 8px; }
.gw-route-cell { width: 17px; height: 17px; border-radius: 5px; border: 1.5px solid var(--gw-rule); background: var(--gw-panel-2); flex: none; }
.gw-rc-lever.gw-rc-cleared { background: #1d3328; border-color: var(--gw-accent); }
.gw-rc-bar.gw-rc-cleared { background: #33291a; border-color: var(--gw-amber); }
.gw-rc-lever.gw-rc-current { border-color: var(--gw-accent); }
.gw-rc-bar.gw-rc-current { border-color: var(--gw-amber); }
.gw-rc-current { border-width: 2.5px; animation: gw-route-pulse 1.6s ease-in-out infinite; }
@keyframes gw-route-pulse { 50% { box-shadow: 0 0 0 4px rgba(87, 199, 135, 0.16); } }
@media (prefers-reduced-motion: reduce) { .gw-rc-current { animation: none; } }
.gw-route-gate { font-family: var(--gw-mono); color: var(--gw-danger); border: 1.5px solid var(--gw-danger); border-radius: 5px;
  width: 19px; height: 19px; display: flex; align-items: center; justify-content: center; font-size: 11px; flex: none; }
.gw-route-here { font-family: var(--gw-mono); font-size: 0.72rem; color: var(--gw-dim); letter-spacing: 0.06em; padding: 6px 2px 0; }

/* Station map view toggle (your band ↔ whole wing) */
.gw-maprow { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.gw-maprow .gw-map-legend { flex: 1; }
.gw-mapview { min-height: 38px; padding: 8px 12px; font-size: 0.8rem; flex: none; }

/* ── Map: chambers, not labels ── */
.gwm { width: 100%; height: auto; display: block; background: var(--gw-panel); border: 1px solid var(--gw-rule); border-radius: 14px; }
.gwm-corridor { stroke: #3a453c; stroke-width: 6; stroke-linecap: round; }
.gwm-corridor-unknown { stroke: var(--gw-rule); stroke-dasharray: 2 9; stroke-width: 4; }
.gwm-chamber rect { fill: var(--gw-panel-2); stroke: var(--gw-rule); stroke-width: 1.5; }
.gwm-lever .gwm-chamber-cleared rect { fill: #1d3328; stroke: var(--gw-accent); }
.gwm-bar .gwm-chamber-cleared rect { fill: #33291a; stroke: var(--gw-amber); }
.gwm-chamber-active rect { stroke-width: 3; }
.gwm-lever .gwm-chamber-active rect { stroke: var(--gw-accent); }
.gwm-bar .gwm-chamber-active rect { stroke: var(--gw-amber); }
.gwm-chamber-locked rect { opacity: 0.35; }
.gwm-chamber-locked text { opacity: 0.4; }
.gwm-glyph { font-size: 13px; }
.gwm-you { animation: gw-you 1.6s ease-in-out infinite; }
@keyframes gw-you { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }
@media (prefers-reduced-motion: reduce) { .gwm-you { animation: none; } }
.gwm-gate rect { fill: var(--gw-bg); stroke: var(--gw-danger); stroke-width: 1.5; }
.gwm-gate text { font-size: 9px; fill: var(--gw-danger); }
.gwm-roomcell { fill: var(--gw-accent); opacity: 0.75; }
.gwm-bar .gwm-roomcell { fill: var(--gw-amber); }
.gwm-roomcount { font-family: var(--gw-mono); font-size: 7.5px; fill: var(--gw-dim); }
.gwm-shortcut { stroke: var(--gw-amber); stroke-width: 2; stroke-dasharray: 6 5; opacity: 0.85; }
.gwm-sealed { font-family: var(--gw-mono); font-size: 8.5px; fill: var(--gw-dim); }
.gwm-corridor-label { font-family: var(--gw-mono); font-size: 8px; fill: var(--gw-dim); letter-spacing: 0.14em; }
.gw-map-legend { margin: 10px 0; font-size: 0.75rem; }
#map-detail { margin-top: 10px; }

/* ── Tab bar ── */
.gw-tabbar { position: fixed; left: 0; right: 0; bottom: 0; display: flex; gap: 6px; padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--gw-bg) 88%, transparent); backdrop-filter: blur(10px); border-top: 1px solid var(--gw-rule); max-width: 560px; margin: 0 auto; }
.gw-tab { flex: 1; min-height: 50px; font-size: 0.85rem; margin: 0; background: transparent; border-color: transparent; color: var(--gw-dim); }
.gw-tab-active { color: var(--gw-accent); font-weight: 750; border-color: var(--gw-rule); background: var(--gw-panel); }

/* Misc */
.gw-stat-row { display: flex; gap: 10px; margin: 12px 0; }
.gw-stat { flex: 1; text-align: center; padding: 12px 4px; }
.gw-stat-num { font-family: var(--gw-mono); font-size: 1.5rem; font-weight: 700; }
.gw-stat-label { color: var(--gw-dim); font-size: 0.72rem; }
.gw-pct { font-size: 0.9rem; color: var(--gw-dim); }
.gw-hook { font-family: var(--gw-mono); font-size: 0.88rem; border: 1px dashed var(--gw-accent); border-radius: 10px; padding: 11px 13px; margin: 10px 0; color: var(--gw-accent); }
.gw-duty { font-family: var(--gw-mono); font-size: 0.76rem; margin: 4px 0; letter-spacing: 0.04em; }
.gw-text { width: 100%; font: inherit; padding: 12px; border: 1px solid var(--gw-rule); border-radius: 10px; margin: 4px 0 8px; background: var(--gw-panel-2); color: var(--gw-ink); }
.gw-textarea { font-family: var(--gw-mono); font-size: 0.78rem; line-height: 1.5; resize: vertical; }
.gw-cal-err { border-left-color: var(--gw-danger); }
.gw-note-row { margin: 8px 0; }
.gw-video-link { display: block; font-size: 0.9rem; color: var(--gw-accent); text-decoration: none; border: 1px solid var(--gw-rule); border-radius: 10px; padding: 12px 14px; margin: 8px 0; background: var(--gw-panel-2); }
.gw-video-link:active { transform: translateY(1px); }
.gw-figures { display: flex; gap: 6px; margin: 10px 0; }
.gw-figures img { flex: 1; min-width: 0; max-width: 33%; border: 1px solid var(--gw-rule); border-radius: 8px; background: var(--gw-panel-2); object-fit: cover; aspect-ratio: 3/4; }
.gw-attempt .gw-bigcue { font-size: 2.4rem; margin: 30px 0; }
.gw-map-reveal { border: 2px solid var(--gw-accent); border-radius: 12px; padding: 14px; margin: 14px 0; background: var(--gw-panel);
  animation: gw-reveal 500ms var(--gw-ease); box-shadow: 0 0 32px rgba(87,199,135,0.18); }
@keyframes gw-reveal { from { transform: scale(0.94); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .gw-map-reveal { animation: none; } }
.gw-explored { margin-top: 4px; font-size: 0.78rem; }

/* ── Sprint 2: cold open + voiced intake ── */
.gw-cold .gw-script { font-size: 0.98rem; }
.gw-intake-voice { margin: 6px 0 12px; border-top: none; padding-top: 0; }

/* ── Work order as a form on Eight's pad ── */
.gw-workorder { margin: 14px 0; }
.gw-order-rows { margin: 10px 0 4px; }
.gw-order-row { display: flex; gap: 12px; padding: 7px 0; border-top: 1px dashed #cdc5b2; font-size: 0.92rem; align-items: baseline; }
.gw-order-row:first-child { border-top: none; }
.gw-order-row > span:first-child { font-family: var(--gw-mono); font-size: 0.66rem; letter-spacing: 0.15em; color: #6e6a5e; min-width: 62px; }
.gw-order-row > span:last-child { font-weight: 650; }
.gw-order-gate > span:last-child { color: #7a4a22; font-weight: 750; }

/* ── Sprint 2: Band 7 live event ── */
.gw-live-dim { color: var(--gw-accent); animation: gw-live-blink 1.4s steps(2) infinite; }
@keyframes gw-live-blink { 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { .gw-live-dim { animation: none; } }
.gw-live .gw-script { border-left: 2px solid var(--gw-accent); padding-left: 12px; margin: 14px 0; }

/* ── Sprint 2: keystone documents ── */
.gw-keystone { border-left: 4px solid #7a4a22; }
.gw-keystone .gw-doc-type { color: #7a4a22; font-weight: 700; }

/* ── Sprint 2: room types ── */
.gw-door-special { color: var(--gw-accent); }
.gw-door-rt { border-color: var(--gw-accent); }
.gw-door-trace { font-style: italic; color: var(--gw-dim); font-size: 0.8rem; line-height: 1.45; border-top: 1px dashed var(--gw-rule); padding-top: 7px; margin-top: 8px; }
.gw-door-locked { opacity: 0.55; }
.gw-door-locked .gw-door-name { color: var(--gw-dim); }

/* ── The chalk wall + ledger (D45) ── */
.gw-newmark { display: flex; align-items: baseline; gap: 10px; border: 1.5px solid var(--gw-accent); border-radius: 10px;
  padding: 11px 13px; margin: 10px 0; background: var(--gw-panel); text-align: left;
  animation: gw-stampin 280ms var(--gw-ease); }
.gw-newmark-stamp { font-family: var(--gw-mono); font-weight: 750; font-size: 0.72rem; letter-spacing: 0.16em;
  color: #0c130e; background: var(--gw-accent); border-radius: 4px; padding: 3px 7px; flex: none; transform: rotate(-1.2deg); }
.gw-newmark > span:last-child { font-size: 0.88rem; line-height: 1.45; }
.gw-lastmark { margin-top: -6px; }
.gw-ledger-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0; }
.gw-ledger-nums { font-family: var(--gw-mono); font-size: 0.95rem; }
.gw-ledger-delta { color: var(--gw-accent); font-weight: 700; margin-left: 6px; }
.gw-spark { width: 84px; height: 20px; flex: none; }
.gw-spark polyline { fill: none; stroke: var(--gw-accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; opacity: 0.9; }
.gw-answer { display: block; width: 100%; text-align: left; margin: 8px 0; }

/* ── Grade reveal (Intake v2, D44) ── */
.gw-grade-stamp { font-family: var(--gw-mono); font-weight: 750; font-size: 1.15rem; letter-spacing: 0.12em;
  color: #7a4a22; border: 2.5px solid #7a4a22; border-radius: 6px; display: inline-block;
  padding: 7px 14px; margin: 8px 0 10px; transform: rotate(-1.6deg);
  animation: gw-stampin 320ms var(--gw-ease); }

/* ── Season framing (D40) ── */
.gw-episode { font-family: var(--gw-mono); letter-spacing: 0.12em; font-size: 0.7rem; color: var(--gw-amber); margin-top: 2px; }
.gw-season-line { color: var(--gw-amber); margin-bottom: 6px; }
.gw-res-special { border-style: dashed; }
.gw-res-sp-quiet { border-color: var(--gw-rule); }
.gw-res-sp-quiet .gw-kind { color: var(--gw-dim); }
.gw-res-sp-echo { border-color: var(--gw-accent); }
.gw-res-sp-cache-open { border-color: var(--gw-amber); }
.gw-res-sp-cache-open .gw-kind, .gw-res-sp-cache-locked .gw-kind { color: var(--gw-amber); }

/* ── Sprint 2: door charge meter (home hero) ── */
.gw-charge { margin: 10px 0 2px; }
.gw-charge-label { font-family: var(--gw-mono); font-size: 0.68rem; letter-spacing: 0.14em; color: var(--gw-amber); margin-bottom: 5px; }
.gw-charge-bar { height: 8px; border-radius: 4px; background: var(--gw-rule); overflow: hidden; }
.gw-charge-fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--gw-amber), var(--gw-accent)); transition: width 600ms var(--gw-ease); }
.gw-charge-note { margin-top: 5px; font-size: 0.76rem; }
.gw-route-pick { margin: 7px 0 2px; font-size: 0.78rem; }
.gw-linklike { background: transparent; border: 1px solid var(--gw-rule); min-height: 30px; padding: 4px 10px; margin: 0 0 0 6px; font-size: 0.78rem; color: var(--gw-accent); border-radius: 7px; }

/* ── Sprint 2: map-as-home additions ── */
.gwm-sil { fill: none; stroke: var(--gw-dim); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; opacity: 0.75; }
.gwm-chamber-locked .gwm-sil { opacity: 0.25; }
.gwm-chamber-cleared .gwm-sil { opacity: 0.9; }
.gwm-lever .gwm-chamber-cleared .gwm-sil { stroke: var(--gw-accent); }
.gwm-bar .gwm-chamber-cleared .gwm-sil { stroke: var(--gw-amber); }
.gwm-today line { stroke: var(--gw-accent); stroke-width: 1.5; stroke-dasharray: 3 3; }
.gwm-today rect { fill: var(--gw-accent); }
.gwm-today text { font-family: var(--gw-mono); font-size: 9px; font-weight: 700; fill: #0c130e; letter-spacing: 0.08em; }
.gwm-charge-bg { fill: var(--gw-rule); }
.gwm-charge-fg { fill: var(--gw-amber); }
.gwm-gate-elected rect:first-of-type { stroke: var(--gw-amber); }
.gwm-gate-elected text { fill: var(--gw-amber); animation: gw-you 1.6s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .gwm-gate-elected text { animation: none; } }
.gwm-meter-bg { fill: var(--gw-rule); }
.gwm-meter-fg { fill: var(--gw-accent); opacity: 0.85; }
.gwm-nextdoor { opacity: 1; fill: var(--gw-ink); }
.gwm-chamber-locked .gwm-nextdoor { opacity: 0.8; }
/* Deep-locked fog: fainter than the named next door, no icons */
.gwm-chamber-fog rect { opacity: 0.22; stroke-dasharray: 4 4; }
.gwm-chamber-fog .gwm-sil { opacity: 0.16; }

/* ── Sprint 2: archive-as-desk ── */
.gw-desk { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin: 12px 0; }
.gw-pile { position: relative; display: block; text-align: left; background: var(--gw-paper); color: var(--gw-paper-ink);
  border: none; border-radius: 4px; padding: 13px 14px; min-height: 104px;
  box-shadow: 0 1px 0 rgba(255,255,255,0.06), 0 7px 16px rgba(0,0,0,0.5); margin: 0; }
.gw-pile::before, .gw-pile::after { content: ''; position: absolute; inset: 0; background: var(--gw-paper);
  border-radius: 4px; z-index: -1; box-shadow: 0 2px 5px rgba(0,0,0,0.35); }
.gw-pile::before { transform: rotate(-1.7deg) translate(-3px, 3px); filter: brightness(0.93); }
.gw-pile::after { transform: rotate(1.1deg) translate(3px, 5px); filter: brightness(0.86); }
.gw-pile:active { transform: translateY(2px); }
.gw-pile-kind { font-family: var(--gw-mono); font-size: 0.64rem; letter-spacing: 0.15em; color: #6e6a5e; }
.gw-pile-count { font-weight: 750; margin: 4px 0 6px; font-size: 0.92rem; }
.gw-pile-top { font-size: 0.78rem; color: #57534a; border-top: 1px dashed #cdc5b2; padding-top: 6px; }
.gw-pile-empty { background: var(--gw-panel); color: var(--gw-dim); border: 1px dashed var(--gw-rule); box-shadow: none; }
.gw-pile-empty::before, .gw-pile-empty::after { display: none; }
.gw-pile-empty .gw-pile-kind { color: var(--gw-dim); }
.gw-pile-kit { background: var(--gw-panel-2); color: var(--gw-ink); border: 1px solid var(--gw-amber); box-shadow: 0 5px 0 #0b0e0c; }
.gw-pile-kit::before, .gw-pile-kit::after { display: none; }
.gw-pile-kit .gw-pile-kind { color: var(--gw-amber); }
.gw-pile-kit .gw-pile-top { color: var(--gw-dim); border-top-color: var(--gw-rule); }
.gw-reader .gw-stack { position: relative; }
.gw-reader .gw-stack::before, .gw-reader .gw-stack::after { content: ''; position: absolute; inset: 12px 0 -4px 0;
  background: var(--gw-paper); border-radius: 4px; z-index: -1; box-shadow: 0 3px 8px rgba(0,0,0,0.4); }
.gw-reader .gw-stack::before { transform: rotate(-1.2deg) translateY(4px); filter: brightness(0.92); }
.gw-reader .gw-stack::after { transform: rotate(0.8deg) translateY(7px); filter: brightness(0.85); }
.gw-reader .gw-document { cursor: pointer; margin-bottom: 4px; }
.gw-leaf-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 14px 0 4px; }
.gw-leaf-row button { min-width: 96px; }
.gw-leaf-row button[disabled] { opacity: 0.35; }

/* ── D54: rest chip in the HUD (the clock is never below the fold) ── */
.gw-hud-rest { color: var(--gw-accent); font-weight: 750; letter-spacing: 0.08em; }

/* ── GW-13 triage: folded fragment on encounter-heavy rests ── */
.gw-doc-folded summary { cursor: pointer; list-style: none; }
.gw-doc-folded summary::-webkit-details-marker { display: none; }
.gw-doc-folded summary .gw-doc-type { display: block; }
.gw-doc-folded summary .gw-doc-title { display: block; font-weight: 750; margin: 5px 0 7px; }
.gw-doc-folded summary .gw-doc-hook { display: block; }
.gw-doc-folded[open] summary .gw-doc-hook { display: none; }

/* ── GW-12: the other corridor's posting ring (static — only TODAY pulses) ── */
.gwm-post { fill: none; stroke: var(--gw-dim); stroke-width: 2; }

/* ── D52: posted-manifest diamond on the map ── */
.gwm-posting { font-size: 12px; fill: var(--gw-amber); }

/* ── D59: the return loop ── */
.gw-return-beat { margin: 2px 0 10px; }
.gw-dayshape { font-family: var(--gw-mono); font-size: 0.74rem; letter-spacing: 0.06em; margin: 3px 0; }
.gw-posting-line { font-family: var(--gw-mono); font-size: 0.74rem; letter-spacing: 0.04em; color: var(--gw-amber); margin: 3px 0; }
.gw-tomorrow { margin-top: 14px; }
.gw-tomorrow .gw-doc-type { color: #7a4a22; font-weight: 700; }
.gw-pips { letter-spacing: 0.2em; color: var(--gw-amber); }

/* ── D61: one-building map ── */
.gwm-hull { fill: rgba(87, 199, 135, 0.025); stroke: var(--gw-rule); stroke-width: 1.5; }

/* ── D61: presentation hierarchy (exercise > workout > game > story) ── */
.gw-form-list { margin: 6px 0 2px; font-size: 0.88rem; }
.gw-work-line { font-size: 1.06rem; font-weight: 650; margin: 4px 0 2px; }
.gw-next-set { font-family: var(--gw-mono); font-size: 0.8rem; color: var(--gw-ink); letter-spacing: 0.04em; margin: 8px 0 2px; }
.gw-prose-fold { margin: 10px 0; }
.gw-prose-fold summary { cursor: pointer; color: var(--gw-dim); font-family: var(--gw-mono); font-size: 0.8rem; padding: 6px 0; list-style: none; }
.gw-prose-fold summary::-webkit-details-marker { display: none; }
.gw-prose-fold summary::before { content: '▸ '; color: var(--gw-accent); }
.gw-prose-fold[open] summary::before { content: '▾ '; }
.gw-hero-story { margin-top: 9px; border-top: 1px dashed var(--gw-rule); padding-top: 8px; }

/* ── D63: the rig tag — the exercise as an object ── */
.gw-rigtag { position: relative; background: var(--gw-panel-2); border: 1px solid #3a453c; border-radius: 6px;
  padding: 16px 16px 12px; margin: 14px 0; text-align: left; box-shadow: 0 5px 0 #0b0e0c; }
.gw-tag-punch { position: absolute; top: 13px; right: 13px; width: 12px; height: 12px; border-radius: 50%;
  border: 2.5px solid #3a453c; background: var(--gw-bg); }
.gw-tag-label { font-family: var(--gw-mono); font-size: 0.66rem; letter-spacing: 0.15em; color: var(--gw-dim); }
.gw-tag-name { font-size: 1.65rem; font-weight: 750; line-height: 1.12; margin: 7px 0 3px; color: var(--gw-ink); }
.gw-tag-aim { font-family: var(--gw-mono); font-size: 1.05rem; margin: 4px 0 10px; }
.gw-tag-aim .gw-dim { font-size: 0.78rem; }
.gw-tag-sets { display: flex; align-items: center; gap: 6px; margin-bottom: 12px; font-size: 0.78rem; }
.gw-tag-pip { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid #3a453c; }
.gw-pip-done { background: var(--gw-dim); border-color: var(--gw-dim); }
.gw-pip-now { border-color: var(--gw-ink); border-width: 2px; }
.gw-tag-cue { border-top: 1px dashed #3a453c; padding-top: 10px; font-size: 0.95rem; line-height: 1.45; }
.gw-tag-more { margin-top: 4px; }
.gw-tag-more summary { font-size: 0.78rem; }

/* ── D63: one instrument bar; route cells ride inside it ── */
.gw-hud { gap: 10px; }
.gw-route { display: inline-flex; align-items: center; gap: 4px; flex: 1; justify-content: center; }
.gw-route-cell { width: 13px; height: 13px; border-radius: 4px; }
.gw-route-gate { width: 15px; height: 15px; font-size: 9px; }
.gw-route-entry, .gw-route-seg, .gw-route-here { display: none; }

/* ── D63: the rest card — the clock is the object mid-rest ── */
.gw-restcard { background: var(--gw-panel); border: 1px solid var(--gw-rule); border-radius: 12px;
  padding: 10px 12px 4px; margin: 12px 0; }
.gw-restcard .gw-next-set { margin: 2px 0 0; }
.gw-restcard .gw-timer { margin: 8px 0 10px; }

/* ── D64: home hero as one object; inline route link; paper dispatch ── */
.gw-inline-link { background: transparent; border: none; color: var(--gw-accent); font-size: 0.85rem;
  padding: 0 2px; margin: 0; min-height: 0; text-decoration: underline dotted; cursor: pointer; }
.gw-stat-paper .gw-stat { background: transparent; border: 1px dashed #cdc5b2; color: var(--gw-paper-ink); }
.gw-stat-paper .gw-stat-label { color: #6e6a5e; }
.gw-document .gw-stat-row { margin: 10px 0 2px; }
.gw-rigtag .gw-test-standard { margin: 4px 0 0; }
