/* FDE Quest — Mission 01 · night-ops console with a parcel-tracking spine */

:root {
  --bg: #0D1420;
  --surface: #131C2B;
  --surface-2: #1A2537;
  --surface-3: #223049;
  --ink: #E8EDF5;
  --ink-2: #9FB0C7;
  --ink-3: #66788F;
  --line: rgba(158, 178, 208, 0.14);
  --amber: #F5B14C;        /* UI signal */
  --amber-deep: #C98120;   /* chart series 1 (validated) */
  --cyan: #2F9DB4;         /* chart series 2 (validated) */
  --violet: #8F6FE0;       /* chart series 3 (validated) */
  --green: #3FA470;        /* status good (validated) */
  --warn: #D9A13B;
  --crit: #D96A5E;
  --radius: 10px;
  --font-display: "Sora", "Space Grotesk", "Avenir Next", sans-serif;
  --font-body: "Plus Jakarta Sans", "Inter", "Helvetica Neue", sans-serif;
  --font-mono: "JetBrains Mono", "IBM Plex Mono", "SF Mono", monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
/* author display rules (e.g. .demo-chip{display:flex}) must not defeat the hidden attribute */
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
}
body::before { /* faint route-grid backdrop */
  content: ""; position: fixed; inset: 0; pointer-events: none; opacity: .5;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(47,157,180,.09), transparent),
    repeating-linear-gradient(0deg, transparent 0 47px, rgba(158,178,208,.03) 47px 48px),
    repeating-linear-gradient(90deg, transparent 0 47px, rgba(158,178,208,.03) 47px 48px);
}

button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
button:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; border-radius: 4px; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.01em; }
.mono { font-family: var(--font-mono); }

/* ---------- header + waybill tracking rail (signature) ---------- */

header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(13, 20, 32, 0.92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-top {
  max-width: 1060px; margin: 0 auto; padding: 14px 24px 10px;
  display: flex; align-items: baseline; gap: 14px;
}
.logo { font-family: var(--font-display); font-weight: 700; font-size: 17px; letter-spacing: .04em; }
.logo em { color: var(--amber); font-style: normal; }
.waybill-no { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); letter-spacing: .08em; }
.hud { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.hud .xp { font-family: var(--font-mono); font-size: 13px; color: var(--amber); position: relative; }
.hud .attempt { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); }
.xp-pop {
  position: absolute; right: 0; top: -4px; font-size: 12px; color: var(--amber);
  animation: xpfloat 1s ease-out forwards; pointer-events: none;
}
@keyframes xpfloat { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-22px); } }

/* the tracking rail: mission progress rendered like a parcel scan timeline */
.rail { max-width: 1060px; margin: 0 auto; padding: 4px 24px 12px; display: flex; align-items: center; }
.stop { display: flex; align-items: center; flex: 1; min-width: 0; }
.stop:last-child { flex: 0; }
.stop .dot {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  border: 2px solid var(--ink-3); display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 10px; color: var(--ink-3);
  transition: all .35s ease; background: var(--bg); position: relative;
}
.stop .lbl {
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .1em; color: var(--ink-3);
  margin-left: 7px; white-space: nowrap; text-transform: uppercase; transition: color .3s;
}
.stop .route { flex: 1; height: 0; border-top: 2px dashed rgba(158,178,208,.22); margin: 0 10px; position: relative; }
.stop.done .dot { border-color: var(--green); color: var(--green); }
.stop.done .route { border-color: rgba(63,164,112,.55); }
.stop.now .dot { border-color: var(--amber); color: var(--bg); background: var(--amber); box-shadow: 0 0 0 4px rgba(245,177,76,.15); }
.stop.now .dot::after {
  content: ""; position: absolute; inset: -7px; border-radius: 50%;
  border: 1px solid rgba(245,177,76,.4); animation: ping 1.8s ease-out infinite;
}
@keyframes ping { 0% { transform: scale(.8); opacity: 1; } 100% { transform: scale(1.35); opacity: 0; } }
.stop.now .lbl { color: var(--amber); }
.stop.done .lbl { color: var(--ink-2); }

/* ---------- stage panels ---------- */

main { max-width: 1060px; margin: 0 auto; padding: 36px 24px 90px; }
.stage { display: none; }
.stage.active { display: block; animation: stagein .45s ease both; }
@keyframes stagein { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.eyebrow {
  display: inline-block; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--amber); border: 1px solid rgba(245,177,76,.35);
  padding: 4px 10px; border-radius: 3px; margin-bottom: 14px;
  background: rgba(245,177,76,.06);
}
.stage h1 { font-size: 34px; line-height: 1.15; margin-bottom: 10px; }
.stage h2 { font-size: 21px; margin-bottom: 8px; }
.lede { color: var(--ink-2); max-width: 62ch; margin-bottom: 22px; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--amber); color: #17110a; font-weight: 600; font-family: var(--font-display);
  padding: 12px 22px; border-radius: 8px; font-size: 15px;
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(245,177,76,.25); }
.btn.ghost { background: transparent; color: var(--ink-2); border: 1px solid var(--line); }
a.btn { text-decoration: none; }
.btn-logout { padding: 8px 14px; font-size: 13px; }
.btn.ghost:hover { color: var(--ink); box-shadow: none; }
.btn:disabled { opacity: .35; cursor: not-allowed; transform: none; box-shadow: none; }

/* ---------- stage 0: briefing ---------- */

.brief-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 22px; margin-top: 24px; }
.client-card { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 18px; }
.avatar {
  width: 46px; height: 46px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--cyan), var(--violet));
  display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; color: #0b1018;
}
.client-meta .nm { font-weight: 600; }
.client-meta .rl { font-size: 12.5px; color: var(--ink-3); }
.quote {
  font-family: var(--font-display); font-size: 18px; line-height: 1.5; color: var(--ink);
  border-left: 3px solid var(--amber); padding-left: 16px; margin: 16px 0 6px;
}
.brief-lines p { color: var(--ink-2); margin-bottom: 10px; }
.metric-tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.tile { background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; }
.tile .v { font-family: var(--font-mono); font-size: 26px; font-weight: 500; color: var(--ink); }
.tile .u { font-size: 14px; color: var(--ink-3); }
.tile .k { font-size: 11.5px; color: var(--ink-3); letter-spacing: .05em; text-transform: uppercase; margin-top: 3px; }
.tile.alert .v { color: var(--crit); }

/* ---------- stage 1: discovery ---------- */

.disc-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 22px; align-items: start; }
.qbudget { font-family: var(--font-mono); font-size: 12px; color: var(--ink-2); margin-bottom: 14px; }
.qbudget b { color: var(--amber); font-weight: 500; }
.qlist { display: flex; flex-direction: column; gap: 8px; }
.qcard {
  text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
  padding: 12px 16px; font-size: 14px; color: var(--ink); width: 100%;
  transition: border-color .2s, background .2s, opacity .3s;
}
.qcard:hover:not(:disabled) { border-color: var(--amber); background: var(--surface-2); }
.qcard:disabled { opacity: .35; cursor: default; }
.qcard.asked { opacity: .45; border-style: dashed; cursor: default; }
.chat { display: flex; flex-direction: column; gap: 12px; min-height: 120px; max-height: 440px; overflow-y: auto; scrollbar-width: thin; padding-right: 4px; }
.bubble { max-width: 92%; padding: 12px 15px; border-radius: 12px; font-size: 14px; animation: stagein .35s ease both; }
.bubble.you { align-self: flex-end; background: var(--surface-3); border-bottom-right-radius: 3px; }
.bubble.client { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--line); border-bottom-left-radius: 3px; color: var(--ink-2); }
.bubble.client b { color: var(--ink); font-weight: 600; }
.bubble .who { font-family: var(--font-mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); display: block; margin-bottom: 4px; }
.lesson-chip { font-size: 12.5px; color: var(--warn); margin-top: 6px; display: block; }

.fieldnotes { position: sticky; top: 120px; }
.fieldnotes h3 { font-size: 13px; font-family: var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 10px; }
.factcard {
  background: rgba(63,164,112,.07); border: 1px solid rgba(63,164,112,.35); border-radius: 8px;
  padding: 10px 13px; margin-bottom: 8px; animation: factin .4s ease both;
}
@keyframes factin { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
.factcard .tag { font-family: var(--font-mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--green); display: block; margin-bottom: 2px; }
.factcard .note { font-size: 13px; color: var(--ink-2); }
.factempty { font-size: 13px; color: var(--ink-3); font-style: italic; }

/* ---------- stages 2–3: choices ---------- */

.optgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 18px; }
.optcard {
  text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; display: flex; flex-direction: column; gap: 9px; position: relative;
  transition: border-color .2s, transform .15s; cursor: pointer; user-select: none;
}
.optcard:hover:not(.locked) { border-color: var(--amber); transform: translateY(-2px); }
.optcard.chosen { border-color: var(--amber); box-shadow: 0 0 0 1px var(--amber); }
.optcard.locked { opacity: .45; pointer-events: none; }
.optcard .nm { font-family: var(--font-display); font-weight: 600; font-size: 16px; }
.optcard .sounds {
  position: absolute; top: 14px; right: 14px; font-family: var(--font-mono); font-size: 9.5px;
  letter-spacing: .08em; text-transform: uppercase; color: var(--violet);
  border: 1px solid rgba(143,111,224,.4); padding: 2px 7px; border-radius: 3px;
}
.optcard .desc { font-size: 13.5px; color: var(--ink-2); }
.mini-diagram { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.mini-diagram .node {
  font-family: var(--font-mono); font-size: 10.5px; color: var(--cyan);
  border: 1px solid rgba(47,157,180,.4); background: rgba(47,157,180,.08);
  padding: 3px 8px; border-radius: 4px;
}
.mini-diagram .arrow { color: var(--ink-3); font-size: 11px; }
.termrow { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.term {
  font-size: 11.5px; color: var(--amber); border-bottom: 1px dotted var(--amber);
  cursor: help; background: none; padding: 0; font-family: var(--font-mono);
}
.proscons { display: none; margin-top: 6px; border-top: 1px dashed var(--line); padding-top: 10px; font-size: 13px; }
.optcard.chosen .proscons { display: block; animation: stagein .3s ease both; }
.proscons .p { color: var(--green); margin-bottom: 3px; }
.proscons .c { color: var(--crit); margin-bottom: 3px; }

.blind-note {
  display: flex; gap: 10px; align-items: center; background: rgba(217,161,59,.08);
  border: 1px solid rgba(217,161,59,.35); border-radius: 8px; padding: 10px 14px;
  font-size: 13px; color: var(--warn); margin: 12px 0 4px;
}
.known-note {
  display: flex; gap: 10px; align-items: center; background: rgba(63,164,112,.06);
  border: 1px solid rgba(63,164,112,.3); border-radius: 8px; padding: 10px 14px;
  font-size: 13px; color: var(--ink-2); margin: 12px 0 4px;
}
.known-note b { color: var(--green); font-weight: 500; }

.decision-block { margin-bottom: 26px; }
.decision-block h3 { font-size: 16px; margin-bottom: 4px; }
.decision-block .dq { font-size: 13.5px; color: var(--ink-2); margin-bottom: 8px; }
.decision-block.pending-lock { opacity: .35; pointer-events: none; }
.optrow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.optrow .optcard { padding: 14px; }
.optrow .optcard .nm { font-size: 14px; }
.optrow .optcard .desc { font-size: 12.5px; }

/* glossary popover */
.gloss {
  position: fixed; z-index: 100; max-width: 320px; background: var(--surface-3);
  border: 1px solid var(--amber); border-radius: 8px; padding: 13px 15px;
  box-shadow: 0 12px 40px rgba(0,0,0,.5); animation: stagein .2s ease both;
}
.gloss .t { font-family: var(--font-display); font-weight: 600; color: var(--amber); font-size: 14px; margin-bottom: 4px; }
.gloss .d { font-size: 13px; color: var(--ink-2); }

/* ---------- stage 4: simulation ---------- */

.simwrap { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 18px; }
.simwrap .panel h3 { font-size: 13px; font-family: var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 12px; }
.pipeline { grid-column: 1 / -1; min-height: 120px; position: relative; overflow: hidden; }
.pipe-svg { width: 100%; height: 150px; display: block; }
.weeklab { font-family: var(--font-mono); font-size: 12px; color: var(--amber); letter-spacing: .1em; margin-bottom: 8px; min-height: 18px; }
.eventlog { display: flex; flex-direction: column; gap: 7px; max-height: 240px; overflow-y: auto; }
.eventlog .evt { display: flex; gap: 9px; font-size: 13px; animation: stagein .3s ease both; }
.evt .wk { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); flex-shrink: 0; padding-top: 1px; }
.evt.good .tx { color: var(--green); } .evt.warn .tx { color: var(--warn); }
.evt.bad .tx { color: var(--crit); } .evt.info .tx { color: var(--ink-2); }
.simcounters { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; grid-column: 1 / -1; }

/* charts */
.chart-figure { width: 100%; }
.chart-title { font-size: 13px; color: var(--ink-2); margin-bottom: 2px; }
.legend { display: flex; gap: 14px; margin: 6px 0 4px; font-size: 11.5px; color: var(--ink-2); }
.legend .sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.chart-svg { width: 100%; height: auto; display: block; }
.chart-svg text { font-family: var(--font-mono); font-size: 10px; fill: var(--ink-3); }
.chart-svg .grid { stroke: rgba(158,178,208,.1); }
.chart-svg .axis { stroke: rgba(158,178,208,.25); }
.chart-tip {
  position: fixed; z-index: 90; background: var(--surface-3); border: 1px solid var(--line);
  border-radius: 6px; padding: 8px 11px; font-size: 12px; pointer-events: none; display: none;
  box-shadow: 0 8px 24px rgba(0,0,0,.45);
}
.chart-tip .r { display: flex; gap: 8px; justify-content: space-between; }
.chart-tip .r b { font-family: var(--font-mono); font-weight: 500; }
details.datatable { margin-top: 8px; font-size: 12px; color: var(--ink-3); }
details.datatable table { width: 100%; border-collapse: collapse; margin-top: 6px; font-family: var(--font-mono); font-size: 11px; }
details.datatable td, details.datatable th { border: 1px solid var(--line); padding: 4px 8px; text-align: right; color: var(--ink-2); }

/* ---------- stage 5: results ---------- */

.score-hero { text-align: center; padding: 34px 20px 26px; }
.score-hero .flabel { font-family: var(--font-mono); font-size: 13px; color: var(--ink-3); letter-spacing: .05em; margin-bottom: 6px; }
.score-big {
  font-family: var(--font-mono); font-size: 84px; font-weight: 500; line-height: 1;
  color: var(--amber); letter-spacing: -0.03em;
}
.score-big .of { font-size: 26px; color: var(--ink-3); }
.score-sub { color: var(--ink-2); margin-top: 8px; }
.cap-note {
  display: inline-flex; gap: 8px; align-items: center; margin-top: 14px;
  background: rgba(217,106,94,.1); border: 1px solid rgba(217,106,94,.45); color: var(--crit);
  border-radius: 8px; padding: 9px 14px; font-size: 13px;
}
.bench-gauge { max-width: 560px; margin: 22px auto 0; }
.gauge-track { height: 10px; background: var(--surface-3); border-radius: 5px; position: relative; }
/* No transition: revealScore() drives this width frame by frame so the bar and
   the number stay locked together. A CSS transition would run its own race. */
.gauge-fill {
  height: 100%; border-radius: 5px; width: 0;
  background: linear-gradient(90deg, var(--amber-deep), var(--amber));
  box-shadow: 0 0 12px rgba(245, 177, 76, .35);
}
.gauge-mark {
  position: absolute; top: -7px; width: 2px; height: 24px; background: var(--ink-3);
  transition: background .25s, box-shadow .25s;
}
.gauge-mark span {
  position: absolute; top: 26px; left: 50%; transform: translateX(-50%);
  font-family: var(--font-mono); font-size: 10px; color: var(--ink-3); white-space: nowrap;
  transition: color .25s;
}
/* lights as the fill goes past it, so passing the cohort median is a moment */
.gauge-mark.passed { background: var(--amber); box-shadow: 0 0 10px var(--amber); }
.gauge-mark.passed span { color: var(--amber); }
.gauge-mark.passed::after {
  content: ""; position: absolute; inset: -6px -5px; border-radius: 4px;
  background: var(--amber); opacity: .55; animation: markPop .5s ease-out forwards;
}
@keyframes markPop { to { opacity: 0; transform: scale(2.1); } }

/* ---- the score, arriving ---- */
#score-n { display: inline-block; font-variant-numeric: tabular-nums; }
.score-big #score-n.counting, .score-small #score-n.counting { animation: scoreBreathe .9s ease-in-out infinite; }
.score-hero.landed #score-n { animation: scoreLand .5s cubic-bezier(.2,1.4,.4,1) both; }
@keyframes scoreBreathe { 50% { opacity: .82; } }
@keyframes scoreLand {
  0% { transform: scale(1.16); text-shadow: 0 0 26px currentColor; }
  100% { transform: scale(1); text-shadow: none; }
}

/* ---- the verdict, stamped once the number stops ---- */
.verdict {
  display: inline-flex; flex-direction: column; align-items: center; gap: 2px;
  margin: 14px auto 0; padding: 9px 20px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface-2);
  opacity: 0; transform: scale(1.5) rotate(-3deg);
}
.verdict.in { animation: stamp .45s cubic-bezier(.2, 1.3, .35, 1) forwards; }
@keyframes stamp {
  0%   { opacity: 0; transform: scale(1.5) rotate(-3deg); }
  60%  { opacity: 1; transform: scale(.94) rotate(0deg); }
  100% { opacity: 1; transform: scale(1) rotate(0deg); }
}
.vd-word { font-family: var(--font-display); font-size: 19px; font-weight: 700; line-height: 1.15; }
.vd-why { font-size: 12.5px; color: var(--ink-3); }
/* --amber is retinted per mission to that client's accent, so a green-accented
   mission would make "Solid" and "Outstanding" the same colour. The three
   verdicts use the fixed status palette instead, which no mission touches. */
