/* ═══════════════════════════════════════════════════════════════════
   First Mile v2 — app.css
   Expedition Field Guide. Paper rooms, navy gate and plates, gold hairlines.
   Display Fraunces · Body Commissioner · Labels IBM Plex Mono.
   ═══════════════════════════════════════════════════════════════════ */

:root {
  --navy: #0B1F3A;
  --navy-2: #122848;
  --navy-3: #1A3256;
  --ink: #18212E;
  --gold: #C9A227;
  --gold-soft: #D4B560;
  --gold-ink: #8C6E14;
  --slate: #6B7480;
  --mute: #98A0AA;
  --rule: #E0DDD3;
  --paper: #FAFAF7;
  --paper-2: #F3F0E8;
  --paper-3: #ECE8DD;
  --vital: #2F5D50;
  --vital-soft: #DCE8E2;
  --trivial: #8A5A3C;
  --trivial-soft: #EFE2D8;
  --danger: #8A3C3C;

  --serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "Commissioner", "Avenir Next", "Helvetica Neue", Helvetica, sans-serif;
  --mono: "IBM Plex Mono", "SF Mono", Menlo, Consolas, monospace;

  --ease: cubic-bezier(.22, .8, .24, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --nav-w: 236px;
  --top-h: 56px;
  --tab-h: 62px;
  --stage-pad: clamp(1.25rem, 3.4vw, 3rem);
  --radius: 3px;
  --shadow-card: 0 1px 0 rgba(11,31,58,.06), 0 10px 28px -12px rgba(11,31,58,.22);
  --shadow-deck: 0 2px 0 rgba(11,31,58,.05), 0 24px 48px -18px rgba(11,31,58,.35), 0 1px 2px rgba(11,31,58,.08);
}

/* ── Reset ───────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html, body { min-height: 100%; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  font-weight: 400;
  letter-spacing: -0.008em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "kern", "liga";
  position: relative;
}
img, svg { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; letter-spacing: inherit; }
button { background: none; border: 0; cursor: pointer; border-radius: var(--radius); }
button:disabled { opacity: .45; cursor: not-allowed; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
::selection { background: var(--gold); color: var(--navy); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
h1, h2, h3 { font-weight: 330; line-height: 1.08; letter-spacing: -0.018em; }
h1, h2, h3, .serif { font-family: var(--serif); font-variation-settings: "opsz" 96; }
em { font-style: italic; }
code, .mono { font-family: var(--mono); }
small { font-size: .82em; }

/* ── Topographic paper ───────────────────────────────────────────── */
.contour {
  position: fixed; inset: 0; z-index: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}
.paper-bg { position: absolute; width: 0; height: 0; }
.gate, .app { position: relative; z-index: 1; }

/* ── Shared type bits ────────────────────────────────────────────── */
.kicker {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1rem;
}
.lede {
  font-size: clamp(1.02rem, 1.2vw, 1.15rem);
  line-height: 1.6;
  color: rgba(250,250,247,.82);
  max-width: 46ch;
  margin-bottom: 1.4rem;
}
.tiny {
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.6;
  letter-spacing: .02em;
  color: var(--mute);
  margin-top: 1rem;
}
.gate .tiny { color: rgba(250,250,247,.5); }

.sub {
  color: var(--slate);
  font-size: 1rem;
  max-width: 58ch;
  margin-top: .5rem;
}
.rule-gold {
  height: 1px;
  background: var(--gold);
  opacity: .9;
  width: 64px;
  margin: 1.2rem 0;
  border: 0;
}
.rule-gold.wide { width: 100%; opacity: .5; }

/* Figure captions: gold mono eyebrow + one italic Fraunces line. */
.fig-cap {
  margin-top: .9rem;
  display: flex;
  flex-direction: column;
  gap: .2rem;
}
.fig-cap .fig-n,
.fig-cap > span:first-child {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--gold);
}
.fig-cap em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 330;
  font-size: .98rem;
  color: var(--slate);
  line-height: 1.45;
}
.gate .fig-cap em { color: rgba(250,250,247,.6); }

/* ── Buttons ─────────────────────────────────────────────────────── */
.gold, .ink, .ghost, .ghost-ink, .danger, .link, .cta,
.btn-start, .btn-switch, .btn-stop {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .78rem 1.3rem;
  font-family: var(--sans);
  font-weight: 500;
  font-size: .95rem;
  line-height: 1;
  letter-spacing: .005em;
  border: 1px solid transparent;
  border-radius: var(--radius);
  transition: transform .18s var(--ease), background .18s var(--ease), color .18s var(--ease), border-color .18s var(--ease), box-shadow .18s var(--ease);
  white-space: nowrap;
}
.gold, .cta {
  background: var(--gold);
  color: var(--navy);
  border-color: var(--gold);
  box-shadow: 0 1px 0 rgba(0,0,0,.08), 0 8px 22px -10px rgba(201,162,39,.8);
}
.gold:hover, .cta:hover { background: var(--gold-soft); transform: translateY(-1px); }
.gold:active, .cta:active { transform: translateY(0); }
.ink {
  background: var(--navy);
  color: var(--paper);
  border-color: var(--navy);
}
.ink:hover { background: var(--navy-2); transform: translateY(-1px); }
.ghost {
  background: transparent;
  color: var(--paper);
  border-color: rgba(250,250,247,.28);
}
.ghost:hover { border-color: var(--gold-soft); color: var(--gold-soft); }
.ghost-ink {
  background: transparent;
  color: var(--navy);
  border-color: var(--rule);
  padding: .6rem 1rem;
  font-size: .88rem;
}
.ghost-ink:hover { border-color: var(--navy); }
.danger {
  background: transparent;
  color: var(--danger);
  border-color: rgba(138,60,60,.35);
}
.danger:hover { background: rgba(138,60,60,.06); border-color: var(--danger); }
.link {
  background: none;
  border: 0;
  padding: .4rem .2rem;
  color: var(--slate);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-underline-offset: 4px;
}
.link:hover { color: var(--navy); text-decoration-color: var(--gold); }
.row-btns { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .4rem; }
.row-btns.samples { margin-top: 1.1rem; }
.row-btns.samples .ghost {
  flex-direction: column;
  align-items: flex-start;
  gap: .25rem;
  padding: .65rem .9rem;
  font-size: .86rem;
}
.row-btns.samples .ghost small {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--gold-soft);
  font-weight: 400;
}

