/* GridSchool platform. Inherits every token and primitive from landing.css:
   same near-black, same thin light, same circles. The landing sells one idea per
   screen; this is a workspace, so density goes up and glow goes down. Light is
   reserved for state that matters: what is next, what is lit, what is blocked. */

:root {
  --rail: 244px;
  --panelbg: rgba(9, 14, 24, 0.72);
  --locked: #3a4d6b;
  --warn: #ffb32b;
}

body { overflow-x: auto; }

/* Any layout rule that sets display beats the hidden attribute, which silently
   leaves empty shells on screen. This makes hidden mean hidden everywhere. */
[hidden] { display: none !important; }

/* The map draws its own grid floor that pans and zooms with the world. The page's
   fixed grid behind it would read as a second, stationary grid sliding underneath. */
body[data-view="map"] .gridbg,
body[data-view="today"] .gridbg,
body[data-view="step"] .gridbg { display: none; }

/* ---------- shell ---------- */

/* One 1fr row so the map can ask for "the rest of the screen" instead of
   guessing at the chrome above it with a magic number. */
.shell {
  display: grid; grid-template-columns: var(--rail) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr); height: 100vh; min-height: 100vh;
}
.shellmain { display: flex; flex-direction: column; min-width: 0; min-height: 0; height: 100%; overflow: hidden; }