.verdict.tier-2 { border-color: var(--green); background: rgba(63, 164, 112, .12); }
.verdict.tier-2 .vd-word { color: var(--green); }
.verdict.tier-1 { border-color: var(--warn); background: rgba(217, 161, 59, .11); }
.verdict.tier-1 .vd-word { color: var(--warn); }
.verdict.tier-0 { border-color: var(--crit); background: rgba(217, 106, 94, .11); }
.verdict.tier-0 .vd-word { color: var(--crit); }
/* the gauge takes the verdict's colour once it has landed */
.score-hero.tier-2 .gauge-fill { background: linear-gradient(90deg, #2c7d55, var(--green)); box-shadow: 0 0 12px rgba(63,164,112,.4); }
.score-hero.tier-1 .gauge-fill { background: linear-gradient(90deg, #96692a, var(--warn)); box-shadow: 0 0 12px rgba(217,161,59,.35); }
.score-hero.tier-0 .gauge-fill { background: linear-gradient(90deg, #9c4a41, var(--crit)); box-shadow: 0 0 12px rgba(217,106,94,.35); }

@media (prefers-reduced-motion: reduce) {
  .verdict { opacity: 1; transform: none; }
  .verdict.in, .score-hero.landed #score-n, .gauge-mark.passed::after { animation: none; }
  .score-big #score-n.counting, .score-small #score-n.counting { animation: none; }
}

.results-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 40px; }
.contrib-row { display: grid; grid-template-columns: 150px 1fr 52px; gap: 10px; align-items: center; margin-bottom: 11px; font-size: 13px; }
.contrib-row .pn { color: var(--ink-2); }
.contrib-row .pn small { display: block; color: var(--ink-3); font-size: 11px; }
.contrib-bar { height: 18px; background: var(--surface-3); border-radius: 4px; overflow: hidden; position: relative; }
.contrib-bar .fill { height: 100%; border-radius: 4px 3px 3px 4px; width: 0; transition: width .9s cubic-bezier(.2,.8,.2,1); background: var(--cyan); }
.contrib-bar .maxmark { position: absolute; top: 0; height: 100%; width: 2px; background: rgba(232,237,245,.35); }
.contrib-row .pv { font-family: var(--font-mono); font-size: 12px; color: var(--ink-2); text-align: right; }
.formula {
  font-family: var(--font-mono); font-size: 13px; color: var(--ink-2); background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 6px; padding: 10px 14px; margin-bottom: 16px; overflow-x: auto; white-space: nowrap;
}
.formula b { color: var(--amber); font-weight: 500; }

.outcome-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 18px; }
.outcome-tiles .tile .delta { font-size: 12px; font-family: var(--font-mono); margin-top: 3px; }
.delta.up { color: var(--green); } .delta.down { color: var(--crit); }

.debrief-list { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.debrief-card { border-left: 3px solid var(--ink-3); background: var(--surface); border-radius: 0 8px 8px 0; padding: 14px 18px; }
.debrief-card.best { border-color: var(--green); }
.debrief-card.risky { border-color: var(--warn); }
.debrief-card.miss, .debrief-card.fail { border-color: var(--crit); }
.debrief-card .dh { display: flex; gap: 10px; align-items: baseline; margin-bottom: 4px; }
.debrief-card .verdict { font-family: var(--font-mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; }
.debrief-card.best .verdict { color: var(--green); } .debrief-card.risky .verdict { color: var(--warn); }
.debrief-card.miss .verdict, .debrief-card.fail .verdict { color: var(--crit); }
.debrief-card .dt { font-weight: 600; font-size: 14px; }
.debrief-card .dd { font-size: 13.5px; color: var(--ink-2); }

.badge-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.badge {
  display: flex; gap: 10px; align-items: center; background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 8px; padding: 10px 14px; opacity: .3;
}
.badge.earned { opacity: 1; border-color: rgba(245,177,76,.5); animation: badgein .5s cubic-bezier(.2,.8,.2,1) both; }
@keyframes badgein { from { transform: scale(.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.badge .ic { font-size: 20px; color: var(--amber); }
.badge .bn { font-size: 13px; font-weight: 600; }
.badge .bc { font-size: 11px; color: var(--ink-3); }

.next-lock {
  margin-top: 26px; border: 1px dashed rgba(158,178,208,.3); border-radius: var(--radius);
  padding: 20px 22px; display: flex; align-items: center; gap: 16px; color: var(--ink-3);
}
.next-lock .lockic { font-size: 22px; }
.next-lock .nm { color: var(--ink-2); font-weight: 600; }

.stage-actions { margin-top: 30px; display: flex; gap: 12px; align-items: center; }
.delivered-stamp {
  display: inline-block; font-family: var(--font-mono); letter-spacing: .2em; font-size: 12px;
  color: var(--green); border: 2px solid var(--green); border-radius: 4px; padding: 5px 12px;
  transform: rotate(-4deg); text-transform: uppercase; opacity: .9; margin-bottom: 14px;
}

/* ---------- responsive + motion ---------- */

@media (max-width: 860px) {
  .brief-grid, .disc-grid, .simwrap, .results-grid { grid-template-columns: 1fr; }
  .optgrid, .optrow { grid-template-columns: 1fr; }
  .outcome-tiles, .simcounters { grid-template-columns: repeat(2, 1fr); }
  .stop .lbl { font-size: 8.5px; }
  .stage h1 { font-size: 26px; }
  .fieldnotes { position: static; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; transition-duration: .001s !important; }
}

/* ---------- v2 additions: field exam + teaser variants ---------- */

.next-lock.unlocked { border-style: solid; border-color: rgba(63,164,112,.4); color: var(--ink-2); }
.next-lock .btn { padding: 9px 16px; font-size: 13.5px; }

.exam-dots { display: flex; gap: 8px; margin: 4px 0 16px; }
.edot {
  width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--ink-3);
  transition: all .25s ease; background: var(--bg);
}
.edot.now { border-color: var(--amber); box-shadow: 0 0 0 4px rgba(245,177,76,.15); }
.edot.right { background: var(--green); border-color: var(--green); }
.edot.wrong { background: var(--crit); border-color: var(--crit); }

.exam-meta { font-size: 11px; letter-spacing: .12em; color: var(--ink-3); margin-bottom: 10px; }
.exam-q { font-family: var(--font-display); font-size: 19px; line-height: 1.45; margin-bottom: 16px; max-width: 70ch; }
.exam-opts { display: flex; flex-direction: column; gap: 8px; max-width: 720px; }
.exam-opt {
  text-align: left; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px;
  padding: 12px 15px; font-size: 14px; color: var(--ink); display: flex; gap: 10px; align-items: baseline;
  transition: border-color .2s, background .2s, opacity .2s;
}
.exam-opt:hover:not(:disabled) { border-color: var(--amber); background: var(--surface-3); }
.exam-opt:disabled { cursor: default; opacity: .75; }
.exam-opt .letter { color: var(--ink-3); font-size: 11px; flex-shrink: 0; }
.exam-opt.is-answer { border-color: var(--green); box-shadow: 0 0 0 1px var(--green); opacity: 1; }
.exam-opt.is-answer .letter { color: var(--green); }
.exam-opt.is-wrong { border-color: var(--crit); box-shadow: 0 0 0 1px var(--crit); opacity: 1; }
.exam-opt.is-wrong .letter { color: var(--crit); }

.exam-verdict { font-family: var(--font-display); font-weight: 600; font-size: 16px; margin: 16px 0 6px; }
.exam-verdict.ok { color: var(--green); }
.exam-verdict.no { color: var(--crit); }
.exam-explain {
  background: rgba(245,177,76,.06); border: 1px solid rgba(245,177,76,.3); border-radius: 8px;
  padding: 12px 16px; font-size: 14px; color: var(--ink-2); max-width: 720px; margin-bottom: 14px;
  animation: stagein .3s ease both;
}
.exam-summary { text-align: center; padding: 22px 10px; }
.exam-concepts { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 16px 0 6px; }
.concept-chip {
  font-family: var(--font-mono); font-size: 11.5px; padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--ink-2);
}
.concept-chip.full { border-color: rgba(63,164,112,.5); color: var(--green); }
.concept-chip.part { border-color: rgba(217,161,59,.5); color: var(--warn); }
.concept-chip.none { border-color: rgba(217,106,94,.5); color: var(--crit); }

/* ---------- v2.1: assistant response feed ---------- */
.respfeed { display: flex; flex-direction: column; gap: 6px; min-height: 150px; max-height: 210px; overflow: hidden; }
.feedempty { font-size: 13px; color: var(--ink-3); font-style: italic; }
.feedrow {
  font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-2);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px;
  padding: 6px 10px; animation: feedin .35s ease both;
}
.feedrow .fa { color: var(--green); font-weight: 500; }
.feedrow .fd { color: var(--amber); font-weight: 500; }
.feedrow .fh { color: var(--violet); font-weight: 500; }
@keyframes feedin { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ---------- v3: post-free-mission unlock band ---------- */
.unlock-band {
  margin-top: 18px; display: grid; grid-template-columns: 1.2fr 1fr; gap: 22px;
  border-color: rgba(245, 177, 76, .55);
  box-shadow: 0 0 0 1px rgba(245, 177, 76, .3), 0 14px 40px rgba(0, 0, 0, .35);
}
.unlock-band .ub-head h2 { margin: 6px 0 8px; }
.unlock-band .ub-head p { font-size: 13.5px; color: var(--ink-2); max-width: 52ch; }
.ub-pitch { border-left: 1px dashed var(--line); padding-left: 22px; display: flex; flex-direction: column; gap: 10px; }
.ub-price { font-size: 30px; color: var(--amber); }
.ub-price span { font-size: 12px; color: var(--ink-3); }
.ub-list { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.ub-list li { font-size: 13px; color: var(--ink-2); padding-left: 20px; position: relative; }
.ub-list li::before { content: "✓"; position: absolute; left: 0; color: var(--green); font-family: var(--font-mono); font-size: 12px; }
.ub-cta { text-align: center; margin-top: 4px; animation: ubpulse 2.2s ease-in-out infinite; }
@keyframes ubpulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(245, 177, 76, .35); } 50% { box-shadow: 0 0 0 7px rgba(245, 177, 76, 0); } }
@media (prefers-reduced-motion: reduce) { .ub-cta { animation: none; } }
@media (max-width: 720px) {
  .unlock-band { grid-template-columns: 1fr; }
  .ub-pitch { border-left: none; padding-left: 0; border-top: 1px dashed var(--line); padding-top: 16px; }
}

/* v3: two-line live-traffic rows */
.respfeed { max-height: 260px; min-height: 190px; }
.feedrow .fq { display: block; color: var(--ink); font-size: 11.5px; margin-bottom: 2px; }
.feedrow .fr { display: block; color: var(--ink-2); }

/* ============================================================= */
/* v4 — chapters, career strip, glyphs, polish, mobile (shared)  */
/* ============================================================= */

/* chapter headers (dashboard mission board + landing curriculum) */
.course-strip-h {
  grid-column: 1 / -1;
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  margin: 26px 0 4px; padding: 10px 14px;
  border-left: 3px solid var(--ch, var(--amber));
  background: linear-gradient(90deg, rgba(255,255,255,.03), transparent 70%);
  border-radius: 0 8px 8px 0;
}
.course-strip-h:first-child { margin-top: 0; }
.course-strip-h .cs-no { font-size: 10.5px; letter-spacing: .2em; color: var(--ch, var(--amber)); }
.course-strip-h .cs-name { font-family: var(--font-display); font-weight: 700; font-size: 17px; color: var(--ink); }
.course-strip-h .cs-tag { font-size: 12.5px; color: var(--ink-3); }
.course-strip-h .cs-prog { margin-left: auto; font-size: 10.5px; color: var(--ink-3); letter-spacing: .1em; }
.course-strip-h.locked .cs-name { color: var(--ink-2); }

/* industry glyphs */
.ind-glyph { display: block; color: var(--ch, var(--amber)); opacity: .9; }

/* career strip on the score page */
.career-strip { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 18px; margin-top: 18px; }
.career-strip .cs-cell { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.career-strip .cs-k { font-size: 10px; letter-spacing: .18em; color: var(--ink-3); }
.career-strip .cs-v { font-family: var(--font-display); font-weight: 700; font-size: 18px; color: var(--ink); }
.career-strip .cs-v small { font-size: 12px; color: var(--ink-3); font-weight: 400; }
.career-strip .cs-sub { font-size: 12px; color: var(--ink-3); }
.career-strip .cs-bar { position: relative; height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.career-strip .cs-bar i { position: absolute; inset: 0 auto 0 0; border-radius: 3px; background: var(--amber);
  transition: width .8s cubic-bezier(.22,1,.36,1); }
.career-strip .good .cs-v { color: var(--green); }
.career-strip .warn .cs-v { color: var(--warn); }

/* gentle life on panels + primary CTAs */
.panel { transition: border-color .25s; }
.panel:hover { border-color: rgba(255,255,255,.14); }
.btn { position: relative; overflow: hidden; }
.btn:not(.ghost)::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%;
  background: linear-gradient(105deg, transparent, rgba(255,255,255,.35), transparent);
  transform: skewX(-20deg); transition: left .5s ease;
}
.btn:not(.ghost):hover::after { left: 120%; }

/* ---------------- mobile: mission player + shared ---------------- */
@media (max-width: 720px) {
  .header-top { flex-wrap: wrap; gap: 10px; padding: 12px 14px; }
  .hud { flex-wrap: wrap; gap: 8px; }
  .gamify-hud { gap: 8px; }
  .gamify-hud .g-bar { width: 90px; }
  .gamify-hud .g-xp { display: none; }           /* focus: rank + bar only */
  main { padding-left: 14px; padding-right: 14px; }
  .stage { padding: 4px 0 40px; }
  .panel { padding: 16px 14px; }
  .score-big { font-size: 56px; }
  .career-strip { grid-template-columns: 1fr 1fr; gap: 14px; }
  .outcome-tiles { grid-template-columns: 1fr 1fr !important; gap: 10px; }
  .exam-opt { padding: 12px 12px; font-size: 14.5px; }
  .stage-actions { flex-direction: column; align-items: stretch; gap: 10px; }
  .stage-actions .btn { width: 100%; text-align: center; }
  .badge-row { grid-template-columns: 1fr !important; }
  .course-strip-h .cs-tag { flex-basis: 100%; }
  .course-strip-h .cs-prog { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .btn:not(.ghost)::after { display: none; }
  .career-strip .cs-bar i { transition: none; }
}

/* ============================================================= */
/* v5 — motion system: reveals, tab bar, press states            */
/* ============================================================= */

[data-rv] { opacity: 0; transform: translateY(16px);
  transition: opacity .55s ease var(--rv-d, 0ms), transform .55s cubic-bezier(.22,1,.36,1) var(--rv-d, 0ms); }
[data-rv].rv-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { [data-rv] { opacity: 1; transform: none; transition: none; } }

/* tactile press feedback everywhere */
.btn:active, .optcard:active, .qcard:active, .exam-opt:active, .drill-chip:active,
.mcard:active, .tab:active { transform: scale(.975); transition: transform .08s; }

/* mobile bottom tab bar */
.tabbar { display: none; }
@media (max-width: 720px) {
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    background: rgba(13, 20, 32, .96); backdrop-filter: blur(10px);
    border-top: 1px solid var(--line);
    padding: 6px max(8px, env(safe-area-inset-left)) max(8px, env(safe-area-inset-bottom));
  }
  .tabbar .tab {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 6px 2px 4px; color: var(--ink-3); text-decoration: none;
    font-family: var(--font-mono); font-size: 9px; letter-spacing: .12em;
    border-radius: 8px; position: relative; transition: color .2s;
  }
  .tabbar .tab svg { width: 22px; height: 22px; }
  .tabbar .tab.on { color: var(--amber); }
  .tabbar .tab.on::before {
    content: ""; position: absolute; top: -7px; left: 50%; transform: translateX(-50%);
    width: 22px; height: 3px; border-radius: 0 0 3px 3px; background: var(--amber);
  }
  body.has-tabbar main { padding-bottom: 96px; }
  /* CTA sits in the page flow (a floating overlay covered content); give it
     room to breathe above the tab bar instead */
  .stage-actions { margin-top: 26px; }
}

/* sparkline draw-in */
.spark { width: 100%; height: 34px; margin-top: 10px; }
.spark polyline { stroke-dasharray: 1; stroke-dashoffset: 1; animation: sparkdraw 1.2s ease-out .3s forwards; }
@keyframes sparkdraw { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .spark polyline { animation: none; stroke-dashoffset: 0; } }

/* ============================================================= */
/* v5 — portraits, icon tiles, option cards, mission-complete    */
/* ============================================================= */

/* client portrait avatar (photo covers initials; initials remain the fallback) */
.avatar { position: relative; overflow: hidden; }
.avatar.has-photo { width: 72px; height: 72px; border: 2px solid var(--cyan); box-shadow: 0 0 0 3px rgba(47,157,180,.18); }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* baseline stat tiles with icons */
.tile { position: relative; }
.tile .tile-ic { width: 26px; height: 26px; color: var(--cyan); margin-bottom: 8px; display: block; }
.tile.alert .tile-ic { color: var(--crit); }

/* architecture option cards: verdict chip, pick check, pros/cons icons */
.optcard { position: relative; transition: transform .18s ease, border-color .2s, box-shadow .2s; }
.optcard:hover { transform: translateY(-2px); }
.optcard .pick-check {
  position: absolute; top: 12px; right: 12px; width: 26px; height: 26px; border-radius: 50%;
  background: var(--amber); color: #17110a; display: grid; place-items: center; font-weight: 700;
  font-size: 14px; transform: scale(0); transition: transform .25s cubic-bezier(.2,1.4,.3,1);
}
.optcard.chosen .pick-check { transform: scale(1); }
.optcard.chosen { border-color: var(--amber); box-shadow: 0 0 0 1px var(--amber), 0 10px 30px rgba(245,177,76,.12); }
.optcard .sounds {
  position: static; display: block; margin-top: 12px; padding: 8px 12px;
  border: 1px solid var(--line); border-radius: 8px;
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink-3); text-align: center;
}
.optcard.chosen .sounds { color: var(--amber); border-color: rgba(245,177,76,.5); }
.optcard .proscons .p, .optcard .proscons .c { display: flex; gap: 8px; align-items: baseline; }
.optcard .proscons .p::before {
  content: "✓"; flex-shrink: 0; width: 15px; height: 15px; border-radius: 50%; font-size: 9.5px;
  display: inline-grid; place-items: center; background: rgba(63,164,112,.18); color: var(--green);
  transform: translateY(2px);
}
.optcard .proscons .c::before {
  content: "–"; flex-shrink: 0; width: 15px; height: 15px; border-radius: 50%; font-size: 11px;
  display: inline-grid; place-items: center; background: rgba(217,106,94,.16); color: var(--crit);
  transform: translateY(2px);
}

/* wide CTAs + reassurance line */
.btn-wide { width: 100%; justify-content: center; text-align: center; }
.stage-actions .reassure { display: block; width: 100%; text-align: center; font-size: 12.5px; color: var(--ink-3); }

/* mission complete hero + promotion banner */
.score-emblem { width: 96px; height: 96px; object-fit: contain; margin: 0 auto 10px; display: block;
  filter: drop-shadow(0 10px 26px rgba(245,177,76,.3)); animation: emblem-pop .7s cubic-bezier(.2,1.4,.3,1) both; }
@keyframes emblem-pop { from { transform: scale(.3) rotate(-8deg); opacity: 0; } to { transform: none; opacity: 1; } }
.mc-eyebrow { font-size: 11.5px; letter-spacing: .24em; color: var(--cyan); margin-bottom: 10px; }
.promo-banner { display: flex; gap: 18px; align-items: center; margin-top: 18px;
  border-color: rgba(245,177,76,.5); background: linear-gradient(100deg, rgba(245,177,76,.1), var(--surface) 60%); }
.promo-banner .pb-img { width: 72px; height: 72px; object-fit: contain; flex-shrink: 0;
  filter: drop-shadow(0 6px 18px rgba(245,177,76,.35)); }
.promo-banner .pb-eyebrow { font-size: 10px; letter-spacing: .2em; color: var(--amber); }
.promo-banner .pb-title { font-family: var(--font-display); font-weight: 700; font-size: 20px; margin: 4px 0 2px; }
.promo-banner .pb-arrow { color: var(--amber); }
.promo-banner .pb-sub { font-size: 13px; color: var(--ink-2); }
/* A promotion happens a handful of times in the whole course, so it gets its
   own beat after the score rather than sliding past with everything else. */
.promo-banner { opacity: 0; transform: translateY(14px); }
.promo-banner.in { animation: promoRise .6s cubic-bezier(.2, .9, .3, 1) forwards; }
@keyframes promoRise { to { opacity: 1; transform: translateY(0); } }
.promo-banner.in .pb-img { animation: promoBadge .8s cubic-bezier(.2, 1.5, .4, 1) .18s both; }
@keyframes promoBadge {
  0%   { transform: scale(.4) rotate(-14deg); opacity: 0; }
  70%  { transform: scale(1.12) rotate(3deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}
/* the light that sweeps across the rank plate as it lands */
.promo-banner.in::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(100deg, transparent 30%, rgba(245,177,76,.22) 50%, transparent 70%);
  animation: promoSweep 1.1s ease-out .3s both;
}
@keyframes promoSweep { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.promo-banner { position: relative; overflow: hidden; }
.promo-banner.in .pb-arrow { animation: arrowNudge .7s ease-out .5s both; }
@keyframes arrowNudge { 0%,100% { transform: translateX(0); } 45% { transform: translateX(5px); } }
@media (prefers-reduced-motion: reduce) {
  .score-emblem, .gamify-promo .pr-img { animation: none; }
  .promo-banner { opacity: 1; transform: none; }
  .promo-banner.in, .promo-banner.in .pb-img, .promo-banner.in::after,
  .promo-banner.in .pb-arrow { animation: none; }
  .promo-banner.in::after { display: none; }
}
@media (max-width: 720px) {
  .promo-banner { flex-direction: column; text-align: center; }
  .avatar.has-photo { width: 64px; height: 64px; }
}

/* desktop: same tab bar as a floating bottom dock */
@media (min-width: 721px) {
  .tabbar {
    display: flex; position: fixed; left: 50%; transform: translateX(-50%); bottom: 18px; z-index: 60;
    background: rgba(19, 28, 43, .94); backdrop-filter: blur(10px);
    border: 1px solid var(--line); border-radius: 999px; padding: 6px 8px; gap: 4px;
    box-shadow: 0 14px 44px rgba(0, 0, 0, .5);
  }
  .tabbar .tab {
    display: flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 999px;
    color: var(--ink-3); text-decoration: none; font-family: var(--font-mono);
    font-size: 10px; letter-spacing: .14em; transition: color .2s, background .2s;
  }
  .tabbar .tab svg { width: 17px; height: 17px; }
  .tabbar .tab:hover { color: var(--ink); }
  .tabbar .tab.on { color: var(--amber); background: rgba(245, 177, 76, .1); }
  body.has-tabbar main { padding-bottom: 110px; }
}

/* ============================================================= */
/* v7 — discovery call: 3-column live-call layout                */
/* ============================================================= */

.disc3 { display: grid; grid-template-columns: 360px 1fr 240px; gap: 18px; align-items: start; }
.disc-left h1 { font-size: 26px; }
.qdots { font-size: 10.5px; letter-spacing: .16em; color: var(--ink-3); margin-bottom: 12px;
  display: flex; align-items: center; gap: 10px; }
.qdots i { display: inline-block; width: 12px; height: 12px; border-radius: 50%;
  background: var(--surface-3); margin-right: 4px; transition: background .3s, box-shadow .3s; }
.qdots i.on { background: var(--amber); box-shadow: 0 0 8px rgba(245,177,76,.5); }

/* numbered question cards with pick check */
.qcard { display: flex; align-items: center; gap: 12px; position: relative; }
.qcard .qnum { flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; display: grid;
  place-items: center; border: 1.5px solid var(--ink-3); color: var(--ink-3); font-size: 11px; }
.qcard .qtxt { flex: 1; }
.qcard .qcheck { flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%; display: grid;
  place-items: center; background: var(--amber); color: #17110a; font-size: 12px; font-weight: 700;
  transform: scale(0); transition: transform .25s cubic-bezier(.2,1.4,.3,1); }
.qcard.asked { opacity: 1; border-color: rgba(245,177,76,.55); border-style: solid; }
.qcard.asked .qcheck { transform: scale(1); }
.qcard.asked .qnum { border-color: var(--amber); color: var(--amber); }
.qcard:disabled:not(.asked) { opacity: .35; }

/* chat window */
.chatpanel .cp-h { font-size: 11px; letter-spacing: .14em; color: var(--ink-3); margin-bottom: 14px;
  display: flex; align-items: center; justify-content: space-between; }
.live { display: inline-flex; align-items: center; gap: 6px; color: var(--green); font-size: 10px; letter-spacing: .14em; }
.live i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); animation: livepulse 1.6s ease-in-out infinite; }
@keyframes livepulse { 0%, 100% { opacity: .4; } 50% { opacity: 1; box-shadow: 0 0 6px var(--green); } }
.msg { display: flex; gap: 10px; align-items: flex-end; }
.msg.you { justify-content: flex-end; }
.b-av { position: relative; border-radius: 50%; overflow: hidden; flex-shrink: 0;
  background: linear-gradient(135deg, var(--cyan), var(--violet)); display: grid; place-items: center; }
.b-av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.b-av .b-init { font-size: 10px; font-weight: 700; color: #0b1018; }
.b-av.you-av { width: 30px; height: 30px; background: var(--surface-3); color: var(--ink-2); }
.msg .bubble { animation: stagein .35s ease both; }

/* field notes cards */
.fieldnotes { margin-top: 16px; }
.factcard { display: flex; gap: 10px; align-items: flex-start; }
.factcard .f-ic { color: var(--green); font-size: 15px; line-height: 1.4; }
.factcard .f-body { flex: 1; min-width: 0; }
.factcard .f-meta { flex-shrink: 0; font-size: 9.5px; color: var(--ink-3); display: flex; gap: 6px; align-items: center; }
.factcard .f-ok { font-style: normal; width: 15px; height: 15px; border-radius: 50%; display: inline-grid;
  place-items: center; background: rgba(63,164,112,.2); color: var(--green); font-size: 9px; }

/* right rail */
.disc-right { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 120px; }
.disc-right .panel { padding: 14px 16px; }
.side-h { display: block; font-size: 9.5px; letter-spacing: .2em; color: var(--ink-3); margin-bottom: 10px; }
.cust-card .cc-top { display: flex; gap: 12px; align-items: center; }
.cust-card .cc-top div { display: flex; flex-direction: column; min-width: 0; }
.cust-card .cc-top b { font-size: 14px; }
.cust-card .cc-top span { font-size: 11.5px; color: var(--ink-3); }
.cust-card .cc-quote { font-size: 12px; color: var(--ink-2); font-style: italic; margin-top: 10px;
  border-left: 2px solid var(--cyan); padding-left: 10px; }
.urgency-card .urg { color: var(--crit); font-family: var(--font-display); font-weight: 700; font-size: 19px; }
.urgency-card span { font-size: 11.5px; color: var(--ink-3); }
.ctx-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 11.5px; color: var(--ink-3); }
.ctx-row .tile-ic { width: 18px; height: 18px; margin: 0; flex-shrink: 0; }
.ctx-row b { color: var(--ink); font-size: 13px; }

/* discovery quality donut */
.donut-wrap { position: relative; width: 84px; margin: 4px auto; }
.donut { width: 84px; height: 84px; transform: rotate(-90deg); }
.d-track { fill: none; stroke: var(--surface-3); stroke-width: 7; }
.d-fill { fill: none; stroke: var(--amber); stroke-width: 7; stroke-linecap: round;
  transition: stroke-dashoffset .8s cubic-bezier(.22,1,.36,1); }
.d-pct { position: absolute; inset: 0; display: grid; place-items: center; font-size: 15px; color: var(--ink); }
.d-label { text-align: center; font-size: 11px; color: var(--ink-3); margin-top: 6px; }

/* bottom progress bar */
.disc-bar { display: flex; align-items: center; gap: 26px; margin: 0 0 18px; padding: 12px 20px;
  position: sticky; top: 112px; z-index: 30; background: rgba(19,28,43,.96); backdrop-filter: blur(8px); }
.db-cell { display: flex; flex-direction: column; gap: 3px; }
.db-k { font-size: 9px; letter-spacing: .18em; color: var(--ink-3); }
.db-v { font-size: 16px; color: var(--ink); }
.db-xp { color: var(--amber); }
.db-cta { margin-left: auto; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.db-cta .reassure { font-size: 10.5px; color: var(--ink-3); }

@media (max-width: 1000px) { .disc3 { grid-template-columns: 1fr 1fr; }
  .disc-right { grid-column: 1 / -1; position: static; flex-direction: row; flex-wrap: wrap; }
  .disc-right .panel { flex: 1 1 200px; } }
@media (max-width: 720px) {
  .disc3 { grid-template-columns: 1fr; }
  .disc-right { order: -1; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .disc-left { order: 1; }
  .disc-mid { order: 2; }
  .disc-right .cust-card { grid-column: 1 / -1; }
  .disc-left h1 { font-size: 22px; }
  .disc-bar { flex-wrap: wrap; gap: 10px 18px; position: static; padding: 12px 14px; }
  .db-cta { flex-basis: 100%; margin-left: 0; }
  .db-cta .btn { width: 100%; justify-content: center; }
  .msg .bubble { max-width: 84%; }
}
@media (prefers-reduced-motion: reduce) { .live i { animation: none; } .d-fill { transition: none; } }

/* question picker: plain list on desktop, collapsible drawer on mobile */
.qp-h { display: none; }
@media (max-width: 720px) {
  .qp-h { display: flex; align-items: center; justify-content: space-between; width: 100%;
    padding: 13px 14px; border: 1px solid rgba(245,177,76,.4); border-radius: 10px;
    background: var(--surface-2); font-size: 10.5px; letter-spacing: .14em; color: var(--amber); }
  .qp-h .rm-chev { transition: transform .25s; color: var(--ink-3); }
  .qpicker.collapsed .qp-h .rm-chev { transform: rotate(-90deg); }
  .qpicker .qlist { margin-top: 10px; }
  .qpicker.collapsed .qlist { display: none; }
  #stage-discovery .disc-left h1, #stage-discovery .disc-left .lede { display: none; } /* bar + picker header carry the context on phones */
}

/* ============================================================= */
/* v7.1 — mobile: floating question FAB + compact mission header */
/* ============================================================= */
@media (max-width: 720px) {
  /* question picker becomes a floating pill + overlay sheet above the chat */
  .qp-h {
    position: fixed; top: 148px; right: 12px; z-index: 45; width: auto;
    border-radius: 999px; padding: 10px 16px; gap: 8px;
    background: var(--amber); color: #17110a; border: none; font-weight: 600;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
  }
  .qp-h .rm-chev { color: #17110a; }
  .qpicker .qlist {
    position: fixed; top: 198px; left: 12px; right: 12px; z-index: 46;
    margin-top: 0; background: var(--surface); border: 1px solid var(--line);
    border-radius: 14px; padding: 12px; max-height: 56dvh; overflow-y: auto;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .65);
  }
  #stage-discovery .qdots { display: none; }  /* the FAB label carries the count */

  /* mission header: row 1 = logo + dispatch + logout, row 2 = attempt/xp */
  body.mission .waybill-no { display: none; }
  body.mission .header-top { flex-wrap: wrap; align-items: center; row-gap: 6px; }
  body.mission .hud { display: contents; }
  body.mission .hud a.btn-logout { order: 1; margin-left: auto; padding: 7px 11px; font-size: 12px; }
  body.mission .hud button.btn-logout { order: 2; padding: 7px 11px; font-size: 12px; }
  body.mission .hud .attempt { order: 3; }
  body.mission .hud .xp { order: 4; }
}

/* FAB: translucent over the chat; solid + pulsing once it becomes the wrap-up CTA */
@media (max-width: 720px) {
  .qp-h { background: rgba(245, 177, 76, .68); backdrop-filter: blur(6px); }
  .qp-h.wrap-ready { background: var(--amber); animation: wrapnudge 2s ease-in-out infinite; }
  @keyframes wrapnudge { 0%, 100% { box-shadow: 0 10px 30px rgba(0,0,0,.5); }
    50% { box-shadow: 0 10px 34px rgba(245,177,76,.55); } }
}
@media (prefers-reduced-motion: reduce) { .qp-h.wrap-ready { animation: none; } }

/* ============================================================= */
/* v7.2 — mobile: liquid-glass floating stage CTAs               */
/* ============================================================= */
@media (max-width: 720px) {
  body.mission .cta-float {
    position: fixed; bottom: 94px; left: 50%; translate: -50% 0; z-index: 45;
    width: auto; min-width: min(300px, calc(100vw - 32px)); max-width: calc(100vw - 24px);
    justify-content: center; border-radius: 999px; padding: 14px 24px;
    background: rgba(245, 177, 76, .6);
    -webkit-backdrop-filter: blur(18px) saturate(170%);
    backdrop-filter: blur(18px) saturate(170%);
    border: 1px solid rgba(255, 255, 255, .4);
    box-shadow: 0 12px 40px rgba(0, 0, 0, .55),
                inset 0 1px 0 rgba(255, 255, 255, .55),
                inset 0 -1px 0 rgba(0, 0, 0, .2);
    color: #17110a; font-weight: 700;
  }
  body.mission .cta-float:disabled {
    background: rgba(34, 48, 73, .55); color: var(--ink-3);
    border-color: rgba(255, 255, 255, .14); opacity: 1; box-shadow: 0 12px 40px rgba(0, 0, 0, .45);
  }
  body.mission main { padding-bottom: 180px; }  /* keep content clear of pill + tab bar */

  /* discovery FAB gets the same glass treatment */
  .qp-h { border: 1px solid rgba(255, 255, 255, .4);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .5);
    -webkit-backdrop-filter: blur(18px) saturate(170%);
    backdrop-filter: blur(18px) saturate(170%); }
}

/* ============================================================= */
/* v8 — route plan: field-note chips, rich cards, details modal, */
/*      decision bar, liquid-glass dock                          */
/* ============================================================= */

.fnotes-row { margin: 4px 0 20px; }
.fn-h { display: block; font-size: 10px; letter-spacing: .2em; color: var(--cyan); margin-bottom: 10px; }
.fact-chips { display: flex; gap: 10px; flex-wrap: wrap; }
.fact-chip { display: flex; gap: 9px; align-items: center; padding: 9px 13px; border: 1px solid rgba(47,157,180,.35);
  border-radius: 10px; background: rgba(47,157,180,.07); max-width: 250px; }
.fact-chip i { font-style: normal; color: var(--cyan); font-size: 15px; }
.fact-chip span { display: flex; flex-direction: column; min-width: 0; }
.fact-chip b { font-family: var(--font-mono); font-size: 9px; letter-spacing: .14em; text-transform: uppercase; color: var(--cyan); }
.fact-chip span > :not(b), .fact-chip { font-size: 12px; color: var(--ink-2); }

.optcard .oc-head { display: flex; gap: 12px; align-items: flex-start; padding-right: 30px; }
.optcard .oc-head > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.arch-ic { width: 34px; height: 34px; flex-shrink: 0; color: var(--amber); padding: 6px;
  border: 1px solid rgba(245,177,76,.35); border-radius: 9px; background: rgba(245,177,76,.07); }
.optcard .proscons.pc2 { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 14px; }
.pc-col { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.pc-h { font-size: 9px; letter-spacing: .18em; }
.pc-h.good { color: var(--green); }
.pc-h.bad { color: var(--crit); }
.oc-foot { display: flex; align-items: flex-end; gap: 10px; }
.oc-terms { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.tap-hint { font-size: 10px; color: var(--ink-3); }
.opt-details { flex-shrink: 0; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .1em;
  color: var(--ink-2); border: 1px solid var(--line); border-radius: 7px; padding: 6px 11px;
  transition: color .2s, border-color .2s; }
.opt-details:hover { color: var(--amber); border-color: rgba(245,177,76,.5); }

/* details modal (web: centered; mobile: bottom sheet) */
.arch-modal-wrap { position: fixed; inset: 0; z-index: 70; background: rgba(7,11,18,.7);
  backdrop-filter: blur(4px); display: grid; place-items: center; animation: fadein .2s ease both; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
.arch-modal { position: relative; width: min(92vw, 640px); max-height: 84vh; overflow-y: auto;
  animation: modalpop .3s cubic-bezier(.2,1.2,.3,1) both; }
@keyframes modalpop { from { transform: scale(.92) translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }
.am-close { position: absolute; top: 12px; right: 14px; color: var(--ink-3); font-size: 16px; padding: 6px; }
.am-close:hover { color: var(--ink); }
.am-head { display: flex; gap: 14px; align-items: center; margin-bottom: 16px; padding-right: 30px; }
.am-head .arch-ic { width: 44px; height: 44px; }
.am-name { font-family: var(--font-display); font-weight: 700; font-size: 20px; }
.am-tag { font-size: 13.5px; color: var(--ink-2); }
.am-sec { margin-top: 16px; }
.am-h { display: block; font-size: 9.5px; letter-spacing: .2em; color: var(--cyan); margin-bottom: 8px; }
.am-h.good { color: var(--green); } .am-h.bad { color: var(--crit); }
.am-flow { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 10px; }
.am-sec p { font-size: 13.5px; color: var(--ink-2); }
.am-term { display: flex; flex-direction: column; gap: 2px; padding: 9px 0; border-top: 1px dashed var(--line); }
.am-term b { font-size: 13.5px; color: var(--ink); }
.am-term span { font-size: 12.5px; color: var(--ink-2); }
.am-duo { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.am-duo .p, .am-duo .c { display: flex; gap: 8px; font-size: 13px; color: var(--ink-2); margin-bottom: 6px; }
.am-duo .p::before { content: "✓"; color: var(--green); }
.am-duo .c::before { content: "–"; color: var(--crit); }

/* decision bar: desktop sticky above the dock; mobile keeps the glass CTA */
.arch-bar { display: flex; gap: 26px; align-items: center; margin-top: 20px; padding: 14px 20px; }
.ab-cell { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ab-k { font-size: 9px; letter-spacing: .18em; color: var(--ink-3); }
.ab-v { font-family: var(--font-display); font-weight: 700; font-size: 14.5px; }
.ab-v.amber { color: var(--amber); }
.ab-s { font-size: 11.5px; color: var(--ink-3); }
.arch-bar .stage-actions { margin: 0 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 4px; }
@media (min-width: 721px) {
  .arch-bar { position: sticky; bottom: 84px; z-index: 40;
    background: rgba(19,28,43,.96); backdrop-filter: blur(8px); }
}
@media (max-width: 720px) {
  .arch-bar { flex-direction: column; align-items: stretch; gap: 12px; background: var(--surface); }
  .arch-bar .ab-cell:nth-child(2) { display: none; } /* keep it tight on phones */
  .arch-modal-wrap { place-items: end center; }
  .arch-modal { width: 100vw; max-height: 88vh; border-radius: 18px 18px 0 0;
    animation: sheetup .35s cubic-bezier(.2,1,.3,1) both; padding-bottom: 30px; }
  @keyframes sheetup { from { transform: translateY(60%); opacity: .4; } to { transform: none; opacity: 1; } }
  .am-duo { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { .arch-modal, .arch-modal-wrap { animation: none; } }

/* desktop dock goes liquid glass */
@media (min-width: 721px) {
  .tabbar {
    background: rgba(26, 37, 55, .55);
    -webkit-backdrop-filter: blur(20px) saturate(170%);
    backdrop-filter: blur(20px) saturate(170%);
    border: 1px solid rgba(255, 255, 255, .16);
    box-shadow: 0 14px 44px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .22);
  }
}

/* ============================================================= */
/* v8.1 — arch cards w/ archetype colors + right insight panel   */
/* ============================================================= */

.arch-wrap { display: grid; grid-template-columns: 1fr 330px; gap: 18px; align-items: start; }
.arch-wrap .optgrid { grid-template-columns: 1fr 1fr; }
.optcard.arch-opt { border-top: 2px solid var(--ac, var(--line)); }
.optcard.arch-opt .arch-ic { color: var(--ac); border-color: color-mix(in srgb, var(--ac) 40%, transparent);
  background: color-mix(in srgb, var(--ac) 8%, transparent); }
.optcard.arch-opt.chosen { border-color: var(--ac); box-shadow: 0 0 0 1px var(--ac),
  0 10px 30px color-mix(in srgb, var(--ac) 15%, transparent); }
.optcard.arch-opt .pick-check { background: var(--ac); }
.oc-more { margin-left: auto; flex-shrink: 0; font-size: 10px; letter-spacing: .14em;
  color: var(--ink-3); border: 1px solid var(--line); border-radius: 7px; padding: 6px 10px; }
.optcard.arch-opt:hover .oc-more { color: var(--ac); border-color: color-mix(in srgb, var(--ac) 50%, transparent); }

/* right insight panel */
.arch-insight { position: sticky; top: 118px; max-height: calc(100vh - 220px); overflow-y: auto;
  scrollbar-width: thin; }
.arch-insight .ai-empty { text-align: center; padding: 34px 10px; color: var(--ink-3); }
.arch-insight .ai-empty .mono { display: block; font-size: 10.5px; letter-spacing: .2em; color: var(--cyan); margin-bottom: 10px; }
.arch-insight .ai-empty p { font-size: 13px; max-width: 30ch; margin: 0 auto; }
.ai-tab { display: inline-block; font-size: 10px; letter-spacing: .2em; color: var(--cyan);
  border-bottom: 2px solid var(--cyan); padding-bottom: 6px; margin-bottom: 14px; }
.am-kind { font-size: 9.5px; letter-spacing: .18em; margin-top: 2px; }
.am-inmission { margin-top: 10px; padding: 10px 12px; border: 1px solid rgba(47,157,180,.35);
  border-radius: 9px; background: rgba(47,157,180,.07); font-size: 12.5px; color: var(--ink-2); }
.am-inmission b { color: var(--cyan); font-weight: 600; }

/* dot-split flow viz */
.split-viz { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.sv-in { text-align: center; flex-shrink: 0; }
.sv-in b { font-family: var(--font-mono); font-size: 22px; color: var(--ink); display: block; }
.sv-in span { font-size: 10px; color: var(--ink-3); line-height: 1.3; display: block; }
.sv-arrow { color: var(--ink-3); font-size: 18px; }
.sv-out { display: flex; flex-direction: column; gap: 10px; flex: 1; min-width: 0; }
.sv-group { display: flex; gap: 10px; align-items: center; }
.sv-meta { display: flex; align-items: baseline; gap: 7px; min-width: 0; }
.sv-meta b { font-family: var(--font-mono); font-size: 15px; }
.sv-meta span { font-size: 11px; color: var(--ink-3); line-height: 1.3; }

@media (max-width: 1000px) { .arch-wrap { grid-template-columns: 1fr; } .arch-insight { display: none; } }
@media (max-width: 720px) {
  .arch-wrap .optgrid { grid-template-columns: 1fr; }
}

/* ============================================================= */
/* v8.3 — arch stage: even rhythm, roomier insight, glass bar    */
/* ============================================================= */

/* even cards: same padding, flexible middle, footer pinned to bottom */
.arch-wrap { grid-template-columns: 1fr 396px; gap: 16px; }
.arch-wrap .optgrid { gap: 16px; align-items: stretch; }
.optcard.arch-opt { display: flex; flex-direction: column; gap: 14px; padding: 20px; }
.optcard.arch-opt .oc-head { padding-right: 34px; }
.optcard.arch-opt .oc-head .nm { font-size: 15.5px; line-height: 1.3; }
.optcard.arch-opt .oc-head .desc { margin-top: 4px; }
.optcard.arch-opt .mini-diagram { margin: 0; }
.optcard.arch-opt .oc-foot { margin-top: auto; align-items: center; }
.optcard.arch-opt .tap-hint { margin-bottom: 2px; }

/* insight: more room, calmer rhythm */
.arch-insight { padding: 24px 24px 28px; }
.arch-insight .am-head { margin-bottom: 4px; }
.arch-insight .am-name { font-size: 18px; line-height: 1.3; }
.arch-insight .am-sec { margin-top: 22px; }
.arch-insight .am-sec p { line-height: 1.65; }
.arch-insight .am-h { margin-bottom: 10px; }
.arch-insight .am-inmission { margin-top: 12px; line-height: 1.55; }
.arch-insight .split-viz { margin: 4px 0 16px; }
.arch-insight .am-flow { row-gap: 8px; padding: 12px; border: 1px dashed var(--line); border-radius: 10px; }
.arch-insight .am-duo { gap: 20px; margin-top: 22px; }
.arch-insight .am-term { padding: 11px 0; }

/* decision bar + lock CTA: liquid glass, content visible beneath */
@media (min-width: 721px) {
  .arch-bar {
    background: rgba(19, 28, 43, .42);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    backdrop-filter: blur(16px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, .14);
    box-shadow: 0 12px 40px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .18);
  }
  .arch-bar .btn {
    background: rgba(245, 177, 76, .55);
    -webkit-backdrop-filter: blur(14px) saturate(170%);
    backdrop-filter: blur(14px) saturate(170%);
    border: 1px solid rgba(255, 255, 255, .38);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 8px 26px rgba(0, 0, 0, .35);
    color: #17110a; border-radius: 999px;
  }
  .arch-bar .btn:disabled { background: rgba(34, 48, 73, .45); color: var(--ink-2);
    border-color: rgba(255, 255, 255, .12); opacity: 1; }
}
@media (max-width: 1000px) { .arch-wrap { grid-template-columns: 1fr; } }

/* insight lives in the popup on all viewports now */
.arch-wrap.solo { grid-template-columns: 1fr; }
.arch-modal .am-sec { margin-top: 22px; }
.arch-modal .am-sec p { line-height: 1.65; }
.arch-modal .am-flow { row-gap: 8px; padding: 12px; border: 1px dashed var(--line); border-radius: 10px; }
.arch-modal .am-inmission { line-height: 1.55; }

/* ============================================================= */
/* v9 — build stage: mission control, decision flow, reselection */
/* ============================================================= */

.build-wrap { display: grid; grid-template-columns: 1fr 300px; gap: 18px; align-items: start; }
.build-flow { display: grid; grid-template-columns: 86px 1fr; gap: 14px; margin-top: 20px; }

/* decision flow rail */
.bf-rail { position: sticky; top: 118px; display: flex; flex-direction: column; gap: 26px; padding-top: 8px; }
.bf-rail::before { content: ""; position: absolute; left: 15px; top: 16px; bottom: 16px;
  border-left: 2px dashed rgba(158,178,208,.22); }
.bfr { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; position: relative; text-align: left; }
.bfr i { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-style: normal;
  font-size: 12px; border: 2px solid var(--ink-3); color: var(--ink-3); background: var(--bg); z-index: 1;
  transition: border-color .25s, color .25s; }
.bfr span { font-family: var(--font-mono); font-size: 8.5px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-3); line-height: 1.35; }
.bfr.done i { border-color: var(--green); color: var(--green); }
.bfr.done i::before { content: "✓"; position: absolute; }
.bfr.done i { font-size: 0; } .bfr.done i::before { font-size: 13px; }
.bfr:hover i { border-color: var(--amber); color: var(--amber); font-size: 12px; }
.bfr.done:hover i { font-size: 0; }

/* decision blocks: header row + collapsible body */
.decision-block { border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
  margin-bottom: 16px; overflow: hidden; }
.decision-block .db-head { display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 14px 16px; text-align: left; }
.decision-block .db-no { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  border: 1.5px solid var(--amber); color: var(--amber); font-size: 11px; flex-shrink: 0; }
.decision-block .db-head h3 { font-size: 16px; margin: 0; flex: 1; min-width: 0; }
.decision-block .sel-chip { font-size: 9px; letter-spacing: .14em; color: var(--green);
  border: 1px solid rgba(63,164,112,.45); border-radius: 999px; padding: 3px 9px; }
.decision-block .rm-chev { color: var(--ink-3); transition: transform .25s; }
.decision-block.collapsed .rm-chev { transform: rotate(-90deg); }
.decision-block .db-body { padding: 0 16px 16px; }
.decision-block.collapsed .db-body { display: none; }
.decision-block.pending-lock { opacity: .45; pointer-events: none; }
.decision-block.pending-lock .db-body { display: none; }
.decision-block .optrow .optcard { position: relative; }
.decision-block .optcard .pick-check { top: 10px; right: 10px; width: 22px; height: 22px; font-size: 12px; }
.decision-block .optcard.chosen { border-color: var(--amber);
  box-shadow: 0 0 0 1px var(--amber), 0 8px 24px rgba(245,177,76,.1); }
.decision-block .optcard.locked { opacity: 1; pointer-events: auto; } /* reselection allowed */

/* mission control sidebar */
.mission-control { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 118px; }
.mission-control .panel { padding: 14px 16px; }
.mc-client { display: flex; gap: 12px; align-items: center; }
.mc-client > div { display: flex; flex-direction: column; min-width: 0; }
.mc-client b { font-size: 14px; }
.mc-client span { font-size: 11.5px; color: var(--ink-3); }
.mc-h { display: block; font-size: 9.5px; letter-spacing: .2em; color: var(--cyan); margin-bottom: 9px; }
.mc-sec p { font-size: 12.5px; color: var(--ink-2); line-height: 1.55; }
.mc-facts { display: flex; flex-wrap: wrap; gap: 6px; }
.mc-fact { font-size: 11px; color: var(--ink-2); border: 1px solid rgba(47,157,180,.35);
  border-radius: 999px; padding: 4px 10px; background: rgba(47,157,180,.06); }
.st-row { display: flex; gap: 10px; align-items: flex-start; padding: 7px 0; border-top: 1px dashed var(--line); }
.st-row:first-child { border-top: 0; }
.st-row i { font-style: normal; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center;
  font-size: 10px; flex-shrink: 0; font-family: var(--font-mono); }
.st-row.done i { background: rgba(63,164,112,.16); color: var(--green); }
.st-row.todo i { border: 1.5px solid var(--ink-3); color: var(--ink-3); }
.st-row span { display: flex; flex-direction: column; min-width: 0; font-size: 12px; color: var(--ink-2); }
.st-row b { font-family: var(--font-mono); font-size: 9px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-3); }
.st-row.todo span { color: var(--ink-3); }
.mc-blind { border-color: rgba(217,106,94,.4); }
.mc-blind .mc-h { color: var(--crit); }
.bs-row { font-size: 12px; color: var(--crit); padding: 3px 0; }
.bs-note { margin-top: 8px; font-size: 11px !important; color: var(--ink-3) !important; }

/* build status bar (glass on desktop, like the arch bar) */
.build-bar { display: flex; gap: 26px; align-items: center; margin-top: 20px; padding: 14px 20px; }
.bb-cell { display: flex; flex-direction: column; gap: 2px; }
.bb-cell.grow { flex: 1; min-width: 0; }
.build-bar .stage-actions { margin: 0 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 4px; }
@media (min-width: 721px) {
  .build-bar { position: sticky; bottom: 84px; z-index: 40;
    background: rgba(19, 28, 43, .42);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    backdrop-filter: blur(16px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, .14);
    box-shadow: 0 12px 40px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .18); }
  .build-bar .btn {
    background: rgba(245, 177, 76, .55);
    -webkit-backdrop-filter: blur(14px) saturate(170%);
    backdrop-filter: blur(14px) saturate(170%);
    border: 1px solid rgba(255, 255, 255, .38);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 8px 26px rgba(0, 0, 0, .35);
    color: #17110a; border-radius: 999px; }
  .build-bar .btn:disabled { background: rgba(34, 48, 73, .45); color: var(--ink-2);
    border-color: rgba(255, 255, 255, .12); opacity: 1; }
}
@media (max-width: 1000px) {
  .build-wrap { grid-template-columns: 1fr; }
  .mission-control { position: static; order: 2; }
  .build-flow { grid-template-columns: 1fr; }
  .bf-rail { display: none; }
}
@media (max-width: 720px) {
  .build-bar { flex-direction: column; align-items: stretch; gap: 10px; }
  .mc-client { display: none; }             /* already met them in the brief */
  .decision-block .optrow { grid-template-columns: 1fr; }
}

/* ============================================================= */
/* v9.1 — rail names on mobile, bottom FAB, back-nav, concepts   */
/* ============================================================= */

/* stage rail: full labels on desktop, short ones under dots on mobile */
.stop .lbl .ls { display: none; }
.stop { cursor: default; }
.stop.done { cursor: pointer; }
.stop.done:hover .dot { border-color: var(--amber); color: var(--amber); }
@media (max-width: 720px) {
  .rail { padding: 6px 10px 10px; }
  .stop { flex-direction: column; align-items: center; gap: 3px; }
  .stop .lbl { margin-left: 0; }
  .stop .lbl .lf { display: none; }
  .stop .lbl .ls { display: block; font-size: 7.5px; letter-spacing: .08em; }
  .stop .route { position: absolute; }  /* connector lines handled by dots row spacing */
  .stop { position: relative; flex: 1; }
  .stop .route { top: 12px; left: calc(50% + 16px); right: calc(-50% + 16px); margin: 0; }
}

/* discovery FAB: bottom-center liquid pill, same pattern as other stage CTAs */
@media (max-width: 720px) {
  .qp-h {
    top: auto; bottom: 94px; left: 50%; right: auto; translate: -50% 0;
    width: auto; min-width: min(300px, calc(100vw - 32px)); max-width: calc(100vw - 24px);
    justify-content: center; font-weight: 700; padding: 14px 24px;
  }
  .qpicker .qlist { top: auto; bottom: 158px; max-height: 52vh; }
}

/* confirm dialog */
.confirm-box { width: min(92vw, 440px); }
.cf-body { margin: 12px 0 18px; font-size: 13.5px; color: var(--ink-2); line-height: 1.6; }
.cf-actions { display: flex; gap: 12px; justify-content: flex-end; }

/* mission control on route plan (uses build-wrap grid) */
.arch-optgrid { grid-template-columns: 1fr 1fr; }
@media (max-width: 1000px) { .arch-optgrid { grid-template-columns: 1fr; } }

/* locked-in strip on the sim stage */
.mc-strip { padding: 14px 18px; margin-bottom: 16px; }
.mc-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.mc-chip { font-size: 12px; color: var(--ink-2); border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 12px; background: var(--surface-2); }
.mc-chip b { font-family: var(--font-mono); font-size: 9px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-3); }
.mc-chip.arch { border-color: rgba(245,177,76,.45); color: var(--amber); }

/* discovery top bar on mobile: counters only — the floating pill is the CTA */
@media (max-width: 720px) { .disc-bar .db-cta { display: none; } }

/* ============================================================= */
/* v9.2 — concept mini-diagrams                                  */
/* ============================================================= */
.ckviz { margin-top: 4px; }
.ckviz .arrow.loop { color: var(--amber); font-size: 16px; }
.ck-split { display: flex; gap: 14px; align-items: center; }
.ck-in { text-align: center; flex-shrink: 0; }
.ck-in b { font-family: var(--font-mono); font-size: 20px; display: block; }
.ck-in span { font-size: 10px; color: var(--ink-3); }
.ck-out { display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 0; }
.ck-srow { display: flex; gap: 9px; align-items: center; }
.ck-dots { display: flex; flex-wrap: wrap; gap: 3px; width: 62px; flex-shrink: 0; }
.ck-dots i { width: 7px; height: 7px; border-radius: 2px; display: block; }
.ck-srow b { font-family: var(--font-mono); font-size: 14px; }
.ck-lbl { font-size: 11.5px; color: var(--ink-3); line-height: 1.3; }
.ck-dial .ck-track { position: relative; height: 8px; border-radius: 4px;
  background: linear-gradient(90deg, var(--cyan), var(--amber)); }
.ck-dial .ck-marker { position: absolute; left: 58%; top: -4px; width: 3px; height: 16px;
  border-radius: 2px; background: var(--ink); box-shadow: 0 0 0 2px var(--bg); }
.ck-ends { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--ink-3); margin-top: 8px; }
.ck-bars { display: flex; flex-direction: column; gap: 10px; }
.ck-brow { display: grid; grid-template-columns: 1fr 90px 26px; gap: 10px; align-items: center; }
.ck-btrack { height: 7px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.ck-btrack i { display: block; height: 100%; background: var(--cyan); border-radius: 4px; }
.ck-brow b { font-family: var(--font-mono); font-size: 12px; text-align: right; }

/* skills view: concept field manual chips */
.concept-cloud-dash { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.ck-chip { display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 13px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2);
  font-size: 12.5px; color: var(--ink-2); text-align: left; transition: border-color .2s, transform .15s; }
.ck-chip:hover { border-color: rgba(245,177,76,.5); transform: translateY(-1px); color: var(--ink); }
.ck-chip.tested { border-color: rgba(63,164,112,.4); }
.ck-chip b { font-size: 10px; color: var(--ink-3); }
.ck-chip.tested b { color: var(--green); }

/* ranks view: level line in standing panel */
.rank-lvl { font-size: 11px; letter-spacing: .12em; color: var(--amber); margin: 6px 0 2px; }
.am-actions { margin-top: 22px; position: sticky; bottom: -1px; padding-top: 10px;
  background: linear-gradient(transparent, var(--surface) 40%); }

/* web discovery: CTA floats as a liquid pill like every other phase */
@media (min-width: 721px) {
  .disc-bar .db-cta {
    position: fixed; bottom: 84px; left: 50%; translate: -50% 0; z-index: 45; margin-left: 0;
  }
  .disc-bar .db-cta .btn {
    min-width: 300px; justify-content: center; border-radius: 999px; font-weight: 700;
    background: rgba(245, 177, 76, .55);
    -webkit-backdrop-filter: blur(14px) saturate(170%);
    backdrop-filter: blur(14px) saturate(170%);
    border: 1px solid rgba(255, 255, 255, .38);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 8px 26px rgba(0, 0, 0, .35);
    color: #17110a;
  }
  .disc-bar .db-cta .btn:disabled { background: rgba(34, 48, 73, .45); color: var(--ink-2);
    border-color: rgba(255, 255, 255, .12); opacity: 1; }
  .disc-bar .db-cta .reassure { display: none; }
}

/* ============================================================= */
/* v10 — deployment redesign + unified web floating CTA          */
/* ============================================================= */

/* one liquid pill position for ALL web stage CTAs that float */
@media (min-width: 721px) {
  .float-web {
    position: fixed; bottom: 84px; left: 50%; translate: -50% 0; z-index: 45;
    min-width: 320px; justify-content: center; border-radius: 999px; font-weight: 700;
    background: rgba(245, 177, 76, .55);
    -webkit-backdrop-filter: blur(14px) saturate(170%);
    backdrop-filter: blur(14px) saturate(170%);
    border: 1px solid rgba(255, 255, 255, .38);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 8px 26px rgba(0, 0, 0, .35);
    color: #17110a;
  }
  .float-web:disabled { background: rgba(34, 48, 73, .45); color: var(--ink-2);
    border-color: rgba(255, 255, 255, .12); opacity: 1; }
  /* discovery bar: container back to normal flow — the button itself floats now */
  .disc-bar .db-cta { position: static; translate: none; }
  body.mission main { padding-bottom: 170px; }
}

/* sim panel header + controls */
.sim-h { display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em; color: var(--ink-3) !important; }
.sim-controls { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.sc-btn { font-family: var(--font-mono); font-size: 11px; color: var(--ink-2);
  border: 1px solid var(--line); border-radius: 7px; padding: 5px 10px; }
.sc-btn:hover:not(:disabled) { color: var(--amber); border-color: rgba(245,177,76,.5); }
.sc-btn:disabled { opacity: .35; }
.sc-sel { background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line);
  border-radius: 7px; padding: 5px 6px; font-size: 11px; }

/* deployment grid: pipeline full, 3 charts, counters, feed | log */
@media (min-width: 861px) {
  .simwrap { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
  .simwrap .pipeline, .simwrap .simcounters { grid-column: 1 / -1; }
  .simwrap .feedpanel { grid-column: 1 / 2; }
  .simwrap .logpanel { grid-column: 2 / -1; }
  .simcounters { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
}
.build-main { min-width: 0; }
.defl-tile { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.defl-tile .donut-wrap { width: 72px; margin: 0 auto; }
.defl-tile .donut { width: 72px; height: 72px; }
.mc-now { font-size: 12.5px; color: var(--ink-2); line-height: 1.5; display: flex;
  flex-direction: column; gap: 4px; }
.mc-now .fq { color: var(--ink-3); }

/* the disc-bar's backdrop-filter made it the containing block for the fixed
   CTA (same trap as the stage transform) — drop the blur so the pill escapes */
@media (min-width: 721px) {
  .disc-bar { backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(19, 28, 43, .97); }
}

/* ============================================================= */
/* v11 — live architecture blueprint                             */
/* ============================================================= */
.mission-graph svg.ag-svg { width: 100%; height: auto; display: block; }
.mission-graph-big { min-height: 240px; }
.mg-hint { font-size: 11px; color: var(--ink-3); margin-top: 8px; }
.ag-edge { fill: none; stroke: rgba(158, 178, 208, .35); stroke-width: 1.6;
  stroke-dasharray: 6 5; animation: agflow 1.2s linear infinite; }
.ag-edge.dashed { stroke: rgba(143, 111, 224, .45); stroke-dasharray: 2 5; }
@keyframes agflow { to { stroke-dashoffset: -11; } }
.ag-elabel { font-size: 10px; fill: var(--amber); letter-spacing: .06em; }
.ag-node { transition: opacity .3s; }
.ag-node.ag-new { animation: agpop .55s cubic-bezier(.2, 1.4, .3, 1) both; transform-origin: center; transform-box: fill-box; }
@keyframes agpop { from { opacity: 0; transform: scale(.7); } to { opacity: 1; transform: scale(1); } }
.ag-count { font-weight: 600; }
@media (prefers-reduced-motion: reduce) { .ag-edge { animation: none; } .ag-dot { display: none; } .ag-node.ag-new { animation: none; } }

/* vertical (mobile) graph */
.vg-host { display: none; }
.vg-wrap { display: flex; flex-direction: column; gap: 4px; }
.vg-row, .vg-lane { display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.vg-ic { width: 20px; height: 20px; flex-shrink: 0; }
.vg-ic svg { width: 100%; height: 100%; }
.vg-lbl { flex: 1; min-width: 0; font-size: 12.5px; color: var(--ink); }
.vg-badge { font-style: normal; color: var(--amber); font-size: 8px; }
.vg-row b, .vg-lane b { color: var(--ink-2); font-size: 12px; }
.vg-con { text-align: center; color: var(--ink-3); font-size: 13px; line-height: 1; padding: 1px 0; }
.vg-lanes { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 6px; }
.vg-lane { flex-direction: column; align-items: flex-start; gap: 6px; padding: 9px 10px; }
.vg-lane .vg-lbl { font-size: 11px; line-height: 1.25; }
@media (max-width: 720px) {
  #simgraph { display: none; }
  .vg-host { display: block; }
  .mc-graph-sec .mission-graph svg.ag-svg { min-height: 90px; }
}

/* ============================================================= */
/* v11.1 — sim polish: speed-linked traffic, 2-up charts, mobile */
/* ============================================================= */

/* faster default traffic; speed control scales it; done/paused stop it */
.ag-edge { animation-duration: var(--agspd, .9s); }
.ag-svg.ag-done .ag-dot, .ag-svg.ag-paused .ag-dot { display: none; }
.ag-svg.ag-done .ag-edge, .ag-svg.ag-paused .ag-edge { animation-play-state: paused; }

/* week progress bar */
.sim-prog { height: 5px; border-radius: 3px; background: var(--surface-3); overflow: hidden; margin: 8px 0 12px; }
.sim-prog i { display: block; height: 100%; width: 0; border-radius: 3px;
  background: linear-gradient(90deg, var(--cyan), var(--amber));
  transition: width .7s cubic-bezier(.22,1,.36,1); }

/* charts 2-up: bigger, two visible at once */
@media (min-width: 861px) {
  .simwrap { grid-template-columns: repeat(2, 1fr); }
  .simwrap .feedpanel { grid-column: 1 / 2; }
  .simwrap .logpanel { grid-column: 2 / 3; }
}

/* mobile: compressed vertical graph + visible activity while running */
@media (max-width: 720px) {
  .vg-wrap { gap: 2px; }
  .vg-row, .vg-lane { padding: 7px 10px; border-radius: 8px; }
  .vg-ic { width: 15px; height: 15px; }
  .vg-lbl { font-size: 11.5px; }
  .vg-row b, .vg-lane b { font-size: 11px; }
  .vg-con { font-size: 11px; padding: 0; line-height: .9; }
  .vg-lanes { grid-template-columns: repeat(auto-fit, minmax(86px, 1fr)); gap: 4px; }
  .vg-lane { padding: 6px 8px; gap: 4px; }
  .vg-lane .vg-lbl { font-size: 10px; }
}
.vg-wrap.running [data-node] { animation: vgpulse 1.5s ease-in-out infinite; }
.vg-wrap.running [data-node]:nth-child(2n) { animation-delay: .35s; }
.vg-wrap.running .vg-lanes [data-node]:nth-child(2) { animation-delay: .5s; }
.vg-wrap.running .vg-lanes [data-node]:nth-child(3) { animation-delay: 1s; }
.vg-wrap.running .vg-con { color: var(--amber); animation: vgpulse 1.5s ease-in-out infinite; }
@keyframes vgpulse { 0%, 100% { border-color: var(--line); box-shadow: none; }
  50% { border-color: rgba(245,177,76,.55); box-shadow: 0 0 12px rgba(245,177,76,.12); } }
@media (prefers-reduced-motion: reduce) { .vg-wrap.running [data-node], .vg-wrap.running .vg-con { animation: none; } }

/* mobile: the locked-in calls strip is redundant in transit (blueprint shows them) */
@media (max-width: 720px) { #stage-sim .mc-strip { display: none; } }

/* ============================================================= */
/* v12 — delivered stage redesign                                */
/* ============================================================= */

.res-hero { display: grid; grid-template-columns: 1.5fr 1fr; gap: 18px; align-items: stretch; }
.hero-cells { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 18px; }
.hc { background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px;
  display: flex; flex-direction: column; gap: 3px; }
.hc span { font-size: 8.5px; letter-spacing: .16em; color: var(--ink-3); }
.hc b { font-family: var(--font-mono); font-size: 15px; color: var(--ink); }
.hc b.amber { color: var(--amber); }

.msg-panel { display: flex; flex-direction: column; gap: 12px;
  background: linear-gradient(160deg, rgba(143,111,224,.08), var(--surface) 55%);
  border-color: rgba(143,111,224,.35); }
.mp-head { display: flex; gap: 12px; align-items: center; }
.mp-quote { font-size: 13.5px; color: var(--ink-2); line-height: 1.65; font-style: italic; flex: 1; }
.mp-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.mp-chip { font-size: 11px; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-2); }
.mp-chip.good { color: var(--green); border-color: rgba(63,164,112,.45); }
.mp-chip.bad { color: var(--crit); border-color: rgba(217,106,94,.45); }
.mp-chip.gold { color: var(--amber); border-color: rgba(245,177,76,.5); }

.res-duo { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; margin-top: 18px; }
.outcome-tiles .tile .tile-ic { margin-bottom: 6px; }
.ba { display: flex; align-items: baseline; gap: 8px; }
.ba .was { font-family: var(--font-mono); font-size: 13px; color: var(--ink-3); text-decoration: line-through; }
.ba .arr { color: var(--ink-3); }
.ba .now { font-family: var(--font-mono); font-size: 20px; }
.ba .now.up { color: var(--green); } .ba .now.down { color: var(--crit); }
.impact-note { margin-top: 12px; padding: 10px 14px; border: 1px dashed var(--line); border-radius: 9px;
  font-size: 12px; color: var(--ink-2); }
.arch-replay .mission-graph svg { width: 100%; height: auto; }

.results-bar { display: flex; align-items: center; gap: 20px; margin-top: 18px; }
.rb-cell { display: flex; gap: 12px; align-items: center; flex: 1; min-width: 0; }
.rb-cell .tile-ic { width: 30px; height: 30px; margin: 0; color: var(--amber); }
.rb-cell b { display: block; font-family: var(--font-display); font-size: 15px; }
.rb-cell span { font-size: 12px; color: var(--ink-3); }
.results-bar .stage-actions { margin: 0; display: flex; align-items: center; gap: 14px; }
.rb-xp { font-size: 11px; color: var(--ink-3); }
@media (min-width: 721px) {
  .results-bar { position: sticky; bottom: 84px; z-index: 40;
    background: rgba(19, 28, 43, .95); border-color: rgba(255,255,255,.14); }
}

/* mobile: fix overflow + stack the delivered stage */
@media (max-width: 720px) {
  .res-hero, .res-duo { grid-template-columns: 1fr; }
  .hero-cells { grid-template-columns: repeat(2, 1fr); }
  .score-big { font-size: 52px; }
  .gauge-mark span { display: none; }        /* labels overflowed the track */
  .formula { overflow-wrap: anywhere; font-size: 11.5px; }
  #radar svg, #radar { max-width: 100%; height: auto; }
  .career-strip { grid-template-columns: 1fr 1fr; }
  .results-grid { grid-template-columns: 1fr; }
  .outcome-tiles { grid-template-columns: 1fr 1fr !important; }
  .ba .now { font-size: 17px; }
  .results-bar { flex-direction: column; align-items: stretch; gap: 12px; }
  .results-bar .stage-actions { flex-direction: column; align-items: stretch; }
  #stage-results { overflow-x: hidden; }
}

/* results overflow fixes: let grid items shrink; stack breakdown rows on phones */
.results-grid > .panel { min-width: 0; }
@media (max-width: 720px) {
  .formula { white-space: normal; overflow-wrap: anywhere; }
  .contrib-row { grid-template-columns: 1fr 44px; row-gap: 4px; }
  .contrib-row .pn { grid-column: 1 / -1; }
}

/* delivered: exam CTA lives INSIDE the glass bar as a liquid pill (no fixed overlap) */
@media (min-width: 721px) {
  .results-bar .btn:not(.ghost) {
    border-radius: 999px; font-weight: 700; min-width: 280px; justify-content: center;
    background: rgba(245, 177, 76, .6);
    -webkit-backdrop-filter: blur(14px) saturate(170%);
    backdrop-filter: blur(14px) saturate(170%);
    border: 1px solid rgba(255, 255, 255, .38);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 8px 26px rgba(0, 0, 0, .35);
    color: #17110a;
  }
  .results-bar { bottom: 78px; }
}

/* ============================================================= */
/* v12.1 — floating CTAs: only show when actionable, smaller     */
/* ============================================================= */
@media (max-width: 720px) {
  body.mission .cta-float:disabled { display: none; }   /* pill appears when the decision is ready */
  body.mission .cta-float {
    bottom: 88px; min-width: 0; max-width: calc(100vw - 48px);
    padding: 11px 20px; font-size: 13.5px;
  }
  .qp-h { padding: 10px 16px; font-size: 10px; bottom: 88px; }
}
@media (min-width: 721px) {
  .float-web:disabled { display: none; }
  .float-web { min-width: 0; padding: 11px 24px; font-size: 14px; }
}

/* ============================================================= */
/* v12.2 — web CTAs float like mobile; richer liquid pills       */
/* ============================================================= */
@media (min-width: 721px) {
  /* bars become info strips; the action floats bottom-center, only when ready */
  .arch-bar, .build-bar, .results-bar { position: static; }
  .arch-bar .stage-actions, .build-bar .stage-actions, .results-bar .stage-actions { margin-left: auto; }
}

/* beautiful glass: warm gradient, specular top, inner depth, soft glow, spring entrance */
body.mission .cta-float:not(:disabled), .float-web:not(:disabled) {
  background: linear-gradient(180deg, rgba(255, 214, 140, .78), rgba(245, 177, 76, .58) 55%, rgba(222, 148, 52, .62));
  border: 1px solid rgba(255, 255, 255, .5);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .45),
              0 2px 14px rgba(245, 177, 76, .35),
              inset 0 1px 0 rgba(255, 255, 255, .7),
              inset 0 -8px 14px rgba(160, 100, 20, .28);
  letter-spacing: .01em; text-shadow: 0 1px 0 rgba(255, 255, 255, .25);
  animation: ctain .5s cubic-bezier(.2, 1.35, .3, 1) both;
}
@keyframes ctain {
  from { opacity: 0; translate: -50% 18px; scale: .88; }
  to   { opacity: 1; translate: -50% 0;   scale: 1; }
}
/* non-floating placements (e.g. desktop back-to-dispatch inline) keep centering off */
@media (min-width: 721px) { .float-web { translate: -50% 0; } }
@media (prefers-reduced-motion: reduce) { body.mission .cta-float, .float-web { animation: none; } }
/* bars are static info strips now — their backdrop-filter would trap the fixed pill */
@media (min-width: 721px) {
  .arch-bar, .build-bar, .results-bar {
    backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--surface);
  }
}
/* floating pills hug their label — btn-wide's 100% must not apply while fixed */
@media (min-width: 721px) {
  .float-web, .float-web.btn-wide { width: auto; max-width: min(440px, calc(100vw - 48px)); }
}

/* blueprint zoom viewer */
.mission-graph.clickable, .vg-host.clickable { cursor: zoom-in; }
.mission-graph.clickable:hover svg { filter: brightness(1.12); }
.graph-modal { width: min(96vw, 1000px); }
.gm-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-top: 14px; }
#gm-mount { min-height: 260px; }
#gm-mount svg.ag-svg { min-width: 760px; }

/* mobile blueprint viewer: large vertical layout, fits the screen */
@media (max-width: 720px) {
  .graph-modal { width: 100vw; }
  .gm-scroll { overflow-x: hidden; }
  .graph-modal.gm-vert .vg-row, .graph-modal.gm-vert .vg-lane { padding: 12px 14px; border-radius: 10px; }
  .graph-modal.gm-vert .vg-lbl { font-size: 13.5px; }
  .graph-modal.gm-vert .vg-row b, .graph-modal.gm-vert .vg-lane b { font-size: 13px; }
  .graph-modal.gm-vert .vg-ic { width: 20px; height: 20px; }
  .graph-modal.gm-vert .vg-lanes { grid-template-columns: 1fr; }
  .graph-modal.gm-vert .vg-con { font-size: 13px; }
}
@media (min-width: 721px) { #gm-mount svg.ag-svg { min-width: 760px; } }

/* blueprint dot (route + build, mobile only) */
.graph-fab { display: none; }
@media (max-width: 720px) {
  .graph-fab.on {
    display: grid; place-items: center; position: fixed; right: 14px; bottom: 152px; z-index: 44;
    width: 46px; height: 46px; border-radius: 50%; color: var(--amber);
    background: rgba(26, 37, 55, .72);
    -webkit-backdrop-filter: blur(14px) saturate(160%);
    backdrop-filter: blur(14px) saturate(160%);
    border: 1px solid rgba(245, 177, 76, .45);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .25);
    animation: ctain-fab .4s cubic-bezier(.2, 1.3, .3, 1) both;
  }
  .graph-fab svg { width: 22px; height: 22px; }
  @keyframes ctain-fab { from { opacity: 0; scale: .6; } to { opacity: 1; scale: 1; } }
}

/* ============================================================= */
/* v12.3 — mobile vertical blueprint beautification              */
/* ============================================================= */
@media (max-width: 720px) {
  .vg-row, .vg-lane {
    border-left: 3px solid var(--nc, var(--line));
    background: linear-gradient(90deg, color-mix(in srgb, var(--nc, #66788F) 7%, var(--surface-2)), var(--surface-2) 55%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
  }
  .vg-ic {
    width: 26px; height: 26px; padding: 5px; border-radius: 8px; box-sizing: border-box;
    color: var(--nc, var(--ink-2));
    background: color-mix(in srgb, var(--nc, #66788F) 13%, transparent);
    border: 1px solid color-mix(in srgb, var(--nc, #66788F) 32%, transparent);
  }
  .vg-row b, .vg-lane b {
    background: var(--surface-3); border-radius: 999px; padding: 3px 9px;
    font-size: 10.5px; color: var(--ink);
  }
  /* connector: gradient thread + arrowhead instead of a bare glyph */
  .vg-con { font-size: 0; display: flex; flex-direction: column; align-items: center; padding: 1px 0; }
  .vg-con::before { content: ""; width: 2px; height: 12px;
    background: linear-gradient(rgba(158,178,208,.15), rgba(245,177,76,.55)); border-radius: 1px; }
  .vg-con::after { content: ""; width: 0; height: 0; margin-top: -1px;
    border-left: 4px solid transparent; border-right: 4px solid transparent;
    border-top: 5px solid rgba(245,177,76,.6); }
  .vg-lanes { position: relative; padding-top: 2px; }
  .vg-lane { border-left: none; border-top: 3px solid var(--nc, var(--line)); }
  /* modal variant scales the same look up */
  .graph-modal.gm-vert .vg-ic { width: 32px; height: 32px; padding: 6px; }
  .graph-modal.gm-vert .vg-row b, .graph-modal.gm-vert .vg-lane b { font-size: 12px; padding: 4px 11px; }
  .graph-modal.gm-vert .vg-con::before { height: 16px; }
}

/* ============================================================= */
/* v13 — field exam redesign                                     */
/* ============================================================= */

.exam-head { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; flex-wrap: wrap;
  background: linear-gradient(120deg, rgba(245,177,76,.07), var(--surface) 55%); }
.eh-emblem { width: 54px; height: 54px; object-fit: contain; flex-shrink: 0;
  filter: drop-shadow(0 4px 14px rgba(245,177,76,.3)); }
.eh-title { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.eh-eyebrow { font-size: 9.5px; letter-spacing: .22em; color: var(--amber); }
.eh-title b { font-family: var(--font-display); font-size: 16px; }
.eh-title span:last-child { font-size: 12px; color: var(--ink-3); }
.eh-cells { display: flex; gap: 0; }
.eh-cell { display: flex; flex-direction: column; gap: 2px; padding: 0 18px; border-left: 1px dashed var(--line); }
.eh-cell span { font-size: 8.5px; letter-spacing: .16em; color: var(--ink-3); }
.eh-cell b { font-family: var(--font-mono); font-size: 15px; font-weight: 600; }
.eh-cell b i { font-style: normal; color: var(--amber); }
.eh-cell b.amber { color: var(--amber); }

.exam-dots { display: flex; gap: 10px; margin: 6px 0 18px; }
.edot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  font-size: 11px; border: 1.5px solid var(--ink-3); color: var(--ink-3); background: transparent; }
.edot.now { border-color: var(--amber); color: var(--amber); box-shadow: 0 0 0 4px rgba(245,177,76,.12); }
.edot.right { border-color: var(--green); color: var(--green); background: rgba(63,164,112,.12); }
.edot.wrong { border-color: var(--crit); color: var(--crit); background: rgba(217,106,94,.1); }

.exam-wrap { display: grid; grid-template-columns: 1fr 320px; gap: 18px; align-items: start; }
.exam-side { position: sticky; top: 118px; }
.es-h { display: block; font-size: 10px; letter-spacing: .18em; color: var(--cyan); margin-bottom: 12px; }
.es-h small { color: var(--ink-3); letter-spacing: .1em; }
.es-empty { font-size: 12.5px; color: var(--ink-3); line-height: 1.6; }
.es-sec { margin-top: 16px; }
.es-sec:first-child { margin-top: 0; }
.es-k { display: block; font-size: 9.5px; letter-spacing: .18em; color: var(--cyan); margin-bottom: 7px; }
.es-k.good { color: var(--green); } .es-k.bad { color: var(--crit); }
.es-sec p { font-size: 13px; color: var(--ink-2); line-height: 1.65; }
.ex-chip { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .08em; color: var(--cyan);
  border: 1px solid rgba(47,157,180,.4); border-radius: 999px; padding: 4px 11px;
  background: rgba(47,157,180,.07); }
.ex-chip:hover { color: var(--ink); border-color: var(--cyan); }
.ex-hint { font-size: 12px; color: var(--ink-3); margin-top: 10px; }

.exam-bar { display: flex; align-items: center; gap: 26px; margin-top: 18px; padding: 13px 20px; }
.eb-cell { display: flex; flex-direction: column; gap: 2px; }
.eb-cell span { font-size: 8.5px; letter-spacing: .16em; color: var(--ink-3); }
.eb-cell b { font-family: var(--font-mono); font-size: 15px; }
.eb-cell b i { font-style: normal; color: var(--amber); }
.eb-hint { margin-left: auto; font-size: 12px; color: var(--ink-3); }

@media (max-width: 1000px) { .exam-wrap { grid-template-columns: 1fr; } .exam-side { position: static; } }
@media (max-width: 720px) {
  .exam-head { gap: 12px; }
  .eh-cells { width: 100%; justify-content: space-between; }
  .eh-cell { padding: 0 10px 0 0; border-left: 0; }
  .exam-dots { flex-wrap: wrap; }
  .exam-bar { flex-wrap: wrap; gap: 14px; }
  .eb-hint { margin-left: 0; flex-basis: 100%; }
  /* stage rail: equidistant stops, horizontal scroll */
  .rail { overflow-x: auto; scrollbar-width: none; }
  .rail::-webkit-scrollbar { display: none; }
  .stop { flex: 0 0 auto; min-width: 58px; }
}

/* ============================================================= */
/* v13.1 — horizontal blueprint everywhere; polished node cards  */
/* ============================================================= */
.ag-node { filter: drop-shadow(0 3px 8px rgba(0, 0, 0, .38)); }
.graph-pan { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
@media (max-width: 720px) {
  #simgraph { display: block; }                 /* horizontal graph is back on mobile */
  #simgraph svg.ag-svg { min-width: 700px; }
  .vg-host { display: none !important; }
  .gm-scroll { overflow-x: auto; }
  #gm-mount svg.ag-svg { min-width: 700px; }
  .mc-graph-sec .mission-graph svg.ag-svg { min-width: 0; } /* sidebar mini stays fit-to-width */
}

/* mobile blueprints: fit-to-width first, opt-in zoom (pan) */
.gm-zoom { display: none; }
@media (max-width: 720px) {
  #simgraph svg.ag-svg { min-width: 0; }                    /* whole graph visible, tap for viewer */
  #gm-mount svg.ag-svg { min-width: 0; }
  .graph-modal.zoomed #gm-mount svg.ag-svg { min-width: 720px; }
  .gm-zoom { display: inline-block; position: absolute; top: 12px; right: 46px;
    font-size: 10px; letter-spacing: .12em; color: var(--amber);
    border: 1px solid rgba(245,177,76,.4); border-radius: 999px; padding: 5px 11px; }
}

/* ============================================================= */
/* v14 — mission photography                                     */
/* ============================================================= */

/* card art strips (dashboard + landing) */
.m-art { margin: -1px -1px 0; border-radius: var(--radius) var(--radius) 0 0; overflow: hidden;
  position: relative; }
.m-art::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(13,20,32,.05), rgba(13,20,32,.55) 82%, var(--surface)); }
.m-art img { display: block; width: 100%; height: 118px; object-fit: cover;
  transition: transform .5s ease; }
.mcard:hover .m-art img { transform: scale(1.05); }
.mcard.locked .m-art img { filter: grayscale(.85) brightness(.6); }

/* mission-card layout adjustments: art bleeds to the card edges */
.mission-grid .mcard, .mission-strip .mcard { overflow: hidden; }
.mission-grid .mcard { padding-top: 0; }
.mission-grid .mcard .m-art + .m-top { margin-top: 12px; }
.mission-strip .mcard { padding-top: 0; }

/* path hero + active-mission art */
.pc-art { margin: -18px -18px 12px; overflow: hidden; border-radius: 12px 12px 0 0; position: relative; }
.active-card .pc-art { margin: -16px -16px 12px; }
.pc-art::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(13,20,32,.02), rgba(13,20,32,.5) 85%, var(--surface-2)); }
.pc-art img { display: block; width: 100%; height: 120px; object-fit: cover; }

/* mission brief hero banner */
.brief-hero { position: relative; border-radius: var(--radius); overflow: hidden; margin-bottom: 20px;
  border: 1px solid var(--line); }
.brief-hero img { display: block; width: 100%; height: clamp(160px, 26vw, 260px); object-fit: cover; }
.brief-hero::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(13,20,32,.05), rgba(13,20,32,.45)); }
.brief-hero .bh-tag { position: absolute; left: 14px; bottom: 12px; z-index: 1;
  font-size: 9.5px; letter-spacing: .2em; color: var(--ink);
  background: rgba(13,20,32,.65); border: 1px solid rgba(255,255,255,.16);
  border-radius: 999px; padding: 5px 12px; backdrop-filter: blur(6px); }

@media (max-width: 720px) {
  .m-art img { height: 96px; }
  .pc-art img { height: 104px; }
  .brief-hero img { height: 150px; }
}

/* brand mark (all pages; pages.css refines the landing header) */
.logo { display: inline-flex; align-items: center; gap: 9px; }
.logo-mark { width: 24px; height: 24px; flex-shrink: 0; display: block; }
.logo-txt { white-space: nowrap; }

/* ============================================================= */
/* v18 — themed scrollbars (replaces the default chrome bars)     */
/* ============================================================= */
* { scrollbar-width: thin; scrollbar-color: rgba(120, 145, 180, .38) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(140, 165, 200, .42), rgba(90, 115, 150, .42));
  border-radius: 999px; border: 3px solid transparent; background-clip: padding-box;
  transition: background .25s;
}
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(245, 177, 76, .8), rgba(201, 129, 32, .8));
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:active { background: var(--amber); background-clip: padding-box; }
/* horizontal panes (route map, graph pans) get a slimmer bar */
.route-scroll::-webkit-scrollbar, .graph-pan::-webkit-scrollbar,
.gm-scroll::-webkit-scrollbar, .rail::-webkit-scrollbar { height: 8px; }

/* ============================================================= */
/* v19 — on-site photo strips in the phase sidebars              */
/* ============================================================= */
.site-strip { position: relative; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line); margin-bottom: 12px; }
.site-strip img { display: block; width: 100%; height: 112px; object-fit: cover;
  transition: transform .6s cubic-bezier(.2,.9,.3,1); }
.site-strip:hover img { transform: scale(1.05); }
.site-strip::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(13,20,32,.15), rgba(13,20,32,.82)); }
.site-strip .ss-tag { position: absolute; left: 10px; bottom: 27px; z-index: 1;
  font-size: 8.5px; letter-spacing: .2em; color: var(--amber); }
.site-strip .ss-co { position: absolute; left: 11px; bottom: 9px; z-index: 1;
  font-size: 11.5px; font-weight: 600; color: var(--ink); }
.disc-right .site-strip { margin-bottom: 0; }
@media (max-width: 720px) { .site-strip img { height: 84px; } }

/* ============================================================= */
/* v19.1 — horizontal panes: swipe, don't show a bar             */
/* ============================================================= */
/* these are intentional side-scrollers (rail, ladder, map, graph). A visible
   bar reads as "the page is broken", so hide the chrome and hint with a fade. */
.rail, .rank-ladder, .route-scroll, .graph-pan, .gm-scroll,
.course-rail, .cc-chips, .exam-dots, .mc-chips, .fact-chips {
  scrollbar-width: none; -ms-overflow-style: none;
}
.rail::-webkit-scrollbar, .rank-ladder::-webkit-scrollbar, .route-scroll::-webkit-scrollbar,
.graph-pan::-webkit-scrollbar, .gm-scroll::-webkit-scrollbar, .course-rail::-webkit-scrollbar,
.cc-chips::-webkit-scrollbar, .exam-dots::-webkit-scrollbar, .mc-chips::-webkit-scrollbar,
.fact-chips::-webkit-scrollbar { display: none; width: 0; height: 0; }

/* edge fade tells you there's more to swipe, without a scrollbar */
@media (max-width: 720px) {
  .route-scroll, .graph-pan, .rank-ladder {
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 14px, #000 calc(100% - 14px), transparent);
    mask-image: linear-gradient(90deg, transparent, #000 14px, #000 calc(100% - 14px), transparent);
  }
  html, body { overflow-x: hidden; }   /* belt and braces against stray overflow */
}

/* ============================================================= */
/* v20 — Learn more cards + deep concept blocks in popups        */
/* ============================================================= */
.oc-concepts { font-size: 9.5px; letter-spacing: .12em; color: var(--ink-3); }
.oc-more { margin-left: auto; flex-shrink: 0; font-size: 10px; letter-spacing: .1em;
  color: var(--cyan); border: 1px solid rgba(47,157,180,.4); border-radius: 999px;
  padding: 6px 13px; background: rgba(47,157,180,.07); transition: all .2s; }
.optcard:hover .oc-more { color: var(--ink); border-color: var(--cyan); background: rgba(47,157,180,.16); }
.decision-block .optcard { display: flex; flex-direction: column; gap: 8px; }
.decision-block .optcard .oc-foot { margin-top: auto; display: flex; align-items: center; gap: 10px; padding-top: 4px; }
.am-note { font-size: 12px; color: var(--ink-3); margin-bottom: 12px; }

/* one teaching block per concept */
.tdeep { border: 1px solid var(--line); border-radius: 11px; padding: 14px 15px; margin-bottom: 10px;
  background: linear-gradient(180deg, rgba(255,255,255,.02), transparent); }
.td-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.td-head b { font-family: var(--font-display); font-size: 15px; color: var(--ink); }
.td-tag { font-size: 8px; letter-spacing: .18em; color: var(--cyan); border: 1px solid rgba(47,157,180,.35);
  border-radius: 999px; padding: 3px 8px; margin-left: auto; }
.td-mission { font-size: 12.5px; color: var(--ink-2); line-height: 1.55; padding: 9px 11px; margin-bottom: 9px;
  border-left: 2px solid var(--cyan); background: rgba(47,157,180,.07); border-radius: 0 7px 7px 0; }
.td-mission b { color: var(--cyan); }
.td-what { font-size: 13px; color: var(--ink-2); line-height: 1.65; }
.td-viz { margin: 12px 0; }
.td-bite { font-size: 12.5px; color: var(--ink-2); line-height: 1.55; margin-top: 10px;
  padding: 9px 11px; border-left: 2px solid var(--crit); background: rgba(217,106,94,.07); border-radius: 0 7px 7px 0; }
.td-bite b { color: var(--crit); }

/* ============================================================= */
/* v21 — sim liveliness: node hits + conversational log          */
/* ============================================================= */
.ag-node.ag-hit rect:first-of-type { animation: aghit .62s ease-out; }
@keyframes aghit {
  0%   { filter: brightness(1); }
  35%  { filter: brightness(1.55) drop-shadow(0 0 10px rgba(245,177,76,.7)); }
  100% { filter: brightness(1); }
}
.ag-node.ag-hit .ag-count { animation: agcount .62s ease-out; }
@keyframes agcount { 0%,100% { opacity: 1; } 40% { opacity: .35; transform: translateY(-1px); } }

/* deployment log: milestones vs. real exchanges */
.eventlog .evt.exchange { align-items: flex-start; animation: stagein .32s ease both; }
.ex-body { display: flex; flex-direction: column; gap: 3px; }
.ex-q { color: var(--ink); font-size: 12.5px; line-height: 1.45; }
.ex-a { color: var(--ink-2); font-size: 12px; line-height: 1.5; }
.ex-a b { font-family: var(--font-mono); font-size: 8.5px; letter-spacing: .12em;
  padding: 2px 6px; border-radius: 4px; margin-right: 6px; vertical-align: 1px; }
.ex-a b.fa { color: var(--green); background: rgba(63,164,112,.14); }
.ex-a b.fd { color: var(--warn); background: rgba(217,161,59,.14); }
.ex-a b.fh { color: var(--violet); background: rgba(143,111,224,.14); }
.ex-meta { font-style: normal; color: var(--ink-3); font-size: 9.5px; margin-left: 6px; letter-spacing: .06em; }
.eventlog .evt.milestone .tx { color: var(--ink-2); }
.eventlog .evt.milestone { border-left: 2px solid rgba(245,177,76,.4); padding-left: 8px; }
.eventlog { max-height: 300px; overflow-y: auto; }
@media (prefers-reduced-motion: reduce) {
  .ag-node.ag-hit rect:first-of-type, .ag-node.ag-hit .ag-count { animation: none; }
}
/* neutral build-effort fact on architecture cards (not a hint at correctness) */
.oc-ships { display: inline-block; align-self: flex-start; font-size: 9.5px; letter-spacing: .1em;
  color: var(--ink-2); border: 1px dashed var(--line); border-radius: 6px; padding: 4px 9px; }

/* ============================================================= */
/* v22 — honest verdict, richer debrief, compare view, components */
/* ============================================================= */

/* verdict honesty */
.call-line { font-size: 13px; color: var(--ink-2); margin-top: 8px; line-height: 1.55; }
.call-line b { color: var(--amber); }
/* the counterfactual: same architecture, strongest answers — matches the dashed
   "Best build" line in the simulation charts */
.cf-line { font-size: 12.5px; color: var(--ink-2); line-height: 1.55; margin-top: 8px;
  border-left: 2px dashed var(--violet); padding-left: 10px; text-align: left; }
.cf-line b { color: var(--violet); }
.score-nomedal { display: inline-block; margin: 0 auto 12px; font-size: 9.5px; letter-spacing: .2em;
  color: var(--crit); border: 1px dashed rgba(217,106,94,.5); border-radius: 999px; padding: 6px 14px; }

/* debrief: your pick vs the stronger call */
.db-correct { margin-top: 12px; padding: 11px 13px; border-radius: 9px;
  border: 1px solid rgba(245,177,76,.3); background: rgba(245,177,76,.06);
  display: flex; flex-direction: column; gap: 5px; }
.dbc-row { font-size: 13px; color: var(--ink-2); }
.dbc-row i { font-style: normal; font-size: 8.5px; letter-spacing: .18em; color: var(--ink-3);
  display: inline-block; min-width: 108px; }
.dbc-row.best { color: var(--ink); }
.dbc-row.best i { color: var(--amber); }
.dbc-why { font-size: 12.5px; color: var(--ink-2); line-height: 1.55; margin-top: 3px;
  padding-top: 7px; border-top: 1px dashed var(--line); }
.db-compare { margin-top: 11px; font-size: 10px; letter-spacing: .1em; color: var(--cyan);
  border: 1px solid rgba(47,157,180,.4); border-radius: 999px; padding: 7px 13px;
  background: rgba(47,157,180,.07); transition: all .2s; }
.db-compare:hover { color: var(--ink); border-color: var(--cyan); background: rgba(47,157,180,.16); }

/* comparison modal */
.cmp-modal { width: min(96vw, 940px); }
.cmp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin-top: 14px; }
.cmp-card { border: 1px solid var(--line); border-radius: 11px; padding: 14px; background: var(--surface-2);
  display: flex; flex-direction: column; gap: 8px; }
.cmp-card.best { border-color: rgba(63,164,112,.55); background: linear-gradient(180deg, rgba(63,164,112,.08), var(--surface-2)); }
.cmp-card.mine { box-shadow: 0 0 0 1px var(--amber); }
.cmp-tags { display: flex; gap: 6px; min-height: 16px; }
.cmp-tags span { font-size: 8px; letter-spacing: .16em; padding: 3px 8px; border-radius: 999px; }
.ct-best { color: var(--green); border: 1px solid rgba(63,164,112,.5); }
.ct-mine { color: var(--amber); border: 1px solid rgba(245,177,76,.5); }
.cmp-name { font-family: var(--font-display); font-weight: 700; font-size: 14.5px; line-height: 1.3; }
.cmp-desc { font-size: 12px; color: var(--ink-3); line-height: 1.5; }
.cmp-score { display: flex; align-items: center; gap: 8px; font-size: 8.5px; letter-spacing: .14em; color: var(--ink-3); }
.cmp-bar { flex: 1; height: 5px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.cmp-bar i { display: block; height: 100%; background: var(--amber); border-radius: 3px; }
.cmp-score b { font-size: 12px; color: var(--ink); }
.cmp-why { font-size: 12px; color: var(--ink-2); line-height: 1.55; padding-top: 8px; border-top: 1px dashed var(--line); }

/* clickable concept chips */
button.concept-chip { cursor: pointer; transition: transform .15s, border-color .2s; }
button.concept-chip:hover { transform: translateY(-1px); border-color: var(--amber); color: var(--ink); }

/* component-by-component walk */
.cwalk { border: 1px solid var(--line); border-radius: 11px; padding: 13px 15px; margin-bottom: 9px;
  background: linear-gradient(180deg, rgba(255,255,255,.02), transparent); }
.cw-head { display: flex; align-items: center; gap: 10px; margin-bottom: 7px; flex-wrap: wrap; }
.cw-no { font-size: 10px; color: var(--ink-3); }
.cw-head b { font-family: var(--font-display); font-size: 14.5px; }
.cw-role { margin-left: auto; font-size: 8px; letter-spacing: .16em; color: var(--cyan);
  border: 1px solid rgba(47,157,180,.35); border-radius: 999px; padding: 3px 8px; }
.cw-does { font-size: 12.5px; color: var(--ink-2); line-height: 1.6; }
.cw-io { font-size: 10.5px; color: var(--cyan); margin: 9px 0; padding: 7px 10px;
  border-left: 2px solid rgba(47,157,180,.45); background: rgba(47,157,180,.06); border-radius: 0 6px 6px 0; }
.cw-tech, .cw-watch { font-size: 12px; color: var(--ink-2); line-height: 1.55; margin-top: 6px; }
.cw-tech b { color: var(--ink); } .cw-watch b { color: var(--crit); }

/* ============================================================= */
/* v23 — architecture-scoped build: component tags + tuning      */
/* ============================================================= */
/* the chip wrapper is layout-neutral on wide screens: its children stay direct
   flex items of .db-head, in their original order */
.db-tags { display: contents; }
.db-comp { font-size: 8.5px; letter-spacing: .14em; color: var(--cyan);
  border: 1px solid rgba(47,157,180,.35); border-radius: 999px; padding: 4px 9px;
  background: rgba(47,157,180,.07); white-space: nowrap; }

.tune-wrap { margin-top: 6px; }
.tune-track { position: relative; display: flex; justify-content: space-between; gap: 6px;
  padding: 22px 6px 8px; }
.tune-track::before { content: ""; position: absolute; left: 22px; right: 22px; top: 30px;
  height: 3px; border-radius: 2px; background: var(--surface-3); }
.tune-stop { position: relative; z-index: 1; flex: 1; display: flex; flex-direction: column;
  align-items: center; gap: 9px; padding: 0 2px; }
.tune-stop i { width: 17px; height: 17px; border-radius: 50%; background: var(--bg);
  border: 2px solid var(--ink-3); transition: all .22s cubic-bezier(.2,1.3,.3,1); }
.tune-stop:hover i { border-color: var(--amber); transform: scale(1.12); }
.tune-stop.on i { border-color: var(--amber); background: var(--amber);
  box-shadow: 0 0 0 5px rgba(245,177,76,.16); transform: scale(1.2); }
.ts-val { font-size: 10px; letter-spacing: .04em; color: var(--ink-3); text-align: center;
  line-height: 1.35; transition: color .22s; }
.tune-stop.on .ts-val { color: var(--amber); font-weight: 500; }
.tune-detail { margin-top: 12px; padding: 13px 15px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--surface-2); }
.td-hint { font-size: 12.5px; color: var(--ink-3); line-height: 1.55; }
.td-set { font-size: 12px; letter-spacing: .08em; color: var(--amber); margin-bottom: 7px; }
.td-desc { font-size: 13px; color: var(--ink-2); line-height: 1.6; }
.td-learn { margin-top: 11px; }
@media (max-width: 720px) {
  .tune-track { flex-wrap: wrap; gap: 14px 6px; }
  .tune-track::before { display: none; }
  .tune-stop { flex: 0 0 calc(50% - 6px); flex-direction: row; justify-content: flex-start; gap: 8px; }
  .ts-val { text-align: left; }
  /* the header is a non-wrapping flex row, so a 100%-basis chip used to squeeze
     the title and print over it — let the row wrap and give the chips their
     own row, below the title and chevron */
  .decision-block .db-head { flex-wrap: wrap; row-gap: 7px; column-gap: 10px; }
  .decision-block .db-head h3 { flex: 1 1 auto; font-size: 15px; line-height: 1.32; }
  .decision-block .rm-chev { order: 1; margin-left: auto; }
  .db-tags { order: 2; flex: 0 0 100%; display: flex; flex-wrap: wrap; gap: 7px 8px; }
  .db-tags:not(:has(> :not([hidden]))) { display: none; }   /* no empty chip row */
  .db-comp { min-width: 0; max-width: 100%; overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap; }
}

/* ============================================================= */
/* v24 — richer concept visuals, aligned cards, explained metrics */
/* ============================================================= */

/* formulas */
.ck-fm { border: 1px dashed var(--line); border-radius: 10px; padding: 13px 15px; }
.fm-eq { font-size: 13px; color: var(--amber); line-height: 1.7; text-align: center;
  padding-bottom: 11px; border-bottom: 1px dashed var(--line); overflow-wrap: anywhere; }
.fm-parts { display: flex; flex-direction: column; gap: 7px; margin-top: 11px; }
.fm-part { display: flex; gap: 10px; align-items: baseline; font-size: 12.5px; color: var(--ink-2); }
.fm-part b { color: var(--cyan); flex-shrink: 0; min-width: 92px; font-size: 11.5px; }
.fm-note { font-size: 12.5px; color: var(--ink-3); line-height: 1.6; margin-top: 11px;
  padding-top: 10px; border-top: 1px dashed var(--line); }

/* two-way comparison */
.ck-vs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.vs-col { border: 1px solid var(--line); border-radius: 10px; padding: 12px 13px; }
.vs-col.good { border-color: rgba(63,164,112,.45); background: rgba(63,164,112,.05); }
.vs-col.bad { border-color: rgba(217,106,94,.4); background: rgba(217,106,94,.05); }
.vs-h { display: block; font-size: 9.5px; letter-spacing: .14em; margin-bottom: 9px; color: var(--ink-2); }
.vs-col.good .vs-h { color: var(--green); } .vs-col.bad .vs-h { color: var(--crit); }
.vs-col ul { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.vs-col li { font-size: 12px; color: var(--ink-2); line-height: 1.5; padding-left: 13px; position: relative; }
.vs-col li::before { content: "·"; position: absolute; left: 3px; color: var(--ink-3); }

/* mini line chart */
.ck-ln svg { width: 100%; height: 84px; display: block; }
.ln-legend { display: flex; gap: 16px; margin-top: 8px; font-size: 10.5px; color: var(--ink-3); }
.ln-legend span { display: flex; align-items: center; gap: 6px; }
.ln-legend i { width: 12px; height: 2.5px; border-radius: 2px; }

/* decision option cards: equal height, CTA can never overflow */
.decision-block .optrow { align-items: stretch; }
.decision-block .optcard { height: 100%; }
.decision-block .oc-foot { display: block; }
.decision-block .oc-more { display: block; width: 100%; margin-left: 0; text-align: center;
  padding: 8px 6px; font-size: 9.5px; letter-spacing: .06em; }

/* sim metric tiles: say what they mean */
.simcounters .tile.met { cursor: pointer; transition: border-color .2s, transform .15s; }
.simcounters .tile.met:hover { border-color: rgba(245,177,76,.5); transform: translateY(-2px); }
.simcounters .kh { font-size: 10.5px; color: var(--ink-3); line-height: 1.45; margin-top: 7px;
  padding-top: 7px; border-top: 1px dashed var(--line); }

/* in-transit: even panels before the run */
.simwrap > .panel { display: flex; flex-direction: column; }
.simwrap > .panel > h3 { margin-bottom: 10px; }
#chart-throughput, #chart-backlog, #chart-rt { min-height: 190px; display: flex; flex-direction: column;
  justify-content: center; }
#chart-throughput:empty::after, #chart-backlog:empty::after, #chart-rt:empty::after {
  content: "Standing by — charts fill in week by week."; font-size: 11.5px; color: var(--ink-3);
  text-align: center; font-family: var(--font-mono); letter-spacing: .06em;
}
.feedpanel .respfeed, .logpanel .eventlog { min-height: 190px; }
@media (max-width: 720px) { .ck-vs { grid-template-columns: 1fr; } .fm-part { flex-direction: column; gap: 2px; } }

/* ============================================================= */
/* v25 — real graphs in popups, stacked split, deeper concepts,   */
/*        preview-before-commit tuning (web + mobile)             */
/* ============================================================= */

/* architecture graph inside a popup */
.am-graph { border: 1px solid var(--line); border-radius: 10px; padding: 8px; background: rgba(13,20,32,.5); }
.am-graph svg.ag-svg { width: 100%; height: auto; display: block; }
.am-graph.clickable { cursor: zoom-in; }
.am-graph.clickable:hover { border-color: rgba(245,177,76,.4); }

/* where the work goes — labelled stacked bar */
.split-viz { display: block; }
.sv-cap { font-size: 8.5px; letter-spacing: .16em; color: var(--ink-3); margin-bottom: 9px; }
.sv-bar { display: flex; height: 26px; border-radius: 7px; overflow: hidden; border: 1px solid var(--line); }
.sv-seg { display: grid; place-items: center; min-width: 26px; transition: filter .2s; }
.sv-seg b { font-family: var(--font-mono); font-size: 11px; color: #0D1420; font-weight: 700; }
.sv-seg:hover { filter: brightness(1.15); }
.sv-keys { display: flex; flex-direction: column; gap: 6px; margin-top: 11px; }
.sv-key { display: flex; align-items: baseline; gap: 9px; font-size: 12.5px; color: var(--ink-2); }
.sv-key i { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; transform: translateY(1px); }
.sv-key b { font-size: 11.5px; color: var(--ink); min-width: 34px; }
.sv-note { font-size: 11.5px; color: var(--ink-3); line-height: 1.55; margin-top: 10px; }

/* concept blocks: sectioned, with a route into the full entry */
.td-sec { margin-top: 12px; }
.td-k { display: block; font-size: 8.5px; letter-spacing: .18em; color: var(--cyan); margin-bottom: 6px; }
.td-more { margin-top: 12px; font-size: 9.5px; letter-spacing: .1em; color: var(--cyan);
  border: 1px solid rgba(47,157,180,.35); border-radius: 999px; padding: 7px 12px;
  background: rgba(47,157,180,.06); transition: all .2s; }
.td-more:hover { color: var(--ink); border-color: var(--cyan); background: rgba(47,157,180,.15); }

/* tuning: read a setting, then commit it */
.td-acts { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.td-use { padding: 9px 18px; font-size: 13.5px; }
.td-live { font-style: normal; font-size: 8.5px; letter-spacing: .14em; color: var(--green);
  border: 1px solid rgba(63,164,112,.45); border-radius: 999px; padding: 3px 8px; margin-left: 8px; }
.tune-stop:focus-visible i { border-color: var(--amber); }

@media (max-width: 720px) {
  .am-graph { padding: 6px; overflow-x: auto; }
  .am-graph svg.ag-svg { min-width: 560px; }
  .sv-bar { height: 30px; }
  .td-acts { flex-direction: column; align-items: stretch; }
  .td-use, .td-learn { width: 100%; text-align: center; justify-content: center; }
}

/* ============================================================ v26
   DEPLOYMENT THEATRE — the six-week replay as a war room.
   The overlay owns no simulation state: it borrows the live nodes.
   ============================================================ */
body.th-open { overflow: hidden; }

.theatre-wrap { position: fixed; inset: 0; z-index: 300;
  display: flex; align-items: center; justify-content: center; padding: 22px;
  background: radial-gradient(1200px 700px at 50% -10%, rgba(47,157,180,.16), transparent 70%), rgba(6,10,18,.82);
  opacity: 0; transition: opacity .26s ease; }
.theatre-wrap.in { opacity: 1; }
/* no backdrop-filter here: it would become the containing block for the
   fixed floating CTAs underneath (this bit has bitten us three times) */

.theatre { width: min(1240px, 96vw); max-height: 94vh; display: flex; flex-direction: column;
  position: relative; overflow: hidden;
  border: 1px solid rgba(158,178,208,.22); border-radius: 20px;
  background: linear-gradient(180deg, rgba(24,34,52,.99), rgba(15,22,34,.99));
  box-shadow: 0 40px 120px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.05);
  transform: translateY(14px) scale(.985); transition: transform .3s cubic-bezier(.2,.9,.3,1); }
.theatre-wrap.in .theatre { transform: none; }

.th-head { display: flex; align-items: center; gap: 16px; padding: 15px 18px 12px; }
.th-titles { min-width: 0; }
.th-eyebrow { display: block; font-size: 10px; letter-spacing: .14em; color: var(--cyan); }
.th-week { font-size: 17px; font-weight: 700; letter-spacing: .04em; color: var(--ink); margin-top: 3px; }
.th-week.flip { animation: thflip .5s cubic-bezier(.2,.9,.3,1); }
@keyframes thflip { 0% { opacity: 0; transform: translateY(-7px); } 100% { opacity: 1; transform: none; } }
.th-ctl { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.th-ctl .sim-controls { display: flex; align-items: center; gap: 8px; }
.th-x { width: 32px; height: 32px; flex: none; border-radius: 50%; cursor: pointer;
  border: 1px solid rgba(158,178,208,.28); background: rgba(255,255,255,.05); color: var(--ink-2); font-size: 13px; }
.th-x:hover { background: rgba(255,255,255,.11); color: var(--ink); }

.th-track { position: relative; height: 6px; margin: 2px 18px 14px; border-radius: 4px;
  background: rgba(158,178,208,.14); box-shadow: inset 0 0 0 1px rgba(158,178,208,.14); overflow: hidden; }
.th-track i { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 4px;
  background: linear-gradient(90deg, var(--cyan), var(--amber));
  transition: width .55s cubic-bezier(.3,.8,.3,1);
  box-shadow: 0 0 18px rgba(245,177,76,.65), 0 0 4px rgba(245,177,76,.9); }
.th-track i::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.32), transparent);
  animation: thflow 1.6s linear infinite; }
@keyframes thflow { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.th-track b { position: absolute; top: 0; width: 2px; height: 6px; background: rgba(9,14,24,.85); z-index: 2; }
.th-track b:last-child { display: none; }
.theatre.done-anim .th-track i, .th-ctl .live { pointer-events: none; }
.th-ctl .live { display: inline-flex; align-items: center; gap: 6px; margin-right: 4px;
  font-size: 10px; letter-spacing: .12em; color: var(--amber); font-family: var(--font-mono); }
.th-ctl .live i { width: 7px; height: 7px; border-radius: 50%; background: var(--amber);
  box-shadow: 0 0 10px var(--amber); animation: thpulse 1.1s ease-in-out infinite; }
@keyframes thpulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.7); } }

/* isolate: panels inside carry their own z-index and were painting over the
   completion overlay; as its own stacking context the whole body stays under */
.th-body { flex: 1; min-height: 0; overflow: auto; padding: 0 18px 18px;
  position: relative; z-index: 0; isolation: isolate;
  display: grid; gap: 13px; align-content: start;
  grid-template-columns: 1fr 1fr;
  grid-template-areas: "graph graph" "counts counts" "charts charts" "feed feed"; }
.th-slot { min-width: 0; }
.th-graph  { grid-area: graph; }
.th-counts { grid-area: counts; }
.th-charts { grid-area: charts; }
.th-feed   { grid-area: feed; }

/* blueprint — capped so a 1200px theatre doesn't give it a 290px-tall band */
.th-graph .graph-pan { margin: 0 auto; max-width: 1020px; padding: 6px;
  border: 1px solid rgba(158,178,208,.16); border-radius: 14px;
  background: rgba(10,16,26,.55); overflow: hidden; min-height: 0; }
.th-graph .mission-graph { max-height: none; }
.th-graph .mission-graph-big { min-height: 0; }   /* no 240px dead band in here */
.th-graph .mission-graph svg { width: 100%; height: auto; display: block; }

/* counters — compact in here; the explainer copy is for the inline view */
.th-counts .simcounters { margin: 0; }
.th-counts .tile .kh { display: none; }
.th-counts .tile { padding: 13px 15px; display: flex; flex-direction: column;
  justify-content: center; gap: 3px; min-height: 0; }
.th-counts .defl-tile { flex-direction: row; align-items: center; gap: 12px; }

/* three charts across, so every metric moves in the same glance */
.th-charts { display: grid; gap: 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.th-charts .panel { margin: 0; padding: 12px 12px 6px; }
.th-charts .panel h3 { font-size: 12px; margin-bottom: 6px; }
.th-charts .panel h3::first-letter { text-transform: uppercase; }
.th-charts .chart-legend { font-size: 10px; }
.th-charts .chart-table, .th-charts details { display: none; }

/* feed + log side by side under the charts */
.th-feed { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.th-feed .panel { margin: 0; padding: 12px; }
.th-feed .panel h3 { font-size: 12px; margin-bottom: 6px; }
.th-feed .eventlog, .th-feed .respfeed { max-height: 172px; }

/* traffic sweep — one pass across the blueprint as each week lands */
.th-graph .graph-pan { position: relative; }
.th-graph .graph-pan.sweep::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(100deg, transparent 42%, rgba(245,177,76,.13) 50%, transparent 58%);
  animation: thsweep 1.1s ease-out; }
@keyframes thsweep { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* counters pop on change */
.tile.bumped { animation: thbump .52s cubic-bezier(.2,.9,.3,1); }
.tile.bumped .v, .tile.bumped .d-pct { animation: thpop .52s cubic-bezier(.2,.9,.3,1); }
@keyframes thbump { 0% { border-color: rgba(245,177,76,.55); box-shadow: 0 0 0 rgba(245,177,76,.4); }
  40% { box-shadow: 0 0 22px rgba(245,177,76,.22); } 100% { box-shadow: none; } }
@keyframes thpop { 0% { transform: scale(1); } 34% { transform: scale(1.13); color: var(--amber); } 100% { transform: scale(1); } }
.d-fill { transition: stroke-dashoffset .6s cubic-bezier(.3,.8,.3,1); }

/* charts draw themselves in on every weekly redraw */
.theatre .cl-line { animation: thdraw .55s ease-out; }
@keyframes thdraw { from { stroke-dasharray: 100; stroke-dashoffset: 100; } to { stroke-dasharray: 100; stroke-dashoffset: 0; } }
.theatre .cl-tip { animation: thtip .6s ease-out; }
@keyframes thtip { 0% { r: 3; opacity: .2; } 55% { r: 6; opacity: 1; } 100% { r: 3; opacity: 1; } }

/* completion stamp, then the theatre bows out */
.th-done { position: absolute; inset: 0; z-index: 9; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px; text-align: center;
  /* near-opaque: at .82 the dashboard behind read as noise through the stamp */
  background: radial-gradient(600px 400px at 50% 45%, rgba(20,29,45,.97), rgba(6,10,18,.96));
  animation: thfade .3s ease; }
.th-done p { color: var(--ink-2); font-size: 11px; letter-spacing: .12em; }
@keyframes thfade { from { opacity: 0; } to { opacity: 1; } }
.th-stamp { font-size: clamp(19px, 4.4vw, 40px); font-weight: 800; letter-spacing: .04em; color: var(--ink);
  padding: 14px 26px; border: 2px solid var(--amber); border-radius: 14px; margin: 0 14px;
  background: linear-gradient(180deg, rgba(37,50,73,.98), rgba(20,29,45,.98));
  box-shadow: 0 0 60px rgba(245,177,76,.3), inset 0 1px 0 rgba(255,255,255,.06);
  animation: thstamp .6s cubic-bezier(.2,1.5,.4,1); }
@keyframes thstamp { 0% { opacity: 0; transform: scale(1.5) rotate(-4deg); }
  60% { opacity: 1; transform: scale(.97) rotate(-1deg); } 100% { opacity: 1; transform: none; } }

@media (max-width: 900px) {
  .theatre-wrap { padding: 0; }
  .theatre { width: 100vw; max-height: 100vh; height: 100%; border: 0; border-radius: 0; }
  .th-body { grid-template-columns: 1fr; padding: 0 12px 16px; gap: 12px;
    grid-template-areas: "graph" "counts" "charts" "feed";
    -webkit-overflow-scrolling: touch; }
  .th-charts, .th-feed { grid-template-columns: 1fr; }
  .th-head { padding: 11px 12px 8px; gap: 8px; }
  /* the header must stay one line each — the company name was wrapping to three */
  .th-titles { flex: 1; min-width: 0; }
  .th-eyebrow, .th-week { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .th-eyebrow { font-size: 9px; letter-spacing: .1em; }
  .th-week { font-size: 14px; }
  .th-ctl { gap: 6px; }
  .th-ctl .live { font-size: 9px; letter-spacing: .08em; margin-right: 0; }
  .th-ctl .sim-controls { gap: 5px; }
  .th-x { width: 28px; height: 28px; }
  .th-track { margin: 0 12px 10px; height: 5px; }
  /* the blueprint is the centrepiece here, so it scrolls at a legible scale
     instead of shrinking to fit (the inline view keeps its zoom-out default) */
  .th-graph { position: relative; }
  .th-graph::after { content: ""; position: absolute; top: 1px; right: 1px; bottom: 1px; width: 34px;
    pointer-events: none; border-radius: 0 14px 14px 0;
    background: linear-gradient(90deg, transparent, rgba(15,22,34,.92)); }
  .th-graph .graph-pan { padding: 4px; scroll-behavior: smooth; }
  .th-counts .defl-tile { justify-content: center; }
  .th-graph #simgraph svg.ag-svg { min-width: 620px; }
  .th-graph .mission-graph-big { min-height: 0; }
  .th-counts .simcounters { grid-template-columns: 1fr 1fr; }
  .th-counts .defl-tile { grid-column: 1 / -1; }
  .th-feed .eventlog, .th-feed .respfeed { max-height: 156px; }
}
@media (max-width: 560px) {
  .th-ctl .sc-btn#sim-replay { font-size: 0; padding: 0; width: 30px; }
  .th-ctl .sc-btn#sim-replay::before { content: "↺"; font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  .theatre-wrap, .theatre { transition: none; }
  .th-week.flip, .tile.bumped, .tile.bumped .v, .theatre .cl-line, .theatre .cl-tip,
  .th-graph .graph-pan.sweep::after, .th-stamp, .th-track i::after, .th-ctl .live i { animation: none; }
}

/* ============================================================ v27
   COMPONENT DEEP-DIVE — how an input actually becomes an output.
   ============================================================ */
.cw-h { display: block; font-size: 9px; letter-spacing: .16em; color: var(--ink-3); margin-bottom: 7px; }

.cw-flow { margin: 11px 0 0; padding: 11px 13px; border-radius: 10px;
  background: rgba(47,157,180,.06); border: 1px solid rgba(47,157,180,.18); }
.cw-flow ol { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
.cw-flow li { font-size: 12.5px; color: var(--ink-2); line-height: 1.55; }
.cw-flow li::marker { color: var(--cyan); font-family: var(--font-mono); font-size: 11px; }

.cw-ex { margin: 10px 0 0; padding: 11px 13px; border-radius: 10px;
  background: rgba(63,164,112,.06); border: 1px solid rgba(63,164,112,.18); }
.cw-ex-row { display: flex; gap: 10px; align-items: flex-start; padding: 4px 0; }
.cw-ex-row + .cw-ex-row { border-top: 1px dashed rgba(158,178,208,.16); }
.cw-ex-row i { flex: none; width: 30px; font-size: 9px; letter-spacing: .12em; color: var(--ink-3);
  font-style: normal; padding-top: 2px; }
.cw-ex-row span { font-size: 12.5px; color: var(--ink-2); line-height: 1.55; }
.cw-ex-row.out span { color: var(--ink); }
.cw-ex-row.out i { color: var(--green); }

@media (max-width: 720px) {
  .cw-flow, .cw-ex { padding: 10px 11px; }
  .cw-flow ol { padding-left: 16px; }
  .cw-flow li, .cw-ex-row span { font-size: 12px; }
}

/* ============================================================ v28
   COMPONENT CHAIN — each box's input is the previous box's output.
   ============================================================ */
.cw-chain { margin: 10px 0 0; padding: 10px 12px; border-radius: 10px;
  background: rgba(47,157,180,.05); border: 1px solid rgba(47,157,180,.16); }
.cw-cr { display: flex; gap: 10px; align-items: flex-start; padding: 5px 0; }
.cw-cr + .cw-cr { border-top: 1px dashed rgba(158,178,208,.14); }
.cw-cr i { flex: none; width: 74px; font-style: normal; font-size: 8.5px;
  letter-spacing: .12em; color: var(--ink-3); padding-top: 3px; }
.cw-cr span { font-size: 12.5px; color: var(--ink-2); line-height: 1.55; min-width: 0; }
.cw-cr span b { display: block; font-size: 9px; letter-spacing: .1em;
  color: var(--cyan); font-weight: 500; margin-bottom: 2px; }
.cw-cr.out i { color: var(--green); }
.cw-cr.out span { color: var(--ink); }
.cw-cr.side i { color: var(--amber); }
.cw-cr.side span { color: var(--ink-2); font-style: italic; }
@media (max-width: 720px) {
  .cw-cr { flex-direction: column; gap: 2px; }
  .cw-cr i { width: auto; padding-top: 0; }
  .cw-cr span { font-size: 12px; }
}

/* ============================================================ v28
   WHERE A DESIGN SITS — every architecture says where in the client's existing
   pipeline it would be installed, what it fixes, and what it leaves alone.
   ============================================================ */
.am-place { border-left: 2px solid var(--line); padding: 2px 0 2px 12px; margin: 10px 0; }
.am-place .ap-h { display: block; font-size: 9px; letter-spacing: .16em; color: var(--ink-3); margin-bottom: 3px; }
.am-place p { margin: 0; font-size: 13px; line-height: 1.6; color: var(--ink-2); }
.am-place:first-of-type { border-left-color: var(--amber); }

/* ============================================================ v29
   SKILLS — the course ladder. A concept you have not reached yet is visibly
   out of reach, and says which mission opens it.
   ============================================================ */
.ck-group.ck-locked { opacity: .55; }
.ck-lock { margin-left: 8px; font-size: 8.5px; letter-spacing: .14em;
  color: var(--ink-3); border: 1px solid var(--line); border-radius: 999px; padding: 2px 7px; }
.ck-chip.locked { color: var(--ink-3); border-style: dashed; cursor: pointer; }
.ck-chip.locked b { color: var(--ink-3); }
.ck-chip.learned { border-color: rgba(158,178,208,.28); }
.ck-chip.learned b { color: var(--amber); }

/* ============================================================ v30
   CONCEPTS PER DESIGN — each architecture names only the concepts it actually
   turns on, and each chip jumps to that concept's entry further down.
   ============================================================ */
.am-concepts { margin-top: 12px; }
.ac-h { display: block; font-size: 9px; letter-spacing: .16em; color: var(--ink-3); margin-bottom: 7px; }
.ac-row { display: flex; flex-wrap: wrap; gap: 6px; }
.ac-chip { font: inherit; font-size: 12px; color: var(--ink); cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 12px; transition: border-color .15s, background .15s; }
.ac-chip:hover { border-color: var(--amber); background: var(--surface-3); }
.tdeep { scroll-margin-top: 12px; }
.td-hit { animation: tdhit 1.1s ease-out; }
@keyframes tdhit {
  0% { box-shadow: 0 0 0 2px var(--amber); }
  100% { box-shadow: 0 0 0 2px transparent; }
}

/* the mission photo runs to the edges on a phone, where the gutter is the frame */
@media (max-width: 720px) {
  .brief-hero { margin-left: -14px; margin-right: -14px; width: auto;
    border-radius: 0; border-left: 0; border-right: 0; }
}
@media (prefers-reduced-motion: reduce) { .td-hit { animation: none; } }

/* ============================================================ v31
   OPEN THE DESIGN — reading the full explanation is the point of this screen,
   so the entry to it is the loudest thing on the card, not a quiet footnote.
   ============================================================ */
.optcard.arch-opt .oc-more {
  margin-left: 0; width: 100%; text-align: center; letter-spacing: .1em;
  font-size: 11px; font-weight: 600; padding: 11px 14px; border-radius: 9px;
  color: var(--bg); background: var(--amber); border: 1px solid var(--amber);
  box-shadow: 0 6px 18px color-mix(in srgb, var(--amber) 22%, transparent);
  transition: transform .15s, box-shadow .15s, filter .15s; }
.optcard.arch-opt:hover .oc-more,
.optcard.arch-opt:focus-within .oc-more {
  color: var(--bg); background: var(--amber); border-color: var(--amber);
  transform: translateY(-1px); filter: brightness(1.06);
  box-shadow: 0 10px 26px color-mix(in srgb, var(--amber) 34%, transparent); }
.optcard.arch-opt .oc-foot { display: block; margin-top: auto; padding-top: 12px; }
/* once an architecture is locked the button is a way back in, not a call to action */
.stage-locked .optcard.arch-opt .oc-more {
  color: var(--amber); background: transparent;
  box-shadow: none; border-color: color-mix(in srgb, var(--amber) 45%, transparent); }
@media (prefers-reduced-motion: reduce) {
  .optcard.arch-opt:hover .oc-more { transform: none; }
}

/* the branches a box can take, so a design can be reasoned about rather than read */
.cw-out { margin-top: 12px; }
.cw-out ul { margin: 0; padding-left: 0; list-style: none; display: grid; gap: 6px; }
.cw-out li { position: relative; padding-left: 18px; font-size: 12.5px;
  line-height: 1.55; color: var(--ink-2); }
.cw-out li::before { content: "→"; position: absolute; left: 0; top: 0;
  color: var(--amber); font-size: 11px; }

/* ============================================================ v32
   THE PRIMER — the client's vocabulary in plain words, before the brief that
   uses it. Nobody should lose a mission to not knowing what a clause is.
   ============================================================ */
.primer { margin-bottom: 20px; }
.pr-h { display: block; font-size: 9px; letter-spacing: .18em; color: var(--amber); margin-bottom: 8px; }
.pr-note { font-size: 12.5px; color: var(--ink-3); margin: 0 0 14px; line-height: 1.55; }
.pr-list { margin: 0; display: grid; gap: 12px; }
.pr-row { display: grid; grid-template-columns: minmax(140px, 210px) 1fr; gap: 14px;
  align-items: baseline; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.pr-row:last-child { border-bottom: 0; padding-bottom: 0; }
.pr-row dt { font-weight: 600; color: var(--ink); font-size: 13.5px; }
.pr-row dd { margin: 0; color: var(--ink-2); font-size: 13px; line-height: 1.65; }
@media (max-width: 720px) {
  .pr-row { grid-template-columns: 1fr; gap: 4px; }
}

/* ============================================================ v33
   SUPPORT BOT — the client's vocabulary, the concepts, and your own notes,
   available on every screen instead of a wall of definitions on one.
   ============================================================ */
.sb-root { position: fixed; z-index: 80; right: 20px; bottom: 20px; }
.sb-launch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 600; color: var(--bg);
  background: var(--amber); border: 0; border-radius: 999px; padding: 11px 18px 11px 13px;
  box-shadow: 0 8px 26px rgba(0,0,0,.45); transition: transform .15s, filter .15s; }
.sb-launch:hover { transform: translateY(-1px); filter: brightness(1.06); }
.sb-launch-ic { display: grid; place-items: center; width: 20px; height: 20px;
  border-radius: 50%; background: rgba(13,20,32,.22); font-size: 12px; font-weight: 700; }
.sb-open .sb-launch { display: none; }

.sb-panel { display: none; flex-direction: column; width: min(92vw, 400px);
  max-height: min(74vh, 640px); background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: 0 24px 60px rgba(0,0,0,.55); overflow: hidden; }
.sb-open .sb-panel { display: flex; }
.sb-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 14px 14px 10px; border-bottom: 1px solid var(--line); }
.sb-eyebrow { display: block; font-size: 8.5px; letter-spacing: .2em; color: var(--amber); }
.sb-title { display: block; font-size: 14px; margin-top: 3px; color: var(--ink); }
.sb-close { background: none; border: 0; color: var(--ink-3); font-size: 15px; cursor: pointer; padding: 2px 4px; }
.sb-close:hover { color: var(--ink); }

.sb-tabs { display: flex; gap: 4px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.sb-tab { flex: 1; font: inherit; font-size: 10px; letter-spacing: .1em; cursor: pointer;
  color: var(--ink-3); background: transparent; border: 1px solid transparent;
  border-radius: 7px; padding: 7px 6px; transition: all .15s; }
.sb-tab:hover { color: var(--ink-2); }
.sb-tab.on { color: var(--bg); background: var(--amber); border-color: var(--amber); font-weight: 600; }

.sb-body { overflow-y: auto; padding: 12px 14px 16px; -webkit-overflow-scrolling: touch; }
.sb-search { position: sticky; top: -12px; background: var(--surface); padding-bottom: 10px; z-index: 1; }
.sb-search input { width: 100%; font: inherit; font-size: 13px; color: var(--ink);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; }
.sb-search input:focus { outline: none; border-color: var(--amber); }
.sb-list { margin: 0; display: grid; gap: 12px; }
.sb-row { padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.sb-row:last-child { border-bottom: 0; padding-bottom: 0; }
.sb-row dt { font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 4px;
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.sb-row dd { margin: 0; font-size: 12.5px; line-height: 1.6; color: var(--ink-2); }
.sb-row mark { background: color-mix(in srgb, var(--amber) 28%, transparent);
  color: var(--ink); border-radius: 3px; padding: 0 2px; }
.sb-tag { font-size: 8px; letter-spacing: .14em; color: var(--ink-3);
  border: 1px solid var(--line); border-radius: 999px; padding: 2px 7px; }
.sb-empty { font-size: 12.5px; line-height: 1.6; color: var(--ink-3); margin: 6px 0; }

.sb-hint { font-size: 11.5px; line-height: 1.55; color: var(--ink-3); margin: 0 0 10px; }
.sb-notes textarea { width: 100%; min-height: 210px; resize: vertical; font: inherit;
  font-size: 13px; line-height: 1.6; color: var(--ink); background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 8px; padding: 11px 12px; }
.sb-notes textarea:focus { outline: none; border-color: var(--amber); }
.sb-noterow { display: flex; align-items: center; justify-content: space-between; margin-top: 9px; }
.sb-saved { font-size: 8.5px; letter-spacing: .18em; color: var(--green); }
.sb-clear { font: inherit; font-size: 10px; letter-spacing: .1em; cursor: pointer;
  color: var(--ink-3); background: none; border: 1px solid var(--line);
  border-radius: 7px; padding: 6px 11px; }
.sb-clear:hover { color: var(--crit); border-color: color-mix(in srgb, var(--crit) 50%, transparent); }

/* On a phone it is a sheet, and it clears the bottom tab bar. */
@media (max-width: 720px) {
  .sb-root { right: 14px; bottom: calc(74px + env(safe-area-inset-bottom, 0px)); }
  .sb-launch { padding: 10px 15px 10px 11px; font-size: 12.5px; }
  .sb-open { position: fixed; inset: 0; right: 0; bottom: 0; }
  .sb-open .sb-panel { width: 100%; height: 100%; max-height: none; border-radius: 0; border: 0; }
  .sb-open .sb-body { padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px)); }
  .sb-notes textarea { min-height: 40vh; }
}
@media (prefers-reduced-motion: reduce) { .sb-launch:hover { transform: none; } }

/* one line where the wall of definitions used to be */
.primer-cue { font-size: 13px; line-height: 1.65; color: var(--ink-2);
  background: var(--surface); border: 1px solid var(--line); border-left: 2px solid var(--amber);
  border-radius: var(--radius); padding: 13px 16px; margin: 0 0 20px; }
.pc-open { font: inherit; font-size: 13px; font-weight: 600; color: var(--amber);
  background: none; border: 0; border-bottom: 1px dashed currentColor; padding: 0; cursor: pointer; }
.pc-open:hover { color: var(--ink); }

/* ============================================================ v34
   CHART DETAIL — a chart in a three-up row is a shape you glance at. Opened,
   it is the same chart with room to read the numbers.
   ============================================================ */
.chart-panel { cursor: pointer; transition: border-color .15s, transform .15s; }
.chart-panel:hover { border-color: color-mix(in srgb, var(--amber) 45%, transparent); }
.chart-panel:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.chart-panel h3 { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.ch-zoom { flex-shrink: 0; font-size: 8.5px; letter-spacing: .16em; color: var(--ink-3);
  border: 1px solid var(--line); border-radius: 999px; padding: 3px 9px; transition: all .15s; }
.chart-panel:hover .ch-zoom { color: var(--amber); border-color: color-mix(in srgb, var(--amber) 50%, transparent); }

.chart-modal-wrap { position: fixed; inset: 0; z-index: 320;  /* above the theatre */ background: rgba(7,11,18,.72);
  backdrop-filter: blur(4px); display: grid; place-items: center; padding: 24px;
  animation: fadein .2s ease both; }
.chart-modal { position: relative; width: min(94vw, 940px); max-height: 90vh; overflow-y: auto;
  animation: modalpop .3s cubic-bezier(.2,1.2,.3,1) both; }
.cm-eyebrow { display: block; font-size: 9px; letter-spacing: .18em; color: var(--amber); }
.cm-title { margin: 6px 0 8px; font-size: 20px; }
.cm-note { margin: 0 0 18px; font-size: 13.5px; line-height: 1.65; color: var(--ink-2); max-width: 68ch; }
.cm-canvas .chart-svg { width: 100%; height: auto; }
.cm-canvas .datatable { margin-top: 16px; }
.cm-canvas .datatable table { width: 100%; }
.cm-now { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.cm-cell { background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 10px; padding: 11px 13px; }
.cm-k { display: flex; align-items: center; gap: 7px; font-size: 9px; letter-spacing: .14em;
  color: var(--ink-3); margin-bottom: 5px; }
.cm-k i { width: 9px; height: 9px; border-radius: 2px; flex-shrink: 0; }
.cm-cell b { font-size: 20px; font-family: var(--font-mono); color: var(--ink); }

@media (max-width: 720px) {
  .chart-modal-wrap { padding: 0; place-items: stretch; }
  .chart-modal { width: 100%; max-height: 100vh; border-radius: 0; border: 0;
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px)); }
  .cm-title { font-size: 17px; }
  .ch-zoom { display: none; }
}

/* ============================================================ v35
   DEBRIEF FIRST — what you got wrong is the lesson; the arithmetic that turned
   it into a number comes after. Anything that cost points reads as red.
   ============================================================ */
.debrief-panel { margin-bottom: 18px; }
.db-lede { font-size: 13px; line-height: 1.6; color: var(--ink-2); margin: 0 0 16px; max-width: 74ch; }
/* if a stronger call existed, this line cost points — say so in one colour,
   regardless of how badly it went */
.debrief-card.lost .dt { color: var(--crit); font-weight: 700; }
.debrief-card.lost { border-left: 2px solid color-mix(in srgb, var(--crit) 55%, transparent); }
.db-cost { display: inline-block; margin: 0 0 8px; font-size: 8.5px; letter-spacing: .18em;
  color: var(--crit); border: 1px solid color-mix(in srgb, var(--crit) 45%, transparent);
  background: color-mix(in srgb, var(--crit) 10%, transparent);
  border-radius: 999px; padding: 3px 9px; }
.debrief-card.risky .db-cost { color: var(--warn);
  border-color: color-mix(in srgb, var(--warn) 45%, transparent);
  background: color-mix(in srgb, var(--warn) 10%, transparent); }
.db-missed { color: var(--crit); font-weight: 700; }
.dbc-row.best { color: var(--green); font-weight: 600; }

/* ============================================================ v36
   WHAT YOU ACTUALLY BUILD — a diagram hides the three things that decide cost
   and risk: is this AI, is it something new, does it store anything.
   ============================================================ */
.cw-build { margin-top: 12px; padding: 11px 13px; border-radius: 9px;
  background: var(--surface-2); border: 1px solid var(--line); }
.cw-build dl { margin: 6px 0 0; display: grid; gap: 8px; }
.cw-build dl > div { display: grid; grid-template-columns: minmax(115px, 150px) 1fr; gap: 12px;
  align-items: baseline; }
.cw-build dt { font-size: 11px; letter-spacing: .04em; color: var(--amber); font-weight: 600; }
.cw-build dd { margin: 0; font-size: 12.5px; line-height: 1.55; color: var(--ink-2); }
@media (max-width: 720px) { .cw-build dl > div { grid-template-columns: 1fr; gap: 2px; } }

/* the modal now reads as five numbered steps rather than a wall of sections */
.am-lead { font-size: 14.5px; line-height: 1.7; color: var(--ink); }
.am-place.warn { border-left-color: var(--crit); }
.am-split { margin-top: 14px; }
.am-why { color: var(--ink-2); }
.am-watch { color: var(--ink-2); font-size: 13px; }

/* ═══════════════════════════════════════════════════════════════════════════
   THE LEARNING LAYER  (learn.js)
   Everything here is inert unless the mission carries the optional keys.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ---- the payoff, on the briefing ---- */
.payoff {
  margin: 26px 0 4px; padding: 18px 20px;
  border: 1px solid var(--line); border-left: 3px solid var(--amber);
  border-radius: var(--radius); background: var(--surface);
}
.po-eyebrow { display: block; font-size: 10.5px; letter-spacing: .14em; color: var(--amber); }
.po-line { margin: 8px 0 12px; font-size: 17px; line-height: 1.5; color: var(--ink); max-width: 62ch; }
.po-cells { display: flex; flex-wrap: wrap; gap: 10px 22px; }
.po-cell { font-size: 13px; color: var(--ink-2); }
.po-cell b { font-family: var(--font-mono); color: var(--ink); font-size: 15px; margin-right: 4px; }

/* ---- the concept card ---- */
/* clear of the floating Help button and, on mobile, the bottom tab bar */
.learn-toasts {
  position: fixed; right: 18px; bottom: 88px; z-index: 60;
  display: flex; flex-direction: column; gap: 10px;
  width: min(340px, calc(100vw - 36px)); pointer-events: none;
}
@media (max-width: 720px) { .learn-toasts { bottom: 104px; left: 18px; width: auto; } }
.pattern-card {
  pointer-events: auto; position: relative;
  padding: 14px 34px 14px 16px; border-radius: var(--radius);
  background: var(--surface-2); border: 1px solid var(--line);
  border-left: 3px solid var(--amber);
  box-shadow: 0 10px 34px rgba(0, 0, 0, .45);
  animation: pcIn .32s cubic-bezier(.2, .8, .3, 1) both;
}
.pattern-card.again { border-left-color: var(--ink-3); }
.pattern-card.out { animation: pcOut .3s ease forwards; }
@keyframes pcIn { from { opacity: 0; transform: translateY(10px) scale(.98); } }
@keyframes pcOut { to { opacity: 0; transform: translateY(6px); } }
/* The label is just "CONCEPT". Only the first meeting is worth marking, so a
   concept coming round again wears no badge at all. */
.pc-eyebrow { display: block; font-size: 10px; letter-spacing: .13em; color: var(--ink-3); }
.pc-new {
  font-style: normal; margin-left: 6px; padding: 1px 5px; border-radius: 3px;
  background: var(--amber); color: var(--bg); font-size: 9px; letter-spacing: .1em;
}
.pc-name { display: block; font-family: var(--font-display); font-size: 15px; margin-top: 3px; }
.pc-title { display: block; font-size: 13px; color: var(--ink-2); margin: 2px 0 6px; }
.pc-body { font-size: 13px; line-height: 1.55; color: var(--ink-2); }
.pc-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-top: 11px;
}
.pc-more { font-size: 10px; letter-spacing: .13em; color: var(--ink-3); }
.pc-see {
  margin-left: auto; padding: 6px 4px; border: 0; background: transparent;
  color: var(--ink-3); font: inherit; font-size: 12px; cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px;
}
.pc-see:hover { color: var(--ink); }
.pc-ok {
  padding: 6px 14px; border-radius: 6px; cursor: pointer;
  border: 1px solid var(--amber); background: transparent;
  color: var(--amber); font: inherit; font-size: 12px;
}
.pc-foot .pc-see + .pc-ok { margin-left: 0; }
.pc-ok:hover { background: var(--amber); color: var(--bg); }
.pc-x {
  position: absolute; top: 8px; right: 8px; width: 22px; height: 22px;
  border: 0; border-radius: 5px; background: transparent;
  color: var(--ink-3); font-size: 16px; line-height: 1; cursor: pointer;
}
.pc-x:hover { background: var(--surface-3); color: var(--ink); }
@media (prefers-reduced-motion: reduce) {
  .pattern-card, .pattern-card.out { animation: none; }
}

/* ---- the signature challenge ---- */
.hero-ch { margin: 22px 0 26px; padding: 22px; border-left: 3px solid var(--violet); }
.hc-eyebrow { display: block; font-size: 10.5px; letter-spacing: .14em; color: var(--violet); }
.hc-title { font-size: 24px; margin: 6px 0 8px; }
.hc-lede { font-size: 15px; line-height: 1.55; color: var(--ink-2); max-width: 68ch; }
.hc-help { font-size: 13px; line-height: 1.5; color: var(--ink-3); margin-top: 8px; max-width: 68ch; }
.hc-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr));
  gap: 10px; margin: 18px 0 14px;
}
.hc-card {
  display: flex; flex-direction: column; gap: 5px; text-align: left;
  padding: 11px 12px; border-radius: 8px; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--line);
  color: var(--ink); font: inherit; transition: border-color .15s, background .15s;
}
/* Hover only speaks for a card that has nothing else to say. Left unqualified
   it outranks .picked on specificity, so resting the cursor on a card you had
   already picked greyed its border and it stopped looking picked. */
.hc-card:hover:not(:disabled):not(.picked):not(.linked) {
  border-color: var(--ink-3);
}
/* Two states that must never be mistaken for one another, so they differ in
   shape and not only in colour: what YOU picked is solid with a ticked box,
   what merely shares a detail is dashed. "linked" is listed first on purpose —
   a card can be both, and picked has to win. */
.hc-card.linked { border-color: var(--violet); border-style: dashed; }
.hc-card.picked, .hc-card.picked.linked {
  border-color: var(--amber); border-style: solid;
  background: rgba(245, 177, 76, .07);
}
/* The finished states. Neither is an error — you either found the ring or you
   were shown it — so neither wears the critical red. */
.hc-card.ring-found {
  border-color: var(--green); border-style: solid; background: rgba(63, 164, 112, .10);
}
.hc-card.ring-shown {
  border-color: var(--violet); border-style: solid; background: rgba(143, 111, 224, .10);
}
/* everything that was not the ring recedes, so the five stand out on their own */
.hc-grid.done .hc-card:not(.ring-found):not(.ring-shown) { opacity: .45; }
.hc-card:disabled { cursor: default; }
/* the tick box — says "this is selectable" before a single click */
.hcc-who { display: flex; align-items: center; gap: 6px; min-width: 0; }
.hcc-box {
  flex: none; width: 13px; height: 13px; border-radius: 3px;
  border: 1px solid var(--ink-3); position: relative;
}
.hc-card.picked .hcc-box { background: var(--amber); border-color: var(--amber); }
.hc-card.picked .hcc-box::after {
  content: "✓"; position: absolute; inset: 0; color: var(--bg);
  font-size: 10px; line-height: 13px; text-align: center; font-weight: 700;
}
.hc-card.ring-found .hcc-box { background: var(--green); border-color: var(--green); }
.hc-card.ring-found .hcc-box::after {
  content: "✓"; position: absolute; inset: 0; color: var(--bg);
  font-size: 10px; line-height: 13px; text-align: center; font-weight: 700;
}
.hc-card.ring-shown .hcc-box { background: var(--violet); border-color: var(--violet); }
.hc-legend {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px;
  margin-top: 10px; font-size: 11.5px; color: var(--ink-3);
}
.hc-legend .lg { width: 16px; height: 11px; border-radius: 3px; border: 1px solid; }
.hc-legend .lg-pick { border-color: var(--amber); background: rgba(245, 177, 76, .07); }
.hc-legend .lg-link { border-color: var(--violet); border-style: dashed; }
.hc-legend .lg-link { margin-left: 10px; }
.hcc-top { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; }
.hcc-top b { color: var(--ink); }
.hcc-top i { color: var(--ink-3); font-style: normal; }
.hcc-item { font-size: 13px; }
.hcc-reason { font-size: 12px; color: var(--ink-3); }
.hcc-attrs { display: flex; flex-direction: column; gap: 1px; margin-top: 3px; }
.hcc-attrs i {
  font-family: var(--font-mono); font-size: 10.5px; font-style: normal;
  color: var(--ink-3); padding: 1px 4px; border-radius: 3px; align-self: flex-start;
}
.hcc-attrs i.link { color: var(--bg); background: var(--violet); font-weight: 600; }
.hc-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.hc-count { font-size: 12px; color: var(--ink-3); }
.hc-result {
  margin-top: 12px; padding: 12px 14px; border-radius: 8px;
  font-size: 14px; line-height: 1.55; background: var(--surface-2);
  border-left: 3px solid var(--ink-3); color: var(--ink-2);
}
.hc-result b { color: var(--ink); margin-right: 4px; }
.hc-result.good { border-left-color: var(--green); }
.hc-result.bad { border-left-color: var(--warn); }
.hc-result.shown { border-left-color: var(--violet); }

/* ---- drill kind: threshold — two lines over a day of scored work ----
   Three zones, one colour each, used identically on the bars, the strip under
   them and the readouts: what the machine waves through, what a person reads,
   what the machine refuses. */
.th-ch { --z-lo: var(--cyan); --z-mid: var(--amber); --z-hi: var(--violet); }
.th-prices { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 12px; font-size: 11.5px; }
.thp { color: var(--ink-3); }
.thp::before { content: "◈ "; }
.thp-miss::before { color: var(--z-lo); }
.thp-false::before { color: var(--z-hi); }

.th-plot { margin: 16px 0 4px; }
.th-bars {
  display: flex; align-items: flex-end; gap: 2px; height: 132px;
  padding: 0 1px; border-bottom: 1px solid var(--line);
}
.th-bar {
  flex: 1; display: flex; flex-direction: column-reverse; justify-content: flex-start;
  height: 100%; min-width: 0;
}
/* honest returns sit under the fraud in the same column, so the mix in each
   band is the thing you read, not two charts side by side */
.th-bar i { display: block; width: 100%; border-radius: 2px 2px 0 0; transition: background .12s; }
.thb-legit { background: var(--ink-3); opacity: .5; }
.thb-fraud { background: var(--ink-2); }
.th-bar.z-lo .thb-fraud { background: var(--z-lo); }
.th-bar.z-mid .thb-fraud { background: var(--z-mid); }
.th-bar.z-hi .thb-fraud { background: var(--z-hi); }
.th-bar.z-lo .thb-legit { background: var(--z-lo); opacity: .26; }
.th-bar.z-mid .thb-legit { background: var(--z-mid); opacity: .26; }
.th-bar.z-hi .thb-legit { background: var(--z-hi); opacity: .26; }

.th-zones { display: flex; height: 4px; margin-top: 3px; gap: 2px; }
.tz { border-radius: 2px; transition: width .12s; }
.tz-lo { background: var(--z-lo); }
.tz-mid { background: var(--z-mid); }
.tz-hi { background: var(--z-hi); }
.th-axis { display: flex; justify-content: space-between; font-size: 10px; color: var(--ink-3); margin-top: 5px; }
.th-keys { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; font-size: 10.5px; color: var(--ink-3); margin-top: 8px; }
.th-note { font-family: var(--font-body); font-size: 11px; color: var(--ink-3); opacity: .8; }
.th-keys span { display: flex; align-items: center; gap: 6px; }
.th-keys .k { width: 10px; height: 10px; border-radius: 2px; }
.k-legit { background: var(--ink-3); opacity: .5; }
.k-fraud { background: var(--ink-2); }

.th-handles { display: grid; gap: 12px; margin: 18px 0 6px; }
.th-h { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 12px; }
.thh-name { font-size: 13px; color: var(--ink-2); }
.thh-v { font-size: 15px; color: var(--ink); grid-row: 1; grid-column: 2; }
.th-h input[type=range] { grid-column: 1 / -1; width: 100%; accent-color: var(--amber); cursor: pointer; }
.th-h input[type=range]:disabled { cursor: default; opacity: .6; }

.th-out { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin: 14px 0 4px; }
.tho {
  padding: 11px 13px; border-radius: 8px; background: var(--surface-2);
  border: 1px solid var(--line); border-left: 3px solid var(--ink-3);
}
.tho b { display: block; font-size: 21px; color: var(--ink); font-variant-numeric: tabular-nums; }
.tho span { display: block; font-size: 11.5px; line-height: 1.45; color: var(--ink-3); }
.tho-miss { border-left-color: var(--z-lo); }
.tho-queue { border-left-color: var(--z-mid); }
.tho-false { border-left-color: var(--z-hi); }
.thq { display: block; height: 4px; border-radius: 2px; background: var(--line); margin: 7px 0 5px; overflow: hidden; }
.thq i { display: block; height: 100%; background: var(--z-mid); transition: width .12s; }
.tho-queue.over { border-left-color: var(--crit); }
.tho-queue.over b, .tho-queue.over .thq-cap { color: var(--crit); }
.tho-queue.over .thq i { background: var(--crit); }
.th-sum { display: block; margin-top: 7px; font-size: 12px; color: var(--ink-3); }
.th-sum b { color: var(--ink); margin: 0; }
@media (prefers-reduced-motion: reduce) {
  .tz, .thq i, .th-bar i { transition: none; }
}

/* ---- drill kind: order — the steps, and what each one needs first ---- */
.od-slots { list-style: none; display: grid; gap: 8px; margin: 16px 0 14px; padding: 0; }
.od-slot {
  display: grid; grid-template-columns: 26px 1fr; align-items: center; gap: 10px;
  min-height: 54px; padding: 6px 8px; border-radius: 8px;
  border: 1px dashed var(--line); background: var(--surface-2);
}
.od-slot > i { font-size: 12px; color: var(--ink-3); text-align: center; font-style: normal; }
.od-slot.filled { border-style: solid; }
.od-slot.right { border-color: var(--green); background: rgba(63, 164, 112, .08); }
.od-pool { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.od-chip {
  display: flex; flex-direction: column; gap: 2px; text-align: left; cursor: pointer;
  padding: 8px 11px; border-radius: 7px; background: var(--surface-3);
  border: 1px solid var(--line); color: var(--ink); font: inherit; max-width: 100%;
}
.od-chip:hover { border-color: var(--ink-3); }
.od-chip b { font-size: 13px; }
.od-chip span { font-size: 11px; color: var(--ink-3); }
.od-drop .od-chip { width: 100%; background: transparent; border: 0; padding: 4px 2px; }

/* ---- drill kind: allocate — more worth doing than budget to do it ---- */
.al-budget { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; margin: 16px 0 12px; }
.alb-h { font-size: 11px; letter-spacing: .12em; color: var(--ink-3); }
.alb-v { font-size: 13px; color: var(--ink); grid-row: 1; grid-column: 2; }
.alb-bar { grid-column: 1 / -1; height: 5px; border-radius: 3px; background: var(--line); overflow: hidden; }
.alb-bar i { display: block; height: 100%; background: var(--amber); transition: width .12s; }
.al-budget.over .alb-bar i { background: var(--crit); }
.al-budget.over .alb-v { color: var(--crit); }
.al-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; margin-bottom: 14px; }
.al-item {
  display: flex; flex-direction: column; gap: 6px; text-align: left; cursor: pointer;
  padding: 11px 12px; border-radius: 8px; background: var(--surface-2);
  border: 1px solid var(--line); color: var(--ink); font: inherit;
}
.al-item:hover:not(:disabled):not(.picked) { border-color: var(--ink-3); }
.al-item.picked { border-color: var(--amber); background: rgba(245, 177, 76, .07); }
.al-item.ring-found { border-color: var(--green); background: rgba(63, 164, 112, .10); }
.al-item:disabled { cursor: default; }
.ali-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ali-top b { font-size: 13px; }
.ali-top i { font-size: 11px; color: var(--ink-3); font-style: normal; }
.ali-note { font-size: 11.5px; line-height: 1.45; color: var(--ink-3); }
@media (prefers-reduced-motion: reduce) { .alb-bar i { transition: none; } }

/* ---- what an architecture buys, and where it breaks ---- */
.am-trade { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .am-trade { grid-template-columns: 1fr; } }
.tr-col .am-h { display: block; margin-bottom: 7px; }
.tr-col.good .am-h { color: var(--green); }
.tr-col.bad .am-h { color: var(--crit); }
.tr-line { font-size: 13.5px; line-height: 1.5; color: var(--ink-2); padding: 3px 0; }

/* ---- the principle, on an architecture and on a build call ---- */
.principle {
  margin-top: 12px; padding: 11px 14px; border-radius: 8px;
  background: var(--surface-2); border-left: 3px solid var(--amber);
  font-size: 14px; line-height: 1.5; color: var(--ink);
}
.principle.good-call { border-left-color: var(--green); animation: pcIn .3s ease both; }
.pr-h { display: block; font-size: 10px; letter-spacing: .13em; color: var(--amber); margin-bottom: 4px; }
.principle.good-call .pr-h { color: var(--green); }
.principle-slot:empty { display: none; }

/* ---- why a number moved, in the deployment feed ---- */
.evt.has-why .tx { display: block; }
.evt-why {
  display: block; margin-top: 3px; font-size: 12px; line-height: 1.5;
  color: var(--ink-3); border-left: 2px solid var(--line); padding-left: 8px;
}

/* ---- what you walk away with, on the delivered screen ---- */
.score-cap {
  font-size: clamp(21px, 3.6vw, 30px); line-height: 1.2;
  margin: 4px 0 8px; text-wrap: balance;
}
.score-small { font-size: 14px; color: var(--ink-3); }
.score-small span { color: var(--amber); font-size: 17px; }
.learned-panel { padding: 22px; border-left: 3px solid var(--green); }
.lp-eyebrow { display: block; font-size: 10.5px; letter-spacing: .14em; color: var(--green); }
.lp-cap { font-size: 21px; margin: 6px 0 16px; }
.lp-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .lp-cols { grid-template-columns: 1fr; } }
.lp-h { display: block; font-size: 10px; letter-spacing: .13em; color: var(--ink-3); margin-bottom: 7px; }
.lp-item { font-size: 14px; line-height: 1.6; }
.lp-item.new { color: var(--ink); }
.lp-item.again { color: var(--ink-2); }
.lp-hero {
  margin-top: 14px; padding: 10px 13px; border-radius: 8px;
  background: var(--surface-2); border-left: 3px solid var(--ink-3);
  font-size: 13.5px; color: var(--ink-2);
}
.lp-hero.good { border-left-color: var(--violet); }
.lp-foot { margin-top: 14px; font-size: 13px; line-height: 1.55; color: var(--ink-3); max-width: 68ch; }

/* ============================================================= */
/* v34 — phones: the action bar and the Help button stop fighting */
/* ============================================================= */
@media (max-width: 720px) {
  /* The primary action is the primary action: give it the full width just
     above the tab bar, instead of a centred pill whose corner lands underneath
     the Help button. */
  body.mission .cta-float:not(:disabled),
  .float-web:not(:disabled) {
    left: 12px; right: 12px; width: auto; max-width: none;
    translate: none; transform: none;
    bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    justify-content: center; padding: 13px 18px; font-size: 14.5px;
  }
  @keyframes ctain { from { opacity: 0; translate: none; scale: .94; }
                     to   { opacity: 1; translate: none; scale: 1; } }

  /* Help is a 44px circle — a thumb target, not a labelled pill — and it sits
     ABOVE the action bar rather than on top of it. */
  .sb-root { right: 12px; bottom: calc(130px + env(safe-area-inset-bottom, 0px)); }
  .sb-launch { padding: 0; width: 44px; height: 44px; border-radius: 50%;
    justify-content: center; gap: 0; }
  .sb-launch-t { display: none; }
  .sb-launch-ic { width: 22px; height: 22px; font-size: 14px; background: none; }
  /* nothing to clear when no action bar is showing */
  body:not(.mission) .sb-root { bottom: calc(74px + env(safe-area-inset-bottom, 0px)); }
}

/* ---- drills: say the task plainly, and keep the explanation folded away ---- */
.hc-task {
  font-size: 15px; line-height: 1.5; color: var(--ink); margin: 12px 0 10px;
  padding: 10px 14px; border-radius: 8px;
  background: rgba(245, 177, 76, .09); border: 1px solid rgba(245, 177, 76, .3);
}
.hc-task b { color: var(--amber); }
.hc-howto { margin-bottom: 14px; }
.hc-howto summary {
  cursor: pointer; font-size: 12.5px; color: var(--ink-3);
  padding: 4px 0; list-style: none;
}
.hc-howto summary::-webkit-details-marker { display: none; }
.hc-howto summary::before { content: "▸ "; }
.hc-howto[open] summary::before { content: "▾ "; }
.hc-howto summary:hover { color: var(--ink-2); }
.hc-howto p {
  font-size: 13px; line-height: 1.55; color: var(--ink-3);
  margin-top: 6px; max-width: 68ch;
}

@media (max-width: 720px) {
  /* the grids are the point on a phone — give them the room */
  .hc-title { font-size: 20px; }
  .hc-lede { font-size: 14px; }
  .hc-task { font-size: 14.5px; padding: 9px 12px; }
  .hero-ch, .th-ch, .od-ch, .al-ch { padding: 16px 14px; }
  .hc-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
  .hc-card { padding: 9px 10px; }
  .hcc-item { font-size: 12px; }
  .hcc-reason { font-size: 11px; }
  .hcc-attrs i { font-size: 9.5px; }
  .al-grid { grid-template-columns: 1fr; }
  .th-out { grid-template-columns: 1fr; }
  .od-slots { gap: 6px; }
  /* Twelve cards is a long scroll, so the count and the submit follow you down
     instead of sitting under all of it. Offset clears the bottom tab bar. */
  .hc-bar {
    position: sticky; z-index: 20;
    bottom: calc(66px + env(safe-area-inset-bottom, 0px));
    margin: 10px -14px -6px; padding: 10px 14px;
    background: var(--surface-2); border-top: 1px solid var(--line);
    box-shadow: 0 -8px 20px rgba(0,0,0,.35);
  }
  .hc-bar .btn { flex: 1; justify-content: center; }
  .hc-count { font-size: 11.5px; }

  /* the attributes are the thing being compared — keep them, but stop each
     card being 160px tall */
  .hcc-attrs { flex-direction: row; flex-wrap: wrap; gap: 4px 8px; }
  .hcc-attrs i { padding: 1px 3px; }
  .hcc-reason { display: none; }
}

/* The gate lives on the mission page, which loads only this stylesheet. */
/* ---- the sign-up prompt shown mid-mission ---- */
/* Deliberately not a wall: it is dismissable, it never blocks the page from
   loading, and the run behind it keeps working if it is waved away. */
.gg-back {
  position: fixed; inset: 0; z-index: 200;
  display: grid; place-items: center; padding: 20px;
  background: rgba(6, 10, 18, .72); backdrop-filter: blur(3px);
  opacity: 0; transition: opacity .22s ease;
}
.gg-back.in { opacity: 1; }
body.gg-open { overflow: hidden; }
.gg-card {
  width: min(440px, 100%);
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  padding: 26px 24px 20px; box-shadow: 0 24px 60px rgba(0, 0, 0, .5);
  transform: translateY(10px); transition: transform .22s ease;
}
.gg-back.in .gg-card { transform: none; }
.gg-eyebrow { display: block; font-size: 9.5px; letter-spacing: .2em; color: var(--amber); margin-bottom: 10px; }
.gg-card h2 { font-size: 21px; line-height: 1.25; margin-bottom: 10px; }
.gg-card p { font-size: 14.5px; line-height: 1.6; color: var(--ink-2); }
.gg-btns { display: flex; flex-direction: column; gap: 10px; margin: 18px 0 12px; }
.gg-btns .btn { justify-content: center; min-height: 46px; }
.gg-skip {
  background: none; border: 0; cursor: pointer;
  color: var(--ink-3); font-size: 13.5px; text-decoration: underline;
  min-height: 44px;
}
.gg-skip:hover { color: var(--ink-2); }
.gg-fine { font-size: 12px; color: var(--ink-3); text-align: center; }
@media (prefers-reduced-motion: reduce) {
  .gg-back, .gg-card { transition: none; }
}

/* ---- how a run was weighted ---- */
/* Visible on the score panel so the rule is something the learner can see and
   plan around, not a silent deduction they only notice in the leaderboard. */
.grade-chip {
  display: inline-block; margin: 8px 0 2px;
  font-size: 9.5px; letter-spacing: .14em;
  padding: 5px 11px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--ink-2);
}
.grade-chip.grade-clean { color: var(--green); border-color: rgba(63, 164, 112, .45); }
.grade-chip.grade-recovered { color: var(--amber); border-color: rgba(245, 177, 76, .45); }
.grade-chip.grade-retry { color: var(--ink-3); }

/* ---- the live incident ---- */
.inc-back {
  position: fixed; inset: 0; z-index: 210;
  display: grid; place-items: center; padding: 18px;
  background: rgba(6, 10, 18, .8); backdrop-filter: blur(4px);
  opacity: 0; transition: opacity .2s ease; overflow-y: auto;
}
.inc-back.in { opacity: 1; }
body.inc-open { overflow: hidden; }
.inc-card {
  width: min(560px, 100%); margin: auto;
  background: var(--surface); border: 1px solid var(--line);
  border-top: 3px solid var(--warn); border-radius: 16px;
  padding: 22px 22px 18px; box-shadow: 0 24px 60px rgba(0, 0, 0, .55);
}
.inc-card.inc-serious { border-top-color: var(--crit); }
.inc-card.inc-minor { border-top-color: var(--green); }
.inc-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.inc-tag { font-size: 9.5px; letter-spacing: .2em; color: var(--warn); }
.inc-serious .inc-tag { color: var(--crit); }
.inc-minor .inc-tag { color: var(--green); }
.inc-clock {
  font-size: 15px; color: var(--ink-2);
  padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px;
  font-variant-numeric: tabular-nums;
}
.inc-clock.urgent { color: var(--crit); border-color: rgba(224, 90, 90, .5); }
.inc-card h2 { font-size: 20px; line-height: 1.25; margin: 12px 0 8px; }
.inc-detail { font-size: 14.5px; line-height: 1.6; color: var(--ink-2); margin-bottom: 16px; }
.inc-opts { display: flex; flex-direction: column; gap: 9px; }
.inc-opt {
  text-align: left; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 11px;
  padding: 12px 14px; color: inherit; font: inherit;
  display: flex; flex-direction: column; gap: 4px;
  transition: border-color .15s ease, transform .15s ease;
}
.inc-opt:hover:not(:disabled) { border-color: var(--cyan); transform: translateY(-1px); }
.inc-opt:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.inc-opt:disabled { cursor: default; opacity: .75; }
.inc-opt.is-right { border-color: var(--green); opacity: 1; }
.inc-opt.is-wrong { border-color: var(--crit); opacity: 1; }
.io-label { font-weight: 600; font-size: 14.5px; }
.io-body { font-size: 12.5px; color: var(--ink-3); line-height: 1.5; }
.inc-out { margin-top: 15px; padding-top: 14px; border-top: 1px solid var(--line); }
.inc-out p { font-size: 14px; line-height: 1.6; margin-bottom: 13px; }
.inc-out.ok p { color: var(--green); }
.inc-out.bad p { color: var(--warn); }
.inc-go { width: 100%; justify-content: center; min-height: 46px; }
@media (prefers-reduced-motion: reduce) {
  .inc-back, .inc-opt { transition: none; }
}
@media (max-width: 720px) {
  .inc-card { padding: 18px 16px 16px; }
  .inc-card h2 { font-size: 18px; }
}

/* ---- the readout: the client's response to your numbers ---- */
.readout-mount { margin: 18px 0; }
.readout-panel { padding: 20px; border-left: 3px solid var(--violet, var(--cyan)); }
.ro-eyebrow { display: block; font-size: 9.5px; letter-spacing: .18em; color: var(--ink-3); margin-bottom: 12px; }
.ro-quote { margin-bottom: 16px; }
.ro-quote p { font-size: 17px; line-height: 1.5; color: var(--ink); font-style: italic; }
.ro-who { display: block; margin-top: 8px; font-size: 12.5px; color: var(--ink-3); }
.ro-opts { display: flex; flex-direction: column; gap: 9px; }
.ro-opt {
  text-align: left; cursor: pointer; font: inherit; color: inherit;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 11px;
  padding: 12px 14px; display: flex; flex-direction: column; gap: 4px;
  transition: border-color .15s ease, transform .15s ease;
}
.ro-opt:hover:not(:disabled) { border-color: var(--cyan); transform: translateY(-1px); }
.ro-opt:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.ro-opt:disabled { cursor: default; opacity: .75; }
.ro-opt.is-right { border-color: var(--green); opacity: 1; }
.ro-opt.is-wrong { border-color: var(--crit); opacity: 1; }
.ro-label { font-weight: 600; font-size: 14.5px; }
.ro-body { font-size: 12.5px; color: var(--ink-3); line-height: 1.5; }
.ro-out { margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--line); }
.ro-out p { font-size: 14px; line-height: 1.6; }
.ro-out.ok p { color: var(--green); }
.ro-out.bad p { color: var(--warn); }
@media (prefers-reduced-motion: reduce) { .ro-opt { transition: none; } }
@media (max-width: 720px) {
  .readout-panel { padding: 16px; }
  .ro-quote p { font-size: 15.5px; }
}

/* ---- the logo is a link on every page except the landing one ---- */
/* Without this it inherits the browser's default anchor styling — blue and
   underlined — and because the pages below it render their content after a
   fetch, that blue wordmark was briefly the only thing on screen. It was
   patched inline on the mission page once; this is the rule that fixes it
   everywhere, including the pages nobody looked at. */
a.logo, a.logo:hover, a.logo:visited {
  color: inherit;
  text-decoration: none;
}

/* ---- page footer ----
   Lived in pages.css, which the dashboard and mission pages do not load,
   so their footer rendered with no styling at all — browser-blue links
   stacked at the top left until the rest of the page arrived. The footer
   is on every page, so its styling belongs in the shared sheet. */
.page-footer { border-top: 1px solid var(--line); margin-top: 80px; padding: 28px 24px 40px; text-align: center; color: var(--ink-3); font-size: 12.5px; }
.page-footer .mono { letter-spacing: .08em; }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: center; margin-top: 10px; }
.foot-links a { font-size: 12.5px; color: var(--ink-3); text-decoration: none; }
.foot-links a:hover { color: var(--amber); text-decoration: underline; }

