/* FastTool site frame, 2026-11-06.
   Loaded on every page. Styles only the shell regions (#ft-header, #ft-crumbs, #ft-related,
   #ft-footer) and opt-in text pages (body.ft-page, .ft-prose, .ft-wrap). No unscoped element
   selectors: the only global rules are custom properties on :root, which never change how an
   existing page renders, one scroll-padding-bottom on :root that is 0 unless the cookie banner is
   open, the opt-in classes .ft-focusmark* and .ft-slot (reserved positions, placed by the rollout)
   and, for print only, #cookieConsent and [data-ft-print="hide"]. Shell rules are scoped by id so
   page CSS cannot leak into them.
   Custom properties other scripts keep on <html>: --ft-consent-h (height of the cookie banner in
   px, 0px while it is closed; /js/consent-20260806.js).
   Builder's manual: work/shell/STYLEGUIDE.md */

/* 1. Tokens ------------------------------------------------------------------------------ */
:root {
  --ft-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;
  --ft-font-mono: ui-monospace, "SF Mono", "Cascadia Mono", "Segoe UI Mono", "Roboto Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --ft-text-xs: 0.8125rem;
  --ft-text-sm: 0.875rem;
  --ft-text-md: 1rem;
  --ft-text-lg: 1.125rem;
  --ft-text-xl: 1.375rem;
  --ft-text-2xl: 1.75rem;
  --ft-text-h1: clamp(1.875rem, 1.4rem + 1.9vw, 2.625rem);
  --ft-leading: 1.55;
  --ft-leading-tight: 1.2;

  --ft-space-1: 0.25rem;
  --ft-space-2: 0.5rem;
  --ft-space-3: 0.75rem;
  --ft-space-4: 1rem;
  --ft-space-5: 1.5rem;
  --ft-space-6: 2rem;
  --ft-space-7: 3rem;
  --ft-space-8: 4rem;

  --ft-max: 75rem;
  --ft-measure: 70ch;
  --ft-gutter: clamp(1rem, 0.6rem + 1.6vw, 1.5rem);
  --ft-header-h: 4rem;
  --ft-crumbs-h: 2.75rem;
  --ft-target: 2.75rem;
  --ft-radius-s: 4px;
  --ft-radius: 6px;
  --ft-radius-l: 10px;

  /* Frame: header, breadcrumb band, related band, footer. Identical in both themes. */
  --ft-frame: #163a2e;
  --ft-frame-deep: #0f2b22;
  --ft-frame-mid: #1d4537;
  --ft-frame-line: rgba(220, 238, 226, 0.16);
  --ft-frame-ink: #f1f6f2;
  --ft-frame-ink-2: #b8cfc2;
  --ft-frame-accent: #cfe8a8;
  --ft-frame-focus: #f4cf6a;

  /* Paper (light theme) */
  --ft-bg: #f6f4ee;
  --ft-surface: #ffffff;
  --ft-surface-2: #efece4;
  --ft-ink: #1b2420;
  --ft-ink-2: #4d5953;
  --ft-ink-3: #646d68;
  --ft-line: #dcd7ca;
  --ft-line-strong: #8a8574;
  --ft-accent: #1b6a4e;
  --ft-accent-hover: #145a41;
  --ft-accent-ink: #ffffff;
  --ft-accent-soft: #e2efe6;
  --ft-link: #17603f;
  --ft-focus: #0b4a34;
  --ft-shadow: 0 1px 2px rgba(27, 36, 32, 0.06), 0 4px 16px rgba(27, 36, 32, 0.06);

  --ft-ok: #1d6b3f;
  --ft-ok-soft: #e3f1e6;
  --ft-warn: #7a4a00;
  --ft-warn-soft: #fbefd9;
  --ft-bad: #a3281d;
  --ft-bad-soft: #f9e3e0;
  --ft-info: #1f5a8a;
  --ft-info-soft: #e2edf6;

  /* Charts (read by /js/lib/ft-plot-20261106.mjs and FastToolShell.chartColors()).
     Series order is fixed; every series is >= 3:1 on --ft-plot-surface and passes the
     colour-vision checks for neighbouring series (first three: every pair). */
  --ft-plot-surface: #ffffff;
  --ft-plot-ink: #1b2420;
  --ft-plot-ink-2: #4d5953;
  --ft-plot-axis: #8a8574;
  --ft-plot-grid: #e6e2d8;
  --ft-plot-legend: rgba(255, 255, 255, 0.92);
  --ft-plot-error: #4d5953;
  --ft-plot-band: #2a78d6;
  --ft-plot-1: #2a78d6;
  --ft-plot-2: #eb6834;
  --ft-plot-3: #0ea282;
  --ft-plot-4: #c58501;
  --ft-plot-5: #d771a5;
  --ft-plot-6: #008300;
  --ft-plot-7: #6250d6;
  --ft-plot-8: #e34948;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ft-bg: #111814;
    --ft-surface: #18211c;
    --ft-surface-2: #1f2a24;
    --ft-ink: #e6ece8;
    --ft-ink-2: #a9b7af;
    --ft-ink-3: #8f9d95;
    --ft-line: #2c3832;
    --ft-line-strong: #6c7f75;
    --ft-accent: #7dd3a4;
    --ft-accent-hover: #9ce2bb;
    --ft-accent-ink: #0a1f15;
    --ft-accent-soft: #1a3327;
    --ft-link: #8fdcb2;
    --ft-focus: #a6e5c3;
    --ft-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.25);
    --ft-ok: #8fdcaa;
    --ft-ok-soft: #183526;
    --ft-warn: #f3c46b;
    --ft-warn-soft: #3a2d12;
    --ft-bad: #ffa59b;
    --ft-bad-soft: #3d1c19;
    --ft-info: #9ccbf3;
    --ft-info-soft: #172c3d;
    --ft-plot-surface: #18211c;
    --ft-plot-ink: #e6ece8;
    --ft-plot-ink-2: #a9b7af;
    --ft-plot-axis: #6c7f75;
    --ft-plot-grid: #2a3530;
    --ft-plot-legend: rgba(24, 33, 28, 0.92);
    --ft-plot-error: #a9b7af;
    --ft-plot-band: #3987e5;
    --ft-plot-1: #3987e5;
    --ft-plot-2: #d95926;
    --ft-plot-3: #199e70;
    --ft-plot-4: #c98500;
    --ft-plot-5: #d55181;
    --ft-plot-6: #008300;
    --ft-plot-7: #9085e9;
    --ft-plot-8: #e66767;
  }
}

