/* The weather-station pages (/pws/, /pws/hu/, /pws/station/) --
   docs/weather-station-ingest.md.

   The colour tokens are the race pages' (server/public/race/css/race.css),
   copied value for value so the station pages read as the same product, in
   both themes; server/tests/pwsManual.test.js fails if they drift -- change
   both together. Day is the default; night is [data-theme="night"] on
   <html>, chosen with the race pages' own Day/Night key (js: theme.js). */
:root {
  --bg: #f1f5f9; --panel: rgba(255, 255, 255, 0.94); --text: #0f172a; --muted: #475569;
  --line: rgba(15, 23, 42, 0.15); --accent: #2563eb; --ok: #16a34a; --warn: #b45309;
  --bad: #b91c1c;
  --code-bg: rgba(15, 23, 42, 0.06);
}
:root[data-theme="night"] {
  --bg: #0b1220; --panel: rgba(17, 24, 39, 0.92); --text: #e5e7eb; --muted: #9ca3af;
  --line: rgba(229, 231, 235, 0.18); --accent: #60a5fa; --ok: #4ade80; --warn: #fbbf24;
  --code-bg: rgba(229, 231, 235, 0.08);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); }
code, pre { font: 13px/1.45 ui-monospace, Menlo, Consolas, monospace; }
code { background: var(--code-bg); border-radius: 4px; padding: 1px 4px; overflow-wrap: anywhere; }
pre { background: var(--code-bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; overflow-x: auto; }
pre code { background: none; padding: 0; overflow-wrap: normal; }

.bar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 16px; background: var(--panel); border-bottom: 1px solid var(--line); backdrop-filter: blur(6px); }
/* The brand stays on one line; on a phone the nav wraps below it instead. */
.bar .brand { font-weight: 700; flex: 1 0 auto; white-space: nowrap; }
.bar nav { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.button, button { border: 1px solid var(--accent); background: var(--accent); color: #fff; border-radius: 999px;
  padding: 5px 12px; font: inherit; font-size: 14px; text-decoration: none; cursor: pointer; }
button.ghost, .chip { border: 1px solid var(--line); background: transparent; color: var(--text); border-radius: 999px;
  padding: 4px 10px; font-size: 13px; cursor: pointer; }
button:disabled { opacity: 0.5; cursor: default; }

.layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 24px; max-width: 1180px; margin: 0 auto; padding: 16px; }
.toc { position: sticky; top: 64px; align-self: start; max-height: calc(100vh - 80px); overflow: auto; font-size: 14px; }
.toc ul { list-style: none; margin: 0; padding: 0; }
.toc li { margin: 2px 0; }
.toc a { color: var(--muted); text-decoration: none; display: block; padding: 3px 8px; border-radius: 6px; }
.toc a:hover { background: var(--code-bg); color: var(--text); }
.doc { min-width: 0; max-width: 820px; }
.doc h1 { font-size: 28px; line-height: 1.2; margin: 8px 0 12px; }
.doc h2 { font-size: 21px; margin: 32px 0 8px; padding-top: 12px; border-top: 1px solid var(--line); scroll-margin-top: 70px; }
.doc h3 { font-size: 17px; margin: 22px 0 6px; scroll-margin-top: 70px; }
.doc blockquote { margin: 12px 0; padding: 8px 14px; border-left: 4px solid var(--accent); background: var(--panel); border-radius: 0 8px 8px 0; }
.doc blockquote p { margin: 6px 0; }
.table-wrap { overflow-x: auto; margin: 10px 0; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; vertical-align: top; padding: 6px 8px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; }

/* /pws/station/ */
.page { max-width: 860px; margin: 0 auto; padding: 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin: 0 0 16px; }
.card h2 { font-size: 18px; margin: 0 0 10px; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
.grid .wide { grid-column: 1 / -1; }
label { display: block; font-size: 13px; color: var(--muted); }
input, select, textarea { width: 100%; margin-top: 3px; border: 1px solid var(--line); background: var(--bg); color: var(--text);
  border-radius: 8px; padding: 7px 9px; font: inherit; }
textarea { min-height: 70px; resize: vertical; }
.check { display: flex; gap: 8px; align-items: flex-start; color: var(--text); font-size: 14px; }
.check input { width: auto; margin-top: 4px; }
.hint { color: var(--muted); font-size: 13px; margin: 4px 0 0; }
.card > p.hint { margin: 0 0 12px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.msg { margin: 10px 0 0; padding: 8px 12px; border-radius: 8px; border: 1px solid var(--line); }
.msg.error { border-color: var(--bad); color: var(--bad); }
.msg.ok { border-color: var(--ok); }
.secret { font: 700 20px/1.3 ui-monospace, Menlo, Consolas, monospace; letter-spacing: 0.04em; overflow-wrap: anywhere; }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 14px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.pill { display: inline-block; border-radius: 999px; padding: 1px 9px; font-size: 13px; font-weight: 600; border: 1px solid var(--line); }
.pill.active { color: var(--ok); border-color: var(--ok); }
.pill.pending { color: var(--warn); border-color: var(--warn); }
.pill.suspended, .pill.silent { color: var(--bad); border-color: var(--bad); }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 10px; }
.tabs .chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
[hidden] { display: none !important; }

@media (max-width: 760px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .toc { position: static; max-height: none; border: 1px solid var(--line); border-radius: 10px; padding: 6px; }
  .grid { grid-template-columns: minmax(0, 1fr); }
  .doc h1 { font-size: 24px; }
}
