/* ═══ Shared field-guide stylesheet ════════════════════════════════════════
   Lifted verbatim from public/cbat-guide.html so the international guides are
   the same document in a different hemisphere, not a lookalike. The UK guide
   keeps its own inline copy on purpose: it is pre-rendered at build time by
   scripts/prerender-cbat-guide.mjs and read by several tests as a single
   self-contained file, so pointing it at this stylesheet would couple a
   working, indexed page to a refactor it does not need.

   If you restyle one, restyle both. The blocks are byte-identical today.
   ══════════════════════════════════════════════════════════════════════════ */

/* ═══ CBAT field guide, editorial print-manual styling ═════════════════════
   Design brief: this is a document people read for twenty minutes at a stretch
   and then scan repeatedly for one fact. So it is built like a printed manual,
   not like an app: warm paper, a real reading measure, and a hard split between
   the CLAIM (sans, tight, coloured by confidence) and the REASONING (serif,
   generous, near-black). That contrast is what makes 151 findings skimmable.

   Legibility rules held throughout:
     · body copy never exceeds ~68 characters a line
     · every text colour clears 4.5:1 on its own background, small text 7:1
     · confidence is carried by THREE channels: colour, a left rule and a
       worded chip, so it survives colour-blindness and greyscale printing
     · nothing meaningful is below 13px
   ══════════════════════════════════════════════════════════════════════════ */

:root{
  /* Paper */
  --paper:#faf8f4; --surface:#fff; --surface2:#f3f0e9;
  --line:#e4dfd4; --line-2:#cfc8b9;

  /* Ink. Warm near-black; ink2 is the prose grey, ink3 the label grey. */
  --ink:#1b1a17; --ink2:#46433c; --ink3:#6d675c;

  /* Accent: deep ink navy. Reads as printed, not as a UI chrome blue. */
  --brand:#1d3f76; --brand-dim:#5c7aa8; --brand-wash:#eef2f8;

  /* Confidence. Chosen dark enough to be READ as text, unlike the usual
     traffic-light set. These sit on white at 5:1 or better. */
  --good:#2f6b3f; --good-ink:#245730; --good-bg:#eef4ee;
  --warn:#8a6300; --warn-ink:#6f4f00; --warn-bg:#f8f2e2;
  --crit:#9e2b25; --crit-ink:#87241f; --crit-bg:#f9edec;
  --grey-ink:#5f594e; --grey-bg:#f1efea;

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

  --measure:68ch;
  --lift:0 1px 2px rgba(40,32,16,.05), 0 1px 0 rgba(40,32,16,.03);
  --lift-2:0 6px 22px -10px rgba(40,32,16,.28), 0 1px 2px rgba(40,32,16,.06);
}

/* Reading at night. Same tokens, warm dark paper, and every rule below inherits
   it, so the two themes cannot drift apart. */
/* Night reading. Deliberately a WARM charcoal, ink on dimmed paper, rather
   than the blue-black an app would use, so the manual keeps its identity at
   2am instead of turning back into a dashboard. */
@media (prefers-color-scheme:dark){
  :root{
    --paper:#17150f; --surface:#201d16; --surface2:#28241c;
    --line:#3a352b; --line-2:#514a3c;
    --ink:#f0eade; --ink2:#c2b9a7; --ink3:#948b79;
    --brand:#a9c6f0; --brand-dim:#6a7d9c; --brand-wash:#1e2230;
    --good:#6fb87f; --good-ink:#96d3a3; --good-bg:#1b261c;
    --warn:#dcae4d; --warn-ink:#eec773; --warn-bg:#2b2415;
    --crit:#e0736a; --crit-ink:#f5a096; --crit-bg:#2c1c19;
    --grey-ink:#ada494; --grey-bg:#272319;
    --lift:0 1px 2px rgba(0,0,0,.45);
    --lift-2:0 6px 22px -10px rgba(0,0,0,.75), 0 1px 0 rgba(255,255,255,.045) inset;
  }
}

*{box-sizing:border-box}
/* scroll-padding cleared the sticky search bar; with that gone an anchor jump
   only needs a little breathing room above the heading. */
html{scroll-behavior:smooth;scroll-padding-top:24px;-webkit-text-size-adjust:100%}
body{margin:0;background:var(--paper);color:var(--ink);
  font:17px/1.7 var(--serif);
  -webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;
  text-rendering:optimizeLegibility}