:root[data-theme="dark"] {
  --ft-bg: #111814;
  --ft-surface: #18211c;
  --ft-surface-2: #1f2a24;
  --ft-ink: #e6ece8;
  --ft-ink-2: #a9b7af;
  --ft-ink-3: #8f9d95;
  --ft-line: #2c3832;
  --ft-line-strong: #6c7f75;
  --ft-accent: #7dd3a4;
  --ft-accent-hover: #9ce2bb;
  --ft-accent-ink: #0a1f15;
  --ft-accent-soft: #1a3327;
  --ft-link: #8fdcb2;
  --ft-focus: #a6e5c3;
  --ft-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.25);
  --ft-ok: #8fdcaa;
  --ft-ok-soft: #183526;
  --ft-warn: #f3c46b;
  --ft-warn-soft: #3a2d12;
  --ft-bad: #ffa59b;
  --ft-bad-soft: #3d1c19;
  --ft-info: #9ccbf3;
  --ft-info-soft: #172c3d;
  --ft-plot-surface: #18211c;
  --ft-plot-ink: #e6ece8;
  --ft-plot-ink-2: #a9b7af;
  --ft-plot-axis: #6c7f75;
  --ft-plot-grid: #2a3530;
  --ft-plot-legend: rgba(24, 33, 28, 0.92);
  --ft-plot-error: #a9b7af;
  --ft-plot-band: #3987e5;
  --ft-plot-1: #3987e5;
  --ft-plot-2: #d95926;
  --ft-plot-3: #199e70;
  --ft-plot-4: #c98500;
  --ft-plot-5: #d55181;
  --ft-plot-6: #008300;
  --ft-plot-7: #9085e9;
  --ft-plot-8: #e66767;
}

/* While the cookie banner is open, the consent script keeps its height in --ft-consent-h on <html> ("0px" when
   there is none). Scrolling an element into view (keyboard focus, in-page links) then stops above the banner
   instead of underneath it; with no banner this is 0 and nothing changes. */
:root { scroll-padding-bottom: calc(var(--ft-consent-h, 0px) * 1.25); }

/* 2. Isolation: shell regions ignore whatever the host page styles ------------------------ */
#ft-header, #ft-crumbs, #ft-related, #ft-footer {
  all: initial;
  display: block;
  box-sizing: border-box;
  width: 100%;
  max-width: none;
  min-width: 0;
  margin: 0;
  grid-column: 1 / -1;
  justify-self: stretch;
  align-self: auto;
  flex: none;
  font-family: var(--ft-font);
  font-size: var(--ft-text-md);
  font-weight: 400;
  line-height: var(--ft-leading);
  color: var(--ft-frame-ink);
  text-align: left;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
