/* Member pages, direction A "Night watch" (register D38): dark ground, signal yellow, Archivo and JetBrains Mono,
   square corners, hard shadows on main buttons only, underlined links, status by dot, word and shape. The theme follows
   the system unless the visitor picks Light or Dark (html[data-theme], kept in localStorage by theme.js). */

@font-face { font-family: Archivo; src: url("/static/fonts/Archivo.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/static/fonts/JetBrainsMono.woff2") format("woff2"); font-weight: 100 800; font-display: swap; }

:root {
  color-scheme: dark;
  --bg: #0B1622; --panel: #12202F; --ink: #EEF2F6; --muted: #B9C5D2; --edge: #EEF2F6; --divider: #3A4A5C;
  --accent: #FFD23F; --focus: #FFD23F; --on-accent: #0B1622; --ok: #5BE38A; --warn: #FFD23F; --off: #B9C5D2;
  --notice-bg: #2A2810; --notice: #FFD23F; --bar: #EEF2F6; --bar-idle: #3A4A5C; --danger: #FF8A80; --now: #6EC6FF;
  --code-bg: #1B2129; --code-edge: #2F3944; --t-k: #8CC8FF; --t-s: #A8E6A1; --t-n: #FFB86C; --t-l: #D7A6FF; --t-c: #8A97A6; --t-f: #FFD23F; --t-kw: #FF9EC4;
  --attrib-filter: invert(1);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #F3F5F7; --panel: #FFFFFF; --ink: #0B1622; --muted: #4A5868; --edge: #0B1622; --divider: #C9D1DA; --focus: #0B1622; /* signal yellow on white is too faint for a focus ring */
    --ok: #1A7F43; --warn: #8A6A00; --off: #4A5868; --notice-bg: #FFF4C2; --notice: #0B1622; --bar: #0B1622;
    --bar-idle: #C9D1DA; --danger: #B3261E; --attrib-filter: none; --now: #1F6FB2;
    --code-bg: #ECEFF2; --code-edge: #C9D1DA; --t-k: #0B5CAD; --t-s: #1A7F43; --t-n: #A14E00; --t-l: #7A3DB8; --t-c: #5A6878; --t-f: #8A6A00; --t-kw: #B0246A;
  }
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #F3F5F7; --panel: #FFFFFF; --ink: #0B1622; --muted: #4A5868; --edge: #0B1622; --divider: #C9D1DA; --focus: #0B1622;
  --ok: #1A7F43; --warn: #8A6A00; --off: #4A5868; --notice-bg: #FFF4C2; --notice: #0B1622; --bar: #0B1622;
  --bar-idle: #C9D1DA; --danger: #B3261E; --attrib-filter: none; --now: #1F6FB2;
  --code-bg: #ECEFF2; --code-edge: #C9D1DA; --t-k: #0B5CAD; --t-s: #1A7F43; --t-n: #A14E00; --t-l: #7A3DB8; --t-c: #5A6878; --t-f: #8A6A00; --t-kw: #B0246A;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 16px/1.55 Archivo, system-ui, sans-serif; }
a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 3px solid var(--focus); outline-offset: 2px; box-shadow: 0 0 0 2px var(--bg);
}
code, .mono { font-family: "JetBrains Mono", ui-monospace, monospace; }
p code { font-size: 0.92em; background: var(--bg); border: 1px solid var(--divider); padding: 0 5px; white-space: nowrap; }
h1 { font-size: clamp(1.7rem, 4vw, 2.3rem); font-weight: 900; line-height: 1.15; margin: 0 0 8px; letter-spacing: -0.01em; }
h2 { font-size: 1.15rem; font-weight: 700; margin: 0 0 12px; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }

/* header */
.top { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; padding: 14px 20px; border-bottom: 2px solid var(--divider); background: var(--bg); }
/* the header stays in view on screens wide enough to keep it to one row */
@media (min-width: 760px) {
  .top { position: sticky; top: 0; z-index: 30; }
  html { scroll-padding-top: 84px; }
}
.brand { font-weight: 900; text-decoration: none; font-size: 1.1rem; margin-right: auto; }
/* The mark: stands on the baseline, 1.75 times the cap height, gap 0.36 of its width, as in the lockup
   (docs/design/logo). */