/* ── Fields ──────────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: .4rem; }
.field span,
label.field > span {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--slate);
}
.gate .field span { color: rgba(250,250,247,.6); }
textarea, input, select {
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: .72rem .85rem;
  width: 100%;
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease);
}
textarea:focus, input:focus, select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,162,39,.18);
}
textarea { min-height: 92px; resize: vertical; line-height: 1.5; }
input[type="number"] { font-family: var(--mono); }
select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%236B7480' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .85rem center;
  padding-right: 2.2rem;
}
.gate textarea, .gate input, .gate select {
  background-color: rgba(250,250,247,.08);
  border-color: rgba(250,250,247,.3);
  color: var(--paper);
}
.gate input::placeholder { color: rgba(250,250,247,.5); }
.gate select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23D4B560' stroke-width='1.5'/%3E%3C/svg%3E"); }
.gate select option { color: var(--ink); background: #fff; }
.gate textarea:focus, .gate input:focus, .gate select:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,162,39,.22); }
input::placeholder, textarea::placeholder { color: var(--mute); }
.fields-2 { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
.fields-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: .9rem; }
.fields-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: .9rem; }

/* ═══════════════════ GATE ═══════════════════ */
.gate {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 1.08fr .92fr;
  background: var(--navy);
  color: var(--paper);
  overflow: hidden;
}
.gate::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(1100px 640px at 18% 86%, rgba(201,162,39,.16), transparent 58%),
    radial-gradient(700px 420px at 92% 6%, rgba(250,250,247,.05), transparent 55%);
  pointer-events: none;
}
.gate > * { position: relative; }
.gate-fig {
  padding: clamp(1.6rem, 3.4vw, 3rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-right: 1px solid rgba(201,162,39,.22);
}
.gate-fig-slot { width: 100%; max-width: 640px; margin: 0 auto; }
.gate-fig-slot svg text { font-family: var(--mono); }
.gate-copy {
  padding: clamp(1.8rem, 4vw, 4rem) clamp(1.6rem, 4vw, 4rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 620px;
}
.gate h1 {
  font-size: clamp(2.6rem, 5.2vw, 4.4rem);
  font-weight: 300;
  margin-bottom: 1.1rem;
  color: var(--paper);
}
.gate h1 em { color: var(--gold); font-weight: 330; }
.steps-row {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.1rem;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--gold-soft);
  margin-bottom: 1.6rem;
  counter-reset: step;
}
.steps-row li { counter-increment: step; }
.steps-row li::before { content: counter(step, decimal-leading-zero) " "; color: rgba(250,250,247,.38); }
.enter { display: flex; flex-direction: column; gap: .95rem; }
.enter .gold { padding-inline: 2rem; }

/* ═══════════════════ APP SHELL ═══════════════════ */
.app { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.top {
  position: sticky; top: 0; z-index: 30;
  height: var(--top-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1.2rem;
  background: rgba(250,250,247,.86);
  backdrop-filter: blur(10px) saturate(1.1);
  -webkit-backdrop-filter: blur(10px) saturate(1.1);
  border-bottom: 1px solid var(--rule);
}
.top .lock { display: flex; align-items: baseline; gap: .6rem; min-width: 0; }
.mark {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.2rem;
  letter-spacing: -.01em;
  color: var(--navy);
  position: relative;
}
.mark::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -3px;
  height: 1px; background: var(--gold);
}
.who {
  color: var(--slate);
  font-size: .95rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.who b { font-weight: 500; color: var(--ink); }
.sample-pill {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .18em;
  padding: .25rem .5rem;
  border: 1px solid var(--gold);
  color: var(--gold-ink);
  border-radius: 999px;
  background: rgba(201,162,39,.1);
  align-self: center;
}
.top-r { display: flex; align-items: center; gap: .45rem; }

.shell {
  flex: 1;
  display: grid;
  grid-template-columns: var(--nav-w) minmax(0, 1fr);
  min-height: calc(100vh - var(--top-h));
}

/* ── Left rail ───────────────────────────────────────────────────── */
.nav {
  position: sticky; top: var(--top-h);
  height: calc(100vh - var(--top-h));
  overflow-y: auto;
  padding: 1.4rem 1rem 2rem 1.2rem;
  border-right: 1px solid var(--rule);
  background: rgba(243,240,232,.55);
}
.nav .grp {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--slate);
  margin: 1.3rem 0 .5rem .6rem;
}
.nav .grp:first-child { margin-top: 0; }
.nav a {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .5rem .6rem;
  border-radius: var(--radius);
  color: var(--ink);
  font-size: .95rem;
  position: relative;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.nav a:hover { background: rgba(11,31,58,.05); }
.nav a.on {
  background: var(--navy);
  color: var(--paper);
}
.nav a.on .pip { border-color: var(--gold-soft); }
.nav a .n {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--mute);
  width: 1.4em;
}
.nav a.on .n { color: var(--gold-soft); }
.pip {
  width: 9px; height: 9px;
  border-radius: 50%;
  border: 1.4px solid var(--slate);
  margin-left: auto;
  flex: none;
  background: transparent;
  position: relative;
}
.pip-1 { background: linear-gradient(90deg, var(--gold) 50%, transparent 50%); border-color: var(--gold); }
.pip-2 { background: var(--gold); border-color: var(--gold); }
.nav a.on .pip-1 { background: linear-gradient(90deg, var(--gold-soft) 50%, transparent 50%); }
.nav a.on .pip-2 { background: var(--gold-soft); }

/* ── Mobile tab bar ──────────────────────────────────────────────── */
.tabbar {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  height: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(250,250,247,.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--rule);
  grid-template-columns: repeat(5, 1fr);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .25rem;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--slate);
  position: relative;
}
.tabbar a svg { width: 20px; height: 20px; }
.tabbar a.on { color: var(--navy); }
.tabbar a.on::before {
  content: ""; position: absolute; top: 0; left: 25%; right: 25%;
  height: 2px; background: var(--gold);
}
.tabbar .pip { position: absolute; top: 8px; right: 22%; margin: 0; width: 6px; height: 6px; }

/* ── Stage ───────────────────────────────────────────────────────── */
.stage {
  padding: var(--stage-pad) var(--stage-pad) 5rem;
  min-width: 0;
  outline: none;
}
.room { max-width: 1080px; margin: 0 auto; }
.room-head { margin-bottom: 1.8rem; }
.room-head h2 {
  font-family: var(--serif);
  font-weight: 330;
  font-size: clamp(2rem, 3.6vw, 3rem);
  color: var(--navy);
  font-variation-settings: "opsz" 120;
}
.room-head h2 em {
  font-style: italic;
  color: var(--gold-ink);
  font-weight: 330;
}
.room-head .kicker { margin-bottom: .6rem; }
.book-line {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 330;
  font-size: 1.08rem;
  color: var(--slate);
  border-left: 2px solid var(--gold);
  padding-left: .9rem;
  margin: 1.4rem 0;
  max-width: 56ch;
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; align-items: start; }
.grid-fig { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 2rem; align-items: start; }
.grid-fig.rev { grid-template-columns: 320px minmax(0, 1fr); }
.stack { display: flex; flex-direction: column; gap: 1rem; }
.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.count-line {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--slate);
  display: flex; gap: 1.2rem; flex-wrap: wrap;
}
.count-line b { color: var(--navy); font-weight: 500; }
.empty {
  padding: 2rem 1.4rem;
  border: 1px dashed var(--rule);
  border-radius: var(--radius);
  color: var(--slate);
  text-align: center;
}
.empty .book-line { margin: 0 auto 1rem; border: 0; padding: 0; }