/* The tab bar is fixed to the bottom, so on the pages that have one the
   footer has to clear it — otherwise Terms, Privacy and the refunds policy
   sit underneath it and cannot be tapped at all. */
body.has-tabbar .page-footer {
  padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px));
}
/* One line of orientation. The card used to open on a headline with no
   indication of where it had come from or why it was interrupting. */
.inc-where { font-size: 12px; color: var(--ink-3); margin: -4px 0 10px; }
/* The XP arithmetic, spelled out. A total that moves without saying why
   reads as arbitrary, and a total that does not move reads as broken. */
.grade-math {
  max-width: 40ch; margin: 8px auto 0;
  font-size: 12.5px; line-height: 1.55; color: var(--ink-3);
}
.grade-math b { color: var(--ink-2); }
/* What this decision is scored on. It used to be glued onto the end of the
   question — "...? Why it matters — ...?" — which read as two questions in
   one breath and made the actual choice harder to find. */
.dq-stake {
  margin-top: 6px; font-size: 12.5px; line-height: 1.5;
  color: var(--ink-3);
}
/* "460 XP" in a mission header is what this run earned. The identical chip on
   the dashboard is the account total, and somebody mid-mission reasonably read
   the smaller number as their rank collapsing. */
.xp-scope { font-style: normal; font-size: 9.5px; letter-spacing: .1em;
  color: var(--ink-3); text-transform: uppercase; margin-left: 4px; }