.brand .mark { height: 1.2em; width: .83em; margin-right: .3em; vertical-align: 0; }
.mark-bar { fill: var(--ink); } .mark-accent { fill: var(--accent); } .mark-idle { fill: #4A5560; }
.top nav { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; }
.nav-map { display: inline-flex; align-items: center; gap: 6px; }
.nav-map .icon { width: 1.15em; height: 1.15em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.top nav a:not(.btn-plain) { text-decoration-thickness: 3px; text-decoration-color: var(--muted); } /* the same bar on every page */
.top nav a[aria-current="page"] { text-decoration-color: var(--accent); }
/* the member links: a group of their own, set apart from the public ones; Sign in and Sign out are buttons */
.nav-member { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; padding: 4px 14px;
  border: 2px solid var(--divider); background: var(--panel); }
.nav-session { padding: 5px 12px; }
/* the theme: one icon button showing the current choice, opening the three choices below it */
.theme { position: relative; }
.theme-toggle { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; padding: 0; cursor: pointer;
  border: 2px solid var(--divider); background: transparent; color: var(--ink); }
.theme-toggle:hover, .theme-toggle[aria-expanded="true"] { border-color: var(--edge); }
.theme-toggle .icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; display: none; }
.theme-toggle .icon .fill { fill: currentColor; stroke: none; }
.theme-toggle[data-mode="system"] .i-system, .theme-toggle[data-mode="light"] .i-light, .theme-toggle[data-mode="dark"] .i-dark { display: block; }
.theme-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; display: flex; border: 2px solid var(--edge);
  background: var(--panel); font-size: 0.85rem; box-shadow: 4px 4px 0 var(--edge); white-space: nowrap; }
.theme-menu[hidden] { display: none; }
.theme-menu span { display: flex; align-items: center; padding: 0 10px; background: var(--edge); color: var(--bg);
  font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; font-size: 0.72rem; }
.theme-menu button { font: inherit; border: 0; border-left: 2px solid var(--edge); background: transparent; color: var(--ink); padding: 6px 12px; cursor: pointer; }
.theme-menu button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); font-weight: 700; }

main { max-width: 980px; margin: 0 auto; padding: 28px 20px 48px; }
.foot { max-width: 980px; margin: 0 auto; padding: 24px 20px; color: var(--muted); font-size: 0.85rem; border-top: 2px solid var(--divider); }

/* panels and notices */
.panel { background: var(--panel); border: 2px solid var(--edge); padding: 20px; margin: 0 0 20px; }
.panel.featured { box-shadow: 6px 6px 0 var(--accent); }
.notice { background: var(--notice-bg); color: var(--notice); border: 2px solid var(--notice); padding: 12px 16px; margin: 0 0 20px; }
.notice > :first-child { margin-top: 0; }
.notice > :last-child { margin-bottom: 0; }
.error { border: 2px solid var(--danger); padding: 12px 16px; margin: 0 0 20px; }

/* buttons */
.btn { display: inline-block; font: 700 1rem Archivo, system-ui, sans-serif; padding: 10px 18px; border: 2px solid var(--edge);
  background: var(--accent); color: var(--on-accent); box-shadow: 4px 4px 0 var(--edge); cursor: pointer; text-decoration: none; }
.btn:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--edge); }
.btn-plain { display: inline-block; font: 600 0.95rem Archivo, system-ui, sans-serif; padding: 7px 14px; border: 2px solid var(--edge);
  background: transparent; color: var(--ink); cursor: pointer; text-decoration: none; }
.btn-danger { border-color: var(--danger); color: var(--danger); }

/* forms */
label { display: block; font-weight: 700; margin: 0 0 4px; }
input[type=text], input[type=number], input[type=email], select { font: inherit; width: 100%; max-width: 420px; padding: 9px 10px;
  border: 2px solid var(--edge); background: var(--bg); color: var(--ink); border-radius: 0; }
