/* ============================================================
   TaiwanBench · ChinaTalk — shared site stylesheet
   Brand: ChinaTalk cream / warm ink / burnt-orange accent
   ============================================================ */

:root {
  /* brand */
  --paper: #F5EDE0;
  --card: #FFFFFF;
  --ink: #221E19;
  --ink2: #5C554B;
  --ink3: #8A8276;
  --accent: #C65D32;
  --line: #DFD6C4;
  --linesoft: #EBE3D3;

  /* aliases used by ported components */
  --hairline: var(--line);
  --hairline-soft: var(--linesoft);
  --ink-2: var(--ink2);
  --ink-3: var(--ink3);

  /* seats */
  --prc: #B3403A;
  --roc: #1F8A70;
  --usa: #2C5FA8;

  /* results encodings */
  --en: #2C5FA8;
  --zh: #B3403A;
  --settle: #1F8A70;
  --frozen: #5B6472;
  --heat0: #F7E8E4; --heat1: #EFC9C0; --heat2: #E3A093;
  --heat3: #CF6F5D; --heat4: #B3403A; --heat5: #7E241F;

  --warnbg: #F3ECDD;
  --warnink: #6B5322;
  --warn-bg: var(--warnbg);
  --warn-ink: var(--warnink);

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --cjk: "Songti SC", "STSong", "Noto Serif CJK SC", "SimSun", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", system-ui, sans-serif;
  --mono: "SF Mono", SFMono-Regular, ui-monospace, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #17181C; --card: #1F2026; --ink: #E9E5DE; --ink2: #ADA79C; --ink3: #7C766C;
    --accent: #D97A4F;
    --line: #33343B; --linesoft: #292A31;
    --prc: #CE5850; --roc: #279C80; --usa: #4A7BC4;
    --en: #4A7BC4; --zh: #CE5850;
    --settle: #279C80; --frozen: #8B94A3;
    --heat0: #2A2224; --heat1: #4A2A28; --heat2: #6E332E;
    --heat3: #94443B; --heat4: #C05A50; --heat5: #E08A80;
    --warnbg: #2B2620; --warnink: #D9BE85;
  }
}

html { background: var(--paper); scroll-behavior: smooth; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--serif); font-size: 16.5px; line-height: 1.62;
  -webkit-text-size-adjust: 100%;
}
.wrap { max-width: 1060px; margin: 0 auto; padding: 0 24px 110px; }
.prose { max-width: 47rem; }
a { color: inherit; }
strong { font-weight: 650; }
p { margin: 0 0 15px; }
.note { color: var(--ink2); font-size: 14.5px; }
code, .mono { font-family: var(--mono); font-size: 0.84em; background: var(--linesoft); border-radius: 3px; padding: 1px 5px; }

h1 { font-size: clamp(30px, 4.6vw, 46px); line-height: 1.14; font-weight: 600; letter-spacing: -0.01em; margin: 0 0 12px; text-wrap: balance; }
h2 { font-size: 27px; font-weight: 600; margin: 0; letter-spacing: -0.005em; text-wrap: balance; }
h3 { font-size: 19px; font-weight: 650; margin: 30px 0 10px; text-wrap: balance; }

/* ---------- Site header / tabs ---------- */
.sitebar {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 16px 0 0; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; }
.brand img { width: 40px; height: 40px; border-radius: 9px; box-shadow: 0 3px 10px rgba(0,0,0,0.14); }
.brandname { font-family: var(--sans); font-weight: 800; font-size: 14px; letter-spacing: 0.13em; text-transform: uppercase; }
.brandsep { color: var(--ink3); }
.brandproj { font-family: var(--sans); font-weight: 600; font-size: 14px; letter-spacing: 0.06em; color: var(--ink2); }
.brandzh { font-family: var(--cjk); font-size: 13px; letter-spacing: 0.35em; color: var(--accent); margin-left: 4px; }
nav.tabs { display: flex; gap: 4px; overflow-x: auto; max-width: 100%; }
nav.tabs a {
  font-family: var(--sans); font-size: 13.5px; font-weight: 650; letter-spacing: 0.02em;
  text-decoration: none; color: var(--ink2); padding: 9px 14px 11px; border-bottom: 3px solid transparent;
  white-space: nowrap;
}
nav.tabs a:hover { color: var(--ink); }
nav.tabs a.active { color: var(--ink); border-bottom-color: var(--accent); }
.siterule { border-bottom: 2px solid var(--ink); margin-bottom: 0; }