:is(#ft-header, #ft-crumbs, #ft-related, #ft-footer) *:not(svg *) {
  all: unset;
  box-sizing: border-box;
}
:is(#ft-header, #ft-crumbs, #ft-related, #ft-footer) :is(div, nav, ul, ol, li, p, h2, section) { display: block; }
:is(#ft-header, #ft-crumbs, #ft-related, #ft-footer) [hidden] { display: none !important; }
:is(#ft-header, #ft-crumbs, #ft-related, #ft-footer) svg:not(:root) { overflow: hidden; flex: none; }
#ft-legacy-hooks, #ft-legacy-hooks * { display: none !important; }
/* The old floating theme control is replaced by the header toggle (its click is still reused). */
#ftGlobalControls { display: none !important; }

/* Full-bleed frame inside padded legacy bodies: the band colour is painted past the box with a
   spread shadow (no layout or scroll effect), clipped to the band's own height. */
#ft-header { box-shadow: 0 0 0 100vmax var(--ft-frame); clip-path: inset(0 -100vmax); }
body > #ft-header:first-child { clip-path: inset(-100vmax -100vmax 0); }
#ft-crumbs { box-shadow: 0 0 0 100vmax var(--ft-frame-deep); clip-path: inset(0 -100vmax); }
#ft-related.ft-related--band { box-shadow: 0 0 0 100vmax var(--ft-frame-mid); clip-path: inset(0 -100vmax); }
#ft-footer { box-shadow: 0 0 0 100vmax var(--ft-frame); clip-path: inset(0 -100vmax -100vmax); }

/* Focus: always visible, never removed. */
:is(#ft-header, #ft-crumbs, #ft-related, #ft-footer) :is(a, button):focus-visible {
  outline: 3px solid var(--ft-frame-focus);
  outline-offset: 2px;
  border-radius: var(--ft-radius-s);
}
#ft-related:not(.ft-related--band) a:focus-visible { outline-color: var(--ft-focus); }

/* 3. Header -------------------------------------------------------------------------------- */
#ft-header {
  position: relative;
  z-index: 30;
  background: var(--ft-frame);
  color: var(--ft-frame-ink);
  align-self: start;
}
#ft-header .ft-skip {
  position: absolute;
  z-index: 2;
  left: var(--ft-gutter);
  top: -6rem;
  display: inline-flex;
  align-items: center;
  min-height: var(--ft-target);
  padding: 0 var(--ft-space-4);
  background: var(--ft-frame-focus);
  color: #10231b;
  font-weight: 650;
  font-size: var(--ft-text-sm);
  border-radius: var(--ft-radius);
  text-decoration: underline;
  cursor: pointer;
}
#ft-header .ft-skip:focus { top: var(--ft-space-2); outline: 3px solid #10231b; outline-offset: 0; }
#ft-header .ft-bar {
  display: flex;
  align-items: center;
  gap: var(--ft-space-4);
  max-width: var(--ft-max);
  height: var(--ft-header-h);
  margin: 0 auto;
  padding: 0 var(--ft-gutter);
}
:is(#ft-header, #ft-footer) .ft-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  min-height: var(--ft-target);
  padding-right: var(--ft-space-2);
  color: var(--ft-frame-ink);
  font-size: 1.1875rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
:is(#ft-header, #ft-footer) .ft-brand__mark { width: 1.75rem; height: 1.75rem; display: block; }
:is(#ft-header, #ft-footer) .ft-brand__mark-bg { fill: var(--ft-frame-accent); }
:is(#ft-header, #ft-footer) .ft-brand__mark-fg { fill: var(--ft-frame); }
#ft-header .ft-nav { display: block; margin-left: auto; }
#ft-header .ft-nav__list { display: flex; align-items: center; gap: var(--ft-space-1); list-style: none; }
#ft-header .ft-nav__item { display: block; }
#ft-header .ft-nav__link {
  display: inline-flex;
  align-items: center;
  min-height: var(--ft-target);
  padding: 0 var(--ft-space-3);
  border-radius: var(--ft-radius);
  color: var(--ft-frame-ink-2);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
#ft-header .ft-nav__link:hover { color: var(--ft-frame-ink); background: var(--ft-frame-mid); }
#ft-header .ft-nav__link[aria-current] {
  color: var(--ft-frame-ink);
  text-decoration: underline;
  text-decoration-color: var(--ft-frame-accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.45em;
}
#ft-header .ft-actions { display: flex; align-items: center; gap: var(--ft-space-2); flex: none; }
/* Buttons carry !important because several old page stylesheets restyle every <button> with it. */
#ft-header .ft-iconbtn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: var(--ft-space-2) !important;
  flex: none !important;
  box-sizing: border-box !important;
  width: auto !important;
  min-width: var(--ft-target) !important;
  height: var(--ft-target) !important;
  min-height: var(--ft-target) !important;
  margin: 0 !important;
  padding: 0 0.625rem !important;
  border: 1px solid var(--ft-frame-line) !important;
  border-radius: var(--ft-radius) !important;
  background: transparent !important;
  color: var(--ft-frame-ink) !important;
  box-shadow: none !important;
  transform: none !important;
  text-shadow: none !important;
  text-decoration: none !important;
  opacity: 1 !important;
  filter: none !important;
  font-family: var(--ft-font) !important;
  font-size: var(--ft-text-sm) !important;
  font-weight: 600 !important;
  line-height: 1 !important;
  cursor: pointer !important;
}
#ft-header .ft-iconbtn:hover { background: var(--ft-frame-mid) !important; }
#ft-header .ft-icon {
  display: block;
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* Icon = the theme you would switch to. Before the script runs it follows <html data-theme>;
   afterwards it follows aria-pressed (which also covers pages that theme <body>). */
#ft-header .ft-theme .ft-icon--sun { display: none; }
:root[data-theme="dark"] #ft-header .ft-theme:not([data-ft-synced]) .ft-icon--sun { display: block; }
:root[data-theme="dark"] #ft-header .ft-theme:not([data-ft-synced]) .ft-icon--moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) #ft-header .ft-theme:not([data-ft-synced]) .ft-icon--sun { display: block; }
  :root:not([data-theme]) #ft-header .ft-theme:not([data-ft-synced]) .ft-icon--moon { display: none; }
}
#ft-header .ft-theme[data-ft-synced][aria-pressed="true"] .ft-icon--sun { display: block; }
#ft-header .ft-theme[data-ft-synced][aria-pressed="true"] .ft-icon--moon { display: none; }
#ft-header[data-ft-theme="fixed"] .ft-theme { display: none !important; }
#ft-header .ft-menu { display: none !important; }

/* Narrow screens without popover support: the links wrap onto a second row (no script needed). */
@media (max-width: 40rem) {
  :root { --ft-header-h: 3.5rem; }
  #ft-header .ft-bar { flex-wrap: wrap; height: auto; min-height: var(--ft-header-h); column-gap: var(--ft-space-2); row-gap: 0; }
  #ft-header .ft-brand { min-height: var(--ft-header-h); font-size: 1.125rem; }
  #ft-header .ft-nav { order: 3; width: 100%; margin: 0 0 var(--ft-space-2); }
  #ft-header .ft-nav__list { flex-wrap: wrap; }
  #ft-header .ft-actions { margin-left: auto; }
}

/* Narrow screens with popover support: links live behind the Menu button. */
@supports selector(:popover-open) {
  @media (max-width: 40rem) {
    #ft-header .ft-bar { flex-wrap: nowrap; height: var(--ft-header-h); }
    #ft-header .ft-menu { display: inline-flex !important; }
    #ft-header .ft-nav { display: none; }
    #ft-header .ft-nav:popover-open {
      display: block;
      position: absolute;
      inset: var(--ft-header-h) 0 auto 0;
      width: auto;
      height: auto;
      max-height: calc(100vh - var(--ft-header-h));
      overflow: auto;
      margin: 0;
      padding: var(--ft-space-2) var(--ft-gutter) var(--ft-space-4);
      background: var(--ft-frame);
      border-top: 1px solid var(--ft-frame-line);
      box-shadow: 0 16px 32px rgba(5, 18, 13, 0.35);
      color: var(--ft-frame-ink);
      font-family: var(--ft-font);
    }
    #ft-header .ft-nav:popover-open .ft-nav__list { flex-direction: column; align-items: stretch; gap: 0; }
    #ft-header .ft-nav:popover-open .ft-nav__link { display: flex; min-height: 3rem; padding: 0 var(--ft-space-3); font-size: var(--ft-text-md); }
    #ft-header .ft-nav::backdrop { background: rgba(5, 18, 13, 0.35); }
  }
}
@media (min-width: 40.0625rem) {
  #ft-header .ft-nav[popover] { position: static; inset: auto; display: block; }
}

/* 4. Breadcrumb band ----------------------------------------------------------------------- */
#ft-crumbs {
  background: var(--ft-frame-deep);
  color: var(--ft-frame-ink-2);
  font-size: var(--ft-text-sm);
  align-self: start;
}
#ft-crumbs .ft-crumbs__list {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  max-width: var(--ft-max);
  height: var(--ft-crumbs-h);
  margin: 0 auto;
  padding: 0 var(--ft-gutter);
  list-style: none;
  overflow: hidden;
}
#ft-crumbs .ft-crumbs__item { display: flex; align-items: center; flex: none; min-width: 0; white-space: nowrap; }
#ft-crumbs .ft-crumbs__item:last-child { flex: 0 1 auto; overflow: hidden; }
#ft-crumbs .ft-crumbs__item + .ft-crumbs__item::before {
  content: "";
  display: block;
  flex: none;
  width: 0.375rem;
  height: 0.375rem;
  margin: 0 0.75rem 0 0.5rem;
  border-top: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
  transform: rotate(45deg);
  opacity: 0.7;
}
#ft-crumbs .ft-crumbs__link {
  display: inline-flex;
  align-items: center;
  min-height: var(--ft-crumbs-h);
  color: var(--ft-frame-ink-2);
  text-decoration: underline;
  text-decoration-color: rgba(184, 207, 194, 0.45);
  text-underline-offset: 0.25em;
  cursor: pointer;
}
#ft-crumbs .ft-crumbs__link:hover { color: var(--ft-frame-ink); text-decoration-color: currentColor; }
/* On some old pages the band stands where the page's own breadcrumb used to be, at the top of <main>, and that
   breadcrumb was also the page's space under the frame. The rollout marks those bands; they keep a gap below,
   so the first block of the page never touches the frame. */
