/* ============================================================================
   MyRealSpeed design system v7 — Night Passage, the cable chart
   ---------------------------------------------------------------------------
   Seventh direction (frontend-design skill). The test measures a physical
   route — Karachi edge, Mumbai origin, a France node — so the interface
   borrows from submarine-cable and nautical charts: deep marine grounds
   ruled with a faint chart grid, plates with modest chart corners, and
   maritime signal orange spent on live measurement and the primary action.
   The signature element is the cable-route strip on the instrument's server
   line: dashed route, endpoint markers, you → server.

   Typography (font policy): Open Sans 800 for display, Inter for reading,
   Roboto for every measured figure (natively equal-width digits).

   Both themes are designed: night passage (dark, default) and the day
   chart (paper-white plates on chart blue-grey). Text tokens verified
   >= 4.5:1 against their surfaces.
   ========================================================================= */

/* --------------------------------------------------------------- webfonts
   Three self-hosted families, three registers, no overlap — the CSP pins
   `font-src 'self'`, so a font CDN would simply be blocked.

     Open Sans      display only: the wordmark, headings, the page title.
     Inter          running text and interface copy.
     Roboto         the instrumentation register: every measured figure,
                    label, unit and timestamp. Not a monospace face, but its
                    digits are natively equal-width — the property the
                    counting readouts actually depend on.

   Latin subsets; an English visitor pays ~82 KB for the display face. */
@font-face {
  font-family: "Open Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/opensans-600-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: "Open Sans";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("/assets/fonts/opensans-800-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: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/fonts/inter-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: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/fonts/inter-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-20C0, U+2113, U+2C60-2C7F,
    U+A720-A7FF;
}
@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("/assets/fonts/roboto-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: "Roboto";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("/assets/fonts/roboto-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-20C0, U+2113, U+2C60-2C7F,
    U+A720-A7FF;
}

/* ----------------------------------------------------------------- tokens
   Themes are selected by data-theme on <html>, written before first paint by
   an inline script; prefers-color-scheme below is only the no-JavaScript
   fallback. Component rules read these names and never hardcode a colour, so
   the whole site changes character from this block alone. */
:root {
  /* Ground and surfaces. The night passage: abyss ground, chart plates. */
  --ink-0: #081826;
  --ink-1: #0e2436;
  --ink-2: #143047;
  --ink-3: #1a3c58;

  /* Chart rules. */
  --line: #1d3e59;
  --line-soft: #17364e;
  --line-strong: #2c567a;

  /* Text. Every step verified >= 4.5:1 against ink-0 through ink-3, so a
     label stays legible whichever surface it lands on. */
  --text: #ecf3f9;
  --text-2: #c4d4e2;
  --dim: #9fb6c8;
  --faint: #86a0b5;

  /* Signal: maritime route orange, with chart cyan as the second trace.
     Spent on live measurement and the primary action, nowhere else. */
  --signal: #ff8a5c;
  --signal-deep: #52b8d8;
  --signal-glow: transparent;
  --gauge-a: #ff8a5c;
  --gauge-b: #52b8d8;
  --on-signal: #081826;

  /* Filled CTA — solid route orange, dark chart ink on top. */
  --cta-a: #f2683a;
  --cta-b: #f2683a;
  --on-cta: #16130f;

  /* Semantic, kept distinct from the accent. */
  --good: #34d399;
  --warn: #f4b942;
  --bad: #f87171;

  /* Compositions. */
  --header-bg: var(--ink-0);
  --overlay-bg: var(--ink-1);
  --tile-bg: var(--ink-1);
  --panel-top: var(--ink-1);
  --panel-bottom: var(--ink-1);
  --panel-bloom: transparent;
  --grid-line: rgba(82, 184, 216, 0.07);
  --nav-mobile-bg: var(--ink-1);
  --focus-ring: rgba(255, 138, 92, 0.4);
  --glass-bg: var(--ink-1);
  --glass-brd: var(--line);
  --glass-hi: transparent;
  --shadow-sm: 0 1px 2px rgba(1, 8, 15, 0.5);
  --shadow-md: 0 6px 20px -10px rgba(1, 8, 15, 0.6);
  --shadow-lg: 0 18px 48px -20px rgba(1, 8, 15, 0.65);
  --scheme: dark;
}

/* The daylight counterpart. Swiss work sits as naturally on paper as on a
   dark ground — Vignelli and the Braun instrument panels are both white-first
   — so this is a designed sibling, not an inversion. The ground goes to true
   white and the rules carry the structure that contrast carries in the dark. */
:root[data-theme="light"] {
  /* The day chart: paper-white plates on a chart blue-grey ground. */
  --ink-0: #eff3f6;
  --ink-1: #fdfdfb;
  --ink-2: #e4ebf0;
  --ink-3: #d8e2e9;

  --line: #ccd9e2;
  --line-soft: #dfe8ee;
  --line-strong: #a9bdcb;

  --text: #14293c;
  --text-2: #3b5268;
  --dim: #4c6478;
  --faint: #5d7488;

  /* Deepened until the accent clears AA on paper; the night values would
     wash out to roughly 2:1 and disappear. */
  --signal: #c7501f;
  --signal-deep: #17698c;
  --signal-glow: transparent;
  --gauge-a: #c7501f;
  --gauge-b: #17698c;
  --on-signal: #ffffff;

  --cta-a: #d6541c;
  --cta-b: #d6541c;
  --on-cta: #ffffff;

  --good: #177344;
  --warn: #8a6100;
  --bad: #c0392b;

  --header-bg: var(--ink-0);
  --overlay-bg: var(--ink-1);
  --tile-bg: var(--ink-1);
  --panel-top: var(--ink-1);
  --panel-bottom: var(--ink-1);
  --panel-bloom: transparent;
  --grid-line: rgba(23, 105, 140, 0.08);
  --nav-mobile-bg: var(--ink-1);
  --focus-ring: rgba(199, 80, 31, 0.3);
  --glass-bg: var(--ink-1);
  --glass-brd: var(--line);
  --glass-hi: transparent;
  --shadow-sm: 0 1px 2px rgba(20, 41, 60, 0.07);
  --shadow-md: 0 6px 20px -10px rgba(20, 41, 60, 0.15);
  --shadow-lg: 0 18px 48px -22px rgba(20, 41, 60, 0.2);
  --scheme: light;
}