/* ── Navy plate / the one move ───────────────────────────────────── */
.plate {
  position: relative;
  background: var(--navy);
  color: var(--paper);
  padding: clamp(1.8rem, 4vw, 3.4rem);
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 30px 60px -30px rgba(11,31,58,.55);
}
.plate::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(900px 480px at 12% 100%, rgba(201,162,39,.18), transparent 60%);
  pointer-events: none;
}
.plate > * { position: relative; }
.plate .kicker { color: var(--gold-soft); }
.plate .rule-gold { width: 56px; margin: 1.2rem 0; }
.move {
  font-family: var(--serif);
  font-weight: 330;
  font-size: clamp(2.2rem, 5vw, 4.6rem);
  line-height: 1.04;
  letter-spacing: -.022em;
  color: var(--paper);
  max-width: 18ch;
  font-variation-settings: "opsz" 144;
  text-wrap: balance;
}
.move em { color: var(--gold); font-style: italic; }
.move-why {
  margin-top: 1.2rem;
  max-width: 52ch;
  color: rgba(250,250,247,.72);
  font-size: 1.02rem;
  line-height: 1.55;
}
.plate .plate-ctas { margin-top: 1.8rem; align-items: center; }
.plate .plate-ctas .ghost {
  border-color: rgba(250,250,247,.35);
  color: var(--paper);
  padding: .85rem 1.15rem;
}
.plate .plate-ctas .ghost:hover { border-color: var(--gold-soft); color: var(--gold-soft); }

/* ── Field cards ─────────────────────────────────────────────────── */
.field-card {
  background: #fff;
  border: 1px solid var(--rule);
  border-top: 2px solid var(--gold);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem 1.2rem;
  box-shadow: var(--shadow-card);
  display: flex; flex-direction: column; gap: .55rem;
  min-width: 0;
}
.field-card.paper { background: var(--paper-2); }
.fc-kicker {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--gold-ink);
}
.fc-stat {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.6rem, 2.6vw, 2.2rem);
  line-height: 1.05;
  color: var(--navy);
  font-variation-settings: "opsz" 72;
}
.fc-stat small { font-family: var(--mono); font-size: .5em; color: var(--slate); letter-spacing: .1em; margin-left: .3em; }
.fc-note {
  font-size: .9rem;
  color: var(--slate);
  line-height: 1.5;
}
.fc-note em { font-family: var(--serif); color: var(--ink); }
.field-card .row-btns { margin-top: .4rem; }
.field-card h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.25rem;
  color: var(--navy);
}
.field-card .fig-mini svg { width: 100%; height: auto; }
.field-card .fig-mini text { font-family: var(--mono); }
.field-card.workflow .kind {
  font-family: var(--mono); font-size: 10px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--slate);
}

/* ── Ratio bar (vital / trivial) ─────────────────────────────────── */
.bar {
  position: relative;
  display: flex;
  height: 14px;
  border-radius: 2px;
  overflow: hidden;
  background: var(--paper-3);
  border: 1px solid var(--rule);
}
.bar .v { background: var(--vital); width: 0%; height: 100%; transition: width .6s var(--ease-out); }
.bar .t { background: var(--trivial); width: 0%; height: 100%; transition: width .6s var(--ease-out); }
.bar .u { background: repeating-linear-gradient(135deg, transparent 0 4px, rgba(107,116,128,.35) 4px 6px); flex: 1; height: 100%; }
.bar-legend {
  display: flex; justify-content: space-between; gap: .5rem 1rem; flex-wrap: wrap;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--slate); margin-top: .5rem;
}
.bar-legend span { white-space: nowrap; }
.bar-legend .lv { color: var(--vital); }
.bar-legend .lt { color: var(--trivial); }
.bar-legend b { font-weight: 500; }

/* ── Progress pips (compass) ─────────────────────────────────────── */
.pips { display: flex; gap: .5rem; align-items: center; margin-bottom: 1.4rem; flex-wrap: wrap; }
.pip-step {
  display: flex; align-items: center; gap: .5rem;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--slate);
  padding: .4rem .7rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  transition: all .15s var(--ease);
}
.pip-step::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  border: 1.3px solid currentColor;
}
.pip-step.on { color: var(--navy); border-color: var(--navy); background: #fff; }
.pip-step.on::before { background: var(--gold); border-color: var(--gold); }
.pip-step.done::before { background: var(--gold); border-color: var(--gold); }
.pip-step:hover { border-color: var(--navy); }

/* ── Compass ─────────────────────────────────────────────────────── */
.compass-wrap {
  position: sticky; top: calc(var(--top-h) + 1rem);
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.2rem;
  box-shadow: var(--shadow-card);
}
.compass-wrap svg { width: 100%; height: auto; }
.panel { display: none; }
.panel.on { display: block; }
.sentence-live {
  font-family: var(--serif);
  font-weight: 330;
  font-size: clamp(1.4rem, 2.4vw, 2rem);
  line-height: 1.25;
  color: var(--navy);
  padding: 1.2rem 1.4rem;
  background: var(--paper-2);
  border-left: 2px solid var(--gold);
  margin: 1.2rem 0;
  text-wrap: balance;
}
.sentence-live .blank { color: var(--gold-ink); font-style: italic; border-bottom: 1px dashed var(--gold); }
.sentence-live .blank.filled { color: var(--navy); border-bottom-color: transparent; font-style: normal; }
.diag { display: flex; flex-direction: column; gap: .8rem; }
.diag-q {
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem; align-items: center;
  padding: .9rem 1rem;
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}
.diag-q .q { font-size: .98rem; }
.yn { display: flex; gap: .3rem; }
.yn button {
  font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  padding: .5rem .8rem; border: 1px solid var(--rule); color: var(--slate);
}
.yn button.on { background: var(--navy); color: var(--paper); border-color: var(--navy); }
.state-name {
  margin-top: 1.2rem;
  padding: 1.2rem 1.4rem;
  background: var(--navy);
  color: var(--paper);
  border-radius: var(--radius);
}
.state-name .kicker { margin-bottom: .3rem; color: var(--gold-soft); }
.state-name h3 { font-family: var(--serif); font-weight: 330; font-size: 1.8rem; color: var(--gold); margin-bottom: .4rem; }
.state-name p { color: rgba(250,250,247,.78); font-size: .98rem; max-width: 52ch; }
.type-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; }
.type-card {
  text-align: left; padding: 1rem; border: 1px solid var(--rule); background: #fff;
  display: flex; flex-direction: column; gap: .3rem; border-radius: var(--radius);
}
.type-card b { font-family: var(--serif); font-weight: 400; font-size: 1.1rem; color: var(--navy); }
.type-card span { font-size: .86rem; color: var(--slate); }
.type-card.on { border-color: var(--navy); box-shadow: inset 0 0 0 1px var(--navy); }
.type-card.on b { color: var(--gold-ink); }