#ft-crumbs[data-ft-crumbs-gap] { margin-bottom: var(--ft-space-4); }

/* Touch: a short crumb ("Tools") is narrower than 44 px, so its hit area reaches 6 px into the gaps beside it. */
@media (max-width: 40rem), (pointer: coarse) {
  #ft-crumbs .ft-crumbs__link { position: relative; }
  #ft-crumbs .ft-crumbs__link::after { content: ""; position: absolute; inset: 0 -0.375rem; }
}
#ft-crumbs .ft-crumbs__current {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ft-frame-ink);
  font-weight: 600;
}

/* 5. Related tools --------------------------------------------------------------------------- */
#ft-related { color: var(--ft-ink); background: transparent; margin-top: var(--ft-space-7); }
#ft-related .ft-related__inner { display: block; }
#ft-related .ft-related__title {
  display: block;
  margin: 0 0 var(--ft-space-4);
  color: var(--ft-ink);
  font-size: var(--ft-text-xl);
  font-weight: 700;
  line-height: var(--ft-leading-tight);
  letter-spacing: -0.005em;
}
#ft-related .ft-related__list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr));
  gap: var(--ft-space-3);
  list-style: none;
}
#ft-related .ft-related__item { display: flex; }
#ft-related .ft-related__link {
  display: flex;
  flex-direction: column;
  gap: var(--ft-space-1);
  width: 100%;
  min-height: 4.5rem;
  padding: var(--ft-space-3) var(--ft-space-4);
  border: 1px solid var(--ft-line);
  border-radius: var(--ft-radius-l);
  background: var(--ft-surface);
  color: var(--ft-ink);
  text-decoration: none;
  cursor: pointer;
}
#ft-related .ft-related__link:hover { border-color: var(--ft-accent); }
#ft-related .ft-related__name {
  display: block;
  color: var(--ft-link);
  font-size: var(--ft-text-md);
  font-weight: 650;
  line-height: 1.35;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 0.2em;
}
#ft-related .ft-related__link:hover .ft-related__name { text-decoration-color: currentColor; }
#ft-related .ft-related__text { display: block; color: var(--ft-ink-2); font-size: var(--ft-text-sm); line-height: 1.45; }