/* Before the inline theme script runs (and for no-JS visitors), follow the
   operating system. The script replaces this within the first paint. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    --ink-0: #eff3f6; --ink-1: #fdfdfb; --ink-2: #e4ebf0; --ink-3: #d8e2e9;
    --line: #ccd9e2; --line-soft: #dfe8ee; --line-strong: #a9bdcb;
    --text: #14293c; --text-2: #3b5268; --dim: #4c6478; --faint: #5d7488;
    --signal: #c7501f; --signal-deep: #17698c;
    --signal-glow: transparent;
    --gauge-a: #c7501f; --gauge-b: #17698c; --on-signal: #ffffff;
    --cta-a: #d6541c; --cta-b: #d6541c; --on-cta: #ffffff;
    --good: #177344; --warn: #8a6100; --bad: #c0392b;
    --header-bg: #eff3f6;
    --overlay-bg: #fdfdfb;
    --tile-bg: #fdfdfb;
    --panel-top: #fdfdfb; --panel-bottom: #fdfdfb;
    --panel-bloom: transparent;
    --grid-line: rgba(23, 105, 140, 0.08);
    --nav-mobile-bg: #fdfdfb;
    --focus-ring: rgba(199, 80, 31, 0.3);
    --glass-bg: #fdfdfb;
    --glass-brd: #ccd9e2;
    --glass-hi: transparent;
    --shadow-sm: 0 1px 2px rgba(20, 41, 60, 0.07);
    --shadow-md: 0 6px 20px -10px rgba(20, 41, 60, 0.15);
    --shadow-lg: 0 18px 48px -22px rgba(20, 41, 60, 0.2);
    --scheme: light;
  }
}

:root {

  /* Type. Three faces, three registers:
       Open Sans — display: headings and the wordmark, on the heavy 800 cut.
       Inter     — running text and interface copy.
       Roboto    — every measured figure, label, unit and timestamp;
                   its digits are natively equal-width. Keep the
                   tnum/tabular-nums declarations on readouts anyway. */
  --font-display: "Open Sans", Inter, ui-sans-serif, system-ui, sans-serif;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI",
          sans-serif;
  --font-num: Roboto, ui-sans-serif, system-ui, sans-serif;
  --font-mono: var(--font-num);

  /* Type scale, deliberately quiet. Oversized display type and micro
     labels are the loudest generated-page tells; this scale keeps the
     headline one notch above the body and the labels readable. */
  --t-display: clamp(1.625rem, 1.2rem + 1.5vw, 2.25rem);
  --t-h1: clamp(1.5rem, 1.2rem + 1.1vw, 1.875rem);
  --t-h2: clamp(1.1875rem, 1.05rem + 0.5vw, 1.4375rem);
  --t-h3: 1.0313rem;
  --t-body: 1rem;
  --t-sm: 0.9375rem;
  --t-xs: 0.8125rem;
  --t-label: 0.75rem;

  /* 4px spatial grid. */
  --s-1: 4px;   --s-2: 8px;   --s-3: 12px;  --s-4: 16px;
  --s-5: 24px;  --s-6: 32px;  --s-7: 48px;  --s-8: 64px;  --s-9: 96px;

  /* Chart corners: modest radii — plates, not pills. */
  --r-xs: 5px;
  --r-sm: 6px;
  --r-md: 9px;
  --r-lg: 12px;
  --r-xl: 14px;
  --r-pill: 8px;

  /* Mechanical easing, not bouncy. */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-needle: cubic-bezier(0.34, 0.8, 0.24, 1);
  --wrap: 1240px;
  --measure: 66ch;
}

/* ------------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  color-scheme: var(--scheme);
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--ink-0);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--t-body);
  line-height: 1.65;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Headings are the only place the display family appears in running layout. It is held
   to 500/600 rather than pushed heavy — weight is not how this design
   creates emphasis. */
h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-display);
  /* Open Sans display runs heavy by intent: chart lettering is emphatic. */
  font-weight: 800;
  line-height: 1.14;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
h1 { font-size: var(--t-h1); }
h2 { font-size: var(--t-h2); }
/* Small headings take the bold cut — the only heavier weight the display
   family carries. */
h3 { font-size: var(--t-h3); font-weight: 800; letter-spacing: -0.008em; }
h4 { font-size: var(--t-sm); font-weight: 800; letter-spacing: 0; }
p { margin: 0; }

a { color: var(--signal); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 0.2em; }

img, svg, canvas { max-width: 100%; }
img { height: auto; }

:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 3px;
  border-radius: var(--s-1);
}

::selection { background: var(--signal); color: var(--on-signal); }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--s-5); }
.muted { color: var(--dim); }
.small { font-size: var(--t-xs); }
.mono, .tabular {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  letter-spacing: 0;
}

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--signal); color: var(--on-signal); font-weight: 500;
  padding: var(--s-3) var(--s-5); border-radius: 0 0 var(--r-sm) 0;
}
.skip-link:focus { left: 0; }

/* --------------------------------------------------------------- masthead */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: var(--header-bg);
  border-bottom: 1px solid var(--line);
}
.header-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s-4); min-height: 60px;
}
.brand {
  display: inline-flex; align-items: center; gap: var(--s-2);
  color: var(--text);
  font-family: var(--font-display); font-size: 1rem; font-weight: 700;
  letter-spacing: -0.01em; white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.brand-name b { color: var(--signal); font-weight: 700; }
.brand-mark { flex: none; }

.header-right { display: flex; align-items: center; gap: var(--s-2); flex: none; }
/* The console clock: the visitor's own system time, always visible; only
   the UTC half yields on narrow screens. */
.mast-clock {
  margin-left: auto;
  font-family: var(--font-mono); font-size: var(--t-label);
  letter-spacing: 0.05em; color: var(--dim);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.mast-clock b { color: var(--text-2); font-weight: 500; }
@media (max-width: 860px) {
  .mast-clock { font-size: 10px; letter-spacing: 0.04em; }
  .mast-clock-utc { display: none; }
}
/* Poppins sets a wider wordmark than the old display face, so the masthead
   needs real savings below 480px: tighter gaps and padding, smaller brand,
   narrower controls. The clock itself always stays visible. */
@media (max-width: 480px) {
  .wrap { padding-inline: var(--s-4); }
  .header-row { gap: var(--s-2); }
  .brand { font-size: 0.875rem; }
  .brand svg { width: 20px; height: 20px; }
  .theme-switch { margin-left: 0; }
  .theme-switch button { width: 28px; }
  .nav-burger { width: 36px; padding: 0 8px; }
  /* hh:mm:ss always stays; the zone label yields on the narrowest screens */
  .mast-clock-tz { display: none; }
}

.site-nav { display: flex; align-items: center; gap: 2px; }
.site-nav a {
  color: var(--dim); font-size: var(--t-sm); font-weight: 400;
  padding: var(--s-2) var(--s-3);
  border-bottom: 1px solid transparent;
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease);
}
.site-nav a:hover { color: var(--text); text-decoration: none; }
.site-nav a.active { color: var(--text); border-bottom-color: var(--signal); }

.nav-toggle { position: absolute; opacity: 0; pointer-events: none; }
.nav-burger { display: none; }

/* Theme switch: Light / Auto / Dark, as a segmented control. */
.theme-switch {
  display: inline-flex; align-items: center; gap: 2px; flex: none;
  padding: 0; margin-left: var(--s-3); gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  overflow: hidden;
  background: var(--ink-1);
}
.theme-switch button {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 26px; padding: 0;
  color: var(--dim); background: none; border: 0; border-radius: 0;
  cursor: pointer;
  transition: color 0.18s var(--ease), background-color 0.18s var(--ease);
}
.theme-switch button + button { border-left: 1px solid var(--line); }
.theme-switch button:hover { color: var(--text); background: var(--ink-2); }
.theme-switch button svg { width: 15px; height: 15px; display: block; }
.theme-switch button[aria-checked="true"] {
  color: var(--on-signal);
  background: var(--signal);
}
.theme-switch .ts-auto { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.06em; }

/* Touch ergonomics: on coarse pointers every control meets the 44px minimum
   target (the hairline aesthetic stays for mouse users, where precision
   makes small targets fine). */
@media (pointer: coarse) {
  /* 38px wide (not 44) so the three-button switch still fits a 375px
     masthead beside the wordmark, clock and burger; tap height stays 44. */
  .theme-switch button { min-width: 38px; min-height: 44px; }
  .test-loc select { min-height: 44px; }
  .btn-sm { min-height: 44px; }
  .share-row .share-link { min-height: 44px; }
  .faq summary { min-height: 44px; }
}

/* Colour changes are instant; only the surfaces ease, and never on load. */
.theme-ready body,
.theme-ready .site-header,
.theme-ready .card,
.theme-ready .test-panel,
.theme-ready .metric,
.theme-ready .verdict-card {
  transition: background-color 0.28s var(--ease), border-color 0.28s var(--ease),
              color 0.28s var(--ease);
}

@media (max-width: 860px) {
  .nav-burger {
    display: flex; flex-direction: column; justify-content: center;
    gap: 5px; width: 42px; height: 42px; padding: 0 10px;
    cursor: pointer; border-radius: var(--r-sm);
  }
  .nav-burger span {
    display: block; height: 1.5px; background: var(--text); border-radius: 2px;
    transition: transform 0.24s var(--ease), opacity 0.24s var(--ease);
  }
  .site-nav {
    display: none; position: absolute; inset: 60px 0 auto 0;
    flex-direction: column; align-items: stretch; gap: 2px; margin-left: 0;
    padding: var(--s-3) var(--s-5) var(--s-5);
    background: var(--nav-mobile-bg);
    border-bottom: 1px solid var(--line-soft);
    }
  .nav-toggle:checked ~ .site-nav { display: flex; }
  .site-nav a { padding: var(--s-3) var(--s-4); font-size: 1rem; }
}

/* --------------------------------------------------------------- controls */
.btn {
  --btn-bg: transparent;
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--s-2);
  font-family: var(--font-display); font-size: var(--t-sm); font-weight: 800;
  letter-spacing: 0;
  padding: var(--s-3) var(--s-5);
  border: 1px solid transparent; border-radius: var(--r-pill);
  background: var(--btn-bg); color: var(--text);
  cursor: pointer; text-align: center; white-space: nowrap;
  position: relative; overflow: hidden;
  transition: transform 0.14s var(--ease), box-shadow 0.18s var(--ease),
              background-color 0.16s var(--ease), border-color 0.16s var(--ease),
              filter 0.16s var(--ease);
}
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(0.975); }