input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--accent); margin: 0; vertical-align: middle; }
.field { margin: 0 0 16px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.row { display: flex; flex-wrap: wrap; gap: 16px; }
.row .field { flex: 1 1 160px; }

/* steps on the registration screen */
.steps { display: flex; gap: 8px; list-style: none; padding: 0; margin: 0 0 24px; flex-wrap: wrap; }
.steps li { border: 2px solid var(--divider); padding: 4px 10px; font-size: 0.9rem; color: var(--muted); }
.steps li[aria-current="step"] { border-color: var(--accent); color: var(--ink); font-weight: 700; }
.steps .n { font-family: "JetBrains Mono", monospace; margin-right: 6px; }
/* the welcome screen: step 4 lights up when the status below reports the first checked message */
main:has(.first-in) .steps li[aria-current="step"] { border-color: var(--divider); color: var(--muted); font-weight: 400; }
main:has(.first-in) .steps li:last-child { border-color: var(--accent); color: var(--ink); font-weight: 700; }

/* port panel and setup tabs */
.port { font: 600 clamp(2.4rem, 8vw, 3.4rem)/1 "JetBrains Mono", monospace; margin: 4px 0 6px; }
.tabs { display: flex; flex-wrap: wrap; gap: 0; margin: 16px 0 0; --tab-bg: var(--panel); } /* the rule under the labels is the top edge of the open tab */
.tabs input { position: absolute; opacity: 0; pointer-events: none; }
.tabs label { margin: 0; padding: 8px 14px; border: 2px solid transparent; border-bottom: 0; cursor: pointer; font-weight: 600; }
.tabs input:checked + label { border-color: var(--edge); background: var(--tab-bg); margin-bottom: -2px; border-bottom: 2px solid var(--tab-bg); position: relative; z-index: 1; }
.tabs input:focus-visible + label { outline: 3px solid var(--focus); outline-offset: 2px; }
.tab { display: none; padding: 16px 0 0; border-top: 2px solid var(--edge); }
#t-catcher:checked ~ .tab.catcher, #t-http:checked ~ .tab.http, #t-dispatcher:checked ~ .tab.dispatcher, #t-other:checked ~ .tab.other,
#t-nmea:checked ~ .tab.nmea, #t-rest:checked ~ .tab.rest, #t-ws:checked ~ .tab.ws,
#t-curl:checked ~ .tab.curl, #t-py:checked ~ .tab.py, #t-js:checked ~ .tab.js, #t-pyws:checked ~ .tab.pyws, #t-pynmea:checked ~ .tab.pynmea { display: block; }
.tab-host { display: flex; flex-wrap: wrap; }
.tab-host .tab { flex-basis: 100%; }
pre.snippet { font: 0.92rem/1.5 "JetBrains Mono", monospace; background: var(--code-bg); border: 2px solid var(--code-edge); padding: 12px 14px;
  margin: 0 0 10px; white-space: pre-wrap; word-break: break-all; }
dl.values { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 0 0 10px; }
dl.values dt { color: var(--muted); }
dl.values dd { margin: 0; font-family: "JetBrains Mono", monospace; }

/* station status: dot plus word, shape as well as colour */
.status { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }
.status::before { content: ""; width: 12px; height: 12px; border: 2px solid currentColor; }
.status.receiving { color: var(--ok); }
.status.receiving::before { background: currentColor; border-radius: 50%; }
.status.quiet { color: var(--warn); }
.status.quiet::before { border-radius: 50%; }
.status.offline, .status.waiting { color: var(--off); }
.status.offline::before { background: currentColor; }
.status.waiting::before { border-style: dashed; border-radius: 50%; }

.station-head { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: baseline; margin: 0 0 20px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 0 0 20px; }
.tile { background: var(--panel); border: 2px solid var(--edge); padding: 14px 16px; }
.tile .v { font: 600 1.7rem/1.1 "JetBrains Mono", monospace; display: block; margin: 0 0 4px; }
.tile .l { color: var(--muted); font-size: 0.9rem; }

.bars { display: flex; align-items: flex-end; gap: 3px; height: 120px; border-bottom: 2px solid var(--edge); margin: 8px 0 4px; }
.bars span { flex: 1; background: var(--bar); min-height: 2px; }
.bars span.idle { background: var(--bar-idle); }
.bars span.now { background: var(--now); } /* the hour so far: its own colour, apart from the yellow of the checks */
.axis { display: flex; justify-content: space-between; color: var(--muted); font-size: 0.8rem; font-family: "JetBrains Mono", monospace; }

ul.checks { list-style: none; padding: 0; margin: 0 0 12px; }
ul.checks li { padding: 4px 0 4px 26px; position: relative; }
ul.checks li::before, .checks-key .key { content: ""; position: absolute; left: 0; top: 10px; width: 12px; height: 12px; border: 2px solid var(--ok); background: var(--ok); }
ul.checks li.noted::before, .checks-key .key.noted { background: transparent; border-color: var(--warn); }
ul.checks li.dropped::before, .checks-key .key.dropped { background: var(--warn); border-color: var(--warn); }
/* a check's notes sit under it, on a rule in the check's own colour, so each note shows which check it explains */
ul.checks li p { margin: 6px 0 4px; padding: 2px 0 2px 12px; border-left: 3px solid var(--warn); }
ul.checks li.dropped p { border-left-style: solid; }
ul.checks li.noted p { border-left-style: dashed; }
.checks-key { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 0; }
.checks-key .key { position: static; display: inline-block; margin-left: 8px; }
.checks-key .key:first-child { margin-left: 0; }
.status-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
/* the station's settings: a labelled, clearly editable block */
details.settings { border-left: 8px solid var(--accent); }
details.settings summary { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; cursor: pointer; list-style: none; }
details.settings summary::-webkit-details-marker { display: none; }
details.settings summary .icon { width: 22px; height: 22px; fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linejoin: round; }
.settings-title { font-weight: 800; font-size: 1.1rem; }
.settings-what { color: var(--muted); }
.settings-action { margin-left: auto; font-weight: 700; padding: 4px 12px; border: 2px solid var(--edge); }
.settings-action .when-open, details.settings[open] .settings-action .when-closed { display: none; }
details.settings[open] .settings-action .when-open { display: inline; }

table.list { width: 100%; border-collapse: collapse; margin: 0 0 12px; }
table.list th, table.list td { text-align: left; padding: 10px 8px; border-bottom: 2px solid var(--divider); vertical-align: top; }
table.list th { font-size: 0.85rem; color: var(--muted); font-weight: 600; }
.key-once { font: 600 1rem "JetBrains Mono", monospace; background: var(--bg); border: 2px solid var(--accent); padding: 12px 14px;
  word-break: break-all; margin: 0 0 10px; }

@media (max-width: 560px) {
  .top { padding: 12px 16px; }
  main { padding: 20px 16px 40px; }
  .panel { padding: 16px; }
}

/* legal pages */
.legal { max-width: 760px; }
.legal h2 { margin: 32px 0 10px; }
.legal ul, .legal ol { padding-left: 22px; margin: 0 0 12px; }
.legal li { margin: 0 0 6px; }
.legal dl.values dd { font-family: inherit; }
.legal table.list { font-size: 0.95rem; }
@media (max-width: 560px) {
  .legal table.list thead { display: none; }
  .legal table.list tr { display: block; border-bottom: 2px solid var(--divider); padding: 8px 0; }
  .legal table.list td { display: block; border: 0; padding: 2px 0; }
  .legal table.list td:first-child { font-weight: 700; }
  .legal table.list td[data-label]:not(:first-child)::before { content: attr(data-label) ": "; color: var(--muted); }
  .legal dl.values { grid-template-columns: 1fr; }
  .legal dl.values dd { margin-bottom: 8px; }
}
.foot p { margin: 0 0 6px; }

/* live map (register D39): the map beside a side panel, stacked on a phone */
main.wide { max-width: 1360px; }
.map-intro { max-width: 760px; }
.map-page { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.map-frame { flex: 999 1 640px; min-width: 0; position: relative; height: max(420px, calc(100vh - 260px)); border: 2px solid var(--edge); background: var(--bg); }
#map { position: absolute; inset: 0; }
.map-status { position: absolute; left: 10px; top: 10px; z-index: 2; background: var(--panel); border: 2px solid var(--edge); padding: 6px 10px;
  font-size: 0.8rem; display: flex; flex-wrap: wrap; gap: 2px 14px; max-width: calc(100% - 80px); }
#map-silent { font-size: 0.65rem; }
.map-zoom { position: absolute; right: 10px; top: 10px; z-index: 2; display: flex; flex-direction: column; border: 2px solid var(--edge); background: var(--panel); }
.map-zoom button { width: 44px; height: 44px; border: 0; background: transparent; color: var(--ink); font: 700 22px Archivo, system-ui, sans-serif; cursor: pointer; }
.map-zoom button + button { border-top: 1px solid var(--divider); }
.map-fail { position: absolute; left: 10px; right: 10px; bottom: 36px; z-index: 2; margin: 0; background: var(--panel); border: 2px solid var(--danger); padding: 10px 14px; }
.map-side { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.map-side .panel { margin: 0; }
.map-sel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin: 0 0 12px; }
.map-sel-head h2 { font-size: 1.4rem; font-weight: 900; margin: 2px 0 0; overflow-wrap: anywhere; }
.map-sel-head .btn-plain { width: 44px; height: 44px; flex: none; padding: 0; font-size: 1.1rem; }
.map-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; margin: 0 0 8px; font-size: 0.9rem; }
.map-facts dt { color: var(--muted); }
.map-facts dd { margin: 0; font-family: "JetBrains Mono", monospace; font-weight: 600; overflow-wrap: anywhere; }
.map-hint { margin: 0; border: 1px dashed var(--muted); padding: 14px 16px; color: var(--muted); }
.map-list { border: 1px solid var(--divider); padding: 10px 16px; }
.map-list summary { cursor: pointer; font-weight: 700; }
.map-list ul { list-style: none; padding: 0; margin: 8px 0 0; max-height: 320px; overflow-y: auto; }
.map-list button { font: inherit; font-size: 0.9rem; background: transparent; color: var(--ink); border: 0; padding: 6px 0; cursor: pointer;
  text-align: left; text-decoration: underline; text-underline-offset: 3px; }
.map-key { border: 1px solid var(--divider); padding: 16px 18px; }
.map-key ul { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-direction: column; gap: 6px; }
.map-key li { display: flex; align-items: center; gap: 12px; font-size: 0.95rem; }
.map-key svg { flex: none; }
.map-key li small { display: block; color: var(--muted); font-size: 0.82rem; }
.map-key .map-types { flex-direction: row; flex-wrap: wrap; gap: 6px 14px; padding-top: 10px; border-top: 1px solid var(--divider); }
.map-key .map-types li { gap: 6px; font-size: 0.9rem; }
.swatch { width: 12px; height: 12px; border: 1px solid #0B1622; }
.foot.wide { max-width: 1360px; }
.map-frame .maplibregl-ctrl.maplibregl-ctrl-attrib, .map-frame .maplibregl-ctrl.maplibregl-ctrl-attrib.maplibregl-compact { font-size: 11px;
  background: var(--panel); color: var(--muted); border: 1px solid var(--divider); border-radius: 0; }
.map-frame .maplibregl-ctrl-attrib-button { background-color: transparent; filter: var(--attrib-filter); }
.map-frame .maplibregl-ctrl-attrib a { color: var(--ink); }
@media (max-width: 560px) {
  .map-frame { height: 70vh; }
}

/* Landing page */
.hero { display: flex; flex-wrap: wrap; gap: 28px; align-items: stretch; margin: 8px 0 36px; }
.hero-text { flex: 1 1 420px; }
.hero-photo { flex: 1 1 340px; min-height: 300px; border: 2px solid var(--edge); box-shadow: 8px 8px 0 var(--accent);
  background: url("/static/bg.jpg") 30% 60% / cover no-repeat; }
.eyebrow { font: 600 0.85rem "JetBrains Mono", monospace; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 0 0 10px; }
.lead { font-size: 1.1rem; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 20px 0 0; }
.actions-alt { margin: 16px 0 0; }
.landing section { margin: 0 0 32px; }
.landing .tiles { list-style: none; padding: 0; counter-reset: step; }
.landing .tile h3 { font-size: 1rem; margin: 0 0 6px; }
/* the alternative text after "/" reads "Step 1:" instead of "0" (the second declaration; browsers without the syntax keep
   the first) */
.landing .tile h3::before { counter-increment: step; content: "0" counter(step) " "; content: "0" counter(step) " " / "Step " counter(step) ": "; font-family: "JetBrains Mono", monospace; color: var(--muted); }
.landing .tile p { margin: 0; }
.hero-photo { position: relative; }
.landing #terms h3 { font-size: 1rem; margin: 20px 0 6px; }
.landing #terms p, .landing #terms ul { max-width: 72ch; }
.landing h2 { font-size: 1.4rem; }
.landing pre.snippet { word-break: normal; overflow-wrap: anywhere; }
@media (max-width: 560px) { .landing .tiles { grid-template-columns: 1fr; } }

/* Documentation pages: the article with a collapsible index ("On this page"). Beside the text and sticky on wide
   screens, a collapsed block above the text on narrow ones; site.js opens it on wide screens and marks the section in
   view with aria-current. */
.docs-page { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 32px; align-items: start; }
.docs p code, .docs li code, .docs td code { white-space: normal; overflow-wrap: anywhere; }
.docs-index { margin: 0 0 20px; }
.docs-index details { border: 2px solid var(--divider); background: var(--panel); }
.docs-index summary { cursor: pointer; padding: 10px 12px; font-weight: 800; font-size: 1.05rem; list-style: none; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.docs-index summary::-webkit-details-marker { display: none; }
.docs-index summary .chev { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.5; transition: transform .15s; }
.docs-index details[open] summary .chev { transform: rotate(90deg); }
.docs-index summary .toggle { margin-left: auto; font-size: 0.78rem; font-weight: 600; color: var(--muted); border: 1px solid var(--divider); padding: 1px 8px; }
.docs-index summary .toggle .when-open, .docs-index details[open] summary .toggle .when-closed { display: none; }
.docs-index details[open] summary .toggle .when-open { display: inline; }
.docs-index nav { padding: 2px 12px 12px; font-size: 0.92rem; }
.docs-index ul { list-style: none; margin: 0; padding: 0; }
.docs-index ul ul { padding-left: 14px; }
.docs-index li { margin: 0; }
.docs-index a { display: block; padding: 3px 0 3px 8px; border-left: 3px solid transparent; text-decoration: none; color: var(--muted); }
.docs-index a:hover { color: var(--ink); text-decoration: underline; }
.docs-index a[aria-current="true"] { color: var(--ink); border-left-color: var(--accent); font-weight: 600; }
@media (min-width: 900px) {
  .docs-page { grid-template-columns: 236px minmax(0, 760px); }
  .docs-index { position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow: auto; margin: 0; }
}


/* the switcher between a member's stations, above the station pages */
.switcher { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 20px; padding: 0 0 14px; border-bottom: 2px solid var(--divider); }
.switcher a { padding: 6px 12px; border: 2px solid var(--divider); text-decoration: none; font-weight: 600; }
.switcher a:hover { border-color: var(--edge); }
.switcher a[aria-current="page"] { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
.switcher form { margin: 0 0 0 auto; }

/* the account page's details */
dl.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px 24px; margin: 0 0 14px; }
dl.facts dt { color: var(--muted); font-size: 0.875rem; margin: 0 0 2px; }
dl.facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
dl.facts dd a { font-weight: 400; }

/* Copy: an icon in the top right corner of a snippet (site.js moves the button there); green words confirm the copy */
.copyable { position: relative; margin: 0 0 14px; }
.copyable > pre.snippet, .copyable > .key-once { margin: 0; padding-right: 52px; }
.copy-btn { position: absolute; top: 6px; right: 6px; display: flex; align-items: center; gap: 6px; height: 34px; min-width: 34px;
  justify-content: center; padding: 0 7px; border: 2px solid var(--divider); background: var(--panel); color: var(--ink); cursor: pointer;
  font: 600 0.85rem Archivo, system-ui, sans-serif; }
.copy-btn:hover { border-color: var(--edge); }
.copy-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.copy-btn .i-done, .copy-btn .copy-done { display: none; }
.copy-btn.done { color: var(--ok); border-color: var(--ok); }
.copy-btn.done .i-copy { display: none; }
.copy-btn.done .i-done, .copy-btn.done .copy-done { display: inline; }
.landing #data .tab-host { max-width: 760px; }
.landing #data .tabs { --tab-bg: var(--bg); }
.landing #data pre.snippet { word-break: normal; overflow-wrap: anywhere; max-height: 420px; overflow: auto; }

/* code colours (site.js): keys, strings, numbers, literals, comments, flags, keywords */
.t-k, .t-u { color: var(--t-k); } .t-s { color: var(--t-s); } .t-n { color: var(--t-n); } .t-l { color: var(--t-l); }
.t-c { color: var(--t-c); } .t-f { color: var(--t-f); } .t-kw { color: var(--t-kw); font-weight: 600; }

/* back to the top */
.to-top { position: fixed; right: 18px; bottom: 18px; z-index: 40; display: flex; align-items: center; gap: 6px; padding: 8px 14px 8px 10px;
  border: 2px solid var(--edge); background: var(--panel); color: var(--ink); font: 700 0.9rem Archivo, system-ui, sans-serif; cursor: pointer;
  box-shadow: 4px 4px 0 var(--edge); }
.to-top[hidden] { display: none; }
.to-top svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }

/* the documentation: method badges, the key field and "Try it" */
.docs h3 .method { display: inline-block; font: 700 0.75rem "JetBrains Mono", monospace; padding: 2px 7px; margin-right: 6px; vertical-align: 2px;
  background: var(--accent); color: var(--on-accent); }
.docs h3 .method.put { background: var(--now); color: var(--bg); }
.docs h3 .method.del { background: var(--danger); color: var(--bg); }
.docs h3 { font-family: "JetBrains Mono", monospace; font-size: 1.02rem; margin: 28px 0 10px; padding: 0 0 6px; border-bottom: 2px solid var(--divider); }
.docs h2 { padding-top: 6px; border-top: 2px solid var(--divider); }
.docs h2:first-of-type { border-top: 0; }
.try-key { border-left: 8px solid var(--accent); }
.try-key label { margin: 0 0 6px; }
.key-row { display: flex; gap: 8px; flex-wrap: wrap; }
.key-row input { flex: 1 1 280px; max-width: none; font-family: "JetBrains Mono", monospace; }
.try { border: 2px solid var(--code-edge); margin: 0 0 18px; }
.try-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px; background: var(--panel); }
.try-head .label { font-weight: 800; padding: 0 4px; }
.try-head input { flex: 1 1 260px; max-width: none; font: 0.9rem "JetBrains Mono", monospace; padding: 7px 8px; }
.try-head .btn { padding: 7px 14px; box-shadow: 3px 3px 0 var(--edge); }
.try-out { border-top: 2px solid var(--code-edge); }
.try-out[hidden] { display: none; }
.try-status { font: 600 0.85rem "JetBrains Mono", monospace; padding: 6px 12px; background: var(--code-bg); color: var(--muted); }
.try-status.ok { color: var(--ok); } .try-status.bad { color: var(--danger); }
.try-out pre.snippet { margin: 0; border: 0; max-height: 420px; overflow: auto; white-space: pre; word-break: normal; }
.try-note { padding: 6px 10px; margin: 0; }
ul.type-list { list-style: none; padding: 0; margin: 0 0 14px; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 2px 18px; }
ul.type-list li { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; border-bottom: 1px solid var(--divider); margin: 0; }
ul.type-list code { background: none; border: 0; padding: 0; }
ul.type-list .nums { color: var(--muted); font: 0.85rem "JetBrains Mono", monospace; white-space: nowrap; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.try-head .method-get { font-weight: 700; padding: 2px 7px; background: var(--accent); color: var(--on-accent); }
.docs .tab-host { margin: 0 0 20px; }
.docs .tab pre.snippet { white-space: pre; word-break: normal; overflow-x: auto; }
.tabs, .tab-host { min-width: 0; max-width: 100%; }
.tab-host .tab { min-width: 0; max-width: 100%; }
pre.snippet, code, .mono { font-variant-ligatures: none; }

/* station pages with the page index */
.page-main { min-width: 0; }
.feed-setup { margin: 0 0 20px; }
.feed-setup h2 { margin: 0 0 6px; }
.guide-link { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin: 18px 0 24px; }
.guide-link .btn { display: inline-flex; align-items: center; gap: 10px; font-size: 1.05rem; padding: 12px 20px; }
.guide-link .btn .icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.guide-link p { margin: 0; flex: 1 1 260px; }
@media (min-width: 900px) { .docs-page:has(.page-main) { grid-template-columns: 220px minmax(0, 1fr); } }
.page-main .tiles { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.field-note { margin: 4px 0 0; }
.docs .tabs { --tab-bg: var(--bg); }
/* the station form: the kind and the publication choices (D52) */
fieldset.choice, fieldset.kind-fields { border: 0; padding: 0; margin: 0 0 16px; min-width: 0; }
fieldset.kind-fields { border-top: 2px solid var(--divider); padding-top: 12px; }
fieldset.kind-fields[hidden] { display: none; }
fieldset legend { font-weight: 700; padding: 0; margin: 0 0 6px; }
fieldset.choice .check { margin: 0 0 8px; }
input[type=radio] { width: 20px; height: 20px; accent-color: var(--accent); margin: 2px 0 0; flex: none; }
.choice-note { display: block; font-weight: 400; }
input[readonly] { color: var(--muted); }
.own-line { margin: 4px 0 8px; }
