/* Network Speed Monitor site. Shared styles; no build step. */

/* Atkinson Hyperlegible Next, SIL OFL (see fonts/OFL.txt), latin subset, self-hosted. */
@font-face { font-family: "Atkinson Hyperlegible Next"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/atkinson-hyperlegible-next-latin-400.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible Next"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("fonts/atkinson-hyperlegible-next-latin-500.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible Next"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("fonts/atkinson-hyperlegible-next-latin-700.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible Next"; font-style: normal; font-weight: 800; font-display: swap;
  src: url("fonts/atkinson-hyperlegible-next-latin-800.woff2") format("woff2"); }

:root {
  color-scheme: light dark;
  --paper: #f3f3f3;
  --ink: #1a1a1a;
  --muted: #5f5f5f;
  --rule: #dcdcdc;
  --down: #0067c0;
  --up: #b35c00;
  --on-ink: #ffffff; /* text on an --ink button */
  --ink-hover: #000000;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #262626;
    --ink: #f2f2f2;
    --muted: #a0a0a0;
    --rule: #333333;
    --down: #5eb8f0;
    --up: #f0a35e;
    --on-ink: #1a1a1a;
    --ink-hover: #ffffff;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.55 "Atkinson Hyperlegible Next", system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
}
a { color: inherit; }
:focus-visible { outline: 2px solid var(--down); outline-offset: 3px; border-radius: 2px; }

.wrap { max-width: 72rem; margin: 0 auto; padding: 0 clamp(1rem, 4vw, 2.5rem); }

/* Headlines are large and tight, and do the visual work. */
h1 { margin: 0 0 1rem; font-weight: 800; font-size: clamp(2.25rem, 5vw, 3.5rem); line-height: 1.02; letter-spacing: -.03em; }

/* Text for screen readers only. */
.vh { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Reading column, with an optional margin column for short asides. */
.read { max-width: 40rem; }
.read-grid { display: grid; grid-template-columns: minmax(0, 40rem) minmax(0, 16rem); column-gap: 4rem; align-items: start; }
.aside { font-size: .95rem; color: var(--muted); border-left: 2px solid var(--rule); padding-left: 1rem; }
@media (max-width: 62rem) {
  .read-grid { display: block; }
  .aside { margin-top: 1rem; }
}

/* header */
.site-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1rem; padding-top: 1.5rem; }
.brand { display: flex; align-items: center; gap: .6rem; font-weight: 700; text-decoration: none; }
.brand svg { width: 26px; height: 26px; }
.site-nav { display: flex; flex-wrap: wrap; gap: .25rem 1.5rem; font-size: .95rem; }
.site-nav a { text-decoration: none; color: var(--muted); }
.site-nav a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
.site-nav a[aria-current="page"] { color: var(--ink); font-weight: 500; }
.site-nav { align-items: center; }
.nav-gh { display: inline-flex; padding: .15rem; margin: -.15rem; } /* a bigger target than the 20 px mark */
.nav-gh svg { width: 20px; height: 20px; fill: currentColor; }

/* page body */
main { padding-block: clamp(2rem, 6vw, 4rem); }
main:empty { padding-block: 0; min-height: 40vh; }

/* buttons and quiet links */
.btn {
  display: inline-flex; align-items: center; gap: .6rem;
  padding: .85rem 1.3rem; border-radius: 6px;
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
}
.btn-primary { background: var(--ink); color: var(--on-ink); }
.btn-primary:hover { background: var(--ink-hover); }
.btn-primary svg { width: 18px; height: 18px; }
.link-quiet { color: var(--ink); font-weight: 500; text-underline-offset: 4px; }
.fine { margin: .9rem 0 0; color: var(--muted); font-size: .9rem; }

/* footer */
.site-foot { border-top: 1px solid var(--rule); margin-top: clamp(2rem, 6vw, 4rem); padding-block: 2rem 3rem; font-size: .95rem; color: var(--muted); }
.site-foot nav { display: flex; flex-wrap: wrap; gap: .25rem 1.5rem; }
.site-foot a { color: var(--ink); text-underline-offset: 4px; }
.site-foot a[aria-current="page"] { font-weight: 500; }
.site-foot p { margin: 1rem 0 0; }

/* ---- Landing hero: a Windows desktop, with the taskbar along the bottom of the first screen ---- */

