/* =========================================================================
   Cairn intelligence dossier — The Facebook Client Method
   Editorial / field-manual aesthetic. System fonts only, no remote assets.
   ========================================================================= */

/* ---------- Tokens ---------- */
:root {
  --ink-900: #080e19;
  --ink-800: #101a2b;
  --ink-700: #17243a;
  --ink-600: #23334e;
  --ink-500: #34456180;

  --paper:      #f4efe4;
  --paper-warm: #efe8d9;
  --card:       #fdfaf3;
  --blush:      #f7eae1;

  --rule:       #ddd3c0;
  --rule-soft:  #e7dfd0;
  --rule-ink:   #2b3a55;

  --text:       #16202f;
  --text-muted: #5c6272;
  --text-onink: #e8e4da;
  --text-onink-muted: #a9b0be;

  --amber:      #b26a12;
  --amber-deep: #8a4f08;
  --amber-lite: #e0a33f;
  --coral:      #c0442e;
  --coral-deep: #a83a26;
  --coral-lite: #e8836a;
  --verd:       #1f6a53;
  --verd-lite:  #63b096;

  --serif: ui-serif, Georgia, "Iowan Old Style", "Palatino Linotype", "Book Antiqua", serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --wrap: 74rem;
  --gut: clamp(1.1rem, 4vw, 2.75rem);
  --nav-h: 3.25rem;

  --shadow-card: 0 1px 2px rgba(16, 26, 43, .06), 0 8px 22px -14px rgba(16, 26, 43, .3);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--serif);
  font-size: 1rem;
  line-height: 1.62;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.18; font-weight: 600; letter-spacing: -.011em; }
p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding-left: 1.25em; }
li { margin-bottom: .38em; }
table { border-collapse: collapse; width: 100%; }
button, input { font: inherit; color: inherit; }

a { color: var(--amber-deep); text-underline-offset: .16em; text-decoration-thickness: .06em; }
a:hover { color: var(--coral-deep); }

:focus-visible {
  outline: 3px solid var(--coral);
  outline-offset: 2px;
  border-radius: 2px;
}
.band-ink :focus-visible, .hero :focus-visible, .masthead :focus-visible, .sectionnav :focus-visible {
  outline-color: var(--amber-lite);
}

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gut); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px;
  padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: .75rem; top: -4rem; z-index: 100;
  background: var(--coral); color: #fff; font-family: var(--sans);
  font-size: .85rem; font-weight: 600; padding: .6rem 1rem;
  border-radius: 0 0 4px 4px; text-decoration: none; transition: top .15s ease;
}
.skip-link:focus { top: 0; color: #fff; }

/* ---------- Shared type ---------- */
.eyebrow {
  font-family: var(--mono);
  font-size: .705rem;
  letter-spacing: .17em;
  text-transform: uppercase;
  color: var(--amber-deep);
  margin: 0 0 .7rem;
  font-weight: 600;
}
.band-ink .eyebrow, .hero .eyebrow { color: var(--amber-lite); }
.eyebrow-alert { color: var(--coral-deep); }

.section-lede {
  font-size: 1.06rem;
  color: var(--text-muted);
  max-width: 62ch;
  margin-bottom: 2rem;
}
.band-ink .section-lede { color: var(--text-onink-muted); }
.band-ink .section-lede strong { color: var(--text-onink); }

.sub-h {
  font-family: var(--sans);
  font-size: .78rem;
  letter-spacing: .13em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--text);
  margin: 3rem 0 1.1rem;
  padding-bottom: .5rem;
  border-bottom: 2px solid var(--rule-ink);
}
.sub-h-tight { margin-top: 0; }

.note {
  font-family: var(--sans);
  font-size: .86rem;
  color: var(--text-muted);
}

.tight > li { margin-bottom: .3em; }