/* Filled CTA — solid route orange, the one saturated object per screen. */
.btn-primary {
  background: var(--cta-a);
  border: 0; color: var(--on-cta);
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.btn-primary:active { transform: translateY(0) scale(0.985); filter: brightness(0.98); }

/* The former hover rule is retired under the pill treatment. */
.btn-rule { display: none; }
.btn-label { position: relative; }
.btn-big { padding: var(--s-4) var(--s-8); }

.btn-ghost { border-color: var(--line); color: var(--text-2); background: var(--ink-1); }
.btn-ghost:hover {
  border-color: var(--signal); color: var(--signal);
  background: color-mix(in srgb, var(--signal) 8%, var(--ink-1));
}

.btn-big { font-size: 1.0625rem; padding: var(--s-4) var(--s-7); }
.btn-sm { font-size: var(--t-xs); padding: var(--s-2) var(--s-4); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ------------------------------------------------------------------- hero
   Left-aligned and ruled rather than centred. A centred headline over a
   centred panel is the arrangement every speed test already uses; setting
   the copy against the left margin under an eyebrow rule is what makes the
   page read as an instrument sheet. */
/* The section keeps the full wrap width so its rule spans the measure and
   lines up with the panel below; only the text is held to a reading width.
   Constraining the section itself would let .wrap's auto margins re-centre
   the whole block, which is what it is deliberately not doing. */
.hero { padding: var(--s-7) 0 var(--s-5); }
.hero-eyebrow {
  display: inline-block;
  color: var(--signal);
  background: transparent;
  font-family: var(--font-mono); font-size: var(--t-label);
  letter-spacing: 0.06em; text-transform: uppercase;
  padding: 4px var(--s-3);
  border: 1px solid color-mix(in srgb, var(--signal) 55%, transparent);
  border-radius: var(--r-xs);
  margin-bottom: var(--s-5);
}
.hero h1 { max-width: 17ch; }
.hero-lede { max-width: 52ch; }
.hero h1 {
  font-size: var(--t-display); font-weight: 700; letter-spacing: -0.015em;
  line-height: 1.1;
}
.hero-lede {
  margin: var(--s-4) 0 0;
  color: var(--dim); font-size: var(--t-sm);
}

/* ------------------------------------------------------- the instrument
   The panel is a plate: one hairline, square corners, flat fill. No gradient
   ground, no calibration grid, no bloom. */
.test-panel {
  position: relative;
  margin: var(--s-5) auto 0;
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  /* The faint chart grid: the instrument sits on ruled water. */
  background:
    repeating-linear-gradient(0deg, var(--grid-line) 0 1px, transparent 1px 44px),
    repeating-linear-gradient(90deg, var(--grid-line) 0 1px, transparent 1px 44px),
    var(--ink-1);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

/* Two columns of deliberately unequal weight: the dial and its action on the
   left, the readings on the right, divided by a single rule. */
.stage {
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(300px, 1fr);
  align-items: center;
}
.stage-instrument {
  display: flex; flex-direction: column; align-items: center;
  gap: var(--s-5);
  padding: var(--s-6) var(--s-5);
  border-right: 1px solid var(--line);
}
.stage-readings { align-self: stretch; display: flex; flex-direction: column; }

.gauge-wrap {
  position: relative;
  width: min(100%, 340px);
  aspect-ratio: 1;
}
.gauge-dial { display: block; width: 100%; height: 100%; overflow: visible; }

.gauge-bezel { fill: none; stroke: var(--line); stroke-width: 1; }
.gauge-bezel--inner { stroke: var(--line-soft); }
.gauge-face { fill: var(--ink-0); stroke: var(--line-soft); stroke-width: 1; }

/* Unlit ticks stay legible so the scale reads as an instrument at rest,
   not as a disabled control. */
.gauge-tick {
  stroke: var(--line-strong); stroke-width: 1.25; stroke-linecap: butt;
  transition: stroke 0.12s linear;
}
.gauge-tick--major { stroke: var(--faint); stroke-width: 2; }
.gauge-tick.lit { stroke: var(--signal); }
.gauge-tick--major.lit { stroke: var(--signal-deep); }

.gauge-scale {
  fill: var(--faint); font-family: var(--font-mono); font-size: 11px;
  font-variant-numeric: tabular-nums;
  text-anchor: middle; dominant-baseline: middle;
}

/* Rotation is the only animated property, on an easing tuned to feel
   weighted: quick to leave, settling rather than bouncing. */
.gauge-needle {
  transform-origin: 200px 200px;
  transition: transform 0.42s var(--ease-needle);
  will-change: transform;
}
.gauge-needle-shaft { stroke: var(--text); stroke-width: 2.5; stroke-linecap: round; }
.gauge-needle-tail { stroke: var(--dim); stroke-width: 4; stroke-linecap: round; }
.gauge-hub { fill: var(--ink-2); stroke: var(--line-strong); stroke-width: 1; }
.gauge-hub-pin { fill: var(--dim); }
.gauge-wrap:not([data-active="1"]) .gauge-needle { opacity: 0.45; }

/* Seated in a window below the hub, the way a bench instrument carries its
   digital display. Centred on the hub, the needle crosses the figure. */
.gauge-readout {
  position: absolute; inset: auto 0 21% 0;
  display: flex; flex-direction: column; align-items: center;
  pointer-events: none;
}
.gauge-value {
  font-family: var(--font-num); font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  font-size: clamp(1.5rem, 1.1rem + 1.3vw, 2.125rem); font-weight: 500;
  line-height: 1; letter-spacing: -0.03em;
}
.gauge-unit {
  margin-top: var(--s-1); color: var(--dim);
  font-family: var(--font-mono); font-size: var(--t-label);
  letter-spacing: 0.07em; text-transform: uppercase;
}
/* Seated in a window at the base of the dial. The panel-coloured plate is
   load-bearing: the bezel circles are drawn full, so without it their rules
   run straight through the text — visibly so once the dial shrinks below
   ~320px. The plate knocks the rules out behind the caption, the way an
   engraved instrument clears a window for its legend. */
.gauge-caption {
  position: absolute; left: 50%; bottom: 4%; transform: translateX(-50%);
  margin: 0; white-space: nowrap;
  padding: 2px var(--s-3);
  background: var(--ink-1);
  color: var(--dim); font-family: var(--font-mono); font-size: var(--t-label);
  letter-spacing: 0.06em; text-transform: uppercase;
}
.gauge-wrap[data-active="1"] .gauge-caption { color: var(--signal); }

/* Measurements as a mini-bento inside the panel: recessed tiles with gaps,
   so the readings read as six small instruments. */
.metric-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: var(--s-2);
  flex: 1;
  padding: var(--s-3);
}
.metric {
  padding: var(--s-4) var(--s-4);
  background: var(--ink-2);
  border-radius: var(--r-md);
}
.m-label {
  display: block; color: var(--dim);
  font-family: var(--font-mono); font-size: var(--t-label);
  letter-spacing: 0.05em; text-transform: uppercase; line-height: 1.4;
}
.m-read { display: flex; align-items: baseline; gap: var(--s-2); margin-top: var(--s-2); }
.m-value {
  font-family: var(--font-num); font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  font-size: 1.5rem; font-weight: 500; letter-spacing: -0.02em;
}
.m-unit { color: var(--faint); font-family: var(--font-mono); font-size: var(--t-xs); }

/* The signature, made honest: a live route diagram. "you" on the left, the
   selected node on the right, its measured ping printed on the wire. */
.test-route {
  display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-4) var(--s-5) 0;
}
.rt-node {
  flex: none; color: var(--text-2);
  font-family: var(--font-mono); font-size: var(--t-label);
  letter-spacing: 0.08em; text-transform: uppercase;
}
.rt-path {
  position: relative; flex: 1; height: 8px; min-width: 60px;
  background:
    radial-gradient(circle 3.5px at 4px 50%, var(--signal) 97%, transparent),
    radial-gradient(circle 3.5px at calc(100% - 4px) 50%, var(--signal) 97%, transparent),
    repeating-linear-gradient(90deg, color-mix(in srgb, var(--signal) 55%, transparent) 0 7px, transparent 7px 13px) 50% 50% / calc(100% - 24px) 2px no-repeat;
}
.rt-path i {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  font-style: normal; font-family: var(--font-mono); font-size: var(--t-label);
  color: var(--signal); background: var(--ink-1);
  padding: 0 var(--s-2);
  font-variant-numeric: tabular-nums;
}
.rt-path i:empty { display: none; }
.test-meta {
  padding: var(--s-3) var(--s-5);
  border-top: 0;
  color: var(--dim); font-family: var(--font-mono); font-size: var(--t-xs);
}

/* Location picker: sits on its own rule above the server line. */
.test-loc {
  display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-3) var(--s-5);
  border-top: 1px solid var(--line);
}
.test-loc .m-label { margin: 0; }
.test-loc select {
  flex: 1; min-width: 0;
  padding: 6px var(--s-3);
  color: var(--text); background: var(--ink-1);
  border: 1px solid var(--line); border-radius: var(--r-xs);
  font: inherit; font-size: var(--t-sm);
  cursor: pointer;
}
.test-loc select:focus-visible { outline: 2px solid var(--signal); outline-offset: 1px; }
.test-loc select:disabled { opacity: 0.55; cursor: default; }
.test-actions {
  display: flex; flex-wrap: wrap; gap: var(--s-3);
  justify-content: center; width: 100%;
}