main.home { padding-block: 0; }
.hero {
  /* Header + hero fill the first screen. hero.js sets --head to the header's measured height;
     these values are only the fallback without JavaScript. */
  --head: 3.5rem;
  display: flex; flex-direction: column;
  min-height: calc(100vh - var(--head));
  min-height: clamp(calc(40rem - var(--head)), calc(100svh - var(--head)), calc(64rem - var(--head)));
}
.hero-copy { flex: 1; display: flex; flex-direction: column; justify-content: center; width: 100%; padding-block: clamp(1.5rem, 5vh, 4rem) .5rem; }
.hero h1 { margin: 0; font-size: clamp(2.75rem, min(6.4vw, 10vh), 5.75rem); line-height: .98; letter-spacing: -.035em; max-width: 11ch; }
.lede { margin: 1.75rem 0 0; max-width: 34rem; font-size: clamp(1.0625rem, 1.6vw, 1.25rem); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.25rem; margin-top: 2.25rem; }

/* The stage: the controls and the note sit in flow above the full-bleed taskbar, so they can never overlap.
   On narrow screens the controls move under the taskbar, and the note gets the row above it. */
.stage {
  --s: 1.5; /* taskbar magnification */
  flex: none; padding-top: .5rem;
  display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "controls note" "bar bar";
  align-items: end; column-gap: 1.5rem;
}
.stage-controls {
  grid-area: controls; margin: 0 0 1rem clamp(1rem, 4vw, 2.5rem);
  display: flex; flex-wrap: wrap; gap: .5rem; font-size: .85rem;
}
.theme-switch { display: inline-flex; border: 1px solid var(--rule); border-radius: 6px; overflow: hidden; background: var(--paper); }
.theme-switch button, .show-menu {
  font: inherit; border: 0; background: transparent; padding: .4rem .75rem; cursor: pointer; color: var(--muted);
}
.theme-switch button[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); }
.show-menu { border: 1px solid var(--rule); border-radius: 6px; color: var(--ink); }
.show-menu:hover, .theme-switch button[aria-pressed="false"]:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