/* ── Ladder: repeated "to find" rungs stay quiet ─────────────────── */
.rung-msg.quiet .hint { display: none; }
.rung-msg.quiet .rung-text { color: var(--slate); }

/* ── Audit: the logger ───────────────────────────────────────────── */
.logger {
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: clamp(1.3rem, 3vw, 2.2rem);
  box-shadow: var(--shadow-card);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1.2rem 2rem;
  align-items: center;
  position: relative;
}
.logger { border-top: 2px solid var(--gold); }
.logger.running { border-color: var(--gold); box-shadow: var(--shadow-card), 0 0 0 3px rgba(201,162,39,.14); }
.logger-time {
  font-family: var(--mono);
  font-size: clamp(2.4rem, 8vw, 5rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -.02em;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
  min-width: 5.2ch;
}
.logger.running .logger-time { color: var(--navy); }
.logger-time small { font-size: .32em; letter-spacing: .14em; color: var(--slate); margin-left: .3em; vertical-align: baseline; }
.logger-task {
  display: flex; flex-direction: column; gap: .5rem; min-width: 0;
}
.logger-task .now {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.2rem, 2.4vw, 1.7rem);
  color: var(--navy);
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.logger-task .since { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--slate); }
.logger-btns { display: flex; gap: .5rem; flex-wrap: wrap; grid-column: 1 / -1; }
.btn-start { background: var(--navy); color: var(--paper); border-color: var(--navy); }
.btn-start:hover { background: var(--navy-2); }
.btn-switch { background: var(--gold); color: var(--navy); border-color: var(--gold); }
.btn-switch:hover { background: var(--gold-soft); }
.btn-stop { background: transparent; color: var(--navy); border-color: var(--rule); }
.btn-stop:hover { border-color: var(--navy); }
.logger-task input { font-size: 1.05rem; padding: .8rem .9rem; }

/* Week strip */
.weekstrip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: .6rem;
  margin-top: 1.8rem;
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1rem;
}
.wday {
  display: flex; flex-direction: column;
  min-height: 190px;
  padding: .6rem .5rem .5rem;
  border-radius: var(--radius);
  border: 1px dashed transparent;
  position: relative;
}
.wday .wlabel {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--slate); margin-bottom: .5rem; display: flex; justify-content: space-between;
}
.wday .wlabel b { color: var(--navy); font-weight: 500; }
.wday.today { background: var(--paper-2); border-color: var(--gold); }
.wday.today .wlabel { color: var(--gold-ink); }
.wday .wcol { display: flex; flex-direction: column-reverse; gap: 3px; flex: 1; justify-content: flex-start; }
.wblock {
  min-height: 6px;
  border-radius: 2px;
  background: var(--slate);
  opacity: .55;
  position: relative;
  transition: opacity .15s;
  cursor: default;
}
.wblock:hover { opacity: 1; }
.wblock.vital { background: var(--vital); opacity: .9; }
.wblock.trivial { background: var(--trivial); opacity: .85; }
.wblock[data-title]:hover::after {
  content: attr(data-title);
  position: absolute; left: 0; bottom: calc(100% + 4px); z-index: 5;
  background: var(--navy); color: var(--paper);
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .04em;
  padding: .3rem .5rem; border-radius: 2px; white-space: nowrap;
  pointer-events: none;
}
.wday .wsum { font-family: var(--mono); font-size: 10.5px; color: var(--slate); margin-top: .5rem; }

/* Backfill / details */
.details, details.backfill {
  margin-top: 1.4rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper-2);
}
.details > summary, details.backfill > summary {
  list-style: none;
  cursor: pointer;
  padding: .85rem 1.1rem;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--slate);
  display: flex; align-items: center; gap: .6rem;
}
.details > summary::-webkit-details-marker, details.backfill > summary::-webkit-details-marker { display: none; }
.details > summary::before, details.backfill > summary::before {
  content: ""; width: 7px; height: 7px;
  border-right: 1.4px solid var(--gold); border-bottom: 1.4px solid var(--gold);
  transform: rotate(-45deg); transition: transform .2s var(--ease);
}
.details[open] > summary::before, details.backfill[open] > summary::before { transform: rotate(45deg); }
.details > .body, .backfill > .body, .details > form, .backfill > form {
  padding: .4rem 1.1rem 1.1rem;
  display: grid;
  grid-template-columns: 140px 120px minmax(0,1fr) auto;
  gap: .7rem;
  align-items: end;
}
.log-list { margin-top: 1.2rem; display: flex; flex-direction: column; }
.log-row {
  display: grid; grid-template-columns: 72px 68px minmax(0,1fr) auto;
  gap: .8rem; align-items: center;
  padding: .55rem 0; border-bottom: 1px solid var(--rule);
  font-size: .93rem;
}
.log-row .d, .log-row .m { font-family: var(--mono); font-size: 11.5px; letter-spacing: .08em; color: var(--slate); }
.log-row .m { color: var(--navy); }
.log-row .b { font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; }
.log-row .b.vital { color: var(--vital); }
.log-row .b.trivial { color: var(--trivial); }