/* ============================================================= */
/* QA pass — controls you can see, and that stay still           */
/* ============================================================= */

/* A chosen option changed its border and nothing else, so on a phone the only
   reliable way to tell what you had picked was to count the "3 of 12" tally.
   Fill it, thicken the ring, and make the tick unmissable. */
.optcard.chosen,
.decision-block .optcard.chosen {
  background: rgba(245, 177, 76, .10);
  box-shadow: 0 0 0 2px var(--amber), 0 8px 24px rgba(245, 177, 76, .12);
}
.optcard.arch-opt.chosen {
  background: color-mix(in srgb, var(--ac) 10%, transparent);
  box-shadow: 0 0 0 2px var(--ac), 0 10px 30px color-mix(in srgb, var(--ac) 15%, transparent);
}
.optcard.chosen .pick-check {
  transform: scale(1);
  background: var(--amber); color: var(--bg);
  box-shadow: 0 0 0 3px rgba(245, 177, 76, .25);
}
.hc-card.picked { box-shadow: 0 0 0 2px var(--amber), 0 6px 18px rgba(245, 177, 76, .12); }

/* Reveals used to travel 30px while fading. A control that arrives under a
   thumb that is already on its way down takes the tap somewhere else, and the
   miss is silent. Fade only — nothing moves. */