header.mast { padding: 52px 0 8px; }
.dek, .subq { font-size: 19.5px; line-height: 1.5; color: var(--ink2); max-width: 44rem; margin: 0 0 26px; text-wrap: balance; }
.eyebrow {
  font-family: var(--sans); font-size: 12px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink3); margin: 0 0 16px;
}
.eyebrow .zhchar { font-family: var(--cjk); font-weight: 600; letter-spacing: 0.4em; color: var(--accent); margin-left: 10px; }

.statstrip { display: flex; flex-wrap: wrap; margin: 38px 0 0; border-top: 1px solid var(--line); }
.stat { flex: 1 1 118px; padding: 13px 16px 4px 0; border-right: 1px solid var(--linesoft); margin-right: 16px; }
.stat:last-child { border-right: 0; margin-right: 0; }
.stat b { display: block; font-size: 25px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat span { font-family: var(--sans); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink3); }

section { padding-top: 58px; }
.sechead { border-bottom: 1px solid var(--line); padding-bottom: 10px; margin-bottom: 24px; }
.sechead .zh-eyebrow { font-family: var(--cjk); font-size: 14px; color: var(--accent); letter-spacing: 0.5em; display: block; margin-bottom: 4px; }
.sechead.numbered { display: flex; align-items: baseline; gap: 16px; }
.secnum { font-family: var(--sans); font-weight: 700; font-size: 13px; letter-spacing: 0.1em; color: var(--ink3); white-space: nowrap; }

.preface { border-left: 3px solid var(--accent); padding: 6px 0 6px 26px; margin: 30px 0 8px; max-width: 46rem; }
.preface p { margin: 0 0 14px; font-size: 16.5px; }
.preface .sig { font-family: var(--sans); font-size: 12.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink3); }

footer.site {
  margin-top: 80px; border-top: 2px solid var(--ink); padding-top: 16px;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  font-family: var(--sans); font-size: 12px; color: var(--ink3);
}
footer.site a { color: inherit; }

/* ---------- Landing components ---------- */
.tabcards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin: 26px 0 0; }
.tabcard {
  display: block; background: var(--card); border: 1px solid var(--line); border-top: 4px solid var(--accent);
  border-radius: 8px; padding: 18px 22px 16px; text-decoration: none; transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.tabcard:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,0.08); }