/* Recomposed rather than stacked: below 900px the dial sits above the
   readings and the dividing rule becomes horizontal. */
@media (max-width: 900px) {
  .stage { grid-template-columns: 1fr; }
  .stage-instrument { border-right: 0; border-bottom: 1px solid var(--line); }
  .verdict-card { grid-template-columns: 1fr; }
  .readout-block + .readout-block {
    border-left: 0; border-top: 1px solid var(--line);
  }
}
@media (max-width: 520px) {
  .metric-grid { grid-template-columns: 1fr; }
  .metric:nth-child(odd) { border-right: 0; }
  .metric:nth-last-child(-n+2):not(:last-child) { border-bottom: 1px solid var(--line-soft); }
}
.test-error {
  margin-top: var(--s-5); padding: var(--s-3) var(--s-4);
  color: var(--bad); text-align: left; font-size: var(--t-sm);
  background: color-mix(in srgb, var(--bad) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--bad) 35%, transparent);
  border-radius: var(--r-md);
}

/* ---------------------------------------------------------------- verdict
   Two panels under one rule: the plain-language reading, then the measured
   facts. They share the dividing hairline rather than floating apart. */
.verdict-card {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  margin-top: var(--s-6);
  text-align: left;
  background: var(--ink-1);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}
.readout-block { padding: var(--s-5) var(--s-5) var(--s-6); min-width: 0; }
.readout-block + .readout-block { border-left: 1px solid var(--line); }

.readout-head {
  display: flex; align-items: baseline; gap: var(--s-3);
  padding-bottom: var(--s-3);
  border-bottom: 1px solid var(--line);
  margin-bottom: var(--s-5);
}
/* The index is real structure — assessment is read before diagnostics — not
   a decorative numeral. */
.readout-index {
  color: var(--faint);
  font-family: var(--font-mono); font-size: var(--t-label);
  letter-spacing: 0.05em;
}
.readout-title { font-size: var(--t-h3); }