/* ── Separate: the deck ──────────────────────────────────────────── */
.deck {
  display: grid;
  grid-template-columns: 1fr minmax(280px, 360px) 1fr;
  gap: 1.4rem;
  align-items: stretch;
  min-height: 360px;
  margin-top: .6rem;
}
.deck-stage { position: relative; display: flex; align-items: center; justify-content: center; perspective: 1200px; }
.deck-card {
  position: relative;
  width: 100%;
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 1.6rem 1.5rem 1.4rem;
  box-shadow: var(--shadow-deck);
  display: flex; flex-direction: column; gap: .8rem;
  transform-origin: center;
  will-change: transform, opacity;
}
.deck-card::before {
  content: "";
  position: absolute; top: 10px; left: 12px; right: 12px;
  height: 1px; background: var(--gold); opacity: .6;
}
.deck-card .dc-day {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--gold-ink);
}
.deck-card .dc-task {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.4rem, 2.6vw, 1.9rem);
  line-height: 1.2;
  color: var(--navy);
  overflow-wrap: anywhere;
  font-variation-settings: "opsz" 60;
}
.deck-card .dc-min {
  font-family: var(--mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--slate);
  margin-top: auto;
  display: flex; justify-content: space-between;
}
.deck-card .dc-min b { color: var(--navy); font-weight: 500; }
.deck-ghost {
  position: absolute; inset: 0; z-index: -1;
  background: #fff; border: 1px solid var(--rule); border-radius: 4px;
  transform: translate(6px, 8px) rotate(1.2deg); opacity: .6;
}
.deck-ghost.two { transform: translate(12px, 16px) rotate(-1deg); opacity: .35; }
.deck-target {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .5rem;
  padding: 1.6rem 1rem;
  border: 1.5px dashed var(--rule);
  border-radius: 4px;
  text-align: center;
  cursor: pointer;
  transition: border-color .18s var(--ease), background .18s var(--ease), transform .18s var(--ease);
  background: transparent;
  min-height: 200px;
}
.deck-target b {
  font-family: var(--serif); font-weight: 400; font-size: clamp(1.3rem, 2.2vw, 1.7rem); line-height: 1.1;
}
.deck-target span {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--slate);
}
.deck-target kbd {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em;
  padding: .2rem .45rem; border: 1px solid currentColor; border-radius: 2px; opacity: .7;
}
.deck-target.vital { color: var(--vital); border-color: rgba(47,93,80,.45); }
.deck-target.vital:hover, .deck-target.vital.hot { background: var(--vital-soft); border-color: var(--vital); transform: scale(1.01); }
.deck-target.trivial { color: var(--trivial); border-color: rgba(138,90,60,.45); }
.deck-target.trivial:hover, .deck-target.trivial.hot { background: var(--trivial-soft); border-color: var(--trivial); transform: scale(1.01); }
.deck-count { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--slate); text-align: center; margin-top: .8rem; }

.punch {
  margin-top: 1.6rem;
  padding: clamp(1.6rem, 3.4vw, 2.6rem);
  background: var(--navy);
  color: var(--paper);
  border-radius: 4px;
  position: relative; overflow: hidden;
}
.punch::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(700px 380px at 90% 0%, rgba(138,90,60,.35), transparent 60%);
  pointer-events: none;
}
.punch > * { position: relative; }
.punch-num {
  font-family: var(--serif);
  font-weight: 330;
  font-size: 5rem;
  line-height: .95;
  color: var(--gold);
  letter-spacing: -.03em;
  font-variation-settings: "opsz" 144;
}
.punch-num small { font-size: .38em; color: rgba(250,250,247,.6); font-family: var(--mono); letter-spacing: .1em; margin-left: .2em; }
.punch-line {
  font-family: var(--serif);
  font-weight: 330;
  font-size: clamp(1.3rem, 2.4vw, 1.9rem);
  line-height: 1.25;
  margin-top: .6rem;
  max-width: 30ch;
  text-wrap: balance;
}
.punch-line em { color: var(--gold-soft); }
.punch .row-btns { margin-top: 1.4rem; }
.resort { margin-top: 1.4rem; }
.resort .log-row { grid-template-columns: 72px 68px minmax(0,1fr) auto auto; }
.resort .log-row button { font-family: var(--mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; padding: .3rem .5rem; border: 1px solid var(--rule); color: var(--slate); }
.resort .log-row button:hover { border-color: var(--navy); color: var(--navy); }

/* ── Translate ───────────────────────────────────────────────────── */
.fat-list { display: flex; flex-direction: column; border-top: 1px solid var(--navy); }
.fat-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto auto;
  gap: 1rem; align-items: center;
  padding: .9rem .2rem;
  border-bottom: 1px solid var(--rule);
  transition: background .15s;
}
.fat-row:hover { background: rgba(255,255,255,.6); }
.fat-row .rank { font-family: var(--mono); font-size: 11px; color: var(--mute); }
.fat-row .task { font-family: var(--serif); font-weight: 400; font-size: 1.15rem; color: var(--navy); overflow-wrap: anywhere; }
.fat-row .task small { display: block; font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--slate); margin-top: .2rem; }
.fat-min { font-family: var(--mono); font-size: 13px; color: var(--trivial); letter-spacing: .06em; white-space: nowrap; }
.fat-min b { font-weight: 500; }
.fat-row.done .task { color: var(--slate); }
.fat-row.done .fat-min { color: var(--slate); }

.wf-draft {
  margin-top: 1.6rem;
  background: #fff;
  border: 1px solid var(--rule);
  border-top: 2px solid var(--gold);
  border-radius: 4px;
  padding: clamp(1.2rem, 2.6vw, 1.8rem);
  box-shadow: var(--shadow-card);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 1.4rem;
}
.wf-draft .wf-head { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; flex-wrap: wrap; }
.wf-draft .wf-head h3 { font-family: var(--serif); font-weight: 400; font-size: 1.5rem; color: var(--navy); }
.wf-draft .wf-head .kind {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--gold-ink); border: 1px solid var(--gold); padding: .25rem .55rem; border-radius: 999px;
}
.wf-draft .field.full { grid-column: 1 / -1; }
.wf-draft textarea {
  min-height: 110px;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.6;
  background: var(--paper);
  border-color: var(--rule);
  white-space: pre-wrap;
}
.wf-draft input { font-family: var(--mono); font-size: 13px; }
.wf-draft .row-btns { grid-column: 1 / -1; }
.wf-list { margin-top: 1.6rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }

/* ── Build: seats + draft ────────────────────────────────────────── */
.seats { display: flex; gap: .5rem; flex-wrap: wrap; }
.seat {
  display: flex; flex-direction: column; align-items: flex-start; gap: .15rem;
  padding: .65rem .9rem;
  border: 1px solid var(--rule);
  background: #fff;
  border-radius: var(--radius);
  min-width: 120px;
  text-align: left;
  transition: all .15s var(--ease);
}
.seat b { font-family: var(--serif); font-weight: 500; font-size: 1.05rem; color: var(--navy); }
.seat span { font-family: var(--mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--slate); }
.seat:hover { border-color: var(--navy); }
.seat.on { background: var(--navy); border-color: var(--navy); }
.seat.on b { color: var(--gold); }
.seat.on span { color: rgba(250,250,247,.7); }
.draft {
  margin-top: 1.4rem;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: clamp(1.2rem, 2.6vw, 1.8rem) clamp(1.2rem, 2.6vw, 2rem);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  position: relative;
  min-height: 160px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8), var(--shadow-card);
}
.draft::before {
  content: attr(data-label);
  position: absolute; top: .7rem; right: 1rem;
  font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--gold-ink);
}
.draft .dl { display: block; min-height: 1.2em; }
.draft .dl.h { color: var(--navy); font-weight: 500; }
.draft .dl.gate { color: var(--gold-ink); }
.draft .dl.edge { color: var(--trivial); }
.draft .dl:empty::before { content: " "; }
.draft-note { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; color: var(--slate); margin-top: .6rem; }
.key-row {
  margin-top: 1.2rem;
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto;
  gap: .6rem; align-items: end;
  padding: 1rem 1.1rem;
  border: 1px dashed var(--rule);
  border-radius: var(--radius);
  background: rgba(255,255,255,.5);
}
.key-row input { font-family: var(--mono); font-size: 12.5px; }
.key-row .tiny { grid-column: 1 / -1; margin-top: 0; }
.wf-pick { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.wf-pick select { max-width: 360px; }
.wf-draft textarea { resize: none; overflow: hidden; min-height: 72px; }

/* ── Ladder ──────────────────────────────────────────────────────── */
.ladder-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 2rem;
  align-items: start;
}
.ladder-wrap .fig { position: sticky; top: calc(var(--top-h) + 1rem); background: #fff; border: 1px solid var(--rule); border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow-card); }
.ladder-wrap .fig svg { width: 100%; height: auto; }
.rung-above, .rung-below { display: flex; flex-direction: column; gap: .7rem; }
.rung-group-label {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--slate);
  display: flex; align-items: center; gap: .8rem; margin: .4rem 0;
}
.rung-group-label::after { content: ""; flex: 1; height: 1px; background: var(--rule); }
.rung-you {
  display: flex; align-items: center; gap: .8rem; margin: 1rem 0;
  font-family: var(--serif); font-style: italic; color: var(--gold-ink);
}
.rung-you::before, .rung-you::after { content: ""; flex: 1; height: 1.5px; background: var(--gold); }
.rung {
  display: grid;
  grid-template-columns: 200px minmax(0,1fr);
  gap: .7rem;
  align-items: start;
  padding: .9rem 1rem;
  background: #fff;
  border: 1px solid var(--rule);
  border-left: 3px solid var(--rule);
  border-radius: var(--radius);
}
.rung.named { border-left-color: var(--navy); }
.rung input { font-size: .95rem; }
.rung .rung-note input { font-size: .9rem; color: var(--slate); }
.rung-msg {
  grid-column: 1 / -1;
  margin-top: .3rem;
  padding: .9rem 1.1rem;
  background: var(--paper-2);
  border-left: 2px solid var(--gold);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 330;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--ink);
  white-space: pre-wrap;
  display: flex; flex-direction: column; gap: .6rem;
}
.rung-msg .hint { font-family: var(--mono); font-style: normal; font-size: 11px; letter-spacing: .08em; color: var(--slate); }
.rung-msg .kindlbl { font-family: var(--mono); font-style: normal; font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--gold-ink); }
.rung-msg .row-btns { margin-top: .2rem; }

/* ── Four: the clock ─────────────────────────────────────────────── */
.clock-wrap {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 2rem;
  align-items: center;
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: clamp(1.2rem, 3vw, 2rem);
  box-shadow: var(--shadow-card);
}
.clock-wrap.running { border-color: var(--gold); }
.ring { position: relative; width: 100%; max-width: 260px; margin: 0 auto; }
.ring svg { width: 100%; height: auto; }
.clock-time {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-family: var(--mono);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  color: var(--navy);
  font-variant-numeric: tabular-nums;
  pointer-events: none;
  padding-bottom: 1.2rem;
}
.clock-time small { font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--slate); margin-top: .2rem; }
.clock-side { display: flex; flex-direction: column; gap: .9rem; min-width: 0; }
.clock-side .now { font-family: var(--serif); font-weight: 400; font-size: clamp(1.3rem, 2.4vw, 1.8rem); color: var(--navy); line-height: 1.2; }
.vital-pick { display: flex; flex-wrap: wrap; gap: .4rem; }
.vital-pick button {
  font-size: .85rem; padding: .4rem .7rem; border: 1px solid var(--rule); background: var(--paper); color: var(--ink);
}
.vital-pick button:hover { border-color: var(--vital); color: var(--vital); }
.fh-list { margin-top: 1.6rem; border-top: 1px solid var(--navy); }
.fh-row {
  display: grid;
  grid-template-columns: 96px 70px minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 1rem; align-items: baseline;
  padding: .8rem .2rem;
  border-bottom: 1px solid var(--rule);
  font-size: .95rem;
}
.fh-row .d, .fh-row .m { font-family: var(--mono); font-size: 11.5px; letter-spacing: .08em; color: var(--slate); }
.fh-row .m { color: var(--vital); }
.fh-row .t { font-family: var(--serif); color: var(--navy); }
.fh-row .p { color: var(--slate); font-size: .92rem; }
.fh-row .p::before { content: "→ "; color: var(--gold); }

/* ── Reclaim ─────────────────────────────────────────────────────── */
.reclaim-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 1.6rem; align-items: start; }
.ledger {
  background: #fff;
  border: 1px solid var(--rule);
  border-top: 2px solid var(--gold);
  border-radius: var(--radius);
  padding: 1.2rem 1.3rem 1.4rem;
  box-shadow: var(--shadow-card);
  display: flex; flex-direction: column; gap: .9rem;
}
.ledger h3 { font-family: var(--serif); font-weight: 400; font-size: 1.3rem; color: var(--navy); }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip {
  font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  padding: .45rem .75rem; border: 1px solid var(--rule); border-radius: 999px; color: var(--slate); background: var(--paper);
  transition: all .15s var(--ease);
}
.chip:hover { border-color: var(--navy); color: var(--navy); }
.chip.on { background: var(--navy); border-color: var(--navy); color: var(--paper); }
.debt-row {
  display: grid; grid-template-columns: 150px minmax(0, 1fr) auto;
  gap: .7rem; align-items: center;
  padding: .6rem 0; border-bottom: 1px solid var(--rule);
}
.debt-row .to { font-family: var(--serif); font-weight: 400; color: var(--navy); font-size: 1.05rem; }
.debt-row .line { color: var(--ink); font-size: .95rem; }
.debt-row .line em { font-family: var(--serif); color: var(--slate); }
.debt-row input { padding: .5rem .7rem; font-size: .92rem; }
.debt-row .danger, .debt-row .link { padding: .3rem .5rem; }
.back-stat {
  font-family: var(--serif);
  font-weight: 330;
  font-size: clamp(2rem, 4.2vw, 3.4rem);
  line-height: 1.02;
  color: var(--navy);
  letter-spacing: -.02em;
  font-variation-settings: "opsz" 144;
}
.back-stat em { color: var(--vital); }
.back-by { margin-top: .9rem; display: flex; flex-direction: column; gap: .35rem; }
.back-by div { display: flex; justify-content: space-between; gap: 1rem; font-size: .92rem; border-bottom: 1px dotted var(--rule); padding: .3rem 0; }
.back-by .m { font-family: var(--mono); font-size: 11.5px; color: var(--vital); }
.next-target { margin-top: 1.2rem; }
.outcomes-grid {
  margin-top: 1.8rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .9rem;
}
.outcome {
  background: #fff; border: 1px solid var(--rule); border-radius: var(--radius);
  padding: .9rem 1rem; display: flex; flex-direction: column; gap: .4rem;
}
.outcome .fc-kicker { color: var(--slate); }
.outcome b { font-family: var(--serif); font-weight: 400; font-size: 1.05rem; color: var(--navy); }
.outcome input { font-family: var(--mono); font-size: 12.5px; padding: .5rem .7rem; }
.outcome input::placeholder { font-style: italic; font-family: var(--serif); font-size: 14px; }

