/* Shared by every page: design tokens (light, dark, and an explicit
   data-theme override that beats the system setting), the top bar, and the
   theme toggle. Accent is the logo's own blue (#1b43e1, sampled from
   logo-mark.png). Radius scale 0/4/8, no shadows. */
:root {
  color-scheme: light dark;
  --bg: #f3f1ec; --surface: #fbfaf7; --sunk: #ece9e2;
  --ink: #17181c; --dim: #5b5e66; --faint: #8b8d94;
  --rule: #d9d6cd; --rule-soft: #e6e3db;
  --accent: #1b43e1; --accent-ink: #ffffff; --accent-wash: #e4e9fb;
  --ok: #1f7a45; --ok-wash: #e2f3e8; --warn: #a35f00; --warn-wash: #f6ead3;
  --danger: #b3261e; --danger-wash: #f6dcda;
  --c-pass: #2a9d5c; --c-dup: #d29a2e; --c-policy: #2385a3; --c-junk: #c9453d; --c-throttle: #9a9ca3;
  --r-1: 4px; --r-2: 8px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  /* aliases for the older pages */
  --canvas: var(--bg); --panel: var(--surface); --recess: var(--sunk);
  --line: var(--rule); --line-soft: var(--rule-soft);
  --accent-tint: var(--accent-wash); --ok-tint: var(--ok-wash); --warn-tint: var(--warn-wash);
  --danger-tint: var(--danger-wash); --lift: none;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0f1012; --surface: #141518; --sunk: #0c0d0e;
    --ink: #ecebe6; --dim: #a3a5ab; --faint: #6e7076;
    --rule: #2a2c30; --rule-soft: #202226;
    --accent: #7b96ff; --accent-ink: #0b0d16; --accent-wash: #1a2140;
    --ok: #52c27f; --ok-wash: #11251a; --warn: #e3a13a; --warn-wash: #2a2111;
    --danger: #ef7a72; --danger-wash: #2c1715;
    --c-pass: #3cb974; --c-dup: #dba43f; --c-policy: #3aa9c9; --c-junk: #ea6f66; --c-throttle: #6f7178;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1012; --surface: #141518; --sunk: #0c0d0e;
  --ink: #ecebe6; --dim: #a3a5ab; --faint: #6e7076;
  --rule: #2a2c30; --rule-soft: #202226;
  --accent: #7b96ff; --accent-ink: #0b0d16; --accent-wash: #1a2140;
  --ok: #52c27f; --ok-wash: #11251a; --warn: #e3a13a; --warn-wash: #2a2111;
  --danger: #ef7a72; --danger-wash: #2c1715;
  --c-pass: #3cb974; --c-dup: #dba43f; --c-policy: #3aa9c9; --c-junk: #ea6f66; --c-throttle: #6f7178;
}
:root[data-theme="light"] { color-scheme: light; }

::selection { background: var(--accent); color: var(--accent-ink); }

.top {
  display: flex; align-items: center; gap: 28px; padding: 0 32px; height: 54px;
  background: var(--surface); border-bottom: 1px solid var(--rule);
  font: 400 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink);
}
.top a { color: inherit; text-decoration: none; }
.top .brand { display: flex; align-items: center; gap: 9px; flex: none; }
.top .brand img { width: 20px; height: 20px; }
.top .brand span { font-weight: 650; letter-spacing: -.01em; }
.top .topnav { display: flex; gap: 22px; font-size: 13px; color: var(--dim); }
.top .topnav a { padding: 17px 0 15px; border-bottom: 2px solid transparent; }
.top .topnav a:hover { color: var(--ink); }
.top .topnav a[aria-current] { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
.top .top-right { margin-left: auto; display: flex; align-items: center; gap: 16px; min-width: 0; font-size: 12.5px; color: var(--dim); }
.top .who { display: flex; align-items: center; gap: 14px; min-width: 0; }
.top .who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top .who a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.top .theme-toggle {
  border: 1px solid var(--rule); background: transparent; color: var(--dim); cursor: pointer;
  padding: 5px 11px; border-radius: var(--r-1); font: 500 12px/1.2 system-ui, sans-serif;
}
.top .theme-toggle:hover { color: var(--ink); border-color: var(--faint); }
.top .theme-toggle:focus-visible, .top a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 900px) {
  .top { padding: 0 18px; gap: 16px; }
  .top .who span { display: none; }
  .top .topnav a.opt { display: none; }
}