.readout-note {
  margin-top: var(--s-5);
  color: var(--faint); font-size: var(--t-label); line-height: 1.7;
}

/* Spec sheet: label left, value right, a hairline per row. */
.spec { margin: 0; }
.spec-row {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: var(--s-4);
  padding: var(--s-3) 0;
  border-bottom: 1px solid var(--line-soft);
}
.spec-row:last-child { border-bottom: 0; }
.spec dt {
  color: var(--dim);
  font-family: var(--font-mono); font-size: var(--t-label);
  letter-spacing: 0.05em; text-transform: uppercase;
  white-space: nowrap;
}
.spec dd {
  margin: 0; text-align: right; min-width: 0;
  font-family: var(--font-mono); font-size: var(--t-xs);
  font-variant-numeric: tabular-nums;
  color: var(--text-2); overflow-wrap: anywhere;
}

.verdict-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); }
.verdict-badge {
  padding: var(--s-2) var(--s-4);
  font-family: var(--font-mono); font-size: var(--t-label);
  letter-spacing: 0.06em; text-transform: uppercase;
  border: 1px solid var(--line); border-radius: var(--r-xs);
  background: var(--ink-2);
}
.verdict-excellent { color: var(--good); border-color: color-mix(in srgb, var(--good) 55%, transparent); }
.verdict-verygood  { color: var(--signal); border-color: color-mix(in srgb, var(--signal) 55%, transparent); }
.verdict-good      { color: var(--signal-deep); border-color: color-mix(in srgb, var(--signal-deep) 55%, transparent); }
.verdict-fair      { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 55%, transparent); }
.verdict-poor,
.verdict-unstable  { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 55%, transparent); }
.verdict-summary { margin-top: var(--s-4); color: var(--text-2); }

/* Capability list. Square state chips, not coloured dots: the shape belongs
   to the same square-cornered vocabulary as everything else. */
.activity-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  margin-top: var(--s-5); padding: 0; list-style: none;
  border-top: 1px solid var(--line-soft);
}
.activity {
  display: flex; gap: var(--s-3); align-items: flex-start;
  padding: var(--s-3) var(--s-4) var(--s-3) 0;
  font-size: var(--t-sm);
  border-bottom: 1px solid var(--line-soft);
}
.activity .dot { flex: none; width: 7px; height: 7px; margin-top: 6px; }
.dot-great { background: var(--good); }
.dot-ok { background: var(--warn); }
.dot-limited { background: var(--bad); }
.activity .a-body { display: block; min-width: 0; }
.activity .a-label { display: block; font-weight: 500; }
.activity .a-note {
  display: block; margin-top: 2px;
  color: var(--dim); font-size: var(--t-xs); line-height: 1.45;
}

.share-row {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: var(--s-2); margin-top: var(--s-5);
}
.share-link {
  flex: 1 1 240px; min-width: 0;
  padding: var(--s-3) var(--s-4);
  color: var(--dim); font-family: var(--font-mono); font-size: var(--t-xs);
  background: var(--ink-0); border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.result-note {
  margin-top: var(--s-4); max-width: var(--measure);
  color: var(--faint); font-size: var(--t-xs); line-height: 1.55;
}

/* -------------------------------------------------------------- trust row */
/* Set as a run of mono tags separated by rules, not centred prose. */
.trust-row {
  display: flex; flex-wrap: wrap;
  gap: var(--s-3) var(--s-5);
  margin: var(--s-4) 0 0; padding: 0; list-style: none;
  color: var(--faint);
  font-family: var(--font-mono); font-size: var(--t-label);
  letter-spacing: 0.08em; text-transform: uppercase;
}
.trust-row span { display: inline-flex; align-items: center; gap: var(--s-5); }
.trust-row span + span::before {
  content: ""; width: 1px; height: 11px; background: var(--line);
}
/* The old decorative diamond is dropped: an ornament per item is exactly the
   kind of unearned flourish this design does without. The rule between items
   above carries the separation on its own. */
.trust-row li + li::before {
  content: ""; width: 1px; height: 11px; background: var(--line);
}

/* --------------------------------------------------------------- sections */
.section { padding: var(--s-8) 0 0; }
.section > h2, .section .wrap > h2 { margin-bottom: var(--s-2); }
.section-alt {
  margin-top: var(--s-8); padding-block: var(--s-7);
  background: transparent;
}
.section-alt .wrap {
  background: var(--ink-1);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm);
  padding-top: var(--s-6); padding-bottom: var(--s-6);
}
/* Tiles inside the alt plate step to the next surface so they stay read
   as tiles rather than vanishing into their ground. */
.section-alt .card { background: var(--ink-2); border-color: transparent; box-shadow: none; }
.kicker {
  margin-bottom: var(--s-2);
  color: var(--dim); font-family: var(--font-mono);
  font-size: var(--t-label); letter-spacing: 0.07em; text-transform: uppercase;
}

/* Chart plates: detached tiles with modest corners on soft shadows,
   lifting slightly on hover. */
.card-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(258px, 1fr));
  gap: var(--s-4);
  margin-top: var(--s-5);
}
.card {
  padding: var(--s-5);
  background: var(--tile-bg);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease),
              background-color 0.2s var(--ease);
}
/* Lift only where a card is actually a link target (blog cards); a
   definition or a tip is not a button and should not pretend to be. */
.post-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
@media (prefers-reduced-motion: reduce) { .post-card:hover { transform: none; } }
.card h3 { margin-bottom: var(--s-2); }
.card p { color: var(--dim); font-size: var(--t-sm); }
.card .cm {
  display: block; margin-bottom: var(--s-2);
  color: var(--dim); font-family: var(--font-mono);
  font-size: var(--t-label); letter-spacing: 0.05em; text-transform: uppercase;
}

/* Definition table: term against the left rule, plain sentence right.
   Reads as a chart legend rather than a feature grid. */
.spec-list { margin: var(--s-5) 0 0; }
.spec-item {
  display: grid; grid-template-columns: minmax(150px, 220px) 1fr;
  gap: var(--s-4);
  padding: var(--s-4) 0;
  border-bottom: 1px solid var(--line-soft);
}
.spec-item:last-child { border-bottom: 0; }
.spec-item dt {
  font-family: var(--font-display); font-weight: 800; font-size: var(--t-sm);
}
.spec-item dd { margin: 0; color: var(--dim); font-size: var(--t-sm); max-width: var(--measure); }
@media (max-width: 640px) {
  .spec-item { grid-template-columns: 1fr; gap: var(--s-1); }
}

.test-note {
  margin-top: var(--s-3);
  color: var(--faint); font-size: var(--t-xs);
}

.faq { max-width: 820px; }
.faq details {
  padding: 0 var(--s-4);
  margin-bottom: var(--s-2);
  background: var(--tile-bg);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
}
.faq summary {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-4);
  padding: var(--s-4) 0; cursor: pointer; list-style: none;
  font-weight: 500; font-size: var(--t-sm);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; flex: none; color: var(--signal);
  font-family: var(--font-mono); font-size: 1.125rem; line-height: 1;
}
.faq details[open] summary::after { content: "−"; }
.faq details p {
  padding-bottom: var(--s-4); max-width: var(--measure);
  color: var(--dim); font-size: var(--t-sm);
}