/* ── Ninety: the route ───────────────────────────────────────────── */
.route-wrap {
  background: var(--navy);
  border-radius: 4px;
  padding: clamp(1.2rem, 3vw, 2rem);
  position: relative; overflow: hidden;
  box-shadow: 0 30px 60px -30px rgba(11,31,58,.55);
}
.route-wrap::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(800px 420px at 8% 100%, rgba(201,162,39,.16), transparent 60%);
  pointer-events: none;
}
.route-wrap > * { position: relative; }
.route-wrap svg { width: 100%; height: auto; }
.route-wrap .fig-cap em { color: rgba(250,250,247,.62); }
.route-day {
  position: absolute; top: 1.2rem; right: 1.4rem;
  font-family: var(--mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--gold-soft);
  text-align: right;
}
.route-day b { display: block; font-family: var(--serif); font-weight: 330; font-size: 2rem; color: var(--paper); letter-spacing: -.02em; line-height: 1; margin-top: .2rem; }
.marks { margin-top: 1.8rem; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
.marks .block { display: flex; flex-direction: column; gap: .4rem; }
.marks .block h3 {
  font-family: var(--serif); font-weight: 400; font-size: 1.25rem; color: var(--navy);
  display: flex; align-items: baseline; gap: .6rem; padding-bottom: .5rem; border-bottom: 1px solid var(--navy); margin-bottom: .3rem;
}
.marks .block h3 small { font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-ink); }
.mark-row {
  display: grid; grid-template-columns: 22px minmax(0,1fr);
  gap: .7rem; align-items: start;
  padding: .5rem .2rem;
  border-bottom: 1px solid var(--rule);
  font-size: .95rem;
  cursor: pointer;
}
.mark-row .box {
  width: 18px; height: 18px; margin-top: .1rem;
  border: 1.5px solid var(--navy); border-radius: 2px;
  position: relative; background: #fff;
}
.mark-row.done .box::after {
  content: ""; position: absolute; left: 3px; top: 1px;
  width: 8px; height: 11px;
  border-right: 2px solid var(--gold); border-bottom: 2px solid var(--gold);
  transform: rotate(40deg);
}
.mark-row.done { color: var(--slate); }
.mark-row.auto { cursor: default; }
.mark-row.auto .box { border-color: var(--gold); border-style: dashed; }
.mark-row .lbl small { display: block; font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-ink); margin-top: .15rem; }
.mark-row.auto .lbl small::before { content: "auto · "; color: var(--slate); }
.review-days { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: 1.4rem; }
.review-days > div {
  font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--slate);
  padding: .5rem .8rem; border: 1px solid var(--rule); border-radius: var(--radius); background: #fff;
}
.review-days b { color: var(--navy); font-weight: 500; }

