:root {
  --ink: #152238;
  --ink-soft: #2a3a55;
  --muted: #5c6b82;
  --bg: #f3f4f7;
  --panel: #ffffff;
  --line: rgba(21, 34, 56, 0.11);
  --navy: #152238;
  --navy-2: #1f3354;
  --amber: #d4a017;
  --amber-soft: #f4e7bf;
  --amber-ink: #5a4308;
  --warn: #8b2e2e;
  --ok: #2f6b54;
  --rail: #101826;
  --radius: 4px;
  --shell: min(880px, calc(100% - 3rem));
  --rail-w: 248px;
  --display: "Syne", "Segoe UI", sans-serif;
  --sans: "IBM Plex Sans", "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body.app {
  margin: 0;
  color: var(--ink);
  font-family: var(--sans);
  background: var(--bg);
  line-height: 1.55;
  min-height: 100vh;
}
img { max-width: 100%; display: block; }
a { color: var(--navy-2); text-underline-offset: 0.14em; }
a:hover { color: #8a6a12; }
h1, h2, h3 {
  font-family: var(--display);
  line-height: 1.15;
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
  font-weight: 800;
}
p { margin: 0 0 1rem; }
.shell { width: var(--shell); margin-inline: auto; }
.sr-only { position: absolute; left: -9999px; }
.kicker {
  text-transform: uppercase;
  letter-spacing: .11em;
  font-size: .7rem;
  font-weight: 700;
  color: var(--muted);
  margin: 0 0 .4rem;
}
.lead { font-size: 1.05rem; color: var(--muted); max-width: 38rem; margin-bottom: 0; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  padding: .65rem 1rem;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 700;
  font-size: .92rem;
  text-decoration: none;
  cursor: pointer;
}
.btn-primary { background: var(--amber); color: var(--navy); }
.btn-primary:hover { filter: brightness(1.06); color: var(--navy); }
.btn-ghost { background: transparent; border-color: rgba(255,255,255,.4); color: #fff; }
.btn-ghost:hover { border-color: #fff; color: #fff; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.15rem 0 0; }

/* Left rail */
.rail {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--rail-w);
  background: var(--rail);
  color: #d7deea;
  z-index: 50;
  display: flex;
  flex-direction: column;
  padding: 1.25rem .9rem 1rem;
  border-right: 1px solid rgba(212, 160, 23, .28);
}
.rail-brand {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: .65rem;
  align-items: center;
  text-decoration: none;
  color: #fff;
  margin-bottom: 1.15rem;
  padding: 0 .2rem;
}
.rail-brand img { width: 36px; height: 36px; border-radius: 4px; }
.rail-brand em {
  display: block;
  font-style: normal;
  font-family: var(--sans);
  font-size: .65rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--amber);
  line-height: 1.2;
}
.rail-brand strong {
  display: block;
  font-family: var(--display);
  font-size: 1.25rem;
  line-height: 1.05;
}
.rail-nav {
  display: grid;
  gap: .1rem;
  flex: 1;
  overflow: auto;
  align-content: start;
  padding-bottom: .5rem;
}
.rail-nav a {
  display: grid;
  grid-template-columns: 1.7rem 1fr;
  gap: .35rem;
  align-items: center;
  color: rgba(215,222,234,.86);
  text-decoration: none;
  font-weight: 600;
  font-size: .86rem;
  padding: .42rem .45rem;
  border-radius: var(--radius);
}
.rail-nav a:hover { background: rgba(255,255,255,.05); color: #fff; }
.rail-nav a.is-active {
  background: rgba(212,160,23,.14);
  color: #fff;
}
.rail-num {
  font-size: .68rem;
  color: var(--amber);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.rail-label { min-width: 0; }
.rail-search {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .3rem;
  margin-top: .65rem;
  padding-top: .75rem;
  border-top: 1px solid rgba(255,255,255,.1);
}
.rail-search input {
  width: 100%;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: var(--radius);
  padding: .48rem .55rem;
  font: inherit;
  font-size: .86rem;
  background: rgba(0,0,0,.28);
  color: #fff;
}
.rail-search input::placeholder { color: rgba(255,255,255,.45); }
.rail-search button {
  border: 0;
  background: var(--amber);
  color: var(--navy);
  border-radius: var(--radius);
  padding: .48rem .7rem;
  font: inherit;
  font-size: .82rem;
  font-weight: 700;
  cursor: pointer;
}
.rail-foot {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem .7rem;
  margin-top: .7rem;
}
.rail-foot a {
  color: rgba(215,222,234,.55);
  text-decoration: none;
  font-size: .74rem;
}
.rail-foot a:hover { color: var(--amber); }
.rail-scrim { display: none; }

.stage {
  margin-left: var(--rail-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}
.stage-bar {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .55rem 1.5rem;
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 30;
}
.stage-brand {
  display: none;
  font-family: var(--display);
  font-weight: 800;
  text-decoration: none;
  color: var(--ink);
}
.stage-warn {
  margin: 0;
  font-size: .8rem;
  color: var(--muted);
  line-height: 1.35;
}
.stage-warn strong { color: var(--warn); font-weight: 700; }
.menu-btn {
  display: none;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: var(--radius);
  padding: .45rem .7rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
main { flex: 1; }

/* Home mast — copy + real photo */
.mast {
  background: #0f1826;
  color: #fff;
  border-bottom: 3px solid var(--amber);
}
.mast-inner {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 1.4rem;
  align-items: center;
  padding: 2.1rem 0 2rem;
}
.mast-domain {
  margin: 0 0 .45rem;
  font-size: .7rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--amber);
  font-weight: 700;
}
.mast h1 {
  font-size: clamp(2.1rem, 4.2vw, 3rem);
  max-width: 14ch;
  margin-bottom: .65rem;
}
.mast .lead { color: rgba(255,255,255,.78); }
.mast-photo {
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.12);
  aspect-ratio: 16 / 10;
  background: #1a2b45;
}
.mast-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.mast .btn-ghost,
.mast .btn-ghost:hover {
  border-color: rgba(255,255,255,.42);
  color: #fff;
  background: transparent;
}
.mast .btn-ghost:hover {
  border-color: #fff;
  background: rgba(255,255,255,.06);
}

.section { padding: 1.5rem 0; }
.section-tight { padding: 1.1rem 0 .4rem; }
.band-head {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  margin-bottom: .95rem;
  padding-bottom: .65rem;
  border-bottom: 1px solid var(--ink);
}
.band-head h2 { margin: 0; font-size: 1.35rem; }
.band-head p { margin: 0; color: var(--muted); font-size: .95rem; }

/* Fixed: label above body — no side column overflow */
.bound {
  display: block;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 3px solid var(--amber);
  border-radius: var(--radius);
  padding: .85rem 1rem .9rem;
}
.bound-label {
  margin: 0 0 .35rem;
  font-family: var(--sans);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--amber-ink);
}
.bound-body {
  margin: 0;
  color: var(--ink-soft);
  font-size: .92rem;
  line-height: 1.5;
}

.lanes { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.lane {
  display: grid;
  grid-template-columns: 132px 2.4rem 1fr auto;
  gap: .85rem;
  align-items: center;
  text-decoration: none;
  color: inherit;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: .55rem .75rem .55rem .55rem;
  overflow: hidden;
}
.lane:hover {
  border-color: rgba(21, 34, 56, .35);
  background: #fafbfd;
}
.lane-photo {
  width: 132px;
  height: 84px;
  object-fit: cover;
  border-radius: 3px;
  background: #dfe3ea;
}
.lane-index {
  font-family: var(--sans);
  font-size: .95rem;
  font-weight: 700;
  color: var(--amber);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.lane-body { display: grid; gap: .15rem; min-width: 0; }
.lane-body strong {
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 800;
}
.lane-body em {
  font-style: normal;
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.4;
}
.lane-go {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--navy);
  white-space: nowrap;
}
.start-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .85rem; }
.start-list { margin: 0; padding-left: 1.05rem; }
.start-list li { margin: .35rem 0; }
.panel-accent { background: var(--navy); color: #fff; border-color: var(--navy); }
.panel-accent a { color: #f0d078; }
.panel-accent h2 { color: #fff; }

.panel, .pillar, .lesson-row, .claim, .phrase-row {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: none;
}
.panel { padding: 1rem 1.05rem; }
.note {
  background: var(--amber-soft);
  border: 1px solid rgba(212,160,23,.35);
  border-radius: var(--radius);
  padding: .8rem .95rem;
}
.warn-box {
  background: #f8ecec;
  border: 1px solid rgba(139,46,46,.22);
  border-radius: var(--radius);
  padding: .8rem .95rem;
}

.glossary-filter {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .4rem;
  max-width: 520px;
  margin: 0 0 1rem;
}
.glossary-filter input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: .58rem .7rem;
  font: inherit;
  background: #fff;
}
.ad-slot { margin: .85rem auto; }
.ks-ad-slot { display: grid; gap: .5rem; }
.ks-ad {
  display: grid;
  gap: .15rem;
  padding: .65rem .9rem;
  border-radius: var(--radius);
  position: relative;
  border: 1px solid var(--line);
  background: #fff;
  text-decoration: none;
  color: inherit;
}
.ks-ad-title { color: var(--navy); font-weight: 700; font-size: .95rem; }
.ks-ad-label {
  position: absolute;
  top: .4rem;
  right: .55rem;
  font-size: .65rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
}

.page-intro { padding: 1.5rem 0 .35rem; }
.page-intro h1 { font-size: clamp(1.7rem, 3vw, 2.3rem); }
.page-intro .btn-ghost,
.actions .btn-ghost,
.section .btn-ghost,
.panel .btn-ghost,
main .btn-ghost {
  border-color: var(--line);
  color: var(--ink);
  background: #fff;
}
.page-intro .btn-ghost:hover,
.actions .btn-ghost:hover,
.section .btn-ghost:hover,
.panel .btn-ghost:hover,
main .btn-ghost:hover {
  border-color: var(--navy);
  color: var(--navy);
}
.lesson-list, .guide-list, .claim-list, .phrase-list { display: grid; gap: .55rem; }
.lesson-row, .phrase-row, .claim {
  padding: .9rem 1rem;
  text-decoration: none;
  color: inherit;
  display: block;
}
.lesson-row:hover, .phrase-row:hover, .claim:hover {
  border-color: rgba(21,34,56,.35);
  border-left: 3px solid var(--amber);
}
.content-grid { display: grid; grid-template-columns: 1fr .36fr; gap: 1.1rem; }
.prose { max-width: 700px; }
.prose h2 { margin-top: 1.3rem; }
.article-cover {
  width: 100%;
  max-height: 300px;
  object-fit: cover;
  border-radius: var(--radius);
  margin: .55rem 0 1rem;
}
.side { display: grid; gap: .75rem; align-content: start; }
.takeaways, .ask-list { padding-left: 1.05rem; }
.chips { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .9rem; }
.chip {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: var(--radius);
  padding: .3rem .65rem;
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  font-size: .84rem;
}
.chip.is-active, .chip:hover {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}

.pillars { display: grid; grid-template-columns: 1fr; gap: .55rem; }
.pillar {
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: grid;
  grid-template-columns: 110px 1fr;
  min-height: 88px;
}
.pillar img { width: 110px; height: 100%; object-fit: cover; }
.pillar > div { padding: .9rem; }
.pillar p { margin: 0; color: var(--muted); font-size: .92rem; }

.prep-steps { display: grid; gap: .9rem; }
.prep-step {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: .95rem;
  background: #fff;
}
.prep-step h3 { margin-bottom: .55rem; }
.stack { display: grid; gap: .5rem; }
.prompt-add {
  display: flex;
  gap: .5rem;
  align-items: flex-start;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: .6rem .7rem;
  background: #fff;
}
.builder-list { list-style: none; padding: 0; margin: .45rem 0; }
.builder-list li { padding: .4rem 0; border-bottom: 1px solid var(--line); }
.print-sheet {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: .95rem;
  background: #fff;
}
.field { display: grid; gap: .28rem; font-weight: 700; margin-bottom: .7rem; }
.field input, .field textarea, .field select, .stack input, .stack textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: .58rem .7rem;
  font: inherit;
  background: #fff;
}
.notice {
  background: #e5f3ea;
  border: 1px solid #9dcea9;
  border-radius: var(--radius);
  padding: .75rem .9rem;
}
.log-form { display: grid; gap: .65rem; }
.script { border-left: 3px solid var(--amber); padding: .15rem 0 .15rem .75rem; margin: .65rem 0; }
.done-mark { color: var(--ok); font-weight: 800; }
.muted { color: var(--muted); }

.footer { margin-top: 1.75rem; background: var(--rail); color: #d5deea; }
.footer a { color: #c2cee0; text-decoration: none; display: block; margin: .18rem 0; font-size: .92rem; }
.footer a:hover { color: var(--amber); }
.footer-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr 1fr 1fr;
  gap: 1rem;
  padding: 1.6rem 0 .9rem;
}
.footer h2 { font-size: .85rem; color: var(--amber); margin-bottom: .45rem; }
.footer-note { color: rgba(255,255,255,.5); font-size: .85rem; margin: 0; }
.footer-copy {
  border-top: 1px solid rgba(255,255,255,.1);
  padding: .7rem 0 1.1rem;
  color: rgba(255,255,255,.5);
  font-size: .84rem;
}
.footer-copy a { display: inline; color: var(--amber); text-decoration: none; }
.footer-copy a:hover { color: #fff; }

@media print {
  .rail, .stage-bar, .footer, .ad-slot, .no-print, .side, .actions, .rail-scrim { display: none !important; }
  .stage { margin-left: 0; }
  body { background: #fff; }
  .content-grid { grid-template-columns: 1fr; }
  body[data-print-mode="prep"] .prep-steps,
  body[data-print-mode="prep"] .page-intro,
  body[data-print-mode="handoff"] .care-extra { display: none !important; }
  body[data-print-mode="prep"] .print-sheet,
  body[data-print-mode="handoff"] .print-sheet { display: block !important; border: none; }
}

@media (max-width: 980px) {
  .rail { left: -110%; right: auto; transform: none; transition: left .2s ease; }
  .rail.is-open { left: 0; box-shadow: 12px 0 40px rgba(0,0,0,.35); }
  .rail-scrim {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(10,16,28,.55);
    z-index: 40;
  }
  .rail-scrim[hidden] { display: none; }
  .stage { margin-left: 0; }
  .menu-btn { display: inline-flex; }
  .stage-brand { display: inline; }
  .stage-warn { font-size: .74rem; min-width: 0; overflow-wrap: anywhere; }
  .stage-bar { padding: .55rem .75rem; gap: .45rem; }
  .shell { width: min(880px, calc(100% - 1.5rem)); }
  .start-grid, .content-grid, .footer-grid { grid-template-columns: 1fr; }
  .lane { grid-template-columns: 96px 1fr; }
  .lane-index, .lane-go { display: none; }
  .lane-photo { width: 96px; height: 72px; }
  .pillar { grid-template-columns: 84px 1fr; }
  .pillar img { width: 84px; }
  .mast-inner {
    grid-template-columns: 1fr;
    padding: 1.5rem 0 1.4rem;
  }
  .mast-photo { order: -1; max-height: 220px; }
  .stage-warn { min-width: 0; overflow-wrap: anywhere; }
  .stage-bar { min-width: 0; }
}

@media (max-width: 400px) {
  .shell { width: calc(100% - 1rem); }
  .lane { grid-template-columns: 1fr; }
  .lane-photo { width: 100%; height: 140px; }
  .pillar { grid-template-columns: 1fr; }
  .pillar img { width: 100%; height: 140px; object-fit: cover; }
  .claim, .lesson-row, .phrase-row { padding: .75rem .7rem; }
  .chip { max-width: 100%; overflow-wrap: anywhere; }
  .mast h1 { font-size: 1.7rem; max-width: none; }
}

.byline {
  color: var(--muted);
  font-size: .9rem;
  margin: .75rem 0 0;
  max-width: 40rem;
}
.byline a { font-weight: 700; }
.byline-sep { margin: 0 .35rem; color: var(--line); }
.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem .4rem;
  padding: .75rem 0 0;
  font-size: .82rem;
  color: var(--muted);
}
.crumbs a { color: var(--muted); }
.crumbs-sep { opacity: .5; }
.label-box, .plain-box {
  border-radius: var(--radius);
  padding: .85rem 1rem;
  margin: 0 0 1rem;
}
.label-box {
  border: 1px solid rgba(21,34,56,.22);
  background: #eef2f8;
}
.plain-box {
  border: 1px solid var(--line);
  background: #fff;
}
.label-box-kicker {
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .68rem;
  font-weight: 800;
  color: var(--muted);
  margin: 0 0 .35rem;
}
.source-list { padding-left: 1.2rem; }
.source-list a { overflow-wrap: anywhere; }
.verdict {
  display: inline-block;
  margin: .65rem 0 0;
  padding: .35rem .65rem;
  background: var(--amber-soft);
  color: var(--amber-ink);
  font-weight: 700;
  border-radius: var(--radius);
}
.hub-group { margin: 1.4rem 0 .55rem; font-size: 1.15rem; }
.decoder-intro { margin: 0 0 1.25rem; }
.prose, .lesson-row h2, .lesson-row h3, .phrase-row h2, .claim h2, .claim p, h1, h2, h3, .page-intro, .mast h1 { overflow-wrap: anywhere; }
.claim, .lesson-row, .phrase-row, .guide-list, .claim-list, .lesson-list, .phrase-list, .shell, main, .stage { min-width: 0; max-width: 100%; }
.claim, .lesson-row, .phrase-row { width: 100%; }
.stage-bar { min-width: 0; }
.stage-bar > * { min-width: 0; }
.footer-grid { min-width: 0; }
.footer-grid > * { min-width: 0; }
.mast-copy, .lane-body, .prose { min-width: 0; }
table { max-width: 100%; }
.table-wrap { overflow-x: auto; }