/* ------------------------------------------------------------ two-column */
.two-col {
  display: grid; grid-template-columns: minmax(0, 1fr) 316px;
  gap: var(--s-7); align-items: start;
}
@media (max-width: 940px) { .two-col { grid-template-columns: 1fr; } }
.rail { position: sticky; top: 88px; display: flex; flex-direction: column; gap: var(--s-4); }

/* ------------------------------------------------------------------- prose */
.article-body, .prose { max-width: var(--measure); font-size: var(--t-body); }
.article-body h2 {
  margin: var(--s-7) 0 var(--s-3);
  font-size: var(--t-h2); letter-spacing: -0.02em;
}
.article-body h3 { margin: var(--s-5) 0 var(--s-2); }
.article-body p { margin: var(--s-4) 0; color: var(--text-2); }
.article-body ul, .article-body ol { margin: var(--s-4) 0; padding-left: 1.35em; color: var(--text-2); }
.article-body li { margin: var(--s-2) 0; }
.article-body li::marker { color: var(--faint); }
.article-body strong { color: var(--text); font-weight: 500; }
.article-body em { color: var(--text); }
.article-body img { border-radius: var(--r-md); }

.article-meta {
  margin: var(--s-3) 0 var(--s-5);
  color: var(--faint); font-family: var(--font-mono); font-size: var(--t-xs);
  letter-spacing: 0.02em;
}
.breadcrumbs {
  padding-top: var(--s-6);
  color: var(--faint); font-family: var(--font-mono); font-size: var(--t-xs);
}
.breadcrumbs a { color: var(--faint); }
.breadcrumbs a:hover { color: var(--signal); }

/* --------------------------------------------------------------- blog bits */
.cat-pills { display: flex; flex-wrap: wrap; gap: var(--s-2); margin: var(--s-5) 0 var(--s-2); }
.cat-pills a {
  padding: var(--s-2) var(--s-4);
  color: var(--dim); font-size: var(--t-xs);
  border: 1px solid var(--line); border-radius: var(--r-pill);
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease);
}
.cat-pills a:hover, .cat-pills a.active {
  color: var(--signal); border-color: var(--signal); text-decoration: none;
}

.post-card { display: flex; flex-direction: column; gap: var(--s-2); }
.post-card .p-cat {
  color: var(--signal); font-family: var(--font-mono);
  font-size: var(--t-label); letter-spacing: 0.05em; text-transform: uppercase;
}
.post-card h3 { line-height: 1.28; }
.post-card h3 a { color: var(--text); }
.post-card h3 a:hover { color: var(--signal); text-decoration: none; }
.post-card p { flex: 1; }
.post-card .p-date {
  color: var(--faint); font-family: var(--font-mono); font-size: var(--t-xs);
}
.card:has(.p-cat):hover { border-color: var(--line); transform: translateY(-2px); }

/* ------------------------------------------------------------------ forms */
.form-grid { display: grid; gap: var(--s-4); max-width: 560px; }
.f-label {
  display: block; margin-bottom: var(--s-2);
  font-size: var(--t-xs); font-weight: 500; color: var(--text-2);
}
.f-input, .f-textarea, .f-select {
  width: 100%; padding: var(--s-3) var(--s-4);
  font-family: inherit; font-size: var(--t-sm); color: var(--text);
  background: var(--ink-1);
  border: 1px solid var(--line); border-radius: var(--r-sm);
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.f-input:focus, .f-textarea:focus, .f-select:focus {
  outline: none; border-color: var(--signal);
  box-shadow: 0 0 0 3px var(--focus-ring);
}
.f-input::placeholder, .f-textarea::placeholder { color: var(--faint); }
.f-textarea { min-height: 148px; resize: vertical; line-height: 1.55; }
.f-help { margin-top: var(--s-1); color: var(--faint); font-size: var(--t-xs); }

.form-msg {
  margin-bottom: var(--s-5); padding: var(--s-3) var(--s-4);
  border-radius: var(--r-md); font-size: var(--t-sm);
}
.form-ok { color: var(--good); background: color-mix(in srgb, var(--good) 10%, transparent); border: 1px solid color-mix(in srgb, var(--good) 35%, transparent); }
.form-err { color: var(--bad); background: color-mix(in srgb, var(--bad) 10%, transparent); border: 1px solid color-mix(in srgb, var(--bad) 35%, transparent); }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ------------------------------------------------------------------- ads */
.ad-box {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: var(--s-1);
  max-width: var(--wrap); margin: var(--s-6) auto; padding: var(--s-2);
  color: var(--faint); text-align: center; overflow: hidden;
  border: 1px dashed var(--line-soft); border-radius: var(--r-md);
}
.ad-tag {
  font-family: var(--font-mono); font-size: var(--t-label);
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint);
}
.ad-placeholder { padding: var(--s-5) 0; color: var(--line); font-size: var(--t-xs); }
.ad-header, .ad-in_article { min-height: 116px; }
.ad-sidebar { min-height: 268px; margin: 0; }
.ad-result { min-height: 132px; max-width: 780px; }
.ad-blog_list { min-height: 100%; margin: 0; }
.ad-footer { min-height: 96px; }

/* ---------------------------------------------------------------- footer */
.site-footer {
  margin-top: var(--s-9); padding: var(--s-8) 0 var(--s-5);
  background: var(--ink-1); border-top: 1px solid var(--line);
}
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr; gap: var(--s-7);
}
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; gap: var(--s-6); } }
.footer-brand {
  margin-bottom: var(--s-2);
  font-family: var(--font-display); font-size: 1rem; font-weight: 700;
  letter-spacing: -0.01em;
}
.footer-brand b { color: var(--signal); }
.footer-h {
  margin-bottom: var(--s-3);
  color: var(--dim); font-family: var(--font-mono);
  font-size: var(--t-label); letter-spacing: 0.06em; text-transform: uppercase;
}
.site-footer nav a { display: block; padding: 3px 0; color: var(--dim); font-size: var(--t-sm); }
.site-footer nav a:hover { color: var(--signal); }
.footer-bottom {
  margin-top: var(--s-6); padding-top: var(--s-4);
  border-top: 1px solid var(--line-soft); text-align: center;
}

/* --------------------------------------------------------------- consent */
/* A slim bar pinned to the bottom edge: it states its business and gets out
   of the way, rather than floating over the content it is asking about. */
.consent-banner {
  position: fixed; inset: auto 0 0 0; z-index: 90;
  display: flex; align-items: center; justify-content: center;
  gap: var(--s-5); flex-wrap: wrap;
  padding: var(--s-3) var(--s-5);
  padding-bottom: calc(var(--s-3) + env(safe-area-inset-bottom, 0px));
  background: var(--overlay-bg);
  border-top: 1px solid var(--line);
}
.consent-banner p {
  margin: 0; font-size: var(--t-xs); color: var(--text-2);
  /* Tighter than body leading: this is small multi-line text in a bar, where
     the default 1.65 reads loose and costs vertical space. */
  line-height: 1.45;
  max-width: 78ch;
}
.consent-actions { display: flex; gap: var(--s-2); flex: none; }
.consent-actions .btn { padding: var(--s-2) var(--s-5); font-size: var(--t-xs); }