.tabcard h4 { margin: 0 0 6px; font-size: 18px; font-weight: 650; }
.tabcard p { margin: 0; font-size: 14.5px; color: var(--ink2); line-height: 1.55; }
.tabcard .go { display: inline-block; margin-top: 12px; font-family: var(--sans); font-size: 12.5px; font-weight: 700; letter-spacing: 0.05em; color: var(--accent); }
.findings { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin-top: 22px; }
.finding { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 17px 21px 13px; }
.finding .fno { font-family: var(--sans); font-size: 11px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
.finding h4 { margin: 5px 0 7px; font-size: 16.5px; font-weight: 650; }
.finding p { margin: 0; font-size: 14px; color: var(--ink2); line-height: 1.55; }

.pull {
  font-size: clamp(21px, 3vw, 27px); line-height: 1.35; font-weight: 500; letter-spacing: -0.005em;
  border-left: 3px solid var(--accent); padding: 4px 0 4px 26px; margin: 34px 0; max-width: 44rem; text-wrap: balance;
}
.pull .zh-inline { font-family: var(--cjk); }

/* ---------- Footnote (hover) ---------- */
.fn { position: relative; cursor: help; border-bottom: 2px dashed color-mix(in srgb, var(--accent) 65%, transparent); }
.fn .fnbody {
  visibility: hidden; opacity: 0; transition: opacity 0.15s ease; position: absolute; z-index: 30;
  left: 50%; transform: translateX(-50%); bottom: calc(100% + 10px); width: min(340px, 78vw);
  background: var(--card); color: var(--ink2); border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 10px 28px rgba(0,0,0,0.16); padding: 12px 16px; font-size: 13.5px; line-height: 1.5;
  font-style: normal; font-weight: 400; text-align: left; text-transform: none; letter-spacing: normal;
}
.fn:hover .fnbody, .fn:focus .fnbody { visibility: visible; opacity: 1; }

/* ---------- Results: language chips, scoreboard ---------- */
.langkey { display: flex; gap: 20px; align-items: center; font-family: var(--sans); font-size: 12.5px; color: var(--ink2); margin: 6px 0 18px; flex-wrap: wrap; }
.langkey .k { display: inline-flex; gap: 7px; align-items: center; }
.sw { width: 14px; height: 14px; border-radius: 3px; display: inline-block; }
.sw.en { background: var(--en); } .sw.zh { background: var(--zh); }

.tscroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--card); }
table.board { border-collapse: collapse; width: 100%; min-width: 900px; font-size: 14.5px; }
table.board th { font-family: var(--sans); font-size: 11px; letter-spacing: 0.07em; text-transform: uppercase; color: var(--ink3); text-align: left; padding: 12px 14px 9px; border-bottom: 2px solid var(--line); white-space: nowrap; }
table.board td { padding: 10px 14px; border-bottom: 1px solid var(--linesoft); vertical-align: middle; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.board tr:last-child td { border-bottom: 0; }
table.board td.mname { font-weight: 650; }
.lang-pill { font-family: var(--sans); font-size: 10.5px; font-weight: 800; letter-spacing: 0.06em; color: #fff; border-radius: 3px; padding: 2px 7px; }
.lang-pill.en { background: var(--en); } .lang-pill.zh { background: var(--zh); }
.oc { font-family: var(--sans); font-size: 11px; font-weight: 800; letter-spacing: 0.05em; border-radius: 3px; padding: 3px 8px; color: #fff; }
.oc.settle { background: var(--settle); } .oc.frozen { background: var(--frozen); }
.oc.missing { background: transparent; color: var(--ink3); border: 1px dashed var(--ink3); }

/* ---------- Results: bar chart ---------- */
.chart { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 22px 26px 18px; }
.bargroup { display: grid; grid-template-columns: 128px 1fr; gap: 4px 14px; align-items: center; margin-bottom: 14px; }
.bargroup .blabel { font-family: var(--sans); font-size: 13px; font-weight: 650; text-align: right; grid-row: span 2; align-self: center; }
.bartrack { position: relative; height: 16px; }
.bar { height: 12px; margin-top: 2px; border-radius: 0 4px 4px 0; position: relative; }
.bar.en { background: var(--en); } .bar.zh { background: var(--zh); }
.bar .v { position: absolute; right: -8px; transform: translateX(100%); top: 50%; translate: 0 -50%; font-family: var(--mono); font-size: 11.5px; color: var(--ink2); }
.bar.none { background: transparent; }
.bar.none .v { color: var(--ink3); font-style: italic; right: auto; left: 0; transform: none; }
.axisnote { font-family: var(--sans); font-size: 11.5px; color: var(--ink3); border-top: 1px solid var(--linesoft); margin-top: 14px; padding-top: 8px; }

/* ---------- Results: crisis map ---------- */
.runstrip { display: grid; grid-template-columns: 158px 1fr 96px; gap: 12px; align-items: center; margin-bottom: 9px; }
.runstrip .rlabel { font-family: var(--sans); font-size: 12.5px; font-weight: 650; text-align: right; white-space: nowrap; }
.runstrip .rlabel .lang-pill { margin-left: 6px; }
.qgrid { display: grid; grid-template-columns: repeat(26, 1fr); gap: 3px; }
.q { height: 20px; border-radius: 3px; background: var(--linesoft); position: relative; }
.q.cr { color: #fff; font-family: var(--mono); font-size: 10px; font-weight: 700; display: grid; place-items: center; background: var(--zh); }
.q.cr.cra { background: var(--heat3); } .q.cr.crc { background: var(--heat4); } .q.cr.crd { background: var(--heat5); }
.crlegend { display: flex; gap: 18px; flex-wrap: wrap; font-family: var(--sans); font-size: 12px; color: var(--ink2); margin-top: 14px; }

/* ---------- Results: heatmap ---------- */
.heatwrap { overflow-x: auto; }
.heat { display: grid; grid-template-columns: 148px repeat(10, minmax(44px, 1fr)); gap: 3px; min-width: 720px; }
.heat .hl { font-family: var(--sans); font-size: 12px; font-weight: 650; align-self: center; text-align: right; padding-right: 10px; white-space: nowrap; }
.heat .hh { font-family: var(--sans); font-size: 10px; font-weight: 700; letter-spacing: 0.03em; color: var(--ink3); text-align: center; align-self: end; padding-bottom: 4px; line-height: 1.25; }
.hc { height: 30px; border-radius: 4px; display: grid; place-items: center; font-family: var(--mono); font-size: 12.5px; font-weight: 700; }
.hc.na { background: var(--linesoft); color: var(--ink3); font-weight: 400; }
.heatkey { display: flex; align-items: center; gap: 8px; font-family: var(--sans); font-size: 11.5px; color: var(--ink3); margin-top: 12px; flex-wrap: wrap; }
.heatkey .cellsw { width: 20px; height: 13px; border-radius: 3px; }

/* ---------- Results: gamma table ---------- */
table.gam { border-collapse: collapse; width: 100%; font-size: 14.5px; }
table.gam th { font-family: var(--sans); font-size: 11px; letter-spacing: 0.07em; text-transform: uppercase; color: var(--ink3); text-align: left; padding: 9px 12px 7px; border-bottom: 2px solid var(--line); }
table.gam td { padding: 8px 12px; border-bottom: 1px solid var(--linesoft); font-variant-numeric: tabular-nums; }

/* ---------- Results: exhibits, profiles, caveats ---------- */
.exhibit { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--zh); border-radius: 6px; padding: 18px 24px 14px; margin: 16px 0; }
.exhibit .exno { font-family: var(--sans); font-size: 11px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--zh); }
.exhibit h4 { margin: 4px 0 8px; font-size: 17px; font-weight: 650; }
.exhibit blockquote { margin: 0 0 10px; padding: 10px 16px; background: var(--linesoft); border-radius: 5px; font-size: 14.5px; font-style: italic; color: var(--ink2); overflow-x: auto; }
.exhibit p { font-size: 14.5px; color: var(--ink2); margin-bottom: 6px; }
.exhibit .cut { color: var(--zh); font-weight: 700; font-style: normal; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); gap: 16px; margin-top: 20px; }
.mcard { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 18px 22px 14px; }
.mcard h4 { margin: 0 0 2px; font-size: 17.5px; font-weight: 650; }
.mcard .flag { font-family: var(--sans); font-size: 10.5px; letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink3); margin-bottom: 10px; }
.mcard .ocline { display: flex; gap: 8px; margin: 8px 0 10px; flex-wrap: wrap; align-items: center; font-family: var(--sans); font-size: 11.5px; color: var(--ink2); }
.mcard p { font-size: 14px; color: var(--ink2); margin-bottom: 8px; line-height: 1.55; }
.mcard p b { color: var(--ink); }