/* ── Toast ───────────────────────────────────────────────────────── */
.toast {
  position: fixed; left: 50%; bottom: 1.6rem; z-index: 100;
  transform: translate(-50%, 16px);
  opacity: 0; pointer-events: none;
  background: var(--navy);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .06em;
  padding: .7rem 1.1rem;
  border-radius: var(--radius);
  border-left: 3px solid var(--gold);
  box-shadow: 0 14px 36px -12px rgba(11,31,58,.5);
  transition: opacity .22s var(--ease), transform .22s var(--ease);
  max-width: min(92vw, 520px);
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ── Motion helpers (app.js adds/removes) ───────────────────────── */
.room-enter { opacity: 0; transform: translateY(10px); }
.fade-up { animation: fadeUp .7s var(--ease-out) both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.pulse-dot { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

/* ═══════════════════ RESPONSIVE ═══════════════════ */
@media (max-width: 1100px) {
  .grid-fig, .grid-fig.rev { grid-template-columns: 1fr; }
  .compass-wrap, .ladder-wrap .fig { position: static; }
  .ladder-wrap { grid-template-columns: 1fr; }
  .ladder-wrap .fig { max-width: 360px; }
  .outcomes-grid, .marks { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 920px) {
  :root { --stage-pad: 1rem; }
  .gate { grid-template-columns: 1fr; }
  .gate-fig { border-right: 0; border-bottom: 1px solid rgba(201,162,39,.22); padding-bottom: 1.4rem; min-height: 0; }
  .gate-copy { max-width: none; }
  .gate h1 { font-size: clamp(2.2rem, 9vw, 3.2rem); }
  .row-btns.samples { flex-direction: column; }
  .row-btns.samples .ghost { width: 100%; }

  .top { padding: 0 .9rem; }
  .top-r .ghost-ink { padding: .5rem .7rem; font-size: .8rem; }
  .shell { grid-template-columns: 1fr; min-height: 0; }
  .nav { display: none; }
  .tabbar { display: grid; }
  .stage { padding: 1rem 1rem calc(var(--tab-h) + 3rem); }
  .app { padding-bottom: 0; }

  .move { font-size: clamp(1.9rem, 8vw, 2.8rem); max-width: none; }
  .plate { padding: 1.5rem 1.2rem; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .fields-2, .fields-3, .fields-4 { grid-template-columns: 1fr; }
  .type-grid { grid-template-columns: 1fr; }

  .logger { grid-template-columns: 1fr; gap: .9rem; padding: 1.2rem 1rem 1.4rem; }
  .logger-time { font-size: clamp(2.2rem, 13vw, 3.4rem); }
  .weekstrip { gap: .3rem; padding: .7rem .5rem; }
  .wday { min-height: 140px; padding: .4rem .3rem; }
  .wday .wlabel { font-size: 9.5px; flex-direction: column; gap: .1rem; }
  .details > .body, .backfill > .body, .details > form, .backfill > form { grid-template-columns: 1fr 1fr; }
  .details > form .field:nth-child(3), .backfill > form .field:nth-child(3) { grid-column: 1 / -1; }
  .log-row { grid-template-columns: 60px 56px minmax(0,1fr); }
  .log-row .b { grid-column: 2 / -1; }

  .deck { grid-template-columns: 1fr; min-height: 0; gap: .9rem; }
  .deck-stage { order: 0; }
  .deck-target { order: 1; min-height: 0; padding: 1rem; flex-direction: row; gap: .8rem; justify-content: space-between; }
  .deck-target.trivial { order: 2; }
  .deck-target b { font-size: 1.2rem; text-align: left; }
  .deck-target span { text-align: left; }
  .deck-target kbd { display: none; }
  .deck-target::after { content: "tap"; font-family: var(--mono); font-size: 10px; letter-spacing: .16em; text-transform: uppercase; opacity: .55; }
  .bar-legend { justify-content: flex-start; gap: .3rem 1.1rem; }
  .punch-num { font-size: 3.6rem; }
  .resort .log-row { grid-template-columns: 56px 52px minmax(0,1fr); }
  .resort .log-row button { grid-column: span 1; }

  .fat-row { grid-template-columns: 22px minmax(0,1fr); }
  .fat-row .fat-min, .fat-row .ink, .fat-row .ghost-ink { grid-column: 2; justify-self: start; }
  .wf-draft { grid-template-columns: 1fr; }

  .seats { gap: .4rem; }
  .seat { min-width: 0; flex: 1 1 calc(50% - .4rem); }
  .draft { font-size: 12.5px; padding: 1.6rem 1rem 1.2rem; }
  .key-row { grid-template-columns: 1fr; }

  .rung { grid-template-columns: 1fr; }
  .clock-wrap { grid-template-columns: 1fr; text-align: center; }
  .ring { max-width: 220px; }
  .clock-side { align-items: center; }
  .fh-row { grid-template-columns: 80px 60px minmax(0,1fr); }
  .fh-row .p { grid-column: 1 / -1; padding-left: 0; }

  .reclaim-grid { grid-template-columns: 1fr; }
  .debt-row { grid-template-columns: minmax(0,1fr) auto; }
  .debt-row .to { grid-column: 1; grid-row: 1; }
  .debt-row .danger { grid-column: 2; grid-row: 1; justify-self: end; width: auto; }
  .debt-row .line, .debt-row input { grid-column: 1 / -1; grid-row: 2; }
  .outcomes-grid, .marks { grid-template-columns: 1fr; }
  .route-day { position: static; text-align: left; margin-bottom: .6rem; }
  .route-day b { display: inline; font-size: 1.4rem; margin-left: .5rem; }
}
@media (max-width: 420px) {
  body { font-size: 15px; }
  .top .who { display: none; }
  .tabbar a { font-size: 9px; letter-spacing: .06em; }
}

/* ── Reduced motion ──────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
  .room-enter { opacity: 1; transform: none; }
  .bar .v, .bar .t { transition: none; }
}

/* ── Tomorrow plan sheet ─────────────────────────────────────────── */
.plan-sheet {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(11, 31, 58, .55);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 2.5vh 1rem 3vh;
  overflow: auto;
}
.plan-sheet-inner {
  width: min(720px, 100%);
  margin: auto 0;
}
.plan-toolbar {
  display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; justify-content: space-between;
  background: var(--navy); color: var(--paper);
  padding: .85rem 1rem; border-radius: var(--radius) var(--radius) 0 0;
}
.plan-toolbar-l { display: flex; flex-direction: column; gap: .15rem; }
.plan-toolbar-l b { font-family: var(--serif); font-weight: 400; font-size: 1.15rem; }
.plan-toolbar .tiny { color: rgba(250,250,247,.62); margin: 0; }
.plan-paper {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-top: 0;
  padding: 1.6rem 1.5rem 1.8rem;
  box-shadow: var(--shadow-card);
  color: var(--ink);
}
.plan-head { margin-bottom: .4rem; }
.plan-brand {
  font-family: var(--mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--gold-ink);
  display: flex; align-items: center; gap: .5rem;
}
.plan-paper h1 {
  font-family: var(--serif); font-weight: 400; font-size: clamp(1.7rem, 4vw, 2.15rem);
  color: var(--navy); margin: .25rem 0 .35rem; letter-spacing: -.02em;
}
.plan-sub, .plan-who, .plan-meta { font-size: .9rem; color: var(--slate); margin: .15rem 0; }
.plan-offer {
  font-family: var(--serif); font-size: 1.05rem; color: var(--navy);
  margin: .7rem 0 .35rem; line-height: 1.35;
}
.plan-block { border-top: 1px solid var(--rule); padding: 1rem 0 .2rem; margin-top: .55rem; }
.plan-kicker {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--gold-ink); margin-bottom: .45rem;
}
.plan-move {
  font-family: var(--serif); font-size: clamp(1.25rem, 3.2vw, 1.65rem);
  color: var(--navy); line-height: 1.2; margin: 0 0 .45rem;
}
.plan-four-task {
  font-family: var(--serif); font-size: clamp(1.15rem, 2.8vw, 1.4rem);
  color: var(--navy); margin: 0 0 .35rem; line-height: 1.25;
}
.plan-why, .plan-prompt, .plan-cta-line { font-size: .92rem; color: var(--slate); margin: .25rem 0; }
.plan-cta-line b { color: var(--navy); font-weight: 560; }
.plan-morning, .plan-steps, .plan-reclaim { list-style: none; margin: 0; padding: 0; }
.plan-morning li {
  display: grid; grid-template-columns: 72px 1fr; gap: .65rem;
  padding: .4rem 0; border-bottom: 1px dotted var(--rule); font-size: .95rem;
}
.pm-when {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--gold-ink); padding-top: .28rem;
}
.plan-step { display: flex; gap: .7rem; padding: .4rem 0; align-items: flex-start; }
.plan-step .ps-mark { width: 1.1rem; color: var(--gold); font-family: var(--mono); line-height: 1.4; }
.plan-step b { display: block; color: var(--navy); font-weight: 560; font-size: .95rem; }
.plan-step.done b { color: var(--vital); }
.plan-step span { display: block; color: var(--slate); font-size: .88rem; margin-top: .1rem; }
.plan-reclaim li { padding: .3rem 0; font-size: .92rem; color: var(--ink); }
.plan-reclaim b { color: var(--navy); }
.plan-foot {
  margin-top: 1.2rem; padding-top: .8rem; border-top: 1px solid var(--rule);
  font-size: .78rem; color: var(--mute); line-height: 1.4;
}
body.plan-open { overflow: hidden; }

/* ── Print: the desk on paper ────────────────────────────────────── */
@media print {
  .contour, .top, .nav, .tabbar, .toast, .gate, .shell, .no-print, .plan-toolbar { display: none !important; }
  .stage { padding: 0; }
  .plate, .punch, .route-wrap { box-shadow: none; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body.plan-open .app { display: none !important; }
  .plan-sheet {
    position: static; inset: auto; background: transparent; padding: 0;
    display: block !important; overflow: visible;
  }
  .plan-sheet[hidden] { display: none !important; }
  .plan-sheet-inner { width: 100%; }
  .plan-paper {
    border: 0; box-shadow: none; padding: 0;
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
}