@media (max-width: 640px) {
  .consent-banner { gap: var(--s-3); padding-inline: var(--s-4); }
  .consent-banner p { flex: 1 1 100%; text-align: center; }
  .consent-actions { flex: 1 1 100%; justify-content: center; }
  .consent-actions .btn { flex: 1 1 0; }
}

/* ----------------------------------------------------------------- admin */
.admin-wrap { max-width: 1040px; margin-inline: auto; padding: var(--s-5); }
.admin-nav { display: flex; flex-wrap: wrap; gap: var(--s-2); margin: var(--s-4) 0 var(--s-6); }
.admin-nav a {
  padding: var(--s-2) var(--s-4); font-size: var(--t-xs); color: var(--dim);
  border: 1px solid var(--line); border-radius: var(--r-sm);
}
.admin-nav a:hover, .admin-nav a.active { color: var(--signal); border-color: var(--signal); text-decoration: none; }
.admin-table { width: 100%; border-collapse: collapse; font-size: var(--t-sm); }
.admin-table th {
  padding: var(--s-3); text-align: left;
  color: var(--dim); font-family: var(--font-mono);
  font-size: var(--t-label); letter-spacing: 0.05em; text-transform: uppercase;
  border-bottom: 1px solid var(--line);
}
.admin-table td { padding: var(--s-3); border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.admin-table tr:last-child td { border-bottom: none; }
.badge {
  display: inline-block; padding: 2px var(--s-3);
  font-family: var(--font-mono);
  font-size: var(--t-label); letter-spacing: 0.06em; text-transform: uppercase;
  border: 1px solid var(--line); border-radius: var(--r-pill);
}
.badge-published { color: var(--good); border-color: color-mix(in srgb, var(--good) 50%, transparent); }
.badge-draft { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 50%, transparent); }
.stat-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(164px, 1fr));
  gap: var(--s-3); margin-bottom: var(--s-6);
}
.stat-box {
  padding: var(--s-4);
  background: var(--ink-1); border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
}
.stat-box .s-num {
  font-family: var(--font-num); font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1;
  font-size: 1.75rem; font-weight: 500; letter-spacing: -0.03em;
}
.stat-box .s-label { color: var(--dim); font-size: var(--t-xs); }

/* ====================================================================
   Instrument surfaces — frosted glass, ambient light, live telemetry
   ==================================================================== */

/* Frosted panel with a lit top edge and a gradient hairline border. */
.glass {
  position: relative;
  background: var(--glass-bg);
  border: 1px solid var(--glass-brd);
  border-radius: var(--r-lg);
}

/* Live sparkline inside each metric tile. */
.metric { position: relative; overflow: hidden; }
.spark { display: block; width: 100%; height: 24px; margin-top: var(--s-1); }
.spark path { fill: none; stroke: var(--signal); stroke-width: 1.75; stroke-linejoin: round; stroke-linecap: round; }
.spark .spark-fill { fill: var(--signal); opacity: 0.1; stroke: none; }
.metric[data-state="live"] { background: var(--ink-2); }
.metric[data-state="live"]::after {
  content: ""; position: absolute; top: var(--s-4); right: var(--s-5);
  width: 6px; height: 6px;
  background: var(--signal);
}

/* Real-time bandwidth graph. */
.bandwidth {
  margin-top: var(--s-5); padding: var(--s-4);
  border-radius: var(--r-md); background: var(--tile-bg);
  border: 1px solid var(--line-soft);
}
.bandwidth-head {
  display: flex; justify-content: space-between; align-items: center;
  gap: var(--s-3); margin-bottom: var(--s-2);
}
.bw-legend { display: flex; gap: var(--s-4); }
.bw-legend span {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: var(--t-label);
  letter-spacing: 0.05em; text-transform: uppercase; color: var(--dim);
}
.bw-legend i { width: 14px; height: 2px; border-radius: 2px; }
.bw-dl { background: var(--signal); }
.bw-ul { background: var(--signal-deep); }
#bw-canvas { display: block; width: 100%; height: 132px; }

/* Home-softness scope retired in v6: the bento treatment above applies to
   every page, so body.home carries no overrides any more. The class stays
   on the homepage markup for future scoping. */

/* ------------------------------------------------------------ simple view
   One dial, one number. Everything else yields until asked back. */
.test-panel.view-simple .stage { grid-template-columns: 1fr; }
.test-panel.view-simple .stage-instrument { border-right: 0; }
.test-panel.view-simple .stage-readings,
.test-panel.view-simple .bandwidth { display: none; }

/* --------------------------------------------------------------- mini UI
   The standalone compact test at /mini: a single column built for
   embedding and quick checks, driven by the same MRSEngine. */
.mini-wrap {
  max-width: 460px; margin: 0 auto; padding: var(--s-7) var(--s-5);
  text-align: center;
}
.mini-value {
  font-family: var(--font-num); font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  font-size: clamp(3rem, 2rem + 5vw, 4.5rem); font-weight: 500;
  line-height: 1; letter-spacing: -0.03em;
}
.mini-unit {
  margin-top: var(--s-1); color: var(--dim);
  font-family: var(--font-mono); font-size: var(--t-label);
  letter-spacing: 0.07em; text-transform: uppercase;
}
.mini-phase { margin-top: var(--s-3); color: var(--dim); font-size: var(--t-xs); min-height: 1.4em; }
.mini-row {
  display: flex; justify-content: center; gap: var(--s-5);
  margin-top: var(--s-4);
  color: var(--dim); font-family: var(--font-mono); font-size: var(--t-xs);
  font-variant-numeric: tabular-nums;
}
.mini-row b { color: var(--text); font-weight: 500; }
.mini-actions { margin-top: var(--s-5); display: flex; flex-direction: column; gap: var(--s-3); align-items: center; }
.mini-share { width: 100%; }
.mini-note { margin-top: var(--s-5); font-size: var(--t-xs); color: var(--faint); }

/* ------------------------------------------------------ landing imagery --
   Illustrations arrive as framed plates: dark instrument renders in rounded
   panels. The generated art has its own ground, so every image gets a frame
   rather than pretending to be transparent line art. */
.hero-grid {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: var(--s-6); align-items: center;
}
.hero-art { margin: 0; }
.hero-art img {
  display: block; width: 100%; height: auto;
  border-radius: var(--r-xl); border: 1px solid var(--line-soft);
  box-shadow: var(--shadow-lg);
}

.section-fig { margin: var(--s-5) 0 0; }
.section-fig img {
  display: block; width: 100%; height: auto;
  border-radius: var(--r-lg); border: 1px solid var(--line-soft);
}

/* Metric icons: monoline SVGs in the signal colour. */
.card-ico { display: block; width: 28px; height: 28px; margin-bottom: var(--s-3); color: var(--signal); }
.card-ico svg { display: block; width: 100%; height: 100%; }