.rail {
  position: sticky; top: 0; align-self: start; height: 100vh;
  display: flex; flex-direction: column; gap: 22px;
  padding: 20px 16px; border-right: 1px solid var(--line);
  background: rgba(5, 7, 12, .78); backdrop-filter: blur(8px);
}
.rail__brand { display: flex; align-items: center; gap: 10px; text-decoration: none; padding: 4px 6px; }
.rail__logo { width: 26px; height: 26px; flex: none; display: block; }
.rail__logo .g-on rect { fill: var(--cyan); }
.rail__logo .g-off rect { fill: #14213a; }

/* Two doors, then a hairline, then the tools. The rule is the whole point: it
   says out loud that the things below it are not decisions you have to make. */
.rail__nav { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rail__link {
  display: flex; align-items: center; gap: 10px; padding: 9px 11px;
  border-radius: var(--radius-sm); text-decoration: none;
  border: 1px solid transparent; position: relative;
}
.rail__linktext { min-width: 0; flex: 1; }
.rail__link b { display: block; font-size: 14px; color: var(--text); font-weight: 600; }
/* scoped to the text block on purpose: the badge is a span too, and a rule this
   broad was quietly painting its digit the same colour as the hint under it */
.rail__linktext span { display: block; font-size: 11.5px; color: var(--muted); }
.rail__link:hover { background: var(--bg2); }
.rail__link.is-active { background: var(--bg2); border-color: var(--hair-cyan); }
.rail__link.is-active b { color: #fff; }
.rail__link.is-active::before {
  content: ""; position: absolute; left: -17px; top: 12px; bottom: 12px; width: 2px;
  background: var(--cyan); box-shadow: 0 0 8px rgba(40, 225, 255, .5);
}

/* A badge is a reason to go, not decoration. The alarm colour is spent only on
   what came back unread; the map's count is a fact and reads as one. */
.rail__badge {
  flex: none; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--cyan); color: #04121a; box-shadow: 0 0 10px rgba(40, 225, 255, .45);
  font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 11px; font-weight: 700;
}
.rail__badge--count {
  background: none; box-shadow: none; color: var(--muted); font-weight: 400;
  letter-spacing: .06em; font-size: 10.5px;
}

.rail__rule { height: 1px; background: var(--line); margin: 0 4px; }
.rail__tools { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.rail__tool {
  display: block; padding: 6px 11px; border-radius: var(--radius-sm);
  text-decoration: none; color: var(--muted); font-size: 13px; white-space: nowrap;
}
.rail__tool:hover { color: #fff; background: var(--bg2); }
.rail__tool.is-active { color: #fff; }

.rail__id { margin-top: auto; border-top: 1px solid var(--line); padding-top: 14px; }
.rail__who b { display: block; font-size: 13.5px; color: #fff; }
.rail__who span { display: block; font-size: 11.5px; color: var(--muted); }
.rail__role {
  display: inline-block;
  margin-top: 4px;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: .12em;
  color: var(--ghost);
  text-transform: uppercase;
}
.rail__role--dev { color: var(--amber); }
.rail__acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

/* ---------- demo banner ---------- */

.demobar {
  display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap;
  padding: 8px 26px; font-size: 12.5px; color: var(--muted);
  border-bottom: 1px solid var(--line); background: var(--bg2);
}
.demobar b { color: var(--amber); font-family: "IBM Plex Mono", ui-monospace, monospace; letter-spacing: .1em; font-size: 11px; }

/* The outlet is the scroll host for document-like views (calendar, tasks,
   library, first-run). Map and step manage their own scrolling. */
.outlet { flex: 1 1 auto; min-width: 0; min-height: 0; outline: none; overflow-y: auto; }
body[data-view="map"] .outlet { overflow: hidden; }
body[data-view="today"] .outlet { display: flex; flex-direction: column; overflow: hidden; }
body[data-view="step"] .outlet { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
body[data-view="step"] .view--step { flex: 1 1 auto; min-height: 0; }
.view { padding: 30px 26px 70px; max-width: 1240px; }
.view--map { padding: 0; max-width: none; }

/* ---------- primitives ---------- */

.eyebrow {
  display: block; font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--cyan); font-weight: 400;
}

.b {
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
  padding: 7px 13px; border-radius: var(--radius-sm); text-decoration: none;
  border: 1px solid var(--line); background: none; color: var(--text);
  transition: border-color .14s, color .14s, background .14s;
  display: inline-flex; align-items: center; gap: 6px;
}
.b:hover:not([disabled]) { border-color: var(--cyan); color: #fff; }
.b[disabled] { opacity: .4; cursor: not-allowed; }
.b--solid { background: #10203a; border-color: #1a4a5c; color: #fff; }
.b--quiet { border-color: transparent; color: var(--muted); padding: 6px 9px; }
.b--quiet:hover { border-color: var(--line); color: #fff; }
.b--danger { border-color: color-mix(in srgb, #ff7b7b 40%, var(--line)); color: #ff9d9d; }
.b--danger:hover { border-color: #ff7b7b; color: #ffc9c9; }

.panel {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panelbg); margin-bottom: 16px;
}
.panel--ok { border-color: color-mix(in srgb, var(--ok) 26%, var(--line)); }
.panel--warn { border-color: color-mix(in srgb, var(--amber) 26%, var(--line)); }
.panel__head {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 14px 18px 0;
}
.panel__heading { min-width: 0; }
.panel__title { font-size: 17px; color: #fff; font-weight: 700; margin-top: 3px; }
.panel__note { font-size: 13px; color: var(--muted); margin-top: 5px; max-width: 62ch; }
.panel__actions { margin-left: auto; display: flex; gap: 6px; flex: none; }
.panel__body { padding: 14px 18px 18px; }
.panel__body > * + * { margin-top: 12px; }

.grid2 { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 16px; }
.col { min-width: 0; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }

.chip2 {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); border-radius: 999px;
  padding: 4px 11px; font-size: 12px; color: var(--muted);
}
.chip2--locked { color: var(--locked); border-color: var(--locked); cursor: pointer; }
.chip2--locked:hover { color: var(--text); border-color: var(--text); }
.chip2--communication { color: var(--cyan); border-color: var(--hair-cyan); }
.chip2--comprehension { color: #9d7bff; border-color: color-mix(in srgb, #9d7bff 34%, transparent); }
.chip2--vision { color: var(--amber); border-color: color-mix(in srgb, var(--amber) 34%, transparent); }
.chip2--verification { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 34%, transparent); }
.chip2__x { background: none; border: 0; color: inherit; cursor: pointer; font-size: 14px; line-height: 1; padding: 0 0 0 2px; }

.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--locked); }
.dot--lit { background: var(--ok); box-shadow: 0 0 7px color-mix(in srgb, var(--ok) 60%, transparent); }
.dot--open { background: var(--cyan); box-shadow: 0 0 7px rgba(40, 225, 255, .55); }
.dot--offered { background: transparent; box-shadow: inset 0 0 0 1px var(--cyan); }
.dot--locked { background: transparent; box-shadow: inset 0 0 0 1px var(--locked); }
.dot--future { background: transparent; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--amber) 45%, transparent); }
.dot--next { background: var(--cyan); box-shadow: 0 0 0 3px color-mix(in srgb, var(--cyan) 30%, transparent), 0 0 10px var(--cyan); }
.dot--review { background: var(--amber); box-shadow: 0 0 7px color-mix(in srgb, var(--amber) 55%, transparent); }
.dot--fix { background: transparent; box-shadow: inset 0 0 0 2px var(--amber); }

.meter { height: 3px; background: var(--line); border-radius: 999px; overflow: hidden; margin-top: 8px; }
.meter__fill {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, #1596ad, var(--cyan));
  box-shadow: 0 0 8px rgba(40, 225, 255, .4); transition: width .3s ease;
}

.empty { padding: 16px 0; }
.empty p { color: var(--muted); font-size: 14px; }
.empty__sub { margin-top: 5px; font-size: 13px; opacity: .8; }

.ph {
  display: flex; gap: 12px; align-items: flex-start;
  border: 1px dashed color-mix(in srgb, var(--amber) 28%, var(--line));
  border-radius: var(--radius); padding: 13px 15px; background: rgba(255, 179, 43, .03);
}
.ph__mark { width: 9px; height: 9px; border-radius: 50%; flex: none; margin-top: 6px; box-shadow: inset 0 0 0 1px var(--amber); }
.ph__body b { color: var(--text); font-size: 14px; }
.ph__body p { color: var(--muted); font-size: 13px; margin-top: 3px; }
.ph__when {
  display: block; margin-top: 6px; color: var(--amber);
  font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 10.5px; letter-spacing: .1em;
}

.notwired {
  display: inline-block; color: var(--amber); opacity: .85;
  font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 11px; letter-spacing: .08em;
}

.field { display: block; margin-bottom: 11px; }
.field__label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 5px; }
.field input, .field textarea, .field select, .rvform select, textarea {
  width: 100%; font: inherit; font-size: 14px; color: var(--text);
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 9px 11px; resize: vertical;
}
.field input:focus, .field textarea:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(40, 225, 255, .1);
}
.field__hint { display: block; font-size: 12px; color: var(--muted); opacity: .8; margin-top: 4px; }

.codeblock {
  white-space: pre-wrap; font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 12px; line-height: 1.6; color: var(--muted);
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 14px; max-height: 320px; overflow: auto;
}
.codeblock--sm { max-height: none; font-size: 12.5px; }

.view__head { margin-bottom: 20px; }
.view__head h1 { font-size: clamp(24px, 3vw, 32px); color: #fff; margin-top: 4px; }
.view__head .muted { margin-top: 7px; max-width: 72ch; font-size: 14.5px; }
.view__nav { display: flex; gap: 8px; margin-top: 14px; }

/* ---------- today: one next action, then the conversation ---------- */

.view--today {
  flex: 1 1 auto; min-height: 0; max-width: none; padding: 0;
  display: flex; flex-direction: column;
}
.nextbar {
  flex: none; padding: 18px 22px 16px; border-bottom: 1px solid var(--line);
}
.nextbar__title { font-size: clamp(20px, 2.4vw, 28px); color: #fff; margin-top: 4px; }
.nextbar__system {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 11px; letter-spacing: .04em; color: var(--muted); margin-top: 8px;
}
.nextbar__why { font-size: 14px; color: var(--muted); margin-top: 6px; max-width: 72ch; }
.nextbar__focus { font-size: 13px; color: var(--cyan); margin-top: 8px; max-width: 72ch; }
.nextbar__acts { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

.thread {
  flex: 1 1 auto; min-height: 0; overflow-y: auto;
  padding: 22px 22px 8px; display: flex; flex-direction: column; gap: 16px;
}
.bubble { max-width: 68ch; }
.bubble--user { margin-left: auto; text-align: right; }
.bubble--user p {
  display: inline-block; text-align: left;
  background: #10203a; border: 1px solid #1a4a5c; border-radius: var(--radius);
  padding: 10px 13px;
}
.bubble__who {
  display: block; font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); font-family: "IBM Plex Mono", ui-monospace, monospace; margin-bottom: 6px;
}
.bubble--assistant p { font-size: 15px; color: var(--text); line-height: 1.55; }
.bubble.is-demo .bubble__who::after { content: " · demo"; color: var(--amber); letter-spacing: .08em; }
.bubble__files { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.bubble__files span { font-size: 11.5px; color: var(--muted); }

.composer {
  flex: none; padding: 10px 18px 16px; border-top: 1px solid var(--line);
  background: rgba(5, 7, 12, .88);
}
.composer__files { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.composer__chip {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px;
  font-size: 12px; color: var(--muted);
}
.composer__x { background: none; border: 0; color: inherit; cursor: pointer; font-size: 14px; }
.composer__input {
  width: 100%; min-height: 44px; max-height: 160px; resize: none;
  font: inherit; font-size: 15px; color: #fff;
  background: #070b13; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px;
}
.composer__input:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(40, 225, 255, .1); }
.composer__bar {
  display: flex; align-items: center; gap: 10px; margin-top: 8px;
}
.composer__hint { font-size: 12px; color: var(--muted); }
.composer__credits {
  margin-left: auto;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 12px; letter-spacing: .04em; color: var(--cyan);
}
.composer__credits.is-low { color: var(--amber); }
.composer__credits.is-empty { color: #ff9d9d; }

.steer { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 18px; }
.steer__cell {
  border: 1px solid color-mix(in srgb, var(--cyan) 22%, var(--line));
  background: var(--bg2); border-radius: var(--radius); padding: 15px 17px;
}
.steer__cell p { margin-top: 7px; font-size: 15px; color: var(--text); }
.steer__src { display: block; margin-top: 9px; font-size: 12px; color: var(--muted); }
.steer__cell .b { margin-top: 11px; }

.waitlist { list-style: none; display: flex; flex-direction: column; gap: 9px; }
.waitlist li { border-left: 2px solid var(--amber); padding-left: 11px; }
.waitlist b { display: block; font-size: 14px; color: var(--text); font-weight: 600; }
.waitlist span { font-size: 12.5px; color: var(--muted); }

.parallel { border-top: 1px solid var(--line); padding-top: 13px; }
.parallel .eyebrow { margin-bottom: 8px; }

.quota__line { font-size: 14px; }
.quota__acts { display: flex; gap: 7px; }
.quota__note { font-size: 12.5px; color: var(--muted); }

/* A native disclosure, dressed. Used wherever a form should be available without
   being in the way - handing work over, mostly. */
.reveal { border-top: 1px solid var(--line); padding-top: 12px; }
.reveal__sum {
  cursor: pointer; font-size: 13.5px; color: var(--cyan); list-style: none;
  display: inline-flex; align-items: center; gap: 7px;
}
.reveal__sum::-webkit-details-marker { display: none; }
.reveal__sum::before { content: "+"; font-family: "IBM Plex Mono", ui-monospace, monospace; opacity: .7; }
.reveal[open] .reveal__sum::before { content: "−"; }
.reveal__sum:hover { color: #fff; }
.reveal__body { margin-top: 13px; }

/* ---------- tasks ---------- */

.tasks { display: flex; flex-direction: column; }
.task {
  display: flex; gap: 11px; align-items: flex-start;
  padding: 11px 2px; border-bottom: 1px solid var(--hair);
}
.task:last-child { border-bottom: 0; }
.tasks--tight .task { padding: 8px 2px; }
.task__mark {
  width: 17px; height: 17px; flex: none; margin-top: 3px; cursor: pointer;
  border-radius: 50%; border: 1px solid var(--line); background: none;
  transition: border-color .14s, background .14s, box-shadow .14s;
}
.task__mark:hover { border-color: var(--cyan); }
.task.is-done .task__mark {
  border-color: var(--ok); background: color-mix(in srgb, var(--ok) 70%, transparent);
  box-shadow: 0 0 8px color-mix(in srgb, var(--ok) 45%, transparent);
}
.task.is-waiting .task__mark { border-color: var(--amber); border-style: dashed; }
.task__main { min-width: 0; flex: 1; }
.task__title {
  margin: 0; font-size: 14.5px; color: var(--text); line-height: 1.45; font-weight: 600;
}
.task.is-done .task__title { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line); }
.task__meta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 3px; font-size: 11.5px; color: var(--muted); }
.task__kind {
  font-family: "IBM Plex Mono", ui-monospace, monospace; letter-spacing: .12em;
  text-transform: uppercase; font-size: 10px; color: var(--cyan); opacity: .85;
}
.task__wait { color: var(--amber); }
.task__dw { font-size: 13.5px; color: var(--text); margin-top: 6px; }
.task__dw b { color: var(--ok); font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }
.task__why { font-size: 13px; color: var(--muted); margin-top: 6px; }
.task__steps { margin-top: 8px; }
.task__steps summary {
  cursor: pointer; font-size: 13px; color: var(--cyan); list-style: none;
}
.task__steps summary::-webkit-details-marker { display: none; }
.task__steps summary:hover { color: #fff; }
.task__how { margin: 9px 0 0 17px; font-size: 13.5px; color: var(--muted); }
.task__how li { margin-bottom: 4px; }
.task__acts { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.tasks--done { opacity: .72; }

/* ---------- the map: two projections of one dataset ---------- */

/* The graph and the list live in one view and swap in place, so the switch never
   reads as navigation to somewhere else. */
.mapview { height: 100%; min-height: 0; display: flex; flex-direction: column; position: relative; }
.mapview > .view { flex: 1 1 auto; min-height: 0; }
.view--maplist { overflow-y: auto; }
.maplist > * + * { margin-top: 16px; }
.lock-float {
  position: absolute;
  left: 50%;
  top: 26%;
  transform: translateX(-50%);
  z-index: 20;
  width: min(420px, calc(100% - 32px));
  pointer-events: auto;
}
.lock-note {
  background: color-mix(in srgb, var(--surface) 94%, #000);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
}
.lock-note__title { display: block; color: #fff; font-size: 15px; margin-bottom: 8px; }
.lock-note p { color: var(--muted); font-size: 14px; line-height: 1.55; margin: 0; }
.lock-note__acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.step--locked .lock-note { margin-top: 24px; max-width: 52ch; box-shadow: none; }
.step__schedule, .step__ready {
  margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--hair);
}
.welcome-sched { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-direction: column; gap: 12px; max-width: 62ch; }
.welcome-sched__item {
  border: 1px solid var(--hair);
  border-radius: var(--radius);
  padding: 12px 14px;
  background: color-mix(in srgb, var(--surface) 80%, transparent);
}
.welcome-sched__item b { display: block; color: #fff; font-size: 14px; }
.welcome-sched__item span { display: block; color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.welcome-sched__item p { color: var(--text); font-size: 13.5px; line-height: 1.5; margin: 8px 0 0; }
.ready-list { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-direction: column; gap: 8px; max-width: 62ch; }
.ready-list__item {
  display: grid;
  grid-template-columns: 1.25rem 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--hair);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 14px;
}
.ready-list__item.is-ok { color: var(--text); border-color: color-mix(in srgb, var(--ok) 35%, var(--hair)); }
.ready-list__mark { color: var(--cyan); font-weight: 700; }
.ready-list__item.is-ok .ready-list__mark { color: var(--ok); }

/* the graph/list switch */
.seg {
  display: inline-flex; border: 1px solid var(--line); border-radius: 999px;
  padding: 2px; background: rgba(6, 10, 18, .9); backdrop-filter: blur(6px);
}
.seg__b {
  font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer;
  border: 0; background: none; color: var(--muted);
  padding: 5px 14px; border-radius: 999px;
}
.seg__b:hover { color: #fff; }
.seg__b.is-on { background: #10203a; color: #fff; box-shadow: inset 0 0 0 1px var(--hair-cyan); }

.mlrows { display: flex; flex-direction: column; }
.mlfam {
  margin: 16px 0 6px;
  color: var(--cyan);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 10.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  opacity: .72;
}
.mlfam:first-child { margin-top: 0; }
.mlrow {
  display: grid; grid-template-columns: minmax(210px, 1.1fr) minmax(0, 2fr) auto;
  gap: 16px; align-items: baseline; padding: 12px 2px; border-bottom: 1px solid var(--hair);
}
.mlrow:last-child { border-bottom: 0; }
.mlrow__open {
  display: flex; align-items: center; gap: 9px; text-align: left;
  background: none; border: 0; padding: 0; font: inherit; color: var(--text); cursor: pointer;
}
.mlrow__open:hover .mlrow__title { color: var(--cyan); }
.mlrow__n { font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 11.5px; color: var(--muted); }
.mlrow__title { font-size: 14.5px; color: #fff; font-weight: 600; }
.mlrow--locked .mlrow__title, .mlrow--locked .mlrow__n { color: var(--locked); }
.mlrow--future .mlrow__title { color: var(--muted); }
.mlrow__proof { min-width: 0; }
.mlrow__url { color: var(--ok); font-size: 12.5px; word-break: break-all; text-decoration: none; }
.mlrow__url:hover { text-decoration: underline; }
.mlrow__need { font-size: 13px; color: var(--muted); }
.mlrow__note { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.mlrow__side { display: flex; gap: 10px; align-items: baseline; flex: none; }
.mlrow__state, .mlrow__at, .mlrow__rv {
  font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 10.5px;
  letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
}
.mlrow__fam {
  font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 10px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted); margin-left: 6px; white-space: nowrap;
}
.mlrow__state--lit { color: var(--ok); }
.mlrow__state--open { color: var(--cyan); }
.mlrow__state--amber { color: var(--amber); }
.mlrow--s-next { background: linear-gradient(90deg, color-mix(in srgb, var(--cyan) 7%, transparent), transparent 60%); }
.mlrow--s-next .mlrow__state { font-weight: 700; }
.mlrow__rv--in-review { color: var(--amber); }
.mlrow__rv--returned { color: var(--ok); }

.view--map { position: relative; height: 100%; overflow: hidden; }
/* The SVG board's node, edge and phase styles left with it (app/js/graph/archive-svg/). */

/* HUD */
.hud { position: absolute; z-index: 2; display: flex; gap: 14px; pointer-events: none; }
.hud > *, .hud__group { pointer-events: auto; }
.hud--top {
  top: 0; left: 0; right: 0; padding: 12px 18px;
  justify-content: space-between; align-items: center; flex-wrap: wrap;
  background: linear-gradient(to bottom, rgba(5, 7, 12, .92), transparent);
}
.hud__group { display: flex; gap: 14px; align-items: center; }
.hud__count { color: #fff; font-size: 13.5px; }
.hud__depth { color: var(--muted); font-size: 12.5px; }
.hud__law { color: var(--muted); font-size: 12px; }
.legend { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); }
.hud--side {
  top: 56px; right: 14px; flex-direction: column; gap: 5px; align-items: stretch;
  transition: right .18s ease;
}
/* map controls read as controls: same width, real edges, glass over the grid */
.hud--side .b {
  min-width: 104px; justify-content: center;
  background: rgba(6, 10, 18, .9); backdrop-filter: blur(6px);
  border-color: var(--line); color: var(--text);
}
.hud--side .b:hover { border-color: var(--cyan); color: #fff; }
.hud--side .b--solid { background: #10203a; border-color: #1a4a5c; color: #fff; }
.hud--status {
  bottom: 16px; left: 18px; padding: 7px 13px; border-radius: var(--radius-sm);
  background: rgba(5, 7, 12, .9); border: 1px solid color-mix(in srgb, var(--amber) 30%, var(--line));
  color: var(--amber); font-size: 12.5px;
}

/* ---------- the modal: a panel that grows out of what you clicked ---------- */

.modal { position: absolute; inset: 0; z-index: 6; }
.modal:not(.is-open) { pointer-events: none; }
.modal__scrim {
  position: absolute; inset: 0; background: rgba(2, 4, 9, .62); backdrop-filter: blur(2px);
  opacity: 0; transition: opacity .22s ease;
}
.modal.is-open .modal__scrim { opacity: 1; }

.modal__panel {
  --room-gap: clamp(16px, 3.2vh, 36px);
  position: absolute; z-index: 1;
  inset: var(--room-gap);
  width: auto; height: auto;
  max-width: none; max-height: none; overflow: hidden auto;
  background: linear-gradient(180deg, #0a1220 0%, #070b13 100%);
  border: 1px solid var(--hair-cyan); border-radius: var(--radius);
  box-shadow: 0 26px 70px rgba(0, 0, 0, .62), 0 0 0 1px rgba(0, 0, 0, .5);
  /* The panel starts as a small round shape sitting on the node, so opening reads
     as the node unfolding rather than a sheet arriving from nowhere. */
  transform: translate(var(--ox, 0px), var(--oy, 0px)) scale(.12);
  border-radius: 50%; opacity: 0;
  transition: transform .34s cubic-bezier(.2, .7, .3, 1), opacity .16s linear, border-radius .3s ease;
  outline: none;
}
.modal.is-open .modal__panel {
  transform: none; opacity: 1; border-radius: var(--radius);
  transition: transform .38s cubic-bezier(.2, .7, .3, 1), opacity .18s linear, border-radius .34s ease;
}
/* the one glowing edge on this screen while it is open: the seam it opened along */
.modal.is-open .modal__panel::before {
  content: ""; position: absolute; top: 0; left: 10%; right: 10%; height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  box-shadow: 0 0 12px var(--cyan);
}
.modal__panel:focus-visible { border-color: var(--cyan); }
.modal__body {
  --body-pad-x: 36px; --body-pad-top: 28px;
  padding: var(--body-pad-top) var(--body-pad-x) 36px; min-height: 100%; box-sizing: border-box;
}

@media (prefers-reduced-motion: reduce) {
  .modal__panel, .modal.is-open .modal__panel { transition: opacity .12s linear; transform: none; border-radius: var(--radius); }
}

/* the node room: one sequence. video, reading, steps, turn-in. */
.room { max-width: none; }
.room > * + * { margin-top: 22px; }
.room__copy { max-width: 46rem; margin-inline: auto; }
/* The way out rides along. A student who has scrolled to the bottom of a long
   step must never have to hunt upward for the door, and Escape is not a promise
   we can keep once focus is inside the video's iframe. */
.room__head {
  position: sticky; top: 0; z-index: 4;
  display: flex; gap: 12px; align-items: flex-start;
  margin: calc(var(--body-pad-top) * -1) calc(var(--body-pad-x) * -1) 0;
  padding: var(--body-pad-top) var(--body-pad-x) 14px;
  background: linear-gradient(180deg, #0a1220 0%, rgba(10, 18, 32, .97) 76%, rgba(10, 18, 32, 0) 100%);
}
.room__title { font-size: 21px; color: #fff; margin-top: 4px; }
.room__close {
  margin-left: auto; flex: none;
  background: none; border: 1px solid var(--line); color: var(--muted);
  width: 28px; height: 28px; border-radius: var(--radius-sm); cursor: pointer; font-size: 17px; line-height: 1;
}
.room__close:hover { border-color: var(--cyan); color: #fff; }
/* Same column as the reading below: top-centered, matching text width. */
.room__video {
  max-width: 46rem;
  margin-inline: auto;
  padding-bottom: 4px;
  text-align: center;
}
.room__video .eyebrow,
.room__video .room__vidtitle { text-align: left; }
.step__video .vid { max-width: none; width: 100%; margin-inline: auto; display: block; }
.room__lesson { max-width: 72ch; }
.room__lesson .lesson__sec + .lesson__sec { margin-top: 18px; }
.room__lesson h3 { font-size: 15px; color: #fff; margin: 0 0 4px; }
.room__lesson p { color: var(--muted); font-size: 14.5px; line-height: 1.7; margin-top: 8px; }

.room__read, .room__lesson, .room__tasks, .room__out, .room__admin {
  border-top: 1px solid var(--line); padding-top: 16px;
}
.room__why { color: var(--text); font-size: 15px; margin-top: 6px; max-width: 68ch; }
.room__reading { color: var(--muted); font-size: 14.5px; margin-top: 10px; max-width: 68ch; line-height: 1.55; }
.room__mods { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-top: 12px; }
.room__mod {
  color: var(--cyan); font-size: 14px; text-decoration: none;
  border-bottom: 1px solid var(--hair-cyan);
}
.room__mod:hover { color: #fff; border-color: var(--cyan); }
.room__grade { margin-top: 12px; max-width: 68ch; }
.room__ccvv, .room__reviewfor { color: var(--muted); font-size: 14px; line-height: 1.55; margin-top: 6px; }
.room__ccvv b, .room__reviewfor b {
  color: var(--ok); font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
}
.room__done { font-size: 14.5px; color: var(--text); margin-top: 6px; max-width: 68ch; }
.room__done b { color: var(--ok); font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }
.room__hint { font-size: 13px; color: var(--muted); margin-top: 6px; max-width: 56ch; }
.room__prereqs { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-top: 10px; }
.room__goto {
  font: inherit; font-size: 13.5px; color: var(--cyan); cursor: pointer;
  background: none; border: 1px solid var(--hair-cyan); border-radius: var(--radius-sm);
  padding: 7px 12px; text-align: left;
}
.room__goto:hover { color: #fff; border-color: var(--cyan); }
.room__vidtitle { font-size: 14px; color: var(--text); margin: 6px 0 10px; }
.room__chips { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 9px; }

/* Compact poster in-flow. Playback only in .vid-theater. */
.vid { margin-top: 8px; width: 100%; max-width: 46rem; }
.vid__poster {
  position: relative; display: block; width: 100%; aspect-ratio: 16 / 9;
  margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background:
    radial-gradient(ellipse at 30% 40%, color-mix(in srgb, var(--cyan) 18%, transparent), transparent 55%),
    #05070c;
  cursor: pointer; overflow: hidden; text-align: left; color: var(--text);
  font: inherit;
}
.vid__poster:hover { border-color: color-mix(in srgb, var(--cyan) 50%, var(--line)); }
.vid__poster:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.vid__poster-img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; display: block;
}
.vid__poster.has-thumb .vid__poster-play {
  background: color-mix(in srgb, #05070c 55%, transparent);
  border-color: color-mix(in srgb, #fff 55%, var(--cyan));
  box-shadow: 0 0 28px rgba(0, 0, 0, .45);
}
.vid__poster.has-thumb .vid__poster-play::after {
  border-color: transparent transparent transparent #fff;
}
.vid__poster-play {
  position: absolute; left: 50%; top: 50%; width: 44px; height: 44px;
  margin: -22px 0 0 -22px; border-radius: 50%;
  background: color-mix(in srgb, var(--cyan) 22%, #05070c);
  border: 1.5px solid color-mix(in srgb, var(--cyan) 70%, var(--line));
  box-shadow: 0 0 24px color-mix(in srgb, var(--cyan) 25%, transparent);
  z-index: 1;
}
.vid__poster-play::after {
  content: ""; position: absolute; left: 17px; top: 13px;
  border-style: solid; border-width: 9px 0 9px 14px;
  border-color: transparent transparent transparent var(--cyan);
}
.vid__poster:hover .vid__poster-play {
  background: color-mix(in srgb, var(--cyan) 32%, #05070c);
}
.vid__poster.has-thumb:hover .vid__poster-play {
  background: color-mix(in srgb, #05070c 40%, transparent);
}
.vid__poster-meta {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 1;
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  padding: 28px 12px 10px;
  background: linear-gradient(transparent, rgba(5, 7, 12, .92));
  font-size: 12.5px;
}
.vid__poster-title {
  font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.vid__poster-mins {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  color: var(--muted); flex-shrink: 0;
}
.vid__bar {
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-top: 8px;
}
.vid__when { font-size: 13px; color: var(--muted); flex: 1 1 180px; }
.vid__meta, .vid__status { font-size: 12px; color: var(--muted); }
.vid__quality {
  font: inherit; font-size: 12.5px; color: var(--cyan); background: var(--bg2);
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 2px 8px;
  cursor: pointer;
}
.vid__quality:focus { outline: 1px solid var(--cyan); }

/* Theater: only place the video plays. Locks page scroll via .vid-lock. */
html.vid-lock, html.vid-lock body { overflow: hidden; }
.vid-theater {
  position: fixed; inset: 0; z-index: 80;
  display: grid; place-items: center; padding: 24px;
  opacity: 0; transition: opacity .18s ease;
}
.vid-theater.is-open { opacity: 1; }
.vid-theater__scrim {
  position: absolute; inset: 0;
  background: rgba(2, 4, 10, .82);
  backdrop-filter: blur(2px);
}
.vid-theater__panel {
  position: relative; z-index: 1;
  width: min(1100px, 100%);
  display: flex; flex-direction: column; gap: 10px;
  outline: none;
}
.vid-theater__close {
  position: absolute; top: -6px; right: -6px; z-index: 2;
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--bg2); color: var(--text);
  font-size: 22px; line-height: 1; cursor: pointer;
  display: grid; place-items: center;
}
.vid-theater__close:hover { border-color: var(--cyan); color: var(--cyan); }
.vid-theater__stage {
  position: relative; width: 100%; aspect-ratio: 16 / 9;
  background: #05070c; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: 0 24px 80px rgba(0, 0, 0, .55);
}
.vid-theater__player {
  position: absolute; inset: 0; width: 100%; height: 100%; border: 0;
  background: #05070c; object-fit: contain;
}
.vid-theater__bar {
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  padding: 0 4px;
}
.vid-theater__title { font-size: 14px; color: var(--text); flex: 1 1 160px; }
@media (max-width: 640px) {
  .vid-theater { padding: 12px; align-items: end; }
  .vid-theater__close { top: 8px; right: 8px; }
}
.room__lit { border-color: color-mix(in srgb, var(--ok) 24%, var(--line)); }
.room__link { display: block; color: var(--ok); font-size: 13px; word-break: break-all; margin-top: 6px; }
.room__note { color: var(--muted); font-size: 13px; margin-top: 6px; }
.room__at { display: block; margin-top: 5px; font-size: 11.5px; color: var(--muted); }
.room__form { border-top: 1px solid var(--line); padding-top: 14px; }
.room__acts { display: flex; gap: 8px; }
.room__handoff { border-top: 1px solid var(--line); padding-top: 14px; }
.room__handoff .reveal { border-top: 0; padding-top: 0; }
.room__rvs { margin-top: 14px; display: flex; flex-direction: column; gap: 11px; }
.room__admin { border-color: color-mix(in srgb, var(--amber) 24%, var(--line)); }
.room__admin .b { margin-top: 10px; }

/* ---------- calendar ---------- */

.cal__pre { margin-top: 6px; font-size: 13px; color: var(--amber); }
.cal__remind { margin-top: 8px; font-size: 13px; }
.cal__remind .b { margin-left: 4px; }

.evs { display: flex; flex-direction: column; }
.ev { display: flex; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--hair); }
.ev:last-child { border-bottom: 0; }
.ev__when { flex: none; width: 106px; }
.ev__when b { display: block; font-size: 13px; color: var(--text); }
.ev__when span { font-size: 12px; color: var(--muted); }
.ev__what { min-width: 0; flex: 1; border-left: 2px solid var(--line); padding-left: 13px; }
.ev--cohort .ev__what { border-color: var(--cyan); }
.ev--oneone .ev__what { border-color: var(--ok); }
.ev--due .ev__what { border-color: var(--amber); }
.ev--return .ev__what { border-color: var(--ok); }
.ev--gate .ev__what { border-color: var(--amber); }
.ev__what b { font-size: 14.5px; color: #fff; }
.ev__meta { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 3px; }
.ev__rel { color: var(--cyan); opacity: .8; }
.ev__agenda { font-size: 13px; color: var(--muted); margin-top: 6px; }
.ev__go { flex: none; align-self: center; }

/* ---------- reviews ---------- */

.rvs { display: flex; flex-direction: column; gap: 13px; }
.rv { border-left: 2px solid var(--line); padding: 2px 0 2px 13px; }
.rv--in-review { border-color: var(--amber); }
.rv--returned { border-color: var(--ok); }
.rv__head { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.rv__head b { font-size: 14.5px; color: #fff; }
.rv__state {
  font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 10.5px;
  letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
}
.rv--in-review .rv__state { color: var(--amber); }
.rv--returned .rv__state { color: var(--ok); }
.rv__meta { display: flex; gap: 13px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 3px; }
.rv__meta a { color: var(--cyan); text-decoration: none; }
.rv__verdict { font-size: 14px; color: var(--text); margin-top: 8px; max-width: 70ch; }
.rv__scores { margin-top: 8px; display: grid; gap: 4px; }
.rv__ccvv {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 12px; letter-spacing: .04em; color: var(--cyan);
}
.rv__move { font-size: 13.5px; color: var(--text); max-width: 70ch; }
.rv__move b { color: var(--muted); font-weight: 500; }
.rv__scoregrid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px; margin: 10px 0;
}
@media (max-width: 560px) {
  .rv__scoregrid { grid-template-columns: 1fr; }
}
.rv__hint { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.rv__acts { margin-top: 9px; }
.rvform { max-width: 560px; }

/* ---------- library ---------- */

.lib { list-style: none; display: flex; flex-direction: column; }
.lib__item { display: flex; gap: 13px; align-items: center; padding: 11px 2px; border-bottom: 1px solid var(--hair); }
.lib__item:last-child { border-bottom: 0; }
.lib__n { font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 11.5px; color: var(--muted); flex: none; }
.lib__body { flex: 1; min-width: 0; }
.lib__body b { display: block; font-size: 14.5px; color: var(--text); font-weight: 600; }
.lib__meta { font-size: 12px; color: var(--muted); }
.lib__when { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.lib__item { flex-wrap: wrap; }
.lib__item .vid { flex: 1 1 100%; }
.lib__item.is-planned .lib__body b { color: var(--muted); }
.lib__nodes { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.libnode {
  display: block; text-align: left; text-decoration: none;
  background: var(--bg2); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 12px 13px; cursor: pointer; font: inherit; color: var(--text);
}
.libnode:hover { border-color: var(--cyan); }
.libnode b { display: block; font-size: 13.5px; }
.libnode span { font-size: 12px; color: var(--muted); }

/* ---------- coach ---------- */

.axes { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 11px; }
.axis { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 11px 13px; }
.axis b { font-size: 13.5px; color: #fff; }
.axis p { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.drills { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.drill { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 15px; background: var(--bg2); }
.drill__head { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; margin-bottom: 9px; }
.drill__head b { font-size: 14.5px; color: #fff; }
.drill__mins { font-size: 11.5px; color: var(--muted); margin-left: auto; }
.drill__prompt {
  font-size: 13.5px; color: var(--text); border-left: 2px solid var(--hair-cyan);
  padding-left: 11px; margin-bottom: 9px;
}
.drill__dw { font-size: 12.5px; color: var(--muted); margin-bottom: 11px; }
.drill__dw b { color: var(--ok); font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; }

/* ---------- the first twenty minutes ---------- */

.view--first { max-width: 900px; }
.law {
  border: 1px solid var(--hair-cyan); border-radius: var(--radius);
  background: linear-gradient(180deg, #0b1524 0%, var(--panelbg) 100%);
  padding: 18px 20px; margin-bottom: 22px;
}
.law__line { font-size: clamp(17px, 2.2vw, 21px); color: #fff; margin-top: 7px; }
.law__sub { font-size: 14px; color: var(--muted); margin-top: 9px; max-width: 74ch; }
.gloss {
  margin: 18px 0 8px; padding: 14px 16px;
  border: 1px solid var(--hair); border-radius: var(--radius); background: var(--surface);
}
.gloss__list {
  list-style: none; margin: 10px 0 0; padding: 0;
  display: flex; flex-direction: column; gap: 8px;
}
.gloss__list li { font-size: 14px; color: var(--muted); line-height: 1.45; }
.gloss__list b { color: var(--cyan); margin-right: 6px; }

.fsteps { list-style: none; display: flex; flex-direction: column; gap: 0; }
.fstep { display: flex; gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--hair); }
.fstep:last-child { border-bottom: 0; }
.fstep__n {
  flex: none; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; border: 1px solid var(--hair-cyan);
  font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 12px; color: var(--cyan);
}
.fstep__body { min-width: 0; }
.fstep__body h2 { font-size: 17px; color: #fff; }
.fstep__body p { font-size: 14px; color: var(--muted); margin: 6px 0 12px; max-width: 70ch; }

.doors { margin-top: 26px; }
.doors__pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; margin-top: 12px; }
.door {
  text-align: left; cursor: pointer; font: inherit; color: var(--text);
  background: var(--bg2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 15px 16px;
}
.door:hover { border-color: var(--cyan); }
.door b { display: block; font-size: 16px; color: #fff; }
.door span { display: block; font-size: 13px; color: var(--muted); margin-top: 5px; }
.doors__note { font-size: 13px; color: var(--muted); margin-top: 12px; max-width: 74ch; }
.frun__acts { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 28px; }

/* ---------- gate ---------- */

.gate { min-height: 100vh; display: grid; place-items: center; padding: 40px 24px; }
.picker { width: 100%; max-width: 460px; }
.picker__brand { display: flex; align-items: center; gap: 10px; margin-bottom: 26px; }
.picker__logo { width: 30px; height: 30px; }
.picker__logo .g-on rect { fill: var(--cyan); }
.picker__logo .g-off rect { fill: #14213a; }
.picker h1 { font-size: 28px; color: #fff; }
.picker .muted { margin-top: 8px; font-size: 14.5px; }
.picker__list { display: flex; flex-direction: column; gap: 9px; margin: 24px 0; }
.picker__row {
  text-align: left; background: var(--bg2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px; cursor: pointer; font: inherit; color: var(--text);
}
.picker__row:hover { border-color: var(--cyan); }
.picker__row b { display: block; font-size: 15px; color: #fff; }
.picker__row span { font-size: 12.5px; color: var(--muted); }
.picker__foot { font-size: 13px; color: var(--muted); }
.picker__foot a { color: var(--cyan); }
.login__err { color: #ff9d9d; font-size: 13px; margin-top: 8px; }

/* ---------- toast ---------- */

.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translate(-50%, 14px);
  z-index: 50; padding: 10px 18px; border-radius: var(--radius-sm);
  background: rgba(6, 10, 18, .97); border: 1px solid var(--hair-cyan);
  color: var(--text); font-size: 13.5px; opacity: 0;
  transition: opacity .22s ease, transform .22s ease;
}
.toast.is-in { opacity: 1; transform: translate(-50%, 0); }
.toast--warn { border-color: color-mix(in srgb, var(--amber) 42%, var(--line)); color: var(--amber); }

/* ---------- responsive ---------- */

@media (max-width: 1080px) {
  .grid2 { grid-template-columns: minmax(0, 1fr); }
  .composer__hint { display: none; }
}

@media (max-width: 900px) {
  /* One column: the strip on top, then a row that takes the rest so the map can
     still ask for full height. minmax(0, …) keeps the nav strip from pushing the
     page sideways. */
  .shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .rail {
    position: static; height: auto; flex-direction: row; align-items: center;
    flex-wrap: wrap; gap: 12px; border-right: 0; border-bottom: 1px solid var(--line);
    min-width: 0;
  }
  .rail__nav {
    flex-direction: row; overflow-x: auto; gap: 4px; flex: 1 1 100%; order: 3;
    min-width: 0; scrollbar-width: none;
  }
  .rail__nav::-webkit-scrollbar { display: none; }
  .rail__link { white-space: nowrap; }
  /* the hint drops, the badge does not: the badge is the reason to tap */
  .rail__linktext span { display: none; }
  .rail__link.is-active::before { left: 10px; right: 10px; top: auto; bottom: -1px; width: auto; height: 2px; }
  /* on a phone the tools sit in the same strip, still quieter, and the hairline
     between them becomes vertical rather than a full-width rule */
  .rail__rule { width: 1px; height: 22px; margin: 0 2px; order: 3; }
  .rail__tools { flex-direction: row; gap: 2px; order: 3; }
  .rail__tool { white-space: nowrap; font-size: 12.5px; }
  /* Identity shares the first row with the brand: name left, actions right.
     The cohort line drops (Today says it); the role tags stay because they
     change what the board does. Actions shrink so four still fit. */
  .rail__id {
    margin: 0; border-top: 0; padding-top: 0; display: flex; gap: 10px;
    align-items: center; justify-content: space-between; flex: 1 1 auto; order: 1; min-width: 0;
  }
  .rail__who { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; min-width: 0; }
  .rail__who b { white-space: nowrap; }
  .rail__who span:not(.rail__role) { display: none; }
  .rail__acts { margin-top: 0; gap: 4px; justify-content: flex-end; }
  .rail__acts .b { padding: 8px 9px; font-size: 12px; }
  /* a thumb is not a cursor: every control clears the 40px tap floor */
  .b { padding: 10px 15px; }
  .b--quiet { padding: 10px 12px; }
  .steer { grid-template-columns: 1fr; }
  .view { padding: 22px 18px 60px; }
  /* map controls sit along the bottom: a vertical stack would eat half the width */
  .hud--side {
    top: auto; bottom: 12px; left: 12px; right: 12px;
    flex-direction: row; flex-wrap: wrap; gap: 8px;
  }
  .hud--side .b { min-width: 0; flex: 1 1 auto; }
  .hud--top { gap: 6px; flex-direction: column; align-items: flex-start; }
  /* a phone has no side room, so the room fills the map area edge to edge */
  .modal__panel { --room-gap: 8px; }
  .modal__body { --body-pad-x: 16px; --body-pad-top: 16px; padding-bottom: 22px; }
  .ev { flex-direction: column; gap: 6px; }
  .ev__when { width: auto; display: flex; gap: 10px; }
  .mlrow { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .mlrow__side { margin-top: 2px; }
  .doors__pair { grid-template-columns: minmax(0, 1fr); }
  .nextbar { padding: 14px 16px 12px; }
  .thread { padding: 16px 16px 8px; }
  .composer { padding: 8px 12px 12px; }
  .composer .b { min-height: 44px; min-width: 64px; }
}

/* ---------- full step page (replaces map modal) ---------- */

/* Full-width scroll host so the wheel works anywhere in the outlet, not only
   over the narrow text column. Content stays centered inside .step. */
.view--step {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
}
.view--step > .step,
.view--step > .step--module {
  max-width: 46rem;
  margin: 0 auto;
  padding: 22px 22px 96px;
  box-sizing: border-box;
}
.step__bar {
  position: sticky;
  bottom: 0;
  z-index: 8;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 36px;
  padding: 14px 0 10px;
  border-top: 1px solid var(--hair);
  background: linear-gradient(to top, var(--bg) 72%, color-mix(in srgb, var(--bg) 70%, transparent));
}
.step__bar-next {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}
.step__bar-hint {
  font-size: 12.5px;
  color: var(--muted);
  max-width: 22ch;
}
.step__bar .b:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}
.step__head { margin-bottom: 28px; }
.step__nav {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
  margin-bottom: 16px;
}
.step__rule {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 11px; letter-spacing: .06em; color: var(--muted);
}
.step__title { font-size: clamp(22px, 3vw, 28px); color: #fff; margin-top: 6px; }
.step__lead { color: var(--text); font-size: 16px; line-height: 1.55; margin-top: 10px; max-width: 70ch; }
.step__scope { color: var(--muted); font-size: 13.5px; margin-top: 8px; max-width: 70ch; }
.step__mode {
  display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: baseline;
  margin-top: 12px; padding: 10px 14px; max-width: 70ch;
  border: 1px solid var(--hair); border-left: 3px solid var(--cyan); border-radius: var(--radius);
  color: var(--muted); font-size: 13.5px; line-height: 1.55;
}
.step__mode b {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--text);
}
.step__mode--incident { border-left-color: var(--warn); }

/* Electives and sign-off share the mode line's shape: one bordered aside,
   colour on the left edge saying what kind of decision it is. */
.elective, .signoff {
  margin-top: 18px; padding: 12px 16px; max-width: 70ch;
  border: 1px solid var(--hair); border-left: 3px solid var(--cyan); border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
}
.elective p, .signoff p { color: var(--muted); font-size: 14px; line-height: 1.6; margin: 6px 0 12px; }
.elective .eyebrow, .signoff .eyebrow { color: var(--text); }
.elective--offer { border-left-style: dashed; }
.elective--on { border-left-color: var(--ok); }
.signoff { border-left-color: var(--amber); }
.signoff--waiting p { margin-bottom: 0; }
.step__evidence { color: var(--text); font-size: 16px; line-height: 1.55; margin-top: 8px; max-width: 70ch; }
.step--welcome .step__lead { font-size: 17px; line-height: 1.6; max-width: 62ch; }
.step--welcome .lesson__sec--letter {
  padding: 18px 20px;
  border: 1px solid var(--hair);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  max-width: 62ch;
}
.step--welcome .lesson__sec--letter h2 { margin-bottom: 10px; }
.step--welcome .lesson__sec--letter p { color: var(--text); font-size: 15.5px; line-height: 1.75; }
.step--welcome .step__video { margin-top: 22px; }
.step__do, .step__why, .step__video, .step__lesson, .step__tasks, .step__out, .step__mods, .step__schedule, .step__ready {
  margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--hair);
}
.step__lesson h2 { font-size: 16px; color: #fff; margin: 0 0 6px; }
.step__lesson .lesson__sec + .lesson__sec { margin-top: 20px; }
.step__lesson p { color: var(--muted); font-size: 15px; line-height: 1.7; margin-top: 8px; }
.lesson__fig {
  margin: 14px 0 4px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #05070c;
}
.lesson__fig img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
}
.lesson__fig figcaption {
  margin-top: 10px;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 12px;
  line-height: 1.45;
  letter-spacing: 0.02em;
  color: var(--muted);
}
.step__modlist { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.step__mod {
  text-align: left; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); color: inherit; padding: 14px 16px;
}
.step__mod:hover { border-color: var(--cyan); }
.step__mod b { display: block; color: var(--cyan); margin-bottom: 4px; }
.step__mod span { font-size: 13px; color: var(--muted); }
.step__prose { margin-top: 18px; max-width: 72ch; }
.step__prose h1, .step__prose h2, .step__prose h3 { color: #fff; margin: 1.4em 0 0.4em; }
.step__prose p, .step__prose li { color: var(--text); font-size: 15.5px; line-height: 1.7; }
.step__prose pre {
  margin-top: 1em; padding: 14px 16px; overflow-x: auto;
  border: 1px solid var(--line); border-radius: var(--radius); background: #05070c;
}
.step__prose code {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.88em; color: var(--cyan);
}
.step__prose table { width: 100%; margin-top: 1em; border-collapse: collapse; font-size: 14px; line-height: 1.5; }
.step__prose th, .step__prose td { padding: 8px 10px; border: 1px solid var(--line); vertical-align: top; text-align: left; }
.step__prose th { color: #fff; font-weight: 600; background: var(--bg2); }
.step__prose tr:nth-child(even) td { background: color-mix(in srgb, var(--bg2) 55%, transparent); }

/* Diagrams: mermaid drawn in place of its source, in lessons and in readings. */
.diagram {
  margin-top: 1em; padding: 14px 16px; overflow-x: auto;
  border: 1px solid var(--line); border-radius: var(--radius); background: #05070c;
}
.diagram svg { display: block; max-width: 100%; height: auto; margin: 0 auto; }
/* Mermaid sizes each box from a label it measured outside the lesson. Page
   paragraph rules would re-flow that label once inside and clip the text. */
.diagram svg p { font: inherit; color: inherit; margin: 0; line-height: inherit; max-width: none; }
pre.diagram--failed { border-color: var(--amber); }
.lesson__fig--diagram { padding: 0; border: 0; background: none; }
.lesson__fig--diagram .diagram { margin-top: 0; }
.lesson__fig--diagram pre {
  margin: 0; padding: 14px 16px; overflow-x: auto;
  border: 1px solid var(--line); border-radius: var(--radius); background: #05070c;
}
.lesson__fig--diagram pre code {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 12.5px; line-height: 1.5; color: var(--text);
}

/* What this step proves: the six-field contract every step carries. */
.step__proves { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--hair); }
.proves { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; margin-top: 12px; }
.proves__row { padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.proves__row b {
  display: block; margin-bottom: 4px;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--cyan);
}
.proves__row p { margin: 0; color: var(--text); font-size: 14px; line-height: 1.6; }
.proves__row--falsify b { color: var(--amber); }
@media (max-width: 720px) { .proves { grid-template-columns: 1fr; } }

/* Until a film exists, the card carries what the film will cover. */
.vid__summary { margin-top: 12px; padding: 12px 14px; border: 1px dashed var(--line); border-radius: var(--radius); }
.vid__summary b { display: block; margin-bottom: 4px; font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.vid__summary p { margin: 0; color: var(--text); font-size: 14.5px; line-height: 1.65; }

@media (max-width: 720px) {
  .view--step > .step,
  .view--step > .step--module { padding: 18px 16px 72px; }
}

@media (prefers-reduced-motion: reduce) {
  .edge--live { animation: none; }
  .world--animating { transition: none; }
}

/* ---------- the 3D floor (graph/scene3d) ---------- */
.world3d-host { position: absolute; inset: 0; }
.world3d { display: block; width: 100%; height: 100%; touch-action: none; }
/* Focusable stand-ins for the pillars: read by assistive tech, invisible otherwise. */
.world3d__proxies { position: absolute; inset: 0; width: 0; height: 0; overflow: hidden; }
.world3d__proxy { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
