/* Kingsgate Navigator brand foundation, 24 October 2026 (the owner's approved Claude Design boards, stage 2).
   One set of tokens from the Kingsgate brand book replaces the colours, faces and sizes of the older stylesheets.
   Dark is the primary mode: the ground is the near-black of kingsgateinstitute.org, Kingsgate Blue is kept for the top
   bar and solid blocks, and yellow marks only the next step and the current item. Light mode is the brand book on white.
   Loaded after every older stylesheet, so its token rules win. */

/* The brand faces, served from our own site (owner, 23 Oct 2026: "use Lexend, DM Sans and DM Mono"). All three are under the
   SIL Open Font License 1.1; the licence texts sit beside the files in /fonts/kingsgate/. Each face comes in two files: the
   basic Latin set, and the extended set that carries the naira sign (U+20A6), loaded only when a page uses one of its characters. */
@font-face { font-family: "Lexend"; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url("/fonts/kingsgate/lexend-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Lexend"; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url("/fonts/kingsgate/lexend-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "DM Sans"; font-style: normal; font-weight: 300 600; font-display: swap;
  src: url("/fonts/kingsgate/dm-sans-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "DM Sans"; font-style: normal; font-weight: 300 600; font-display: swap;
  src: url("/fonts/kingsgate/dm-sans-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "DM Sans"; font-style: italic; font-weight: 400; font-display: swap;
  src: url("/fonts/kingsgate/dm-sans-italic-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "DM Sans"; font-style: italic; font-weight: 400; font-display: swap;
  src: url("/fonts/kingsgate/dm-sans-italic-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "DM Mono"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/fonts/kingsgate/dm-mono-400-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "DM Mono"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/fonts/kingsgate/dm-mono-400-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "DM Mono"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("/fonts/kingsgate/dm-mono-500-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "DM Mono"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("/fonts/kingsgate/dm-mono-500-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root,
/* 29 Oct 2026 · round 22 colour roles (board 22a): each brand colour has one job. Kingsgate Blue frames and heads; ink
   carries body text and emphasis; yellow marks decisions; Sky and Dodger Blue carry data; Golden Brown warns; grey labels. */
html[data-theme="dark"] {
  /* Brand palette (brand book p16) */
  --kg-blue: #000072;
  --kg-yellow: #FFD900;
  --kg-black: #444444;
  --kg-soft-white: #F5F5F5;
  --kg-golden-brown: #AF8500;
  --kg-dodger-blue: #24A5ED;
  --kg-sky-blue: #5AC2E2;

  /* Faces. Lexend stands in for Stolzl (owner, 23 Oct 2026); DM Sans and DM Mono are the brand's text and figure faces. */
  --kg-font-heading: "Lexend", "Segoe UI", system-ui, sans-serif;
  --kg-font-body: "DM Sans", "Segoe UI", system-ui, sans-serif;
  --kg-font-figures: "DM Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  /* The type scale: seven sizes, nothing below 14px (component sheet 2a) */
  --kg-size-title: 48px;     /* page title */
  --kg-size-section: 28px;   /* section heading, key figure */
  --kg-size-next: 22px;      /* next-step title, phone h2 */
  --kg-size-lead: 20px;      /* Key takeaways, block headings */
  --kg-size-body: 17px;      /* body, table rows, chart titles */
  --kg-size-ui: 15px;        /* interface, navigation, states, buttons, strip values */
  --kg-size-small: 14px;     /* dates, sources, keys, table headers, chart labels */

  /* Colour jobs, dark (primary) */
  --kg-ground: #0E0E0E;
  --kg-ground-soft: #171717;   /* current navigation row, highlighted table row */
  --kg-text: #F5F5F5;
  --kg-text-muted: #A8A8A8;    /* small print; 8:1 on the ground */
  --kg-heading: #FFFFFF;
  --kg-link: #5AC2E2;
  --kg-rule: rgba(255, 255, 255, 0.16);
  --kg-rule-strong: #F5F5F5;
  --kg-accent: #FFD900;        /* the next step and the current item only */
  --kg-on-accent: #000072;
  --kg-brand-block: #000072;   /* the top bar and solid blocks only */
  --kg-on-brand-block: #FFFFFF;
  --kg-on-brand-muted: #B8BCE0;
  --kg-state-partly: #F5F5F5;   /* round 22 */
  --kg-warning: #D4A72C;   /* round 22 */
  --kg-on-brand-figure: #5AC2E2;   /* round 22 */
  --kg-accent-edge: #FFD900;   /* round 22 */

  /* Data series, in fixed order */
  --kg-data-1: #5AC2E2;
  --kg-data-2: #1478B8;
  --kg-data-3: #A8A8A8;
  --kg-data-4: var(--kg-data-3);
  --kg-data-band: rgba(90, 194, 226, 0.28);

  /* The assessment states (one shape each, so they read in greyscale) */
  --kg-state-on-track: #F5F5F5;
  --kg-state-off-track: #D4A72C;
  --kg-state-watching: #D4A72C;
  --kg-state-missing: #F5F5F5;
  --kg-state-disputed: #F5F5F5;

  color-scheme: dark;
}

html[data-theme="light"] {
  --kg-ground: #FFFFFF;
  --kg-ground-soft: #F5F5F5;
  --kg-text: #262626;
  --kg-text-muted: #6B6B6B;    /* 5.3:1 on white */
  --kg-heading: #000072;
  --kg-link: #0A5A8E;
  --kg-rule: #DADADA;
  --kg-rule-strong: #262626;
  --kg-accent: #FFD900;
  --kg-on-accent: #000072;
  --kg-brand-block: #000072;
  --kg-on-brand-block: #FFFFFF;
  --kg-on-brand-muted: #B8BCE0;
  --kg-state-partly: #262626;   /* round 22 */
  --kg-warning: #AF8500;   /* round 22 */
  --kg-on-brand-figure: #5AC2E2;   /* round 22 */
  --kg-accent-edge: #262626;   /* round 22 */

  --kg-data-1: #000072;
  --kg-data-2: #1F86A6;
  --kg-data-3: #6B6B6B;
  --kg-data-4: var(--kg-data-3);
  --kg-data-band: rgba(90, 194, 226, 0.28);

  --kg-state-on-track: #262626;
  --kg-state-off-track: #AF8500;
  --kg-state-watching: #AF8500;
  --kg-state-missing: #262626;
  --kg-state-disputed: #262626;

  color-scheme: light;
}

/* The older stylesheets read their own variable names. Point every one of them at a brand token, so pages not yet rebuilt
   on a board template take the brand ground, text and rules. The evidence colours keep their jobs, in brand values:
   confirmation reads in the On-track blue, deterioration in the alert colour, a watch condition in the lifted golden
   brown, unavailable in the muted grey. */
:root,
html[data-theme="dark"],
html[data-theme="light"] {
  --bg: var(--kg-ground);
  --panel: var(--kg-ground);
  --panel2: var(--kg-ground-soft);
  --panel3: var(--kg-ground-soft);
  --panel-hover: var(--kg-ground-soft);
  --hover-fill: var(--kg-ground-soft);
  --kpi-bg: var(--kg-ground);
  --reading-bg: var(--kg-ground-soft);
  --reading-ink: var(--kg-text);
  --line: var(--kg-rule);
  --line2: var(--kg-rule);
  --txt: var(--kg-text);
  --ink: var(--kg-heading);
  --ink-body: var(--kg-text);
  --ink2: var(--kg-text-muted);
  --dim: var(--kg-text-muted);
  --title: var(--kg-heading);
  --surface-ink: var(--kg-heading);
  --link: var(--kg-link);
  --navy: var(--kg-brand-block);
  --acc: var(--kg-link);
  --acc2: var(--kg-link);
  --blue: var(--kg-data-1);
  --kg-sky: var(--kg-link);
  --kg-gold: var(--kg-golden-brown);
  --kg-dodger: var(--kg-dodger-blue);
  --kg-soft: var(--kg-soft-white);
  --green: var(--kg-state-on-track);
  --red: var(--kg-state-off-track);
  --gold: var(--kg-state-disputed);
  --grey: var(--kg-text-muted);
  --state-observed: var(--kg-data-1);
  --state-observed-improving: var(--kg-state-on-track);
  --state-observed-watch: var(--kg-state-disputed);
  --state-partly-observed: var(--kg-text);
  --state-unavailable: var(--kg-text-muted);
  --state-model: var(--kg-text-muted);
  --state-analyst: var(--kg-text-muted);
  --state-contested: var(--kg-state-disputed);
  --serif: var(--kg-font-heading);
  --ccf-observed: var(--kg-data-1);
  --font: 400 var(--kg-size-body)/1.55 var(--kg-font-body);
  --fs-kicker: var(--kg-size-small);
  --fs-micro: var(--kg-size-small);
  --fs-small: var(--kg-size-small);
  --fs-body: var(--kg-size-body);
  --track-kicker: 0;
  --track-label: 0;
  --r-sm: 0; --r-md: 0; --r-lg: 0; --r-pill: 0;
  --maxmain: 1440px;
  /* the two series the model explorer and the coalition layers compare (P1, stabilisation; P7, the household cushion) */
  --mx-p1: var(--kg-data-1); --mx-p7: var(--kg-data-3); --p1: var(--kg-data-1); --p7: var(--kg-data-3);
  --measure: min(34em, 100%);
  --measure-wide: min(36em, 100%);
}

/* The foundation (24 Oct 2026, redesign step 10). What every terminal page stands on, from the older base, layout and
   responsive sheets, which are gone: no default margins or padding, the reading measure, links, plain heading sizes for the
   older parts that set none, the skip link, the screen-reader class, reduced motion and print. Scoped to the terminal (the
   hosted page marks <html>; the standalone page marks <body>) through :where(), so the scope adds no weight: an element rule here
   weighs what an element rule weighs, enough to win over the app's own base layer (Tailwind's, which sets headings and links to
   inherit), and every class rule on a page wins over it. The site's own pages, which load this file too, are untouched. */
:where(html.nga-fable-active, body.kg-terminal) *, :where(html.nga-fable-active, body.kg-terminal) *::before, :where(html.nga-fable-active, body.kg-terminal) *::after { box-sizing: border-box; }
:where(html.nga-fable-active, body.kg-terminal) * { margin: 0; padding: 0; }
:where(html.nga-fable-active, body.kg-terminal) button, :where(html.nga-fable-active, body.kg-terminal) input, :where(html.nga-fable-active, body.kg-terminal) select, :where(html.nga-fable-active, body.kg-terminal) textarea { font: inherit; }
:where(html.nga-fable-active, body.kg-terminal) a { color: var(--kg-link); text-decoration: none; }
:where(html.nga-fable-active, body.kg-terminal) a:hover { text-decoration: underline; text-underline-offset: 3px; }
:where(html.nga-fable-active, body.kg-terminal) p { max-width: var(--measure); }
:where(html.nga-fable-active, body.kg-terminal) h1 { font-size: var(--kg-size-section); margin-bottom: 6px; }
:where(html.nga-fable-active, body.kg-terminal) h2 { font-size: var(--kg-size-lead); margin: 20px 0 8px; }
:where(html.nga-fable-active, body.kg-terminal) h3 { font-size: var(--kg-size-body); }
:where(html.nga-fable-active, body.kg-terminal) h4 { font-size: var(--kg-size-ui); }
:where(html.nga-fable-active, body.kg-terminal) code, :where(html.nga-fable-active, body.kg-terminal) kbd, :where(html.nga-fable-active, body.kg-terminal) samp { font-family: var(--kg-font-figures); }
:where(html.nga-fable-active, body.kg-terminal) :where(#main:focus, #main:focus-visible) { outline: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -9999px; top: 0; z-index: 200; padding: 10px 16px; background: var(--kg-accent); color: var(--kg-on-accent); font: 500 var(--kg-size-ui)/1.2 var(--kg-font-body); }
.skip:focus { left: 0; }
@media (prefers-reduced-motion: reduce) {
  :where(html.nga-fable-active, body.kg-terminal) *, :where(html.nga-fable-active, body.kg-terminal) *::before, :where(html.nga-fable-active, body.kg-terminal) *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media print {
  :where(html.nga-fable-active, body.kg-terminal) :where(.tabs, .btnrow) { display: none !important; }
  :where(html.nga-fable-active, body.kg-terminal) #main { padding: 0; max-width: 100%; }
}

/* Base: the brand ground, text and faces on the terminal. */
html.nga-fable-active,
html.nga-fable-active body {
  background: var(--kg-ground);
  color: var(--kg-text);
}
.nga-fable-root,
body.kg-terminal {
  font-family: var(--kg-font-body);
  font-size: var(--kg-size-body);
  line-height: 1.55;
  color: var(--kg-text);
  background: var(--kg-ground);
  -webkit-font-smoothing: antialiased;
}
.nga-fable-root h1, .nga-fable-root h2, .nga-fable-root h3, .nga-fable-root h4,
body.kg-terminal h1, body.kg-terminal h2, body.kg-terminal h3, body.kg-terminal h4 {
  font-family: var(--kg-font-heading);
  font-weight: 500;
  font-style: normal;
  color: var(--kg-heading);
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.nga-fable-root a, body.kg-terminal a { color: var(--kg-link); text-underline-offset: 3px; }
.nga-fable-root p, body.kg-terminal p { text-wrap: pretty; }

/* Figures in tables and tiles: equal-width digits. */
.kg-figures { font-family: var(--kg-font-figures); font-variant-numeric: tabular-nums; }

/* A solid block of brand colour. */
.kg-on-brand { background: var(--kg-brand-block); color: var(--kg-on-brand-block); }

/* ---------- One assessment framework (component sheet 2a) ----------
   Layer 1, one state per item: On track (filled circle), Off track (filled triangle), Watching (outlined square),
   Partly measured (half solid, half hatched), Record missing (hatched square), Disputed (square with a diagonal).
   Always paired with the word; colour is never the only cue. */
.kg-mark {
  display: inline-block;
  width: 12px;
  height: 12px;
  box-sizing: border-box;
  flex: 0 0 auto;
  vertical-align: -1px;
}
.kg-mark--on-track { background: var(--kg-state-on-track); border-radius: 50%; }
.kg-mark--off-track { background: var(--kg-state-off-track); clip-path: polygon(50% 2%, 100% 98%, 0 98%); }
.kg-mark--watching { border: 1.5px solid var(--kg-state-watching); }
.kg-mark--partly {
  border: 1px solid var(--kg-state-missing);
  background-image: linear-gradient(to right, var(--kg-state-missing) 0 50%, transparent 50%),
    repeating-linear-gradient(135deg, var(--kg-state-missing) 0 1px, transparent 1px 4px);
}
.kg-mark--missing {
  border: 1px solid var(--kg-state-missing);
  background-image: repeating-linear-gradient(135deg, var(--kg-state-missing) 0 1px, transparent 1px 4px);
}
.kg-mark--disputed {
  border: 1.5px solid var(--kg-state-disputed);
  background-image: linear-gradient(135deg, transparent calc(50% - 0.75px), var(--kg-state-disputed) calc(50% - 0.75px) calc(50% + 0.75px), transparent calc(50% + 0.75px));
}
.kg-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--kg-size-ui);
  font-weight: 500;
  color: var(--kg-text);
  white-space: nowrap;
}

/* Layer 2, one mark per figure: Measured (solid), Record missing (hatched), Reported, not checked (dotted). */
.kg-fill-measured { background: var(--kg-data-1); }
.kg-fill-missing {
  box-sizing: border-box;
  border: 1px solid var(--kg-state-missing);
  background-image: repeating-linear-gradient(135deg, var(--kg-state-missing) 0 1px, transparent 1px 5px);
}
.kg-fill-unchecked {
  box-sizing: border-box;
  border: 1px dotted var(--kg-text-muted);
  background-image: radial-gradient(var(--kg-text-muted) 1px, transparent 1.3px);
  background-size: 5px 5px;
}
.kg-fmark {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--kg-size-small);
  color: var(--kg-text-muted);
}
.kg-fmark > i { display: inline-block; width: 10px; height: 10px; flex: 0 0 auto; }

/* Layer 3, change since the last reading: in words only, never an arrow or a bare dash. */
.kg-change { font-size: var(--kg-size-ui); font-weight: 500; color: var(--kg-text); }

/* The one-line key, under the tests on every page that uses the states. */
.kg-key {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  align-items: center;
  font-size: var(--kg-size-small);
  color: var(--kg-text-muted);
}
.kg-key .kg-state { font-size: var(--kg-size-small); font-weight: 400; color: var(--kg-text); gap: 6px; }

/* Buttons: square corners, 44px. Yellow with Kingsgate Blue text for the next step only; a hairline outline otherwise. */
.kg-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid var(--kg-rule-strong);
  background: transparent;
  color: var(--kg-heading);
  font: 500 var(--kg-size-ui)/1.2 var(--kg-font-body);
  text-decoration: none;
  border-radius: 0;
  cursor: pointer;
}
.kg-btn:hover { background: var(--kg-ground-soft); }
.kg-btn--next {
  background: var(--kg-accent);
  border-color: var(--kg-accent);
  color: var(--kg-on-accent);
}
.kg-btn--next:hover { background: var(--kg-accent); filter: brightness(0.95); }
.nga-fable-root a.kg-btn, body.kg-terminal a.kg-btn { color: var(--kg-heading); }
.nga-fable-root a.kg-btn--next, body.kg-terminal a.kg-btn--next { color: var(--kg-on-accent); }

/* Focus: one visible ring everywhere. */
.nga-fable-root :focus-visible, body.kg-terminal :focus-visible {
  outline: 2px solid var(--kg-accent);
  outline-offset: 2px;
}

/* The dark view (the owner, 2 Nov 2026): light text on a dark ground reads heavier than dark on light, so the regular weight
   looked bold and what is medium (500) could not be told from it. The body text takes a lighter weight of the variable font in
   the dark view only; every label, heading and emphasis keeps its own weight, and the distance between them returns.
   DM Sans's faces above are declared 300 to 600 for this. */
html[data-theme="dark"] :is(.nga-fable-root, body.kg-terminal) { font-weight: 350; }