/* Band variant: added outside <main> on existing pages; part of the frame, same in both themes. */
#ft-related.ft-related--band {
  margin: 0;
  padding: var(--ft-space-6) 0 var(--ft-space-6);
  background: var(--ft-frame-mid);
  color: var(--ft-frame-ink);
  align-self: end;
}
#ft-related.ft-related--band .ft-related__inner { max-width: var(--ft-max); margin: 0 auto; padding: 0 var(--ft-gutter); }
#ft-related.ft-related--band .ft-related__title { color: var(--ft-frame-ink) !important; font-size: var(--ft-text-lg); }
#ft-related.ft-related--band .ft-related__link {
  border-color: var(--ft-frame-line);
  background: rgba(15, 43, 34, 0.55);
  color: var(--ft-frame-ink);
}
#ft-related.ft-related--band .ft-related__link:hover { border-color: var(--ft-frame-accent); }
#ft-related.ft-related--band .ft-related__name { color: var(--ft-frame-ink); }
#ft-related.ft-related--band .ft-related__text { color: var(--ft-frame-ink-2); }

/* 6. Footer -------------------------------------------------------------------------------- */
#ft-footer {
  background: var(--ft-frame);
  color: var(--ft-frame-ink);
  font-size: var(--ft-text-sm);
  align-self: end;
}
#ft-footer .ft-footer__inner { max-width: var(--ft-max); margin: 0 auto; padding: var(--ft-space-7) var(--ft-gutter) 0; }
#ft-footer .ft-footer__top { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ft-space-2) var(--ft-space-5); margin-bottom: var(--ft-space-6); }
#ft-footer .ft-footer__tagline { color: var(--ft-frame-ink-2); font-size: var(--ft-text-md); max-width: 40rem; }
#ft-footer .ft-footer__tools {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 10.5rem), 1fr));
  gap: var(--ft-space-6) var(--ft-space-5);
  padding-bottom: var(--ft-space-6);
  border-bottom: 1px solid var(--ft-frame-line);
}
#ft-footer .ft-footer__heading {
  display: block;
  margin: 0 0 var(--ft-space-2);
  color: var(--ft-frame-ink) !important; /* old dark-theme rules force every h2 colour */
  font-size: var(--ft-text-sm);
  font-weight: 700;
  line-height: 1.3;
}
/* A category heading is a link to that category on /tools/. Its 24 px hit area overlaps the line's own
   leading (negative margin), so the heading is exactly as tall as the plain text was. */
#ft-footer .ft-footer__headlink { display: inline-flex; align-items: center; min-height: 1.5rem; margin-block: -0.1875rem; color: var(--ft-frame-ink); text-decoration: none; cursor: pointer; }
#ft-footer .ft-footer__headlink:hover { text-decoration: underline; text-underline-offset: 0.2em; }
#ft-footer .ft-footer__list { display: block; list-style: none; }
#ft-footer .ft-footer__list > li { display: block; }
#ft-footer .ft-footer__link, #ft-footer .ft-footer__button {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.25rem 0;
  color: var(--ft-frame-ink-2);
  font-size: var(--ft-text-sm);
  line-height: 1.35;
  text-decoration: none;
  cursor: pointer;
}
#ft-footer .ft-footer__link:hover, #ft-footer .ft-footer__button:hover { color: var(--ft-frame-ink); text-decoration: underline; text-underline-offset: 0.2em; }
#ft-footer .ft-footer__site { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--ft-space-2) var(--ft-space-5); padding: var(--ft-space-4) 0; }
#ft-footer .ft-footer__sitelist { display: flex; flex-wrap: wrap; gap: 0 var(--ft-space-5); list-style: none; }
#ft-footer .ft-footer__sitelist > li { display: block; }
#ft-footer .ft-footer__button {
  display: inline-flex !important;
  align-items: center !important;
  flex: none !important;
  box-sizing: border-box !important;
  width: auto !important;
  min-width: 0 !important;
  height: auto !important;
  min-height: 2.25rem !important;
  margin: 0 !important;
  padding: 0 var(--ft-space-3) !important;
  border: 1px solid var(--ft-frame-line) !important;
  border-radius: var(--ft-radius) !important;
  background: transparent !important;
  color: var(--ft-frame-ink) !important;
  box-shadow: none !important;
  transform: none !important;
  text-shadow: none !important;
  opacity: 1 !important;
  filter: none !important;
  font-family: var(--ft-font) !important;
  font-size: var(--ft-text-sm) !important;
  font-weight: 400 !important;
  line-height: 1.35 !important;
  cursor: pointer !important;
}
#ft-footer .ft-footer__button:hover { background: var(--ft-frame-mid) !important; }
#ft-footer .ft-footer__legal {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ft-space-1) var(--ft-space-5);
  justify-content: space-between;
  padding: var(--ft-space-4) 0 var(--ft-space-6);
  border-top: 1px solid var(--ft-frame-line);
  color: var(--ft-frame-ink-2);
  font-size: var(--ft-text-xs);
}
#ft-footer .ft-footer__legal-text { display: block; }
#ft-footer .ft-footer__legal .ft-footer__link { font-size: var(--ft-text-xs); min-height: 1.5rem; padding: 0; color: var(--ft-frame-ink-2); text-decoration: underline; text-underline-offset: 0.2em; }