.reveal, .reveal-item,
.reveal.in, .reveal-item.in {
  transform: none !important;
  filter: none !important;
}
/* And nothing is clickable until it has finished arriving. */
.reveal:not(.in), .reveal-item:not(.in) { pointer-events: none; }

/* Stepper beside each threshold handle. Dragging to an exact number on a phone
   is the fiddliest interaction in the drills; these do the same job with a tap. */
.thh-set { display: inline-flex; align-items: center; gap: 8px; }
.th-step {
  width: 34px; height: 34px; flex-shrink: 0;
  display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px;
  color: var(--ink-2); font-size: 16px; line-height: 1; cursor: pointer;
}
.th-step:hover { border-color: var(--cyan); color: var(--ink); }
.th-step:active { background: var(--line); }
.th-step:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
@media (max-width: 720px) { .th-step { width: 40px; height: 40px; } }

/* The guest exam gate. It is a reward being collected, not a toll, so it lists
   what arrives rather than what is withheld. */
.claim-list { list-style: none; padding: 0; margin: 18px 0; max-width: 46ch; }
.claim-list li {
  position: relative; padding: 7px 0 7px 26px;
  font-size: 14.5px; color: var(--ink-2); border-top: 1px solid var(--line);
}
.claim-list li:first-child { border-top: 0; }
.claim-list li::before {
  content: "✓"; position: absolute; left: 4px; color: var(--green); font-weight: 700;
}
.claim-fine { margin-top: 12px; font-size: 12.5px; color: var(--ink-3); }