.caveat { background: var(--warnbg); color: var(--warnink); border-radius: 8px; padding: 18px 24px; margin: 24px 0; font-size: 15px; }
.caveat b { font-weight: 700; }
.caveat ul { margin: 8px 0 0; padding-left: 20px; }
.caveat li { margin-bottom: 6px; }

/* ---------- How-it-works: seats, game board ---------- */
.seat { font-family: var(--sans); font-size: 12px; font-weight: 700; letter-spacing: 0.05em; padding: 2px 9px 3px; border-radius: 3px; color: #fff; white-space: nowrap; }
.seat.prc { background: var(--prc); }
.seat.roc { background: var(--roc); }
.seat.usa { background: var(--usa); }
.seatline { display: flex; flex-wrap: wrap; gap: 10px 22px; margin: 18px 0 6px; font-size: 15.5px; align-items: center; }
.seatline .who { display: flex; gap: 9px; align-items: baseline; }
.seatline .who i { font-style: normal; color: var(--ink2); }

.boardscroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 6px; background: var(--card); padding: 20px 20px 16px; }
.gameboard { display: grid; grid-template-columns: 118px repeat(26, minmax(27px, 1fr)); gap: 4px; min-width: 940px; }
.gameboard .rowlab { font-family: var(--sans); font-size: 11.5px; font-weight: 600; letter-spacing: 0.04em; color: var(--ink2); align-self: center; padding-right: 8px; white-space: nowrap; }
.phasebar { font-family: var(--sans); font-size: 10.5px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink2); border-bottom: 2px solid var(--line); padding: 0 2px 5px; margin-bottom: 4px; white-space: nowrap; overflow: hidden; }
.cell { height: 27px; border-radius: 4px; position: relative; background: var(--linesoft); }
.cell.land.prc-c { background: var(--prc); }
.cell.land.roc-c { background: var(--roc); }
.cell.land.usa-c { background: var(--usa); }
.cell.stand.prc-c { box-shadow: inset 0 0 0 2px var(--prc); background: transparent; }
.cell.stand.roc-c { box-shadow: inset 0 0 0 2px var(--roc); background: transparent; }
.cell.stand.usa-c { box-shadow: inset 0 0 0 2px var(--usa); background: transparent; }
.cell.final::after { content: "★"; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 12px; }
.qlab { font-family: var(--mono); font-size: 9.5px; color: var(--ink3); text-align: center; padding-top: 4px; font-variant-numeric: tabular-nums; }
.boardkey { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 16px; font-family: var(--sans); font-size: 12.5px; color: var(--ink2); align-items: center; }
.k { display: inline-flex; align-items: center; gap: 7px; }
.k .sw { width: 15px; height: 15px; }
.k .sw.fill { background: var(--ink3); }
.k .sw.ring { box-shadow: inset 0 0 0 2px var(--ink3); }
.calnotes { margin-top: 14px; font-size: 14px; color: var(--ink2); }
.calnotes b { font-weight: 650; color: var(--ink); }