/* Step cards: the illustration bleeds to the card edges, copy sits below. */
.card-illus { overflow: hidden; }
.card-illus img,
.card-illus video {
  display: block;
  width: calc(100% + 2 * var(--s-5)); height: auto;
  margin: calc(-1 * var(--s-5)) calc(-1 * var(--s-5)) var(--s-4);
  border-bottom: 1px solid var(--line-soft);
}
.card-illus img,
.card-illus video { border-radius: var(--r-lg) var(--r-lg) 0 0; }

/* Blog cards: thumbnail strip above the category tag. */
.post-thumb { display: block; margin: calc(-1 * var(--s-5)) calc(-1 * var(--s-5)) var(--s-2); overflow: hidden; }
.post-thumb img { display: block; width: 100%; height: auto; border-bottom: 1px solid var(--line-soft); transition: transform 0.35s var(--ease); }
.post-thumb { border-radius: var(--r-lg) var(--r-lg) 0 0; }
.post-card:hover .post-thumb img { transform: scale(1.03); }
@media (prefers-reduced-motion: reduce) { .post-card:hover .post-thumb img { transform: none; } }

/* Article share panel: one ruled strip, buttons as quiet outline chips. */
.share-panel {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2);
  margin-top: var(--s-5); padding-top: var(--s-4);
  border-top: 1px solid var(--line-soft);
}
.share-panel .m-label { margin: 0 var(--s-2) 0 0; }
.share-btn {
  display: inline-block; padding: 5px var(--s-3);
  color: var(--dim); background: none;
  border: 1px solid var(--line); border-radius: var(--r-pill);
  font: inherit; font-size: var(--t-xs); text-decoration: none;
  cursor: pointer;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.share-btn:hover { color: var(--signal); border-color: var(--signal); text-decoration: none; }
.share-btn:focus-visible { outline: 2px solid var(--signal); outline-offset: 1px; }

/* Theme-conditional artwork: each slot carries a dark and a light plate; the
   root data-theme decides which renders. Declared AFTER every imagery rule
   above so the equal-specificity display:block rules lose the tie, and the
   hidden sibling stays display:none (lazy loading then skips its download). */
img.thm-light, video.thm-light { display: none; }
html[data-theme="light"] img.thm-dark { display: none; }
html[data-theme="light"] img.thm-light,
html[data-theme="light"] video.thm-light { display: block; }

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: var(--s-4); }
  .hero-art { display: none; }
}

/* Delta chips: change vs the previous run, semantic by direction. */
.m-delta {
  margin-left: auto;
  font-family: var(--font-mono); font-size: var(--t-label);
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
  padding: 1px var(--s-2);
  border: 1px solid currentColor;
  border-radius: var(--r-xs);
}
.m-delta--better { color: var(--good); }
.m-delta--worse { color: var(--bad); }
.m-delta--flat { color: var(--faint); text-transform: uppercase; letter-spacing: 0.05em; }

/* Health beside the verdict badge, and the shared tooltip it opens. */
.verdict-health {
  font-family: var(--font-mono); font-size: var(--t-xs);
  letter-spacing: 0.04em; color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
.tipbox {
  position: fixed; z-index: 120;
  max-width: 320px;
  padding: var(--s-3) var(--s-4);
  background: var(--ink-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-xs);
  color: var(--text-2);
  font-family: var(--font-mono); font-size: var(--t-xs);
  line-height: 1.6;
  white-space: pre-line;
  pointer-events: none;
}
[data-tip] { cursor: help; border-bottom: 1px dotted var(--line-strong); }

/* Cloudflare cross-check: a three-column ruled comparison. */
.cf-check { margin-top: var(--s-4); }
.cf-grid { max-width: 560px; }
.cf-row {
  display: grid; grid-template-columns: minmax(7em, 1fr) 1fr 1.3fr;
  align-items: baseline; gap: var(--s-4);
  padding: var(--s-3) 0;
  border-bottom: 1px solid var(--line-soft);
}
.cf-row:last-child { border-bottom: 0; }
.cf-row .specs-key {
  color: var(--dim);
  font-family: var(--font-mono); font-size: var(--t-label);
  letter-spacing: 0.06em; text-transform: uppercase;
}
.cf-row .specs-val {
  margin: 0;
  font-family: var(--font-num); font-size: var(--t-sm);
  font-variant-numeric: tabular-nums; color: var(--text-2);
}
.cf-head .specs-val {
  font-family: var(--font-mono); font-size: var(--t-label);
  letter-spacing: 0.05em; text-transform: uppercase; color: var(--faint);
}
.cf-delta {
  margin-left: var(--s-2);
  font-size: var(--t-label); color: var(--faint);
}

/* Local test history. */
.history-wrap { margin-top: var(--s-7); }
.history-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s-3); flex-wrap: wrap; margin-bottom: var(--s-3);
}
.history-table { width: 100%; border-collapse: collapse; font-size: var(--t-sm); }
.history-table th {
  padding: var(--s-2) var(--s-3); text-align: left;
  color: var(--dim); font-family: var(--font-mono);
  font-size: var(--t-label); letter-spacing: 0.05em; text-transform: uppercase;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.history-table td {
  padding: var(--s-3); border-bottom: 1px solid var(--line-soft);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.history-table tbody tr { transition: background-color 0.16s var(--ease); }
.history-table tbody tr:hover { background: var(--tile-bg); }
.rating {
  padding: 2px var(--s-3); border-radius: var(--r-pill);
  font-family: var(--font-mono);
  font-size: var(--t-label); letter-spacing: 0.05em; text-transform: uppercase;
  border: 1px solid currentColor;
}
.r-excellent { color: var(--good); }
.r-verygood  { color: var(--signal); }
.r-good      { color: var(--signal-deep); }
.r-fair      { color: var(--warn); }
.r-poor, .r-unstable { color: var(--bad); }

/* Skeleton shimmer for values awaiting their first sample. */
.skeleton {
  display: inline-block; min-width: 3ch; height: 1em; border-radius: 4px;
  background: linear-gradient(90deg, var(--line-soft), var(--line), var(--line-soft));
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* Short viewports: keep dial + primary action inside the first screen. */
@media (max-height: 760px) {
  .hero { padding: var(--s-4) 0 0; }
  .hero p { display: none; }
  .test-panel { margin-top: var(--s-4); padding: var(--s-5) var(--s-4) var(--s-5); }
  .gauge-wrap { width: clamp(160px, 22vh, 208px); height: clamp(160px, 22vh, 208px); }
  .gauge-value { font-size: clamp(2rem, 6vw, 2.5rem); }
  .test-phase { margin-top: var(--s-3); }
}

/* -------------------------------------------------------- reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ------------------------------------------------------------------ print */
@media print {
  .site-header, .site-footer, .ad-box, .consent-banner, .test-actions { display: none; }
  body { background: #fff; color: #000; }
  .test-panel, .verdict-card, .card { border-color: #ccc; box-shadow: none; background: #fff; }
}