@media (max-width: 40rem), (pointer: coarse) {
  #ft-footer .ft-footer__headlink { min-height: var(--ft-target); margin-block: 0; }
  #ft-footer .ft-footer__heading:has(> .ft-footer__headlink) { margin-bottom: 0; }
  #ft-footer .ft-footer__link { min-height: var(--ft-target); min-width: var(--ft-target); } /* a short word ("About", "Terms") is still 44 px wide */
  #ft-footer .ft-footer__button { min-height: var(--ft-target) !important; }
  #ft-footer .ft-footer__legal .ft-footer__link { min-height: var(--ft-target); }
  #ft-footer .ft-footer__tools { grid-template-columns: repeat(auto-fill, minmax(min(100%, 9.5rem), 1fr)); gap: var(--ft-space-5) var(--ft-space-4); }
  #ft-footer .ft-footer__sitelist { gap: 0 var(--ft-space-4); }
}

/* 7. Opt-in page base (new pages: <body class="ft-page">) ---------------------------------- */
:root:has(> body.ft-page) { color-scheme: light; background: var(--ft-bg); }
:root[data-theme="dark"]:has(> body.ft-page) { color-scheme: dark; }
@media (prefers-color-scheme: dark) { :root:not([data-theme]):has(> body.ft-page) { color-scheme: dark; } }
body.ft-page {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--ft-bg);
  color: var(--ft-ink);
  font-family: var(--ft-font);
  font-size: var(--ft-text-md);
  line-height: var(--ft-leading);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-wrap: break-word;
}
body.ft-page > main { flex: 1 0 auto; display: block; }
body.ft-page :where(*, *::before, *::after) { box-sizing: border-box; }
body.ft-page :where(img, svg, canvas, video) { max-width: 100%; }
body.ft-page :where(a) { color: var(--ft-link); text-underline-offset: 0.18em; }
body.ft-page :where(a:hover) { text-decoration-thickness: 2px; }
body.ft-page :where(:focus-visible) { outline: 3px solid var(--ft-focus); outline-offset: 2px; }
/* Focusable parts inside an SVG (a chart handle with role="slider", a focusable group). The ring above follows the
   element's bounding box, which for a group is a large rectangle around everything in it. So, by default:
   - a focused group or link that holds round handles (circle, ellipse) shows the ring on those handles, no box;
   - a focused circle or ellipse shows the ring on its own edge, no box;
   - any other focused shape or group keeps the box, so focus is never invisible (also where :has() is missing).
   The ring is !important because page CSS usually styles a handle's stroke with a class, and a ring that loses
   to it would leave no focus mark at all. To draw your own mark instead, give the focusable element class
   ft-focusmark (these defaults then stand back) and put a shape with class ft-focusmark__ring where the ring
   belongs; it is drawn only while the element has keyboard focus. A single focusable shape can carry
   "ft-focusmark ft-focusmark--stroke": its own outline becomes the ring. STYLEGUIDE.md section 9. */
body.ft-page svg :is(g, a):is([tabindex], [role="slider"]):not(.ft-focusmark):focus-visible:has(circle, ellipse),
body.ft-page svg :is(circle, ellipse):is([tabindex], [role="slider"]):not(.ft-focusmark):focus-visible { outline: none; }
body.ft-page svg :is(g, a):is([tabindex], [role="slider"]):not(.ft-focusmark):focus-visible :is(circle, ellipse),
body.ft-page svg :is(circle, ellipse):is([tabindex], [role="slider"]):not(.ft-focusmark):focus-visible { stroke: var(--ft-focus) !important; stroke-width: 4px !important; vector-effect: non-scaling-stroke; }
.ft-focusmark:focus, .ft-focusmark:focus-visible { outline: none; }
.ft-focusmark__ring { fill: none; stroke: none; pointer-events: none; }
.ft-focusmark:focus-visible .ft-focusmark__ring, .ft-focusmark--stroke:focus-visible { stroke: var(--ft-focus); stroke-width: 3px; vector-effect: non-scaling-stroke; }
.ft-focusmark--stroke:focus-visible { paint-order: stroke; }
body.ft-page :where(h1, h2, h3, h4) { color: var(--ft-ink); line-height: var(--ft-leading-tight); text-wrap: balance; }
body.ft-page :where(p, li) { text-wrap: pretty; }
/* Text that keeps its own spaces and line breaks wraps the ordinary way: an early WebKit 26 build crashes the page
   when it lays out pre-wrap text with text-wrap: pretty at some widths. text-wrap-style only, so nowrap stays nowrap. */