p,li{text-wrap:pretty}
h1,h2,h3,.h2sub,.testhead .tn,.tile .l{text-wrap:balance}
a{color:var(--brand);text-decoration:underline;text-decoration-thickness:1px;
  text-underline-offset:2px;text-decoration-color:var(--brand-dim)}
a:hover{text-decoration-color:currentColor}
::selection{background:#fde68a;color:#1b1a17}
@media (prefers-color-scheme:dark){::selection{background:#3c4a6b;color:#fff}}
:focus-visible{outline:2px solid var(--brand);outline-offset:3px;border-radius:3px}
.tile .n,.score,ol.key li::before,.tag{font-variant-numeric:tabular-nums}
*{scrollbar-width:thin;scrollbar-color:var(--line-2) transparent}
*::-webkit-scrollbar{width:12px;height:12px}
*::-webkit-scrollbar-track{background:transparent}
*::-webkit-scrollbar-thumb{background:var(--line-2);border-radius:99px;border:3px solid var(--paper)}

/* ── Masthead ───────────────────────────────────────────────────────────── */
.masthead{border-bottom:1px solid var(--line-2);background:var(--surface2)}
/* Two columns on wide screens: the standfirst reads at a proper measure on the
   left, the provenance note sits beside it as a set-off sidenote. Without this
   both stack in one narrow column and leave half the masthead empty. No markup
   change needed. The children are placed onto the grid by name. */
.masthead .wrap{max-width:1240px;margin:0 auto;padding:64px 32px 54px;
  display:grid;grid-template-columns:minmax(0,1.08fr) minmax(0,.92fr);gap:0 60px;align-items:start}
.masthead .kicker,.masthead h1{grid-column:1/-1}
/* Leading of 1.7, not 1. On a phone the kicker wraps onto a second line, and at
   a line-height of 1 the two lines sit right on top of one another: the link's
   underline lands in "updated for 2026". The extra leading has to clear the
   underline as well as the text, hence 1.7 rather than a nominal 1.2. */
.kicker{font:700 11.5px/1.7 var(--sans);letter-spacing:.2em;text-transform:uppercase;color:var(--brand)}
/* The way back to the site. A reader who arrived from Google has no history to
   go back to, so the masthead has to carry the link itself. Underlined because
   the whole kicker is already brand-coloured, so colour alone wouldn't read as a
   link here. */
.kicker a{color:inherit;text-decoration:none;border-bottom:1px solid color-mix(in srgb,var(--brand) 45%,transparent);
  padding-bottom:2px}
.kicker a:hover{border-bottom-color:var(--brand)}
h1{margin:.5em 0 .32em;font:600 clamp(38px,6vw,62px)/1.06 var(--serif);letter-spacing:-.02em;color:var(--ink)}
h1 span{color:var(--brand);font-style:italic}
.sub{grid-column:1;color:var(--ink2);max-width:56ch;font-size:19.5px;line-height:1.6;margin:0}
.byline{grid-column:2;margin:9px 0 0;padding:2px 0 2px 30px;
  border-left:2px solid var(--line-2);color:var(--ink3);font-size:15px;line-height:1.66;max-width:46ch}
@media (max-width:1024px){
  .masthead .wrap{grid-template-columns:1fr;gap:0}
  .sub,.byline{grid-column:1;max-width:62ch}
  .byline{margin-top:28px;padding:20px 0 0;border-left:0;border-top:2px solid var(--line-2)}
}

/* ── Shell + contents rail ──────────────────────────────────────────────── */
.shell{max-width:1240px;margin:0 auto;padding:0 32px 100px;display:grid;
  grid-template-columns:236px minmax(0,1fr);gap:56px;align-items:start}
nav.toc{position:sticky;top:24px;max-height:calc(100vh - 44px);overflow:auto;
  padding:34px 0 40px;font-family:var(--sans);border-right:1px solid var(--line);
  margin-right:-24px;padding-right:20px}
nav.toc h4{margin:22px 0 8px;font:700 10.5px/1 var(--sans);letter-spacing:.15em;
  text-transform:uppercase;color:var(--ink3)}
nav.toc a{display:block;padding:6px 10px 6px 13px;color:var(--ink2);font-size:13.5px;
  line-height:1.35;border-left:2px solid transparent;text-decoration:none;border-radius:0 5px 5px 0}
nav.toc a:hover{background:var(--surface2);color:var(--ink)}
nav.toc a.on{color:var(--brand);border-left-color:var(--brand);font-weight:650;background:var(--brand-wash)}
nav.toc a.sub{padding-left:24px;font-size:12.8px;color:var(--ink3)}
nav.toc a.sub.on{color:var(--brand)}
main{padding-top:38px;min-width:0}

/* ── Section headings ───────────────────────────────────────────────────── */
section{margin-bottom:72px;scroll-margin-top:84px}
h2{font:700 11.5px/1 var(--sans);letter-spacing:.19em;text-transform:uppercase;
  color:var(--brand);margin:0 0 10px}
h2+.h2sub{margin:0 0 26px;font:600 33px/1.18 var(--serif);letter-spacing:-.018em;color:var(--ink);
  padding-bottom:16px;border-bottom:2px solid var(--ink)}
h3{font:600 21px/1.3 var(--serif);margin:40px 0 12px;color:var(--ink)}
p.lead{color:var(--ink2);max-width:var(--measure);font-size:17px}
.note{border-left:3px solid var(--brand);background:var(--brand-wash);
  border-radius:0 8px 8px 0;padding:16px 20px;color:var(--ink2);font-size:15.5px;
  line-height:1.62;margin:22px 0;max-width:var(--measure)}
.note strong{color:var(--ink)}

/* ── Confidence chips ───────────────────────────────────────────────────── */
.chip{display:inline-flex;align-items:center;gap:6px;font:700 10.5px/1 var(--sans);
  letter-spacing:.09em;text-transform:uppercase;padding:4px 9px;border-radius:4px;
  border:1px solid;white-space:nowrap;flex:none}
.chip .dot{width:7px;height:7px;border-radius:2px;flex:none}
.c-green{color:var(--good-ink);background:var(--good-bg);border-color:color-mix(in srgb,var(--good) 34%,transparent)}
.c-green .dot{background:var(--good)}
.c-amber{color:var(--warn-ink);background:var(--warn-bg);border-color:color-mix(in srgb,var(--warn) 34%,transparent)}
.c-amber .dot{background:var(--warn)}
.c-red{color:var(--crit-ink);background:var(--crit-bg);border-color:color-mix(in srgb,var(--crit) 36%,transparent)}
.c-red .dot{background:var(--crit)}
.c-grey{color:var(--grey-ink);background:var(--grey-bg);border-color:var(--line-2)}
.c-grey .dot{background:var(--ink3)}
.pills{display:flex;flex-wrap:wrap;gap:8px;margin:16px 0 6px}

/* ── Findings ───────────────────────────────────────────────────────────── */
.facts{display:flex;flex-direction:column;gap:12px;margin-top:20px}
.item{background:var(--surface);border:1px solid var(--line);border-left:4px solid var(--ink3);
  border-radius:5px;padding:17px 21px;box-shadow:var(--lift);
  transition:box-shadow .16s ease,border-color .16s ease}
.item:hover{box-shadow:var(--lift-2);border-color:var(--line-2)}
.item.green{border-left-color:var(--good)}
.item.amber{border-left-color:var(--warn)}
.item.red{border-left-color:var(--crit)}
.item.grey{border-left-color:var(--ink3)}
/* The claim: sans, tight, coloured. Scans in one pass. */
.item .stmt{font:650 16px/1.48 var(--sans);letter-spacing:-.006em;max-width:var(--measure);color:var(--ink)}
.item.green .stmt{color:var(--good-ink)}
.item.amber .stmt{color:var(--warn-ink)}
.item.red   .stmt{color:var(--crit-ink)}
.item.grey  .stmt{color:var(--grey-ink)}
/* The reasoning: serif, generous, near-black. This is the part people read. */
.item .note2{margin-top:10px;color:var(--ink2);font:16px/1.66 var(--serif);max-width:var(--measure)}
.item .meta{margin-top:13px;display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.tag{font:600 10.5px/1 var(--sans);letter-spacing:.07em;text-transform:uppercase;
  padding:4px 8px;border-radius:4px;background:var(--surface2);color:var(--ink3);
  border:1px solid var(--line)}

/* ── Test headers ───────────────────────────────────────────────────────── */
.testhead{display:flex;flex-wrap:wrap;gap:12px;align-items:baseline;
  border-bottom:1px solid var(--line-2);padding-bottom:12px;margin-top:52px}
.testhead .tn{font:600 25px/1.2 var(--serif);letter-spacing:-.015em;color:var(--ink)}
.testhead .ta{font:700 12px/1 var(--mono);color:var(--brand);background:var(--brand-wash);
  padding:5px 9px;border-radius:4px;border:1px solid color-mix(in srgb,var(--brand) 26%,transparent)}
.aka{font:15px/1.5 var(--serif);font-style:italic;color:var(--ink3)}
.brief{border:1px solid var(--line);border-left:4px solid var(--brand-dim);background:var(--surface2);
  border-radius:0 6px 6px 0;padding:16px 20px;margin:18px 0 0;font:16px/1.68 var(--serif);
  color:var(--ink2);max-width:var(--measure)}
.brief .bh{display:block;font:700 10.5px/1 var(--sans);letter-spacing:.15em;text-transform:uppercase;
  color:var(--ink3);margin-bottom:9px}
.brief .bsrc{display:block;margin-top:11px;font:13px/1.5 var(--sans);color:var(--ink3)}

/* ── SkyWatch simulation beside the format panel ────────────────────────────
   The panel keeps its reading measure and the square sits beside it, so the
   two read as one row: this is the test, and this is our version of it. The
   column only splits when there is room for the panel to stay at a proper
   measure. Below that the square goes under it at full width rather than
   squeezing the prose into a gutter. */
.briefrow{display:grid;grid-template-columns:minmax(0,1fr) 272px;gap:0 26px;align-items:start}
.briefrow.nosim{display:block}
.briefcol{min-width:0}

/* The frame is given the full 640px viewport the game is laid out for, then
   scaled down as a whole, like a video, not like a shrunken web page.
   Sizing the iframe to the box instead would make the game's own viewport 272px
   wide, and every `vw`/`dvh` measurement inside it would answer 272: the games
   would lay themselves out for a phone and then be scaled again on top. --simw
   is unitless so it can drive both the box's size and the scale factor. */
.sim{--simw:272;--simstage:640;margin:18px 0 0;padding:0}
.simbox{position:relative;width:calc(var(--simw)*1px);height:calc(var(--simw)*1px);
  border:1px solid var(--line-2);border-radius:8px;overflow:hidden;
  background:#06101e;box-shadow:var(--lift-2)}
/* Scenery: it plays itself and must never take the caret or a scroll gesture
   away from the document. */
.simbox iframe{position:absolute;top:0;left:0;border:0;display:block;
  width:calc(var(--simstage)*1px);height:calc(var(--simstage)*1px);
  transform-origin:top left;transform:scale(calc(var(--simw)/var(--simstage)))}
.sim figcaption{margin-top:9px;font:13px/1.5 var(--sans);color:var(--ink3);
  max-width:calc(var(--simw)*1px)}
.sim figcaption strong{color:var(--ink2);font-weight:650}
@media (max-width:1180px){
  .briefrow{grid-template-columns:1fr;gap:0}
  .sim{--simw:340}
}

/* ── Lists ──────────────────────────────────────────────────────────────── */
ul.tight{margin:14px 0;padding-left:22px;color:var(--ink2);max-width:var(--measure)}
ul.tight li{margin:9px 0}
ul.tight li::marker{color:var(--brand-dim)}
ol.key{counter-reset:k;list-style:none;padding:0;margin:22px 0}
ol.key li{counter-increment:k;position:relative;padding:16px 20px 16px 62px;margin-bottom:10px;
  background:var(--surface);border:1px solid var(--line);border-radius:5px;color:var(--ink2);
  font:16px/1.62 var(--serif);box-shadow:var(--lift);max-width:calc(var(--measure) + 62px)}
ol.key li::before{content:counter(k);position:absolute;left:20px;top:16px;width:27px;height:27px;
  border-radius:4px;background:var(--brand);color:#fff;font:700 13px/27px var(--sans);
  text-align:center}
ol.key li strong{color:var(--ink);font-family:var(--sans);font-size:15px;font-weight:650}

/* ── Data displays ──────────────────────────────────────────────────────── */
.tiles{display:grid;grid-template-columns:repeat(auto-fit,minmax(158px,1fr));gap:14px;margin:24px 0}
.tile{background:var(--surface);border:1px solid var(--line);border-radius:6px;padding:20px;
  box-shadow:var(--lift)}
.tile .n{font:600 38px/1 var(--serif);letter-spacing:-.03em;color:var(--ink)}
.tile .n.acc{color:var(--brand)}
.tile .l{margin-top:9px;font:13px/1.42 var(--sans);color:var(--ink3)}

.tblwrap{overflow-x:auto;border:1px solid var(--line);border-radius:6px;background:var(--surface);
  box-shadow:var(--lift)}
table{border-collapse:collapse;width:100%;min-width:560px;font:15px/1.55 var(--serif)}
th{text-align:left;padding:13px 17px;font:700 10.5px/1 var(--sans);letter-spacing:.13em;
  text-transform:uppercase;color:var(--ink3);border-bottom:1px solid var(--line-2);
  white-space:nowrap;background:var(--surface2)}
td{padding:13px 17px;border-bottom:1px solid var(--line);vertical-align:top;color:var(--ink2)}
tbody tr:last-child td{border-bottom:none}
tbody tr:hover{background:var(--surface2)}
td strong{color:var(--ink)}

.stack{display:flex;height:28px;border-radius:5px;overflow:hidden;gap:2px;background:var(--surface2);margin-top:8px}
.stack i{display:block;height:100%;border-radius:2px}
.legend{display:flex;flex-wrap:wrap;gap:18px;margin-top:13px;font:13.5px var(--sans);color:var(--ink2)}
.legend span{display:inline-flex;align-items:center;gap:8px}
.legend b{width:11px;height:11px;border-radius:3px;display:inline-block}

.crit-row{display:grid;grid-template-columns:minmax(150px,1.15fr) 1fr auto;gap:16px;align-items:center;
  padding:12px 0;border-bottom:1px solid var(--line)}
.crit-row:last-child{border-bottom:none}
.crit-row .cn{font:650 15px/1.35 var(--sans);color:var(--ink)}
.crit-row .cn em{display:block;font-style:normal;font-size:12.5px;color:var(--ink3);font-weight:400;margin-top:3px}
.meter{height:8px;border-radius:4px;background:var(--surface2);overflow:hidden;border:1px solid var(--line)}
.meter i{display:block;height:100%;border-radius:4px;background:var(--brand)}
.score{font:700 14px var(--mono);color:var(--ink);white-space:nowrap}
.score small{color:var(--ink3);font-weight:400}

.btn{background:var(--surface);border:1px solid var(--line-2);color:var(--ink2);border-radius:6px;
  padding:10px 15px;font:600 14px var(--sans);cursor:pointer;box-shadow:var(--lift)}
.btn:hover{border-color:var(--brand);color:var(--brand)}

/* ── Utility + filtering ────────────────────────────────────────────────── */
.hidden{display:none !important}
body.filtering section{margin-bottom:38px}
body.filtering .testhead{margin-top:26px}
body.filtering h3{margin-top:22px}

footer{border-top:1px solid var(--line-2);padding:34px 32px 72px;color:var(--ink3);
  font:14px/1.65 var(--sans);background:var(--surface2)}
footer .wrap{max-width:76ch;margin:0 auto}

/* ── Narrow screens ─────────────────────────────────────────────────────── */
@media (max-width:960px){
  body{font-size:16.5px}
  .shell{grid-template-columns:1fr;gap:0;padding:0 20px 72px}
  .masthead .wrap{padding:44px 20px 36px}
  nav.toc{position:static;max-height:none;border-right:0;margin-right:0;padding:0 0 16px;
    border-bottom:1px solid var(--line)}
  nav.toc .tocbody{display:none}
  nav.toc.open .tocbody{display:block}
  .toctoggle{display:block;width:100%;text-align:left;margin-top:16px}
  main{padding-top:28px}
  h2+.h2sub{font-size:27px}
  .testhead .tn{font-size:22px}
  ol.key li{padding-left:56px}
  .crit-row{grid-template-columns:1fr;gap:8px}
  footer{padding:28px 20px 56px}
}
@media (min-width:961px){.toctoggle{display:none}}

/* ── Print. A guide people take to Cranwell. ────────────────────────────── */
@media print{
  :root{--paper:#fff;--surface:#fff;--surface2:#fff;--ink:#000;--ink2:#222;--ink3:#555;
    --line:#bbb;--line-2:#888;--brand:#000;--brand-wash:#fff;--lift:none;--lift-2:none}
  nav.toc,.toctoggle{display:none !important}
  .shell{display:block;padding:0;max-width:none}
  body{font-size:11pt;background:#fff}
  .masthead .wrap{padding:0 0 18pt}
  section{margin-bottom:24pt;page-break-inside:auto}
  .item,.tile,ol.key li,.brief,.note{page-break-inside:avoid;box-shadow:none}
  .testhead{page-break-after:avoid;page-break-inside:avoid}
  h2,h3,.h2sub{page-break-after:avoid}
  a{text-decoration:none;color:#000}
}