/* ---------- Bands ---------- */
.band { padding: clamp(3rem, 7vw, 5.25rem) 0; }
.band > .wrap > h2 {
  font-size: clamp(1.65rem, 3.6vw, 2.4rem);
  max-width: 20ch;
}
.band-paper { background: var(--paper); border-top: 1px solid var(--rule); }
.band-ink {
  background: var(--ink-800);
  color: var(--text-onink);
  background-image: linear-gradient(var(--ink-800), var(--ink-800));
}
.band-ink h2, .band-ink h3, .band-ink h4 { color: #fff; }
.band-ink a { color: var(--amber-lite); }
.band-ink a:hover { color: var(--coral-lite); }
.band-alert { background: var(--blush); border-top: 3px solid var(--coral); border-bottom: 1px solid var(--rule); }

.section-head-row {
  display: flex; flex-wrap: wrap; gap: 1.5rem;
  align-items: flex-end; justify-content: space-between;
}
.section-head-row > div:first-child { flex: 1 1 30rem; min-width: 0; }
.section-head-row .section-lede { margin-bottom: 1rem; }

/* ---------- Masthead ---------- */
.masthead { background: var(--ink-900); color: var(--text-onink); }
.masthead-inner {
  display: flex; flex-wrap: wrap; gap: .5rem 1.5rem;
  align-items: baseline; justify-content: space-between;
  padding-block: .8rem;
}
.masthead p { margin: 0; font-family: var(--mono); font-size: .72rem; letter-spacing: .1em; }
.masthead-mark { text-transform: uppercase; font-weight: 600; }
.mark-glyph { color: var(--coral-lite); }
.mark-sep { color: #4a566d; padding-inline: .25rem; }
.mark-kind { color: var(--amber-lite); }
.masthead-meta { color: #8a93a5; text-transform: uppercase; }
.masthead-meta .dot { padding-inline: .55rem; }

/* ---------- Section nav ---------- */
.sectionnav {
  position: sticky; top: 0; z-index: 40;
  background: var(--ink-700);
  border-bottom: 1px solid #2c3a54;
  box-shadow: 0 6px 18px -12px rgba(8, 14, 25, .9);
}
.navlist {
  display: flex; gap: 0; margin: 0; padding: 0; list-style: none;
  overflow-x: auto; overflow-y: hidden;
  scrollbar-width: none; -ms-overflow-style: none;
  scroll-snap-type: x proximity;
}
.navlist::-webkit-scrollbar { display: none; }
.navlist li { margin: 0; flex: 0 0 auto; scroll-snap-align: start; }
.navlist a {
  display: block;
  font-family: var(--sans);
  font-size: .765rem;
  font-weight: 600;
  letter-spacing: .035em;
  white-space: nowrap;
  color: #b9c0cd;
  text-decoration: none;
  padding: 1.02rem .82rem .95rem;
  border-bottom: 3px solid transparent;
  transition: color .15s ease, border-color .15s ease, background-color .15s ease;
}
.navlist a:hover { color: #fff; background: #1e2d47; }
.navlist a[aria-current="true"] {
  color: #fff;
  border-bottom-color: var(--coral);
  background: #1c2a42;
}

/* ---------- Hero ---------- */
.hero {
  background: var(--ink-800);
  color: var(--text-onink);
  padding: clamp(2.5rem, 6vw, 4.25rem) 0 clamp(2.75rem, 6vw, 4rem);
  border-bottom: 1px solid var(--rule-ink);
}
.hero-grid {
  display: grid;
  gap: clamp(1.75rem, 4vw, 3.25rem);
  align-items: start;
}
/* When the source plays inline, the thumbnail card is not rendered and the
   hero body gets the full measure instead of a two-column split. */
.hero-grid-wide { grid-template-columns: minmax(0, 1fr); }
.hero-grid-wide .hero-lede { max-width: 78ch; }
.hero-body { min-width: 0; }
.hero h1 {
  font-size: clamp(1.85rem, 5vw, 3.05rem);
  color: #fff;
  letter-spacing: -.022em;
  margin-bottom: 1.15rem;
  text-wrap: balance;
}
.h1-sub { color: var(--text-onink-muted); font-weight: 400; }

.videometa {
  display: flex; flex-wrap: wrap; gap: 0;
  margin: 0 0 1.75rem;
  border-top: 1px solid var(--rule-ink);
  border-bottom: 1px solid var(--rule-ink);
}
.videometa > div {
  padding: .7rem 1.35rem .7rem 0;
  margin-right: 1.35rem;
  border-right: 1px solid var(--rule-ink);
}
.videometa > div:last-child { border-right: 0; margin-right: 0; padding-right: 0; }
.videometa dt {
  font-family: var(--mono); font-size: .66rem; letter-spacing: .14em;
  text-transform: uppercase; color: #8a93a5; margin-bottom: .18rem;
}
.videometa dd { margin: 0; font-family: var(--sans); font-size: .93rem; font-weight: 600; color: #fff; }

.verdict {
  margin: 0 0 1.5rem;
  border-left: 4px solid var(--coral);
  padding: .15rem 0 .15rem 1.15rem;
}
.verdict blockquote { margin: 0; }
.verdict blockquote p {
  margin: 0 0 .35rem;
  font-size: clamp(1.2rem, 2.9vw, 1.7rem);
  font-weight: 600;
  color: #fff;
  letter-spacing: -.015em;
  line-height: 1.28;
}
.verdict figcaption {
  font-family: var(--mono); font-size: .68rem; letter-spacing: .15em;
  text-transform: uppercase; color: var(--coral-lite);
}
.hero-lede { color: #cdd2dc; max-width: 60ch; margin-bottom: 0; }
.hero-lede strong { color: #fff; }

/* Thumbnail */
.hero-thumb { margin: 0; min-width: 0; }
.thumb-link {
  position: relative; display: block; text-decoration: none;
  border: 1px solid var(--rule-ink);
  background: var(--ink-900);
  overflow: hidden;
}
.thumb-link img { width: 100%; transition: opacity .2s ease, transform .35s ease; }
.thumb-link:hover img { opacity: .82; transform: scale(1.014); }
.thumb-play {
  position: absolute; inset: 0; display: grid; place-items: center;
  pointer-events: none;
}
.thumb-play svg { filter: drop-shadow(0 3px 10px rgba(0,0,0,.5)); }
.thumb-cta {
  display: block; font-family: var(--sans); font-size: .78rem; font-weight: 600;
  letter-spacing: .05em; color: #fff; background: var(--ink-700);
  padding: .62rem .85rem; border-top: 1px solid var(--rule-ink);
}
.thumb-link:hover .thumb-cta { background: var(--coral-deep); }
.hero-thumb figcaption {
  font-family: var(--sans); font-size: .76rem; line-height: 1.5;
  color: #8a93a5; margin-top: .6rem;
}

/* Inline source-video player */
.hero-player { margin: 0; }
.hero-player figcaption {
  font-family: var(--sans); font-size: .82rem; line-height: 1.55;
  color: #a8b0c0; margin-top: .7rem;
}
.hero-player figcaption strong { color: #fff; }
.video-embed {
  margin-top: 0;
  position: relative;
  aspect-ratio: 16 / 9;
  max-width: 62rem;
  background: var(--ink-900);
  border: 1px solid var(--rule-ink);
  overflow: hidden;
}
.video-embed iframe {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border: 0;
}

/* Signals */
.signals {
  list-style: none; margin: clamp(2rem, 5vw, 3rem) 0 0; padding: 0;
  display: grid; gap: 1px;
  background: var(--rule-ink);
  border: 1px solid var(--rule-ink);
}
.signal { margin: 0; padding: 1.35rem 1.4rem 1.5rem; background: var(--ink-700); }
.signal p { margin: 0 0 .5rem; }
.signal p:last-child { margin-bottom: 0; color: #c3c9d4; font-size: .93rem; }
.signal-label {
  font-family: var(--mono); font-size: .655rem; letter-spacing: .16em;
  text-transform: uppercase; font-weight: 600;
}
.signal-head {
  font-family: var(--serif); font-size: 1.12rem; font-weight: 600;
  color: #fff; line-height: 1.28; letter-spacing: -.01em;
}
.signal-insight { border-top: 3px solid var(--verd-lite); }
.signal-insight .signal-label { color: var(--verd-lite); }
.signal-risk { border-top: 3px solid var(--coral); }
.signal-risk .signal-label { color: var(--coral-lite); }
.signal-move { border-top: 3px solid var(--amber-lite); }
.signal-move .signal-label { color: var(--amber-lite); }

/* ---------- Method flow ---------- */
.flow {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 1px; background: var(--rule);
  border: 1px solid var(--rule);
}
.flow-step {
  margin: 0; padding: 1.4rem 1.35rem 1.5rem; background: var(--card);
  position: relative;
}
.flow-num {
  font-family: var(--mono); font-size: .78rem; font-weight: 700;
  color: #fff; background: var(--ink-700);
  width: 1.85rem; height: 1.85rem; display: grid; place-items: center;
  border-radius: 50%; margin: 0 0 .8rem;
}
.flow-step h3 {
  font-size: 1.08rem; margin-bottom: .4rem;
}
.flow-step p:last-child { margin-bottom: 0; font-size: .93rem; color: var(--text-muted); }
.flow-step-flag { background: #fbf3e6; }
.flow-step-flag .flow-num { background: var(--coral-deep); }
.flow-note {
  display: block; margin-top: .55rem; padding-top: .55rem;
  border-top: 1px dashed var(--rule);
  font-family: var(--sans); font-size: .81rem; color: var(--coral-deep); font-weight: 600;
}

/* ---------- Decision panel ---------- */
.decision-grid { display: grid; gap: 1.25rem; }
.dcard {
  background: var(--ink-700);
  border: 1px solid var(--rule-ink);
  border-top-width: 4px;
  padding: 1.4rem 1.45rem 1.5rem;
}
.dcard h3 {
  font-size: 1.05rem; display: flex; flex-wrap: wrap; align-items: baseline;
  gap: .55rem; margin-bottom: .9rem; color: #fff;
}
.dtag {
  font-family: var(--mono); font-size: .66rem; letter-spacing: .14em;
  text-transform: uppercase; font-weight: 700;
  padding: .22rem .5rem; border-radius: 2px;
}
.dcard ul { margin: 0; padding-left: 1.1em; }
.dcard li { color: #c3c9d4; font-size: .93rem; }
.dcard strong { color: #fff; }
.dcard-copy { border-top-color: var(--verd-lite); }
.dcard-copy .dtag { background: rgba(99, 176, 150, .17); color: var(--verd-lite); }
.dcard-adapt { border-top-color: var(--amber-lite); }
.dcard-adapt .dtag { background: rgba(224, 163, 63, .16); color: var(--amber-lite); }
.dcard-reject { border-top-color: var(--coral); }
.dcard-reject .dtag { background: rgba(232, 131, 106, .16); color: var(--coral-lite); }

/* ---------- Chapters ---------- */
.head-controls { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }

.btn {
  font-family: var(--sans); font-size: .78rem; font-weight: 600;
  letter-spacing: .03em; cursor: pointer;
  padding: .52rem .9rem;
  border: 1px solid var(--rule-ink);
  background: transparent; color: var(--text);
  border-radius: 3px;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
  text-decoration: none; display: inline-block;
}
.btn:hover { background: var(--ink-700); color: #fff; border-color: var(--ink-700); }
.band-ink .btn { border-color: #45536d; color: var(--text-onink); }
.band-ink .btn:hover { background: var(--amber-lite); color: var(--ink-900); border-color: var(--amber-lite); }
.btn-reset:hover { background: var(--coral-deep); color: #fff; border-color: var(--coral-deep); }

.chapters {
  list-style: none; margin: 0; padding: 0;
  border-top: 2px solid var(--rule-ink);
}
.chapter { margin: 0; border-bottom: 1px solid var(--rule); background: var(--card); }
.chapter details { }
.chapter summary {
  display: grid;
  grid-template-columns: 2.6rem 1fr auto;
  grid-template-areas: "idx title time" ". idea idea";
  gap: .18rem .5rem;
  align-items: baseline;
  padding: 1.05rem 1.1rem 1.05rem .9rem;
  cursor: pointer;
  list-style: none;
  transition: background-color .13s ease;
}
.chapter summary::-webkit-details-marker { display: none; }
.chapter summary:hover { background: #f8f2e5; }
.ch-index {
  grid-area: idx;
  font-family: var(--mono); font-size: .78rem; font-weight: 700;
  color: var(--amber-deep);
}
.ch-title {
  grid-area: title;
  font-family: var(--serif); font-size: 1.1rem; font-weight: 600;
  letter-spacing: -.012em; color: var(--text);
}
.ch-idea {
  grid-area: idea;
  font-family: var(--sans); font-size: .875rem; line-height: 1.5;
  color: var(--text-muted);
}
.ch-time {
  grid-area: time;
  font-family: var(--mono); font-size: .78rem; font-weight: 600;
  color: var(--text-muted);
  border: 1px solid var(--rule);
  padding: .1rem .42rem; border-radius: 2px;
  background: var(--paper-warm);
  white-space: nowrap;
}
.ch-time-seek {
  text-decoration: none;
  color: var(--text);
  border-color: var(--rule-strong, var(--rule));
  cursor: pointer;
  justify-self: end;
}
.ch-time-seek:hover {
  background: var(--coral-lite, #e9a23b);
  color: #101a2b;
  border-color: var(--coral-lite, #e9a23b);
}
.chapter details[open] summary { background: #f8f2e5; border-bottom: 1px dashed var(--rule); }
.chapter summary::after {
  content: "";
  grid-area: idx;
  justify-self: start; align-self: center;
  width: .5rem; height: .5rem;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: translateY(-.1rem) rotate(45deg);
  margin-left: 1.55rem;
  transition: transform .18s ease;
}
.chapter details[open] summary::after { transform: translateY(.1rem) rotate(-135deg); }

.chapter-flagged .ch-index { color: var(--coral-deep); }
.chapter-flagged { box-shadow: inset 3px 0 0 var(--coral); }
.chapter-key { box-shadow: inset 3px 0 0 var(--verd); }
.chapter-key .ch-index { color: var(--verd); }

.ch-body { padding: 1.15rem 1.4rem 1.5rem 3.5rem; max-width: 78ch; }
.ch-body > p:last-child { margin-bottom: 0; }
.ch-body .quotes { list-style: none; padding-left: 0; }
.ch-body .quotes li {
  border-left: 2px solid var(--rule);
  padding-left: .9rem; font-style: italic; color: var(--text-muted);
}

.line {
  font-family: var(--sans); font-size: .92rem; line-height: 1.55;
  padding: .7rem .85rem; margin-bottom: .6rem;
  background: var(--paper-warm);
  border-left: 3px solid var(--rule-ink);
}
.linetag {
  display: block;
  font-family: var(--mono); font-size: .63rem; letter-spacing: .14em;
  text-transform: uppercase; font-weight: 700; margin-bottom: .2rem;
}
.line-claim { border-left-color: #6b7488; background: #f0ece1; }
.line-claim .linetag { color: #4d5566; }
.line-assess { border-left-color: var(--ink-700); }
.line-assess .linetag { color: var(--ink-700); }
.line-take { border-left-color: var(--verd); background: #ecf2ee; }
.line-take .linetag { color: var(--verd); }
.line-warn { border-left-color: var(--coral); background: #f9ece6; }
.line-warn .linetag { color: var(--coral-deep); }
.line-rule { border-left-color: var(--amber); background: #f8f0e0; }
.line-rule .linetag { color: var(--amber-deep); }
.line-bound { border-left-color: #6b7488; background: #f0ece1; }
.line-bound .linetag { color: #4d5566; }

.pull {
  margin: 1rem 0; padding: .9rem 1.15rem;
  border-left: 3px solid var(--amber);
  background: var(--paper-warm);
  font-style: italic; font-size: 1.02rem;
}
.ch-link { font-family: var(--sans); font-size: .82rem; margin-top: 1.1rem; }
.ch-link a { font-weight: 600; }
.ch-xref { color: var(--text-muted); margin-left: .75rem; }

/* ---------- Evidence gallery ---------- */
.gallery { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.75rem; }
.ev { margin: 0; scroll-margin-top: calc(var(--nav-h) + 1rem); }
.ev figure {
  margin: 0; display: grid; gap: 0;
  border: 1px solid var(--rule-ink);
  background: var(--ink-700);
}
.ev img { width: 100%; background: var(--ink-900); }
.ev figcaption { padding: 1.2rem 1.35rem 1.35rem; }
.ev-title {
  font-family: var(--serif); font-size: 1.1rem; font-weight: 600;
  color: #fff; margin-bottom: .45rem; letter-spacing: -.01em;
}
.ev figcaption p { color: #c3c9d4; font-size: .93rem; }
.ev figcaption p:last-child { margin-bottom: 0; }
.ev-link { font-family: var(--mono); font-size: .74rem; letter-spacing: .06em; margin-top: .9rem !important; }

/* ---------- Claim audit ---------- */
.tablewrap { overflow-x: auto; border: 1px solid var(--rule); background: var(--card); }
.audit, .block { font-family: var(--sans); font-size: .9rem; min-width: 42rem; }
.block { min-width: 24rem; }
.audit th, .audit td, .block th, .block td {
  text-align: left; vertical-align: top;
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--rule-soft);
}
.audit thead th, .block thead th {
  background: var(--ink-700); color: #fff;
  font-family: var(--mono); font-size: .68rem; letter-spacing: .13em;
  text-transform: uppercase; font-weight: 600;
  border-bottom: 0;
}
.audit tbody th { font-weight: 600; width: 27%; color: var(--text); }
.audit td { color: var(--text-muted); }
.audit tbody tr:last-child th, .audit tbody tr:last-child td,
.block tbody tr:last-child th, .block tbody tr:last-child td { border-bottom: 0; }
.audit tbody tr:nth-child(even) { background: #faf6ec; }
.block tbody th { font-family: var(--mono); font-size: .82rem; white-space: nowrap; width: 8rem; color: var(--amber-deep); }

.tag {
  display: inline-block;
  font-family: var(--mono); font-size: .62rem; letter-spacing: .11em;
  text-transform: uppercase; font-weight: 700;
  padding: .2rem .45rem; border-radius: 2px; margin-right: .5rem;
  margin-bottom: .25rem;
  border: 1px solid currentColor;
  white-space: nowrap;
}
.tag-directional { color: var(--amber-deep); background: #f8efdd; }
.tag-opinion     { color: #4d5566;         background: #eeeade; }
.tag-anecdotal   { color: #4d5566;         background: #eeeade; }
.tag-plausible   { color: var(--verd);     background: #e9f1ec; }
.tag-unsupported { color: var(--coral-deep); background: #f9ebe6; }
.tag-conflict    { color: #fff; background: var(--coral-deep); border-color: var(--coral-deep); }

/* ---------- Policy ---------- */
.policy-grid { display: grid; gap: 1.25rem; }
.pcard {
  background: var(--card);
  border: 1px solid var(--rule);
  border-left: 4px solid var(--coral);
  padding: 1.35rem 1.4rem 1.4rem;
}
.pcard-kind {
  font-family: var(--mono); font-size: .655rem; letter-spacing: .16em;
  text-transform: uppercase; font-weight: 700; color: var(--coral-deep);
  margin-bottom: .55rem;
}
.pcard-note { color: var(--text-muted); font-weight: 400; letter-spacing: .08em; }
.pcard h3 { font-size: 1.07rem; margin-bottom: .6rem; }
.pcard p { font-size: .95rem; }
.pcard-src { font-family: var(--sans); font-size: .82rem; margin-bottom: 0 !important; }
.pcard-foot {
  font-family: var(--sans); font-size: .85rem; color: var(--text-muted);
  margin: .9rem 0 0 !important; padding-top: .8rem; border-top: 1px dashed var(--rule);
}
.pcard-rec {
  border-left-color: var(--ink-700);
  background: var(--ink-700); color: var(--text-onink);
}
.pcard-rec h3 { color: #fff; }
.pcard-rec .pcard-kind { color: var(--amber-lite); }
.pcard-rec .pcard-note { color: #8a93a5; }
.pcard-rec p, .pcard-rec li { color: #c8cdd7; }
.pcard-rec .pcard-foot { border-top-color: #3a4760; color: #a9b0be; }

/* ---------- Plan ---------- */
.plan-topline { display: grid; gap: 1.25rem; margin-bottom: .5rem; }
.topline {
  background: var(--ink-700); color: var(--text-onink);
  padding: 1.4rem 1.45rem 1.5rem;
  border-top: 4px solid var(--amber-lite);
}
.topline-offer { border-top-color: var(--verd-lite); }
.topline-label {
  font-family: var(--mono); font-size: .655rem; letter-spacing: .16em;
  text-transform: uppercase; font-weight: 700; color: var(--amber-lite); margin-bottom: .45rem;
}
.topline-offer .topline-label { color: var(--verd-lite); }
.topline-value {
  font-family: var(--serif); font-size: 1.28rem; font-weight: 600;
  color: #fff; line-height: 1.24; margin-bottom: .6rem; letter-spacing: -.012em;
}
.topline p:last-child { margin-bottom: 0; color: #c3c9d4; font-size: .93rem; }

.guardrails {
  counter-reset: g; list-style: none; padding: 0; margin: 0;
  display: grid; gap: 1px; background: var(--rule);
  border: 1px solid var(--rule);
}
.guardrails li {
  counter-increment: g; margin: 0;
  background: var(--card);
  padding: .9rem 1.1rem .9rem 3rem; position: relative;
  font-size: .95rem;
}
.guardrails li::before {
  content: counter(g, decimal-leading-zero);
  position: absolute; left: 1.1rem; top: .95rem;
  font-family: var(--mono); font-size: .74rem; font-weight: 700; color: var(--coral-deep);
}

.weeks { display: grid; gap: 1.25rem; }
.week {
  background: var(--card); border: 1px solid var(--rule);
  border-top: 3px solid var(--ink-700);
  padding: 1.3rem 1.35rem 1.4rem;
}
.week-days {
  font-family: var(--mono); font-size: .68rem; letter-spacing: .15em;
  text-transform: uppercase; font-weight: 700; color: var(--amber-deep); margin-bottom: .3rem;
}
.week h4 { font-size: 1.12rem; margin-bottom: .75rem; }
.week ul, .week ol { font-size: .92rem; }
.week p { font-size: .92rem; }
.week-gate {
  font-family: var(--sans); font-size: .85rem;
  margin: 1rem 0 0 !important; padding-top: .8rem;
  border-top: 1px dashed var(--rule); color: var(--text-muted);
}
.gate-label {
  display: inline-block;
  font-family: var(--mono); font-size: .62rem; letter-spacing: .13em;
  text-transform: uppercase; font-weight: 700; color: var(--ink-700);
  background: var(--paper-warm); border: 1px solid var(--rule);
  padding: .12rem .4rem; border-radius: 2px; margin-right: .5rem;
}
.stages { list-style: none; padding-left: 0; counter-reset: s; }
.stages li { counter-increment: s; padding-left: 0; }
.stage-name {
  display: inline-block; min-width: 5.7rem;
  font-family: var(--mono); font-size: .68rem; letter-spacing: .11em;
  text-transform: uppercase; font-weight: 700; color: var(--verd);
  margin-right: .4rem;
}

.criteria-grid { display: grid; gap: 1.25rem; }
.crit { padding: 1.35rem 1.4rem 1.4rem; border: 1px solid var(--rule); background: var(--card); }
.crit h4 { font-size: 1.08rem; }
.crit-note, .crit ul { font-size: .93rem; }
.crit-note { color: var(--text-muted); }
.crit-pass { border-left: 4px solid var(--verd); }
.crit-decide { border-left: 4px solid var(--amber); }
.crit-foot {
  font-family: var(--sans); font-size: .86rem; color: var(--text-muted);
  margin: .9rem 0 0 !important; padding-top: .8rem; border-top: 1px dashed var(--rule);
}
.decisions { margin: 0; }
.decisions > div { padding: .6rem 0; border-bottom: 1px solid var(--rule-soft); }
.decisions > div:last-child { border-bottom: 0; }
.decisions dt {
  font-family: var(--mono); font-size: .7rem; letter-spacing: .14em;
  text-transform: uppercase; font-weight: 700; color: var(--amber-deep); margin-bottom: .2rem;
}
.decisions dd { margin: 0; font-size: .93rem; }

.auto-grid { display: grid; gap: 1.25rem; }
.auto { padding: 1.3rem 1.35rem 1.4rem; border: 1px solid var(--rule); background: var(--card); border-top-width: 3px; }
.auto h4 { font-size: 1.02rem; margin-bottom: .3rem; }
.auto-note {
  font-family: var(--mono); font-size: .66rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--text-muted); margin-bottom: .85rem;
}
.auto ul { font-size: .92rem; }
.auto-safe { border-top-color: var(--verd); }
.auto-human { border-top-color: var(--amber); }
.auto-never { border-top-color: var(--coral); background: #f9f0ec; }

/* ---------- Checklist ---------- */
.checklist-controls { flex-direction: column; align-items: flex-start; gap: .55rem; min-width: 13rem; }
.progress { margin: 0; display: flex; align-items: baseline; gap: .45rem; }
.progress-count { font-family: var(--mono); font-size: 1.35rem; font-weight: 700; color: #fff; }
.progress-word {
  font-family: var(--mono); font-size: .66rem; letter-spacing: .15em;
  text-transform: uppercase; color: var(--text-onink-muted);
}
.progress-bar {
  width: 100%; min-width: 12rem; height: 5px; background: #2c3a54; overflow: hidden;
}
.progress-fill {
  display: block; height: 100%; width: 0%;
  background: var(--verd-lite); transition: width .25s ease;
}

.nojs-note {
  font-family: var(--sans); font-size: .85rem;
  border: 1px dashed #45536d; padding: .7rem .9rem;
  color: var(--text-onink-muted); margin-bottom: 1.5rem;
}
.band-paper .nojs-note { border-color: var(--rule); color: var(--text-muted); background: var(--card); }

.checklist { display: grid; gap: 1.25rem; margin-top: .5rem; }
.cl-group {
  border: 1px solid var(--rule-ink); background: var(--ink-700);
  padding: .35rem 1.25rem 1.1rem; margin: 0; min-width: 0;
}
.cl-group legend {
  font-family: var(--mono); font-size: .72rem; letter-spacing: .15em;
  text-transform: uppercase; font-weight: 700; color: #fff;
  padding: .35rem .7rem; background: var(--ink-900); border: 1px solid var(--rule-ink);
}
.cl-days { color: var(--amber-lite); font-weight: 400; letter-spacing: .1em; }
.cl-group ul { list-style: none; margin: .9rem 0 0; padding: 0; }
.cl-group li { margin: 0; border-bottom: 1px solid #223350; }
.cl-group li:last-child { border-bottom: 0; }
.cl-group label {
  display: flex; gap: .7rem; align-items: flex-start;
  padding: .62rem .2rem; cursor: pointer;
  font-family: var(--sans); font-size: .89rem; line-height: 1.45;
  color: #c8cdd7;
}
.cl-group label:hover { color: #fff; }
.cl-group input[type="checkbox"] {
  flex: 0 0 auto; width: 1.05rem; height: 1.05rem; margin: .15rem 0 0;
  accent-color: var(--verd-lite); cursor: pointer;
}
.cl-group input:checked + span { color: #7f8899; text-decoration: line-through; text-decoration-thickness: 1px; }

/* ---------- Calculator ---------- */
.calc { display: grid; gap: 1.5rem; align-items: start; }
.calc-inputs {
  background: var(--card); border: 1px solid var(--rule);
  padding: 1.4rem 1.45rem 1.5rem;
}
.field { margin-bottom: 1.05rem; }
.field label {
  display: block;
  font-family: var(--sans); font-size: .82rem; font-weight: 700;
  letter-spacing: .02em; margin-bottom: .3rem;
}
.field .unit { color: var(--text-muted); font-weight: 400; }
.field input {
  width: 100%; max-width: 12rem;
  font-family: var(--mono); font-size: 1rem;
  padding: .5rem .6rem;
  border: 1px solid var(--rule-ink); border-radius: 3px;
  background: #fff; color: var(--text);
}
.field-note {
  font-family: var(--sans); font-size: .78rem; color: var(--text-muted);
  margin: .32rem 0 0; max-width: 42ch;
}

.calc-output {
  background: var(--ink-700); color: var(--text-onink);
  border: 1px solid var(--rule-ink);
  padding: 1.4rem 1.45rem 1.5rem;
}
.calc-output .sub-h { color: #fff; border-bottom-color: #45536d; }
.funnel { list-style: none; margin: 0 0 1.1rem; padding: 0; counter-reset: f; }
.funnel li {
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
  padding: .72rem 0; border-bottom: 1px solid #2c3a54; margin: 0;
}
.fn-label {
  font-family: var(--sans); font-size: .87rem; color: #c3c9d4;
}
.fn-value {
  font-family: var(--mono); font-size: 1.28rem; font-weight: 700; color: #fff;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.fn-total { border-bottom: 0; border-top: 2px solid var(--amber-lite); margin-top: .4rem; padding-top: .9rem; }
.fn-total .fn-label { color: var(--amber-lite); font-weight: 700; text-transform: uppercase; font-size: .72rem; letter-spacing: .14em; font-family: var(--mono); }
.fn-total .fn-value { font-size: 1.6rem; color: var(--amber-lite); }
.calc-warning {
  font-family: var(--sans); font-size: .84rem; line-height: 1.55;
  color: #a9b0be; margin: 0; padding: .9rem 1rem;
  background: rgba(192, 68, 46, .13);
  border-left: 3px solid var(--coral);
}
.calc-warning strong { color: #fff; }

/* ---------- Sources ---------- */
.sources-grid { display: grid; gap: 2rem; align-items: start; }
.srccol h3, .boundaries h3 {
  font-family: var(--sans); font-size: .76rem; letter-spacing: .14em;
  text-transform: uppercase; font-weight: 700; color: var(--amber-lite);
  border-bottom: 1px solid #45536d; padding-bottom: .5rem; margin: 2rem 0 1rem;
}
.srccol h3:first-child { margin-top: 0; }
.srclist { list-style: none; margin: 0; padding: 0; }
.srclist li { margin-bottom: 1.05rem; }
.srclist a { font-family: var(--sans); font-size: .93rem; font-weight: 600; }
.srclist p {
  font-family: var(--sans); font-size: .85rem; color: var(--text-onink-muted);
  margin: .28rem 0 0; max-width: 62ch;
}
.boundaries { background: var(--ink-700); border: 1px solid var(--rule-ink); padding: 1.35rem 1.45rem 1.5rem; }
.boundaries h3 { margin-top: 0; }
.boundaries ul { padding-left: 1.1em; margin-bottom: 0; }
.boundaries li { font-size: .9rem; color: #c3c9d4; }
.boundaries strong { color: #fff; }

.transcript-tool { margin-top: 1.6rem; padding-top: 1.2rem; border-top: 1px dashed #45536d; }
.transcript-tool h4 {
  font-family: var(--mono); font-size: .68rem; letter-spacing: .15em;
  text-transform: uppercase; color: var(--amber-lite); margin-bottom: .5rem;
}
.transcript-tool p { font-size: .87rem; color: var(--text-onink-muted); font-family: var(--sans); }
.tt-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: 0; }
.tt-error { font-family: var(--sans); font-size: .8rem; color: var(--coral-lite); flex: 1 1 100%; }
.transcript-view {
  margin-top: 1rem; max-height: 26rem; overflow: auto;
  border: 1px solid var(--rule-ink); background: var(--ink-900);
}
.transcript-view pre {
  margin: 0; padding: 1rem;
  font-family: var(--mono); font-size: .78rem; line-height: 1.65;
  color: #c3c9d4; white-space: pre-wrap; word-wrap: break-word;
}

/* ---------- Footer ---------- */
.siteftr {
  background: var(--ink-900); color: var(--text-onink-muted);
  padding: clamp(2.5rem, 5vw, 3.5rem) 0 2rem;
  border-top: 3px solid var(--coral);
}
.ftr-grid { display: grid; gap: 2rem; }
.ftr-col h2 {
  font-family: var(--mono); font-size: .68rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--amber-lite); margin-bottom: .85rem;
}
.ftr-col ul { list-style: none; margin: 0; padding: 0; }
.ftr-col li { margin-bottom: .5rem; }
.ftr-col a { font-family: var(--sans); font-size: .9rem; color: #dfe3ea; text-decoration: none; border-bottom: 1px solid #45536d; }
.ftr-col a:hover { color: #fff; border-bottom-color: var(--coral-lite); }
.ftr-note p { font-family: var(--sans); font-size: .85rem; max-width: 44ch; margin: 0; }
.ftr-base {
  font-family: var(--mono); font-size: .68rem; letter-spacing: .11em;
  color: #6d7688; margin: 2.5rem 0 0; padding-top: 1.25rem;
  border-top: 1px solid #1e2a3f;
}

/* =========================================================================
   Responsive
   ========================================================================= */
@media (min-width: 40em) {
  .flow { grid-template-columns: repeat(2, 1fr); }
  .decision-grid, .policy-grid, .criteria-grid, .auto-grid,
  .plan-topline, .weeks, .checklist { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 56em) {
  .signals { grid-template-columns: repeat(3, 1fr); }
  .flow { grid-template-columns: repeat(3, 1fr); }
  .decision-grid, .auto-grid { grid-template-columns: repeat(3, 1fr); }
  .guardrails { grid-template-columns: repeat(2, 1fr); }
  .ev figure { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
  .ev figcaption { align-self: center; }
  .calc { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .sources-grid { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
  .ftr-grid { grid-template-columns: repeat(3, 1fr); }
  .hero-grid { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
  .hero-grid-wide { grid-template-columns: minmax(0, 1fr); }
  .checklist { grid-template-columns: repeat(2, 1fr); }
  .chapter summary { grid-template-columns: 2.9rem minmax(0, 1fr) auto; }
}

@media (min-width: 74em) {
  .flow { grid-template-columns: repeat(6, 1fr); }
  .flow-step { padding: 1.25rem 1.05rem 1.35rem; }
  .flow-step h3 { font-size: .98rem; }
  .flow-step p:last-child { font-size: .855rem; }
  .weeks { grid-template-columns: repeat(3, 1fr); }
  .checklist { grid-template-columns: repeat(3, 1fr); }
  .policy-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Chapter summary: stack on very narrow screens so the timestamp never clips */
@media (max-width: 29em) {
  .chapter summary {
    grid-template-columns: 2.6rem 1fr;
    grid-template-areas: "idx title" ". time" ". idea";
    row-gap: .35rem;
  }
  .ch-time { justify-self: start; }
  .videometa > div { padding-right: 1rem; margin-right: 1rem; }
}

/* =========================================================================
   Motion / print
   ========================================================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .thumb-link:hover img { transform: none; }
}

@media print {
  :root { --wrap: 100%; --gut: 0; }
  html, body { background: #fff; color: #000; font-size: 10.5pt; }
  .sectionnav, .skip-link, .head-controls, .checklist-controls,
  .btn, .thumb-play, .thumb-cta, .nojs-note, .transcript-tool,
  #calc-form button, .progress-bar { display: none !important; }

  .masthead, .hero, .band-ink, .siteftr, .dcard, .signal, .cl-group,
  .topline, .calc-output, .boundaries, .ev figure, .pcard-rec {
    background: #fff !important;
    color: #000 !important;
    border-color: #999 !important;
  }
  .band-ink h2, .band-ink h3, .band-ink h4, .hero h1, .verdict blockquote p,
  .signal-head, .ev-title, .topline-value, .fn-value, .progress-count,
  .siteftr .ftr-col h2, .srccol h3, .boundaries h3, .calc-output .sub-h,
  .dcard h3, .cl-group legend, .pcard-rec h3 { color: #000 !important; }
  .band-ink p, .band-ink li, .hero-lede, .signal p:last-child, .dcard li,
  .ev figcaption p, .srclist p, .boundaries li, .fn-label, .calc-warning,
  .topline p:last-child, .cl-group label, .ftr-note p, .transcript-tool p,
  .masthead p, .masthead-meta, .section-lede, .ftr-col a { color: #222 !important; }

  .band { padding: 1.1rem 0; border-top: 1px solid #ccc; break-inside: auto; }
  .hero { padding: .5rem 0 1rem; }
  .hero-grid, .calc, .sources-grid, .ftr-grid { grid-template-columns: 1fr 1fr; }
  .signals, .flow, .decision-grid, .weeks, .auto-grid, .policy-grid,
  .criteria-grid, .checklist, .plan-topline, .guardrails { grid-template-columns: 1fr 1fr; gap: .5rem; background: none; }
  .flow { grid-template-columns: repeat(3, 1fr); }
  .gallery { gap: .75rem; }

  h1, h2, h3, h4 { break-after: avoid; }
  .chapter, .ev, .week, .pcard, .dcard, .signal, .cl-group, .flow-step,
  .crit, .auto, .topline, .calc-inputs, .calc-output { break-inside: avoid; }

  /* Expand every chapter for the printed record */
  .chapter details > .ch-body { display: block !important; }
  .chapter summary::after { display: none; }
  .chapter summary { background: #f2f2f2 !important; }

  .band-ink { border-top: 1px solid #ccc; }
  a { color: #000 !important; text-decoration: underline; }
  .ch-link a[href^="http"]::after,
  .srclist a[href^="http"]::after,
  .pcard-src a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 8pt; word-break: break-all; }
  .ev img { max-height: 8cm; object-fit: contain; }
  .cl-group input[type="checkbox"] { -webkit-appearance: none; appearance: none; border: 1px solid #333; }
  .tag { border-color: #666 !important; color: #000 !important; background: #eee !important; }
  .siteftr { border-top: 1px solid #ccc; }
  .transcript-view { display: none; }
}