/* Taskbar replica. Colours are the app's overlay palettes (src/ui/overlay_renderer.cpp). */
.taskbar {
  grid-area: bar;
  --tb-bg: #202020; --tb-text: #ffffff; --tb-muted: #9a9a9a; --tb-up: #f0a35e; --tb-down: #5eb8f0;
  --tb-hover: rgba(255, 255, 255, .1);
  position: relative;
  height: calc(40px * var(--s));
  background: var(--tb-bg);
  color: var(--tb-text);
  display: flex; align-items: stretch; justify-content: space-between;
  /* Like the app; the site face's latin subset has no arrows, so system fonts come first. */
  font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, "Atkinson Hyperlegible Next", sans-serif;
  font-size: calc(12px * var(--s));
  transition: background-color .25s, color .25s;
  -webkit-user-select: none; user-select: none;
}
.taskbar.taskbar-light {
  --tb-bg: #eeeeee; --tb-text: #000000; --tb-muted: #5f5f5f; --tb-up: #b35c00; --tb-down: #0067c0;
  --tb-hover: rgba(0, 0, 0, .07);
}
.taskbar :focus-visible { outline-color: var(--tb-text); outline-offset: -3px; }
.tb-left {
  display: flex; align-items: center; gap: calc(4px * var(--s)); padding-left: calc(4px * var(--s));
  -webkit-mask-image: linear-gradient(90deg, #000 0, #000 30%, transparent 85%);
          mask-image: linear-gradient(90deg, #000 0, #000 30%, transparent 85%);
  flex: 1; overflow: hidden; min-width: 0;
}
.tb-start { width: calc(48px * var(--s)); height: 100%; display: grid; place-items: center; flex: none; }
.tb-start svg { width: calc(16px * var(--s)); height: calc(16px * var(--s)); fill: var(--tb-text); }
.tb-search {
  height: calc(32px * var(--s)); width: calc(280px * var(--s)); flex: none;
  background: color-mix(in srgb, var(--tb-text) 9%, transparent);
  border-radius: 2px; display: flex; align-items: center; padding-left: calc(12px * var(--s));
  color: var(--tb-muted); white-space: nowrap;
}
.tb-app { width: calc(48px * var(--s)); height: 100%; display: grid; place-items: center; flex: none; }
.tb-app i { display: block; width: calc(22px * var(--s)); height: calc(22px * var(--s)); border-radius: 3px;
  background: color-mix(in srgb, var(--tb-text) 22%, transparent); }

/* Windows 11: a 48 px bar with centred task buttons and a rounded search box. The readout's place, left of
   the tray, and its colours are the same as on Windows 10. */
.taskbar.win11 {
  --tb-bg: #1c1c1c; --tb-accent: #4cc2ff;
  height: calc(48px * var(--s)); box-shadow: inset 0 1px rgba(255, 255, 255, .08);
}
.taskbar.win11.taskbar-light { --tb-bg: #e8e8e8; --tb-accent: #0067c0; box-shadow: inset 0 1px rgba(0, 0, 0, .08); }
.win11 .tb-left, .only-11, .tb-center { display: none; }
.win11 .only-11 { display: flex; }
.win11 .only-10 { display: none; }
.win11 .tb-center {
  display: flex; align-items: center; gap: calc(4px * var(--s));
  position: absolute; top: 0; bottom: 0; left: 50%; transform: translateX(-50%);
}
.w11-btn { position: relative; display: grid; place-items: center; width: calc(40px * var(--s)); height: calc(40px * var(--s)); border-radius: calc(4px * var(--s)); flex: none; }
.w11-start svg { width: calc(18px * var(--s)); height: calc(18px * var(--s)); fill: var(--tb-accent); }
.w11-app i { display: block; width: calc(24px * var(--s)); height: calc(24px * var(--s)); border-radius: calc(5px * var(--s));
  background: color-mix(in srgb, var(--tb-text) 22%, transparent); }
.w11-app.is-active { background: color-mix(in srgb, var(--tb-text) 8%, transparent); }
.w11-app.is-open::after, .w11-app.is-active::after { /* running-app indicator under the button */
  content: ""; position: absolute; bottom: calc(1px * var(--s)); left: 50%; transform: translateX(-50%);
  width: calc(6px * var(--s)); height: calc(3px * var(--s)); border-radius: 2px; background: var(--tb-muted);
}
.w11-app.is-active::after { width: calc(16px * var(--s)); background: var(--tb-accent); }
.w11-search {
  display: flex; align-items: center; gap: calc(8px * var(--s)); flex: none;
  height: calc(32px * var(--s)); margin: 0 calc(4px * var(--s)); padding: 0 calc(40px * var(--s)) 0 calc(12px * var(--s));
  border-radius: calc(16px * var(--s)); color: var(--tb-muted); white-space: nowrap;
  background: color-mix(in srgb, var(--tb-text) 6%, transparent); border: 1px solid color-mix(in srgb, var(--tb-text) 9%, transparent);
}
.w11-search svg { width: calc(14px * var(--s)); height: calc(14px * var(--s)); stroke: var(--tb-text); fill: none; stroke-width: 1.4; }
/* The centred buttons must clear the readout and tray: the search box shrinks to its icon below 100rem, and below
   90rem the buttons move left, as the "Left" taskbar alignment puts them. */
@media (max-width: 100rem) {
  .w11-search { width: calc(40px * var(--s)); padding: 0; margin: 0; justify-content: center; border: 0; background: none; font-size: 0; }
  .w11-search svg { width: calc(18px * var(--s)); height: calc(18px * var(--s)); }
}
@media (max-width: 90rem) {
  .win11 .tb-center { position: static; transform: none; flex: 1; min-width: 0; overflow: hidden; padding-left: calc(4px * var(--s)); }
}
.win11 .tb-btn { padding: 0 calc(4px * var(--s)); }
.win11 .tb-group { padding: 0 calc(4px * var(--s)); }
.win11 .tb-clock { align-items: flex-end; text-align: right; padding: 0 calc(8px * var(--s)) 0 calc(6px * var(--s)); }
.win11 .tb-bell { padding: 0 calc(12px * var(--s)) 0 calc(4px * var(--s)); }

.tb-tray { position: relative; display: flex; align-items: stretch; flex: none; margin-left: auto; }
.tb-icons, .tb-group { display: flex; align-items: stretch; }
.tb-btn { display: flex; align-items: center; justify-content: center; padding: 0 calc(6px * var(--s)); }
.tb-btn svg { width: calc(16px * var(--s)); height: calc(16px * var(--s)); stroke: var(--tb-text); fill: none; stroke-width: 1.2; }
.tb-clock { flex-direction: column; line-height: 1.25; padding: 0 calc(8px * var(--s)); text-align: center; white-space: nowrap; }
.tb-notif { width: calc(40px * var(--s)); }

/* The readout: 54 x 28 DIP graph, 6 DIP gap, then two right-aligned lines. */
.readout {
  display: flex; align-items: center; gap: calc(6px * var(--s));
  padding: 0 calc(4px * var(--s)); margin-right: calc(2px * var(--s));
  background: transparent; border: 0; color: inherit; font: inherit; cursor: pointer;
  font-variant-numeric: tabular-nums; -webkit-touch-callout: none;
}
.readout:hover { background: var(--tb-hover); }
.readout svg { width: calc(54px * var(--s)); height: calc(28px * var(--s)); overflow: visible; flex: none; }
.readout polyline { fill: none; stroke-width: 1.5; stroke-linejoin: round; }
#g-rx { stroke: var(--tb-down); }
#g-tx { stroke: var(--tb-up); }
.readout .lines { display: grid; line-height: 1.33; text-align: right; white-space: nowrap; min-width: 5.6em; }
.readout .a-up { color: var(--tb-up); }
.readout .a-down { color: var(--tb-down); }
.readout.letters .a-up, .readout.letters .a-down { color: var(--tb-muted); }

/* Annotation pointing at the readout. */
.note {
  grid-area: note; justify-self: end; position: relative;
  margin: 0 var(--note-right, 1rem) 1.35rem 0; /* hero.js lines the note up with the readout */
  width: max-content; max-width: min(19rem, calc(100% - 2rem)); text-align: right;
  font-family: "Atkinson Hyperlegible Next", system-ui, sans-serif; font-size: .95rem; line-height: 1.4; color: var(--ink);
  pointer-events: none;
}
.note::after {
  content: ""; position: absolute; right: var(--lead-x, 4rem); top: calc(100% + .35rem);
  width: 1px; height: .7rem; background: var(--ink);
}

/* Popups open above the taskbar, like the real flyouts. */
.popup {
  position: absolute; bottom: calc(100% + 10px); right: var(--pop-right, .75rem); z-index: 5;
  max-width: calc(100% - 1.5rem);
  box-shadow: 0 8px 28px rgba(0, 0, 0, .28);
  font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, "Atkinson Hyperlegible Next", sans-serif;
  text-align: left;
  transform-origin: bottom right;
}
.popup[hidden] { display: none; }
.popup.opening { animation: rise .16s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

/* Context menu: the standard light Win32 menu, whatever the taskbar colour. */
.menu { min-width: 15rem; padding: 4px 0; background: #ffffff; color: #1a1a1a; border: 1px solid #cccccc; font-size: 14px; }
.menu button {
  display: flex; width: 100%; justify-content: space-between; gap: 2rem; border: 0; background: none; color: inherit;
  font: inherit; padding: 6px 14px 6px 30px; text-align: left; cursor: default; position: relative;
}
.menu button:hover, .menu button:focus-visible { background: #cce8ff; }
.menu button:focus { outline: none; }
.menu button:focus-visible { box-shadow: inset 0 0 0 1px #0067c0; }
.menu button[aria-checked="true"]::before { content: "\2713"; position: absolute; left: 11px; }
.menu .default { font-weight: 700; } /* what a left-click does */
.menu .sub::after { content: "\203A"; }
.menu .sub[aria-expanded="true"] { background: #cce8ff; }
/* Adapter and Units submenus: hero.js places them beside the menu, or above it when there's no room. */
.submenu { bottom: auto; right: auto; min-width: 9rem; }
.menu.radio button[aria-checked="true"]::before { content: "\2022"; } /* Units uses a radio bullet, like the app */
.menu hr { border: 0; border-top: 1px solid #e0e0e0; margin: 4px 0; }

/* Report window replica, a reusable component. Colours from src/ui/report_paint.cpp.
   Sizes are in em of a 12 DIP base (the window's message font), so font-size scales the whole window. */
.report {
  --r-bg: #ffffff; --r-surface: #f5f5f5; --r-border: #e0e0e0; --r-text: #1a1a1a; --r-muted: #5f5f5f;
  --r-received: #0067c0; --r-sent: #b35c00; --r-accent: #0067c0; --r-grid: #e6e6e6;
  --r-control: #e1e1e1; --r-control-edge: #adadad; --r-field: #ffffff; --r-field-edge: #7a7a7a;
  font-family: "Segoe UI", system-ui, "Atkinson Hyperlegible Next", sans-serif;
  font-size: 13px; line-height: 1.36;
  background: var(--r-bg); color: var(--r-text); border: 1px solid var(--r-border);
  display: flex; flex-direction: column;
}
.report.report-dark {
  --r-bg: #202020; --r-surface: #2b2b2b; --r-border: #3d3d3d; --r-text: #ffffff; --r-muted: #a0a0a0;
  --r-received: #5eb8f0; --r-sent: #f0a35e; --r-accent: #5eb8f0; --r-grid: #353535;
  --r-control: #333333; --r-control-edge: #6b6b6b; --r-field: #383838; --r-field-edge: #6b6b6b;
}
@media (prefers-color-scheme: dark) { /* .report-auto follows the page's colour scheme; same values as above */
  .report.report-auto {
    --r-bg: #202020; --r-surface: #2b2b2b; --r-border: #3d3d3d; --r-text: #ffffff; --r-muted: #a0a0a0;
    --r-received: #5eb8f0; --r-sent: #f0a35e; --r-accent: #5eb8f0; --r-grid: #353535;
    --r-control: #333333; --r-control-edge: #6b6b6b; --r-field: #383838; --r-field-edge: #6b6b6b;
  }
}
.report :focus-visible { outline-color: var(--r-accent); }
.report-title { display: flex; align-items: center; flex: none; padding-left: 1em; height: 2.6em; }
.report-title > span:first-child { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.report-title .cap {
  display: grid; place-items: center; width: 3.8em; height: 100%; border: 0; background: none; color: inherit;
  font: inherit; font-size: .85em; padding: 0;
}
.report-title button.cap { cursor: pointer; }
.report-title button.cap:hover { background: #e81123; color: #ffffff; }
.report-body { position: relative; padding: 1em; overflow: auto; min-height: 0; }
.r-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .667em; }
/* The Period drop-down list: a real select, drawn like the Win32 combo box. */
.r-select { position: relative; display: inline-flex; }
.r-select select {
  -webkit-appearance: none; appearance: none; min-width: 11em; margin: 0; border-radius: 0; cursor: pointer;
  padding: .2em 2em .2em .5em; font: inherit; color: var(--r-text); background: var(--r-field); border: 1px solid var(--r-field-edge);
}
.r-select select:focus-visible { outline: 2px solid var(--r-accent); outline-offset: 1px; }
.r-select option { color: var(--r-text); background: var(--r-field); }
.r-select::after {
  content: ""; position: absolute; right: .7em; top: 50%; width: .45em; height: .45em; pointer-events: none;
  border: solid var(--r-text); border-width: 0 1px 1px 0; transform: translateY(-70%) rotate(45deg);
}
/* The Custom range dialog, over the report like the app's modal one. */
.r-dialog {
  position: absolute; z-index: 2; top: 3.2em; left: 1em; display: grid; gap: .667em; padding: 1em 1.2em;
  background: var(--r-bg); color: var(--r-text); border: 1px solid var(--r-field-edge); box-shadow: 0 8px 24px rgba(0, 0, 0, .3);
}
.r-dialog[hidden] { display: none; }
.r-dialog-title { margin: 0; font-weight: 600; }
.r-dialog label { display: flex; align-items: center; justify-content: space-between; gap: 1em; }
.r-dialog input { font: inherit; color: var(--r-text); background: var(--r-field); border: 1px solid var(--r-field-edge); padding: .15em .4em; color-scheme: light; }
.report-dark .r-dialog input { color-scheme: dark; }
@media (prefers-color-scheme: dark) { .report-auto .r-dialog input { color-scheme: dark; } }
.r-dialog-btns { display: flex; justify-content: flex-end; gap: .667em; margin-top: .333em; }
.r-dialog .r-btn { font: inherit; color: var(--r-text); min-width: 6em; cursor: pointer; }
.r-range { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--r-muted); }
.r-btns { display: flex; gap: .667em; margin-left: auto; }
.r-btn { padding: .2em .9em; background: var(--r-control); border: 1px solid var(--r-control-edge); white-space: nowrap; }
/* Tab strip as PaintTabs draws it: the selected tab gets the surface fill and a 2 DIP accent bar. */
.r-tabs { display: flex; margin-top: .667em; border-bottom: 1px solid var(--r-border); overflow-x: auto; scrollbar-width: none; }
.r-tabs button {
  flex: none; padding: .45em .9em; border: 0; background: none; color: var(--r-muted);
  font: inherit; white-space: nowrap; cursor: pointer;
}
.r-tabs button:hover { color: var(--r-text); }
.r-tabs [aria-selected="true"] { color: var(--r-text); background: var(--r-surface); box-shadow: inset 0 -2px var(--r-accent); }
.r-tabs button:focus-visible { outline: 2px solid var(--r-accent); outline-offset: -2px; border-radius: 0; }
/* Every page shares one grid cell, so on wide screens the window keeps the height of its tallest page. */
.r-pages { display: grid; }
.r-page { grid-area: 1 / 1; margin-top: .667em; min-width: 0; }
.r-page[hidden] { display: block; visibility: hidden; }
.r-page:focus-visible { outline: 2px solid var(--r-accent); outline-offset: 2px; }
.r-cards, .r-panels { display: grid; grid-template-columns: repeat(var(--r-cols, 4), minmax(0, 1fr)); gap: 1em; }
.r-panels, .r-cards.r-three { --r-cols: 3; }
.r-panels { margin-top: 1.333em; }
.r-card, .r-panel { background: var(--r-surface); border: 1px solid var(--r-border); border-radius: .5em; padding: 1em; min-width: 0; }
.r-card { display: grid; gap: .333em; }
.r-card.is-on { border: 2px solid var(--r-accent); padding: calc(1em - 1px); }
.r-card > span, .r-row > span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r-muted { color: var(--r-muted); }
.r-value { font-size: 1.833em; font-weight: 600; line-height: 1.25; white-space: nowrap; }
.r-panel-title { margin: 0 0 .5em; font-size: 1.1667em; font-weight: 600; }
.r-row { display: flex; justify-content: space-between; gap: .667em; line-height: 1.833em; }
.r-row > span:last-child { flex: none; }
.r-note { margin: 1.333em 0 0; color: var(--r-muted); }

/* Timeline (PaintTimeline): legend, Y labels from ChooseAxis, gridlines, stacked day bars at 70% of their slot. */
.r-legend { display: flex; gap: 1.667em; }
.r-legend span { display: inline-flex; align-items: center; gap: .5em; }
.r-sw { display: block; width: 10px; height: 10px; }
.r-sw.r-rx, .r-col .r-rx { background: var(--r-received); }
.r-sw.r-tx, .r-col .r-tx { background: var(--r-sent); }
.r-chart {
  display: grid; grid-template-columns: 4.5em minmax(0, 1fr); grid-template-rows: 14em auto;
  column-gap: .667em; margin-top: 1.333em; padding: .5em 4px 0 0;
}
.r-y { position: relative; color: var(--r-muted); }
.r-y span { position: absolute; right: 0; transform: translateY(50%); white-space: nowrap; }
.r-plot { position: relative; display: flex; align-items: flex-end; }
.r-grid { position: absolute; left: 0; right: 0; height: 0; border-top: 1px solid var(--r-grid); }
.r-grid.r-base { border-color: var(--r-border); }
.r-slot { position: relative; flex: 1 1 0; height: 100%; display: flex; align-items: flex-end; justify-content: center; }
.r-slot:hover { background: var(--r-surface); }
.r-col { display: flex; flex-direction: column; width: 70%; }
.r-col > span { flex-basis: 0; }
.r-x { grid-column: 2; display: flex; margin-top: .333em; color: var(--r-muted); }
.r-x span { flex: 1 1 0; display: flex; justify-content: center; white-space: nowrap; min-width: 0; }

/* Adapters and Wi-Fi networks: report-style list views; the raw-traffic note above them is muted. */
.r-raw { margin: 0; color: var(--r-muted); }
.r-check { display: flex; align-items: center; gap: .4em; margin: .667em 0 .333em; }
.r-check i { width: 13px; height: 13px; border: 1px solid var(--r-field-edge); background: var(--r-field); }
.r-table-wrap { margin-top: .667em; overflow-x: auto; }
.r-table { width: 100%; border-collapse: collapse; white-space: nowrap; }
.r-table th { position: relative; padding: .3em .6em; font-weight: 400; text-align: left; border-bottom: 1px solid var(--r-border); }
.r-table th + th { border-left: 1px solid var(--r-border); }
.r-table td { padding: .25em .6em; }
.r-table .r-num { text-align: right; width: 7.5em; }
.r-table th:nth-child(2):not(.r-num) { width: 6.5em; } /* the Type column */
.r-sort { /* HDF_SORTDOWN: a small caret along the header's top edge */
  position: absolute; top: 1px; left: 50%; width: .4em; height: .4em; transform: translateX(-50%) rotate(45deg);
  border: solid var(--r-muted); border-width: 0 1px 1px 0;
}

/* The report popup above the taskbar. */
.popup.report { width: 42rem; max-height: calc(100svh - 48px * var(--s) - 2rem); }

/* ---- Landing sections: one reading column, separated by space and a heading ---- */

.section { padding-top: clamp(4rem, 10vw, 7rem); }
h2 { margin: 0 0 1.25rem; font-weight: 800; font-size: clamp(1.875rem, 3.4vw, 2.5rem); line-height: 1.08; letter-spacing: -.025em; }
.section p, .section ul { margin: 0 0 1rem; }
.section ul { padding-left: 1.25rem; }
.section li + li { margin-top: .5rem; }
.section a:not(.btn) { color: var(--ink); text-underline-offset: 3px; }
.section a:not(.btn):hover { text-decoration-thickness: 2px; }
.lead { font-size: clamp(1.375rem, 2.6vw, 1.75rem); font-weight: 700; line-height: 1.25; letter-spacing: -.01em; }
/* "Upload" and "download" in body copy: ink-coloured words, each after a small swatch in its series colour
   (the colours themselves are too light for body text on paper). */
.mark-up, .mark-down { white-space: nowrap; }
.mark-up::before, .mark-down::before {
  content: ""; display: inline-block; width: .55em; height: .55em; margin-right: .3em; vertical-align: .05em;
}
.mark-up::before { background: var(--up); }
.mark-down::before { background: var(--down); }
code { font-family: ui-monospace, Consolas, monospace; font-size: .9em; overflow-wrap: anywhere; }
.aside h3 { margin: 0 0 .5rem; font-size: 1rem; color: var(--ink); }
.aside p { margin: 0 0 .75rem; }
.aside code { display: block; color: var(--ink); }

/* What it does: a two-column definition list on wide screens. */
.facts { display: grid; grid-template-columns: 11rem minmax(0, 1fr); margin: 1.75rem 0 0; }
.facts dt, .facts dd { margin: 0; padding: .9rem 0; border-top: 1px solid var(--rule); }
.facts dt { font-weight: 700; padding-right: 1.5rem; }
@media (max-width: 36rem) {
  .facts { display: block; }
  .facts dt { padding-bottom: .2rem; }
  .facts dd { border-top: 0; padding-top: 0; }
}

/* The in-page report: a window on the page, in the page's own colour scheme. */
.report-figure { margin: 2.25rem 0; max-width: 54rem; }
.report-window { font-size: 14px; box-shadow: 0 2px 12px rgba(0, 0, 0, .12); }
.report-window .report-title { color: var(--r-text); }
.report-figure figcaption { margin-top: .75rem; font-size: .9rem; color: var(--muted); }

.section .downloads { list-style: none; padding: 0; }
.downloads li + li { margin-top: .75rem; }
.downloads a { font-weight: 700; }
.downloads code { display: block; color: var(--muted); }

/* ---- Supporting pages: a title, then one reading column ---- */

.doc h1 { font-size: clamp(2.25rem, 4.6vw, 3.25rem); }
.intro { margin: 0 0 2rem; font-size: clamp(1.0625rem, 1.6vw, 1.1875rem); }
.doc section { padding-top: clamp(2.5rem, 6vw, 3.75rem); }
.doc h2 { margin-bottom: 1rem; font-size: clamp(1.5rem, 2.8vw, 1.875rem); }
.doc h3 { margin: 2rem 0 .5rem; font-size: 1.25rem; font-weight: 800; letter-spacing: -.01em; }
.doc p, .doc ul, .doc ol, .doc table, .doc .code { margin: 0 0 1rem; }
.doc ul, .doc ol { padding-left: 1.25rem; }
.doc li + li { margin-top: .5rem; }
.doc a:not(.btn) { color: var(--ink); text-underline-offset: 3px; }
.doc a:not(.btn):hover { text-decoration-thickness: 2px; }
.doc .facts { margin: 1rem 0 1rem; }
.doc .fine { margin: 0 0 1rem; }

/* On-page contents: a plain list of links between two rules. */
.toc { margin: 0; padding: 1rem 0; border-block: 1px solid var(--rule); }
.doc .toc h2 { margin: 0 0 .5rem; font-size: 1rem; letter-spacing: 0; line-height: 1.4; }
.toc ul { list-style: none; margin: 0; padding: 0; columns: 2 13rem; column-gap: 2rem; }
.doc .toc li { margin: 0; padding: .15rem 0; break-inside: avoid; }

/* Code blocks scroll sideways inside themselves, never the page. */
.code { display: flex; flex-direction: column; border-radius: 6px; background: color-mix(in srgb, var(--ink) 6%, var(--paper)); }
.code pre { min-width: 0; margin: 0; padding: .8rem 1rem; overflow-x: auto; }
.code pre code { font-size: .875rem; overflow-wrap: normal; white-space: pre; }
.copy { /* under the command, so the command gets the full width */
  align-self: flex-start; margin: -.25rem 0 .6rem 1rem; padding: .3rem .75rem; min-width: 5.5rem;
  font: inherit; font-size: .875rem; font-weight: 500; color: var(--ink); cursor: pointer;
  background: var(--paper); border: 1px solid var(--rule); border-radius: 4px;
}
.copy:hover { border-color: var(--muted); }
.copy[hidden] { display: none; }

/* Plain data tables, ruled like the definition lists. */
.table-wrap { overflow-x: auto; margin: 0 0 1rem; }
.doc .table-wrap table { margin: 0; }
.cols { width: 100%; border-collapse: collapse; font-size: .95rem; }
.cols th, .cols td { padding: .6rem 1rem .6rem 0; text-align: left; vertical-align: top; border-top: 1px solid var(--rule); }
.cols thead th { border-top: 0; font-weight: 700; }
.cols td:first-child { white-space: nowrap; }

@media (max-height: 45rem), (max-width: 50rem) { /* short or narrow screens: keep the taskbar in view */
  .hero { min-height: clamp(calc(36rem - var(--head)), calc(100svh - var(--head)), calc(64rem - var(--head))); }
  .hero-copy { padding-block: .5rem; }
  .hero h1 { font-size: clamp(2.25rem, min(6.4vw, 8.5vh), 5.75rem); }
  .lede { margin-top: .75rem; font-size: clamp(1rem, 1.5vw, 1.125rem); line-height: 1.5; }
  .actions { margin-top: 1rem; row-gap: .5rem; }
  .actions .btn { padding-block: .6rem; }
  .fine { margin-top: .5rem; font-size: .85rem; }
  .stage { padding-top: 0; }
  .note { margin-bottom: 1.2rem; }
  .note::after { top: calc(100% + .3rem); height: .6rem; }
}
@media (max-width: 50rem) {
  .hero { --head: 6rem; }
  .stage { --s: 1.15; grid-template-columns: minmax(0, 1fr); grid-template-areas: "note" "bar" "controls"; }
  .stage-controls { margin: .75rem 0 0 clamp(1rem, 4vw, 2.5rem); }
  .tb-search, .tb-hide-narrow, .win11 .tb-hide-narrow { display: none; }
  .note { font-size: .875rem; }
  .r-cards, .r-cards.r-three { --r-cols: 2; }
  .r-panels { --r-cols: 1; }
  .r-range { display: none; }
  .report-window { font-size: 12px; }
  .r-page[hidden] { display: none; } /* the stacked summary is much taller than the other pages here */
}
@media (max-width: 32rem) {
  .hero { --head: 7rem; }
  .site-head { padding-top: 1rem; row-gap: .5rem; }
  /* All four tabs stay visible: on one line down to 320 px, and they wrap if a wider font needs it. */
  .report-window .report-body { padding-inline: .6em; }
  .r-tabs { flex-wrap: wrap; }
  .r-tabs button { padding-inline: .45em; }
}
@media (max-width: 50rem) and (max-height: 40rem) { /* short phones, with the browser's toolbars showing */
  .site-head { padding-top: .75rem; row-gap: .25rem; }
  .site-nav { font-size: .875rem; column-gap: 1.1rem; }
  .hero { min-height: clamp(calc(30rem - var(--head)), calc(100svh - var(--head)), calc(64rem - var(--head))); }
  .hero-copy { padding-block: .25rem; }
  .hero h1 { font-size: 2rem; }
  .lede { margin-top: .5rem; font-size: .9375rem; line-height: 1.4; }
  .actions { margin-top: .75rem; }
  .actions .btn { padding-block: .45rem; }
  .fine { margin-top: .4rem; font-size: .8rem; line-height: 1.35; }
  .note { margin-bottom: 1rem; font-size: .8125rem; line-height: 1.3; }
  .note::after { top: calc(100% + .25rem); height: .5rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