body.ft-page :where(pre, code, kbd, samp, textarea, .ft-formula) { text-wrap-style: auto; }
body.ft-page :where(code, kbd, samp, pre) { font-family: var(--ft-font-mono); font-size: 0.9em; }
body.ft-page :where([hidden]) { display: none !important; }
body.ft-page :where(#main, #ft-content-start):focus { outline: none; }

.ft-wrap { box-sizing: border-box; width: 100%; max-width: var(--ft-max); margin-inline: auto; padding-inline: var(--ft-gutter); }
.ft-visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Text pages (About, guides, updates): <main class="ft-main"> ... <div class="ft-prose"> */
.ft-pagehead { padding-block: var(--ft-space-6) var(--ft-space-5); }
.ft-pagehead__title { margin: 0; font-size: var(--ft-text-h1); font-weight: 750; letter-spacing: -0.015em; line-height: 1.12; color: var(--ft-ink); }
.ft-pagehead__lede { margin: var(--ft-space-3) 0 0; max-width: 46rem; color: var(--ft-ink-2); font-size: var(--ft-text-lg); line-height: 1.5; }
.ft-pagehead__meta { margin: var(--ft-space-3) 0 0; color: var(--ft-ink-3); font-size: var(--ft-text-sm); }

.ft-prose { color: var(--ft-ink); font-size: 1.0625rem; line-height: 1.65; }
.ft-prose > * { max-width: var(--ft-measure); }
.ft-prose > :where(.ft-wide, table, figure, pre, .ft-table-wrap, .ft-tablewrap) { max-width: none; }
.ft-prose :where(h2) { margin: 2.25em 0 0.6em; font-size: var(--ft-text-xl); font-weight: 700; line-height: 1.25; letter-spacing: -0.005em; }
.ft-prose :where(h3) { margin: 1.8em 0 0.5em; font-size: var(--ft-text-lg); font-weight: 650; line-height: 1.3; }
.ft-prose :where(h4) { margin: 1.5em 0 0.4em; font-size: var(--ft-text-md); font-weight: 650; }
.ft-prose :where(h2, h3, h4):first-child { margin-top: 0; }
.ft-prose :where(p, ul, ol, dl, blockquote, figure, pre, table) { margin: 0 0 1em; }
.ft-prose :where(ul, ol) { padding-left: 1.4em; }
.ft-prose :where(li) { margin: 0.35em 0; }
.ft-prose :where(li > ul, li > ol) { margin: 0.35em 0 0; }
.ft-prose :where(a) { color: var(--ft-link); text-decoration: underline; text-underline-offset: 0.18em; }
.ft-prose :where(strong) { font-weight: 650; }
.ft-prose :where(code) { padding: 0.1em 0.3em; border-radius: var(--ft-radius-s); background: var(--ft-surface-2); font-family: var(--ft-font-mono); font-size: 0.88em; }
.ft-prose :where(pre) { overflow-x: auto; padding: var(--ft-space-4); border: 1px solid var(--ft-line); border-radius: var(--ft-radius); background: var(--ft-surface); font-family: var(--ft-font-mono); font-size: 0.875rem; line-height: 1.55; }
.ft-prose :where(pre code) { padding: 0; background: none; font-size: inherit; }
.ft-prose :where(kbd) { padding: 0.05em 0.35em; border: 1px solid var(--ft-line-strong); border-bottom-width: 2px; border-radius: var(--ft-radius-s); font-family: var(--ft-font-mono); font-size: 0.85em; }
.ft-prose :where(blockquote) { padding: 0.1em 0 0.1em 1em; border-left: 3px solid var(--ft-line-strong); color: var(--ft-ink-2); }
.ft-prose :where(hr) { margin: 2.5em 0; border: 0; border-top: 1px solid var(--ft-line); }
.ft-prose :where(table) { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.ft-prose :where(th, td) { padding: 0.5em 0.75em; border-bottom: 1px solid var(--ft-line); text-align: left; vertical-align: top; }
.ft-prose :where(th) { font-weight: 650; color: var(--ft-ink); background: var(--ft-surface-2); }
.ft-prose :where(figure) { margin-inline: 0; }
.ft-prose :where(figcaption) { margin-top: 0.5em; color: var(--ft-ink-2); font-size: var(--ft-text-sm); }
.ft-prose :where(dt) { font-weight: 650; }
.ft-prose :where(dd) { margin: 0 0 0.75em; }
.ft-prose :where(img) { max-width: 100%; height: auto; }

/* Reserved positions (.ft-slot). The rollout puts them on published tool pages: one between the tool and
   "How to use" (new template), one after the article and before the related tools. Each is an empty, hidden
   <div>: no height, no text, no label, no script. If one is ever switched on (its `hidden` removed and
   --ft-slot-h set on it), it holds that height from the first paint and keeps a full section gap from its
   neighbours, so nothing moves and it never touches a control. Never printed. The [hidden] rule is !important
   because old page stylesheets give every <div> a display value. STYLEGUIDE.md section 3. */
.ft-slot {
  display: block;
  box-sizing: border-box;
  width: 100%;
  max-width: var(--ft-max);
  min-height: var(--ft-slot-h, 0px);
  margin: var(--ft-space-7) auto;
  grid-column: 1 / -1;
  overflow: hidden;
}
.ft-slot[hidden] { display: none !important; }

/* Decimal-comma note (ft-shell-20261106.mjs, initDecimalCommas). For a few seconds it floats over
   the page beside a number field whose browser dropped or turned away a comma: it takes no room, so nothing moves,
   and it never takes a click. The script sets data-ft-tone from the background behind the field, so the note fits
   old pages with or without a dark theme; its colours are the paper tokens of that theme. Screen readers get the same
   words from a visually hidden status line. */
#ft-numnote {
  all: initial;
  --ft-numnote-bg: #ffffff;
  --ft-numnote-ink: #1b2420;
  --ft-numnote-line: #8a8574;
  --ft-numnote-mark: #7a4a00;
  --ft-numnote-shadow: 0 1px 2px rgba(27, 36, 32, 0.08), 0 4px 16px rgba(27, 36, 32, 0.14);
  position: absolute;
  z-index: 2147483000;
  display: block;
  box-sizing: border-box;
  max-width: min(20rem, calc(100vw - 16px));
  margin: 0;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--ft-numnote-line);
  border-left: 4px solid var(--ft-numnote-mark);
  border-radius: 6px;
  background: var(--ft-numnote-bg);
  color: var(--ft-numnote-ink);
  box-shadow: var(--ft-numnote-shadow);
  font-family: var(--ft-font);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.4;
  text-align: left;
  white-space: normal;
  overflow-wrap: break-word;
  pointer-events: none;
}
#ft-numnote[data-ft-tone="dark"] {
  --ft-numnote-bg: #18211c;
  --ft-numnote-ink: #e6ece8;
  --ft-numnote-line: #6c7f75;
  --ft-numnote-mark: #f3c46b;
  --ft-numnote-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.35);
}
#ft-numnote[hidden] { display: none !important; }