/* ---------- How-it-works: pregame flow ---------- */
.flow { display: flex; flex-direction: column; gap: 0; counter-reset: step; margin: 26px 0 8px; }
.step { display: grid; grid-template-columns: 52px 1fr; gap: 0 20px; position: relative; padding-bottom: 30px; }
.step::before {
  counter-increment: step; content: counter(step);
  width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--ink);
  display: grid; place-items: center; font-family: var(--sans); font-weight: 700; font-size: 15px;
  background: var(--card); z-index: 1; justify-self: center;
}
.step::after { content: ""; position: absolute; left: 25px; top: 34px; bottom: 0; width: 2px; background: var(--line); }
.step:last-child::after { display: none; }
.stepbody { padding-top: 3px; }
.steptitle { font-weight: 650; font-size: 18px; margin: 0 0 4px; }
.steptitle .mono { font-size: 0.72em; vertical-align: 1px; }
.stepbody p { font-size: 15.5px; color: var(--ink2); margin-bottom: 8px; }
.withheld { display: inline-block; font-family: var(--sans); font-size: 11.5px; font-weight: 600; letter-spacing: 0.05em; background: var(--warnbg); color: var(--warnink); border-radius: 3px; padding: 3px 9px; margin: 2px 8px 2px 0; }
.stepseats { margin: 8px 0 2px; display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- How-it-works: functionals ---------- */
.fncard { background: var(--card); border: 1px solid var(--line); border-radius: 8px; margin: 26px 0; overflow: hidden; }
.fnhead { padding: 18px 26px 14px; border-bottom: 1px solid var(--linesoft); display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.fnhead h3 { margin: 0; font-size: 21px; }
.fnhead .plain { font-size: 15px; color: var(--ink2); font-style: italic; }
.fnbar { height: 4px; }
.fnbar.prc-b { background: var(--prc); } .fnbar.roc-b { background: var(--roc); } .fnbar.usa-b { background: var(--usa); }
.eqscroll { overflow-x: auto; padding: 26px 26px 20px; }
.eq { font-family: var(--serif); font-size: 20px; white-space: nowrap; line-height: 2.1; letter-spacing: 0.01em; }
.eq i { font-style: italic; }
.eq sub, .eq sup { font-size: 0.62em; }
.eq .op { padding: 0 0.35em; color: var(--ink2); }
.eq.sub-eq { font-size: 17px; color: var(--ink2); }
.term { position: relative; padding: 3px 6px 4px; border-radius: 5px; }
.term .tn { position: absolute; top: -13px; left: 50%; transform: translateX(-50%); font-family: var(--sans); font-size: 10.5px; font-weight: 700; color: #fff; width: 17px; height: 17px; border-radius: 50%; display: grid; place-items: center; }
.prc-t .tn { background: var(--prc); } .roc-t .tn { background: var(--roc); } .usa-t .tn { background: var(--usa); }
.prc-t { background: color-mix(in srgb, var(--prc) 9%, transparent); }
.roc-t { background: color-mix(in srgb, var(--roc) 9%, transparent); }
.usa-t { background: color-mix(in srgb, var(--usa) 9%, transparent); }
.termlist { list-style: none; margin: 0; padding: 4px 26px 22px; }
.termlist li { display: grid; grid-template-columns: 26px 1fr; gap: 12px; padding: 9px 0; border-top: 1px solid var(--linesoft); font-size: 15.5px; }
.termlist li:first-child { border-top: none; }
.termlist .tn2 { font-family: var(--sans); font-size: 10.5px; font-weight: 700; color: #fff; width: 17px; height: 17px; border-radius: 50%; display: grid; place-items: center; margin-top: 3px; }
.prc-n { background: var(--prc); } .roc-n { background: var(--roc); } .usa-n { background: var(--usa); }
.termlist b { font-weight: 650; }
.termlist p { margin: 2px 0 0; color: var(--ink2); font-size: 15px; }

/* model-determined slot marker — visible dashed underline, both in prose AND inside equations */
.md {
  border-bottom: 2px dashed var(--accent);
  padding-bottom: 1px;
  cursor: help;
}
.eq .md { border-bottom-width: 2px; }
.slotbox { background: var(--warnbg); color: var(--warnink); border-radius: 6px; padding: 16px 22px; margin: 22px 0; font-size: 15.5px; }
.slotbox b { font-weight: 700; }
.slotbox .md { border-bottom-color: var(--warnink); }

/* ---------- How-it-works: turn loop ---------- */
.loopband { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 24px; margin: 24px 0; }
.looprow { display: flex; gap: 0; align-items: stretch; overflow-x: auto; padding-bottom: 6px; }
.loopcard { flex: 1 1 0; min-width: 168px; border: 1px solid var(--line); border-radius: 6px; padding: 14px 16px; background: var(--paper); }
.looparrow { align-self: center; padding: 0 10px; color: var(--ink3); font-size: 20px; flex: 0 0 auto; }
.loopcard h4 { margin: 0 0 6px; font-family: var(--sans); font-size: 12px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--ink2); }
.loopcard p { margin: 0; font-size: 14px; color: var(--ink2); line-height: 1.5; }
.loopcard .mono { font-size: 12px; }

.vistable { width: 100%; border-collapse: collapse; margin: 20px 0 8px; font-size: 15px; }
.vistable th { font-family: var(--sans); font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink3); text-align: left; padding: 8px 14px; border-bottom: 2px solid var(--line); }
.vistable td { padding: 9px 14px; border-bottom: 1px solid var(--linesoft); vertical-align: top; }
.vistable td:first-child { font-weight: 650; white-space: nowrap; }
.pub { color: var(--roc); font-weight: 700; font-family: var(--sans); font-size: 12px; letter-spacing: 0.04em; }
.priv { color: var(--prc); font-weight: 700; font-family: var(--sans); font-size: 12px; letter-spacing: 0.04em; }

/* ---------- How-it-works: crisis subtrees & terminals ---------- */
.crisisgrid { display: grid; gap: 12px; margin: 22px 0; }
.crisisrow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 12px 16px; }
.crname { font-family: var(--sans); font-size: 12.5px; font-weight: 700; width: 218px; flex: 0 0 auto; }
.crname small { display: block; font-weight: 500; color: var(--ink3); letter-spacing: 0.02em; }
.crnode { font-family: var(--mono); font-size: 12.5px; font-weight: 600; color: #fff; border-radius: 4px; padding: 4px 9px; white-space: nowrap; }
.crarrow { color: var(--ink3); }
.crwhy { font-size: 13.5px; color: var(--ink2); flex: 1 1 240px; }

.termgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 14px; margin: 22px 0; }
.termcard { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 15px 18px 13px; }
.termcard h4 { margin: 0 0 5px; font-size: 16.5px; font-weight: 650; }
.termcard .tid { font-family: var(--mono); font-size: 11px; color: var(--ink3); display: block; margin-bottom: 7px; }
.termcard p { margin: 0; font-size: 14px; color: var(--ink2); line-height: 1.5; }
.sev { font-family: var(--sans); font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; float: right; margin-top: 2px; }
.sev.calm { color: var(--roc); } .sev.mid { color: var(--warnink); } .sev.hot { color: var(--prc); }

/* ---------- How-it-works: worked examples ---------- */
.example { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: 6px; padding: 20px 24px 16px; margin: 20px 0; }
.example.ex-roc { border-left-color: var(--roc); }
.example.ex-prc { border-left-color: var(--prc); }
.example.ex-usa { border-left-color: var(--usa); }
.exhead { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.exhead .mono { font-size: 12.5px; }
.exhead b { font-size: 17px; font-weight: 650; }
.exlabel { font-family: var(--sans); font-size: 11px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink3); margin: 12px 0 3px; }
.example p { font-size: 15px; margin: 0 0 6px; color: var(--ink2); }
.example .chosen { color: var(--ink); font-weight: 650; }
blockquote { margin: 0; padding: 2px 0 2px 16px; border-left: 2px solid var(--line); font-size: 14.5px; color: var(--ink2); font-style: italic; }
.pathstrip { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 16px 0 6px; font-family: var(--mono); font-size: 13px; }
.pathstep { background: var(--linesoft); border-radius: 4px; padding: 5px 10px; white-space: nowrap; }
.pathstep.final-p { background: var(--roc); color: #fff; font-weight: 700; }

/* ---------- How-it-works: endgame ---------- */
.tiers { display: grid; gap: 10px; margin: 22px 0; }
.tier { display: grid; grid-template-columns: 92px 1fr; background: var(--card); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.tier .tno { display: grid; place-items: center; font-family: var(--sans); font-weight: 800; font-size: 15px; background: var(--linesoft); color: var(--ink2); padding: 12px 8px; text-align: center; line-height: 1.25; }
.tier .tno small { font-weight: 600; font-size: 10px; letter-spacing: 0.07em; text-transform: uppercase; display: block; }
.tier .tbody { padding: 12px 18px; font-size: 15px; color: var(--ink2); }
.tier .tbody b { color: var(--ink); font-weight: 650; }
.passes { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin: 24px 0; }
.pass { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 18px 22px; }
.pass h4 { margin: 0 0 4px; font-size: 17px; font-weight: 650; }
.pass .sub { font-family: var(--sans); font-size: 12px; color: var(--ink3); letter-spacing: 0.04em; margin-bottom: 12px; }
.pass ol { margin: 0; padding-left: 20px; font-size: 14.5px; color: var(--ink2); }
.pass ol li { margin-bottom: 7px; }
.pass ol li b { color: var(--ink); font-weight: 650; }

.variant { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin: 24px 0; }
.vcard { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 18px 22px; font-size: 15px; }
.vcard h4 { margin: 0 0 8px; font-size: 16.5px; }
.vcard p, .vcard ul { color: var(--ink2); margin: 0 0 8px; }
.vcard ul { padding-left: 18px; }

/* ---------- Pitch components ---------- */
.bignum-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; margin: 24px 0; }
.bignum { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 20px 22px 16px; }
.bignum b { display: block; font-size: clamp(30px, 3.6vw, 40px); font-weight: 600; letter-spacing: -0.01em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.bignum .u { font-family: var(--sans); font-size: 12px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--ink2); display: block; margin-top: 8px; }
.bignum p { margin: 8px 0 0; font-size: 13px; color: var(--ink3); line-height: 1.5; }
.bignum p a { color: inherit; }
.asklist { list-style: none; margin: 20px 0; padding: 0; display: grid; gap: 12px; }
.asklist li { display: grid; grid-template-columns: 44px 1fr; gap: 16px; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 16px 20px; align-items: start; }
.asklist .ico { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--accent); color: var(--accent); display: grid; place-items: center; font-family: var(--sans); font-weight: 800; font-size: 15px; margin-top: 2px; }
.asklist b { font-weight: 650; }
.asklist p { margin: 3px 0 0; font-size: 14.5px; color: var(--ink2); }
.srcnote { font-family: var(--sans); font-size: 12px; color: var(--ink3); }
.srcnote a { color: inherit; }

/* ---------- Auto-advance pill (site.js) ---------- */
.nextpill {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%) translateY(90px);
  display: inline-flex; align-items: center; overflow: hidden;
  background: var(--card); border: 1px solid var(--line); border-radius: 999px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.14); padding: 10px 20px;
  font-family: var(--sans); font-size: 13px; color: var(--ink2);
  text-decoration: none; z-index: 60;
  opacity: 0; transition: transform 0.25s ease, opacity 0.25s ease;
  pointer-events: none;
}
.nextpill.show { transform: translateX(-50%) translateY(0); opacity: 1; pointer-events: auto; }
.nextpill .npfill {
  position: absolute; left: 0; top: 0; bottom: 0; width: 0;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
}
.nextpill .nptext { position: relative; white-space: nowrap; }
.nextpill .nptext b { color: var(--ink); font-weight: 700; }
.nextpill.armed { border-color: var(--accent); }
.nextpill.go .npfill { background: color-mix(in srgb, var(--accent) 34%, transparent); }

@media (max-width: 640px) {
  body { font-size: 16px; }
  .runstrip { grid-template-columns: 110px 1fr 80px; }
  .bargroup { grid-template-columns: 96px 1fr; }
  .crname { width: auto; }
  .tier { grid-template-columns: 70px 1fr; }
  .sitebar { justify-content: center; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