/* 8. Motion and print ---------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  :is(#ft-header, #ft-crumbs, #ft-related, #ft-footer) * { transition: none !important; animation: none !important; }
}
@media print {
  /* Paper is light whatever theme the screen shows: every colour token that the dark theme changes goes back to
     its light value (checked against the :root block by tests/value-expansion-integration-shared-shell-css-20261106.test.mjs). */
  :root, :root[data-theme], :root:not([data-theme="light"]) {
    --ft-bg: #f6f4ee; --ft-surface: #ffffff; --ft-surface-2: #efece4; --ft-ink: #1b2420; --ft-ink-2: #4d5953;
    --ft-ink-3: #646d68; --ft-line: #dcd7ca; --ft-line-strong: #8a8574; --ft-accent: #1b6a4e;
    --ft-accent-hover: #145a41; --ft-accent-ink: #ffffff; --ft-accent-soft: #e2efe6; --ft-link: #17603f;
    --ft-focus: #0b4a34; --ft-shadow: 0 1px 2px rgba(27, 36, 32, 0.06), 0 4px 16px rgba(27, 36, 32, 0.06);
    --ft-ok: #1d6b3f; --ft-ok-soft: #e3f1e6; --ft-warn: #7a4a00; --ft-warn-soft: #fbefd9; --ft-bad: #a3281d;
    --ft-bad-soft: #f9e3e0; --ft-info: #1f5a8a; --ft-info-soft: #e2edf6; --ft-plot-surface: #ffffff;
    --ft-plot-ink: #1b2420; --ft-plot-ink-2: #4d5953; --ft-plot-axis: #8a8574; --ft-plot-grid: #e6e2d8;
    --ft-plot-legend: rgba(255, 255, 255, 0.92); --ft-plot-error: #4d5953; --ft-plot-band: #2a78d6;
    --ft-plot-1: #2a78d6; --ft-plot-2: #eb6834; --ft-plot-3: #0ea282; --ft-plot-4: #c58501; --ft-plot-5: #d771a5;
    --ft-plot-6: #008300; --ft-plot-7: #6250d6; --ft-plot-8: #e34948;
  }
  :root:has(> body.ft-page), :root[data-theme]:has(> body.ft-page), :root:not([data-theme]):has(> body.ft-page) { color-scheme: light; background: #fff; }
  body.ft-page { background: #fff; color: #000; }
  /* No use on paper: site navigation, breadcrumbs, the related band, footer link lists, the cookie banner.
     Any page can hide more with data-ft-print="hide" on an element. */
  #ft-header .ft-nav, #ft-header .ft-actions, #ft-header .ft-skip, #ft-crumbs, #ft-related.ft-related--band, #ft-footer .ft-footer__tools, #ft-footer .ft-footer__site { display: none !important; }
  #cookieConsent, [data-ft-print="hide"], .ft-slot, #ft-numnote { display: none !important; }
  #ft-header, #ft-footer { background: none !important; color: #000 !important; box-shadow: none !important; clip-path: none !important; }
  #ft-header .ft-bar { height: auto; padding: 0 0 8pt; border-bottom: 1px solid #000; }
  #ft-header .ft-brand, #ft-footer .ft-brand { color: #000 !important; }
  #ft-footer .ft-footer__inner { padding-top: 8pt; }
  #ft-footer .ft-footer__legal { color: #000; border-top: 1px solid #000; }
  #ft-footer .ft-footer__legal .ft-footer__link { color: #000; }
  #ft-footer .ft-footer__top { margin-bottom: 0; }
  #ft-footer .ft-footer__tagline { color: #000; }
}

/* 9. Forced colours (Windows high contrast) ------------------------------------------------- */
@media (forced-colors: active) {
  /* Focus rings are outlines, so they survive this mode; they take the system highlight colour. */
  :is(#ft-header, #ft-crumbs, #ft-related, #ft-footer) :is(a, button):focus-visible, #ft-header .ft-skip:focus, body.ft-page :where(:focus-visible) { outline-color: Highlight; }
  .ft-focusmark:focus-visible .ft-focusmark__ring, .ft-focusmark--stroke:focus-visible { stroke: Highlight; }
  body.ft-page svg :is(g, a):is([tabindex], [role="slider"]):not(.ft-focusmark):focus-visible :is(circle, ellipse),
  body.ft-page svg :is(circle, ellipse):is([tabindex], [role="slider"]):not(.ft-focusmark):focus-visible { stroke: Highlight !important; }
  /* The brand mark is a logo: it keeps its own two colours instead of becoming one block. */
  :is(#ft-header, #ft-footer) .ft-brand__mark { forced-color-adjust: none; }
  /* The highlighted result of a search list (home page) and any other listbox option was marked by a fill only. */
  body.ft-page [role="option"][aria-selected="true"] { outline: 2px solid Highlight; outline-offset: -2px; }
}
