/* Flight Watcher — "dragon's hoard" design system.
 * The watcher is a dragon guarding your fares. Night theme: basalt and embers. Day theme: parchment and soot.
 * Temperature carries meaning: hot = good for you, cold = uncertain or old.
 *   fire   = your targets and the actions you take (alert price, max price, primary buttons)
 *   gold   = treasure: an itinerary that qualifies, a healthy system
 *   frost  = caution: unverified, degraded, not checked recently
 *   danger = rejected, failed, destructive
 * Colour is never the only cue: every state also has a word, an icon, or a border style.
 */

@font-face { font-family: "Cinzel"; src: url("/static/fonts/Cinzel-Variable.ttf") format("truetype"); font-weight: 400 900; font-display: swap; }
@font-face { font-family: "B612 Mono"; src: url("/static/fonts/B612Mono-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "B612 Mono"; src: url("/static/fonts/B612Mono-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Atkinson Next"; src: url("/static/fonts/AtkinsonHyperlegibleNext-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Atkinson Next"; src: url("/static/fonts/AtkinsonHyperlegibleNext-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Atkinson Next"; src: url("/static/fonts/AtkinsonHyperlegibleNext-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Atkinson Next"; src: url("/static/fonts/AtkinsonHyperlegibleNext-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Atkinson Next"; src: url("/static/fonts/AtkinsonHyperlegibleNext-Italic.woff2") format("woff2"); font-style: italic; font-weight: 400; font-display: swap; }

/* ---------- tokens: day (parchment and soot) ---------- */
:root {
  --bg: oklch(0.955 0.014 75);
  --surface: oklch(0.985 0.008 75);
  --raised: oklch(0.995 0.004 75);
  --sunken: oklch(0.925 0.018 70);
  --ink: oklch(0.22 0.02 40);
  --ink-2: oklch(0.36 0.025 40);
  --muted: oklch(0.47 0.025 45);
  --rule: oklch(0.88 0.018 60);
  --rule-strong: oklch(0.72 0.025 55);
  --control: oklch(0.6 0.03 50);
  --fire: oklch(0.52 0.19 38);
  --fire-hot: oklch(0.56 0.2 42);
  --on-fire: oklch(0.99 0.01 75);
  --fire-soft: oklch(0.93 0.05 55);
  --gold: oklch(0.5 0.11 75);
  --gold-bright: oklch(0.78 0.15 85);
  --gold-soft: oklch(0.94 0.06 90);
  --frost: oklch(0.47 0.11 235);
  --frost-soft: oklch(0.94 0.03 230);
  --danger: oklch(0.51 0.19 27);
  --danger-soft: oklch(0.94 0.04 25);
  --hatch: oklch(0.8 0.02 60);
  --focus: var(--fire);
  --glow: 0 0 0 transparent;
  --shadow-color: 35 30% 30%;
  --shadow-sm: 0.5px 1px 1px hsl(var(--shadow-color) / 0.14);
  --shadow-md: 1px 2px 2px hsl(var(--shadow-color) / 0.08), 2px 4px 4px hsl(var(--shadow-color) / 0.08), 4px 8px 8px hsl(var(--shadow-color) / 0.08);
  --shadow-lg: 1px 2px 2px hsl(var(--shadow-color) / 0.07), 2px 4px 4px hsl(var(--shadow-color) / 0.07), 4px 8px 8px hsl(var(--shadow-color) / 0.07), 8px 16px 16px hsl(var(--shadow-color) / 0.07), 16px 32px 32px hsl(var(--shadow-color) / 0.07);
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --font-display: "Cinzel", "Trajan Pro", Georgia, serif;
  --font-body: "Atkinson Next", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-data: "B612 Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --tabbar-h: 0px;
  color-scheme: light;
}

/* ---------- tokens: night (basalt and embers) ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: oklch(0.155 0.014 35);
    --surface: oklch(0.195 0.016 35);
    --raised: oklch(0.235 0.018 35);
    --sunken: oklch(0.13 0.012 35);
    --ink: oklch(0.95 0.012 75);
    --ink-2: oklch(0.84 0.018 65);
    --muted: oklch(0.7 0.02 55);
    --rule: oklch(0.29 0.02 35);
    --rule-strong: oklch(0.4 0.025 35);
    --control: oklch(0.54 0.03 45);
    --fire: oklch(0.72 0.18 45);
    --fire-hot: oklch(0.78 0.17 60);
    --on-fire: oklch(0.17 0.03 40);
    --fire-soft: oklch(0.3 0.08 40);
    --gold: oklch(0.86 0.14 85);
    --gold-bright: oklch(0.9 0.15 90);
    --gold-soft: oklch(0.3 0.06 80);
    --frost: oklch(0.8 0.09 225);
    --frost-soft: oklch(0.28 0.05 230);
    --danger: oklch(0.72 0.16 25);
    --danger-soft: oklch(0.29 0.07 25);
    --hatch: oklch(0.34 0.02 40);
    --glow: 0 0 24px oklch(0.72 0.18 45 / 0.28);
    --shadow-color: 30 40% 3%;
    --shadow-sm: 0 1px 1px hsl(var(--shadow-color) / 0.4);
    --shadow-md: 0 2px 4px hsl(var(--shadow-color) / 0.35), 0 8px 16px hsl(var(--shadow-color) / 0.3);
    --shadow-lg: 0 4px 8px hsl(var(--shadow-color) / 0.4), 0 16px 40px hsl(var(--shadow-color) / 0.45);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: oklch(0.155 0.014 35);
  --surface: oklch(0.195 0.016 35);
  --raised: oklch(0.235 0.018 35);
  --sunken: oklch(0.13 0.012 35);
  --ink: oklch(0.95 0.012 75);
  --ink-2: oklch(0.84 0.018 65);
  --muted: oklch(0.7 0.02 55);
  --rule: oklch(0.29 0.02 35);
  --rule-strong: oklch(0.4 0.025 35);
  --control: oklch(0.54 0.03 45);
  --fire: oklch(0.72 0.18 45);
  --fire-hot: oklch(0.78 0.17 60);
  --on-fire: oklch(0.17 0.03 40);
  --fire-soft: oklch(0.3 0.08 40);
  --gold: oklch(0.86 0.14 85);
  --gold-bright: oklch(0.9 0.15 90);
  --gold-soft: oklch(0.3 0.06 80);
  --frost: oklch(0.8 0.09 225);
  --frost-soft: oklch(0.28 0.05 230);
  --danger: oklch(0.72 0.16 25);
  --danger-soft: oklch(0.29 0.07 25);
  --hatch: oklch(0.34 0.02 40);
  --glow: 0 0 24px oklch(0.72 0.18 45 / 0.28);
  --shadow-color: 30 40% 3%;
  --shadow-sm: 0 1px 1px hsl(var(--shadow-color) / 0.4);
  --shadow-md: 0 2px 4px hsl(var(--shadow-color) / 0.35), 0 8px 16px hsl(var(--shadow-color) / 0.3);
  --shadow-lg: 0 4px 8px hsl(var(--shadow-color) / 0.4), 0 16px 40px hsl(var(--shadow-color) / 0.45);
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.5 var(--font-body);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
#app { isolation: isolate; }
::selection { background: var(--fire); color: var(--on-fire); }
a { color: var(--fire); text-decoration-thickness: 1px; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
p, h1, h2, h3 { overflow-wrap: break-word; }
p { text-wrap: pretty; }
h1, h2, h3 { text-wrap: balance; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.sr-only:focus-visible { position: fixed; top: 8px; left: 8px; width: auto; height: auto; clip: auto; padding: 8px 12px; z-index: 100; background: var(--raised); border-radius: var(--radius-sm); }
.data, .num { font-family: var(--font-data); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.tiny { font-size: 13px; }
.nowrap { white-space: nowrap; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.spacer { flex: 1; }
.stack { display: grid; gap: 16px; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 16px;
  padding: 10px max(16px, calc((100vw - 1240px) / 2));
  padding-top: max(10px, env(safe-area-inset-top));
  background: color-mix(in oklch, var(--bg) 90%, transparent);
  backdrop-filter: saturate(1.3) blur(10px);
  border-bottom: 1px solid var(--rule);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand svg { width: 34px; height: 34px; flex: none; filter: drop-shadow(0 0 6px oklch(0.72 0.18 45 / 0.35)); }
.brand b { font: 700 18px/1 var(--font-display); letter-spacing: 0.06em; }
.nav { display: flex; gap: 4px; }
.nav a {
  display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 8px 12px; border-radius: var(--radius-sm);
  color: var(--ink-2); text-decoration: none; font-weight: 500;
}
.nav a svg { width: 18px; height: 18px; }
.nav a[aria-current="page"] { color: var(--ink); background: var(--fire-soft); box-shadow: inset 0 -2px 0 var(--fire); }
.nav a .badge { margin-left: 2px; }
@media (hover: hover) and (pointer: fine) { .nav a:hover { color: var(--ink); background: var(--sunken); } }
.badge {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--fire); color: var(--on-fire); font: 700 12px/1 var(--font-data);
}
.sysline { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.sysline .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.sysline .dot.warn { background: var(--frost); box-shadow: 0 0 0 3px var(--frost-soft); }
.sysline .dot.bad { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.signout { padding: 8px; color: var(--muted); }
.signout[hidden] { display: none; }
.install[hidden] { display: none; }
.topbar .new-top { display: none; }

/* phone tab bar (shown under 720px) */
.tabbar { display: none; }

/* ---------- page layout ---------- */
main { max-width: 1240px; margin: 0 auto; padding: 24px 16px 96px; }
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin: 4px 0 24px; }
.back {
  display: inline-flex; align-items: center; gap: 4px; min-height: 32px; font-size: 14px; font-weight: 600;
  color: var(--muted); text-decoration: none;
}
.back svg { width: 16px; height: 16px; }
@media (hover: hover) and (pointer: fine) { .back:hover { color: var(--fire); } }
.eyebrow { font: 600 13px/1.2 var(--font-body); color: var(--muted); }
h1 { font: 700 clamp(1.75rem, 1.4rem + 1.4vw, 2.4rem)/1.1 var(--font-display); letter-spacing: 0.01em; margin: 4px 0 0; }
h2 { font: 700 19px/1.2 var(--font-display); letter-spacing: 0.02em; margin: 0; color: var(--ink); }
h3 { font: 600 17px/1.3 var(--font-body); margin: 0; }
.lede { margin: 8px 0 0; color: var(--ink-2); max-width: 62ch; }

/* ---------- buttons, pills ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px;
  border: 1px solid var(--control); border-radius: var(--radius-sm);
  background: var(--raised); color: var(--ink);
  font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap;
  user-select: none; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  transition: background-color 0.14s ease, border-color 0.14s ease, transform 0.12s var(--ease-out), box-shadow 0.14s ease;
}
@media (hover: hover) and (pointer: fine) { .btn:hover { border-color: var(--ink-2); } }
.btn:active { transform: scale(0.97); }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn.primary {
  background: linear-gradient(180deg, var(--fire-hot), var(--fire)); color: var(--on-fire); border-color: transparent;
  box-shadow: var(--shadow-sm), var(--glow);
}
@media (hover: hover) and (pointer: fine) { .btn.primary:hover { border-color: transparent; background: var(--fire-hot); } }
.btn.go { background: linear-gradient(180deg, var(--gold-bright), var(--gold)); border-color: transparent; color: oklch(0.2 0.03 60); }
:root:not([data-theme="dark"]) .btn.go { color: oklch(0.99 0.01 80); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.go { color: oklch(0.2 0.03 60); } }
.btn.ghost { background: transparent; border-color: transparent; }
@media (hover: hover) and (pointer: fine) { .btn.ghost:hover { background: var(--sunken); border-color: transparent; } }
.btn.danger { color: var(--danger); }
.btn.sm { min-height: 36px; padding: 6px 12px; font-size: 14px; }
.btn.icon-only { padding: 8px; min-width: 44px; }
.pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px;
  font: 600 13px/18px var(--font-body); background: var(--sunken); color: var(--ink-2); white-space: nowrap;
}
.pill svg { width: 14px; height: 14px; flex: none; }
.pill.ok { background: var(--gold-soft); color: var(--gold); }
.pill.warn { background: var(--frost-soft); color: var(--frost); }
.pill.bad { background: var(--danger-soft); color: var(--danger); }
.pill.target { background: var(--fire-soft); color: var(--fire); }
.pill.info { background: var(--sunken); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--rule-strong); }

/* instant watch status under the watch title */
.instant-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }

/* ---------- panels ---------- */
.panel { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-lg); }
.panel > header { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 16px 20px 0; }
.panel > .body { padding: 16px 20px 20px; }
.panel + .panel { margin-top: 16px; }

/* ---------- lair: the dashboard's opening band (the one ember moment) ---------- */
.lair {
  position: relative; overflow: hidden; isolation: isolate;
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 20px;
  padding: 24px; margin-bottom: 24px; border-radius: var(--radius-lg);
  background:
    radial-gradient(120% 140% at 0% 100%, oklch(0.62 0.2 38 / 0.28), transparent 55%),
    radial-gradient(80% 120% at 100% 0%, oklch(0.8 0.15 85 / 0.12), transparent 60%),
    var(--surface);
  border: 1px solid var(--rule);
}
.lair .emblem { width: 88px; height: 88px; filter: drop-shadow(0 0 16px oklch(0.72 0.18 45 / 0.45)); }
.lair h1 { margin: 0; }
.lair .tally { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 10px; color: var(--ink-2); font-size: 15px; }
.lair .tally b { font-family: var(--font-data); color: var(--ink); }
.lair .tally .hot b { color: var(--gold); }
.embers { position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.embers i {
  position: absolute; bottom: -8px; left: var(--x); width: var(--s, 3px); height: var(--s, 3px); border-radius: 50%;
  background: var(--fire-hot); box-shadow: 0 0 6px 1px oklch(0.78 0.17 60 / 0.8);
  opacity: 0;
}
@media (prefers-reduced-motion: no-preference) {
  .embers i { animation: ember var(--d, 5s) linear var(--delay, 0s) 3 both; }
  @keyframes ember {
    0% { transform: translate(0, 0); opacity: 0; }
    12% { opacity: 0.9; }
    60% { transform: translate(var(--drift, 12px), -90px); opacity: 0.6; }
    100% { transform: translate(calc(var(--drift, 12px) * -0.5), -170px); opacity: 0; }
  }
}

/* ---------- watch cards (dashboard) ---------- */
.bay { display: grid; gap: 12px; }
.bay-title { display: flex; align-items: baseline; gap: 10px; margin: 8px 0 12px; }
.strip {
  position: relative; display: grid; grid-template-columns: 210px minmax(0, 1fr) 104px; align-items: stretch;
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-lg);
  overflow: hidden; text-decoration: none; color: inherit;
  transition: border-color 0.16s ease, transform 0.16s var(--ease-out);
}
.strip[data-status="qualified"] {
  border-color: color-mix(in oklch, var(--gold) 55%, var(--rule));
  background: linear-gradient(100deg, color-mix(in oklch, var(--gold-soft) 70%, transparent), transparent 45%), var(--surface);
}
.strip[data-status="paused"] { opacity: 0.8; }
.strip[data-status="degraded"] { border-color: color-mix(in oklch, var(--frost) 45%, var(--rule)); }
@media (hover: hover) and (pointer: fine) { .strip:hover { border-color: var(--fire); transform: translateY(-1px); } }
.strip .route { padding: 18px 12px 18px 20px; display: grid; align-content: center; gap: 4px; border-right: 1px solid var(--rule); }
.route .codes { font: 700 23px/1.1 var(--font-display); letter-spacing: 0.03em; }
.route .codes .grp { white-space: nowrap; }
.route .codes .arrow { color: var(--fire); font-weight: 400; margin: 0 2px; }
.route .alt { font: 400 13px/1.3 var(--font-data); color: var(--muted); }
.strip .mid { padding: 16px 18px; display: grid; gap: 8px; min-width: 0; }
.strip .title { display: flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: wrap; }
.strip .title h3 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.strip .deal { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.strip .deal .price { font: 700 26px/1 var(--font-data); color: var(--gold); }
.strip .deal.none .price { color: var(--ink-2); font: 600 16px/1.3 var(--font-body); }
.strip .facts { font-size: 14px; color: var(--muted); display: flex; gap: 6px 14px; flex-wrap: wrap; }
.strip .facts .target { color: var(--fire); font-weight: 600; }
.strip .gauge { border-left: 1px solid var(--rule); display: grid; place-items: center; padding: 6px 4px; background: var(--sunken); }
.coverage-bar { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.coverage-bar .track { flex: 0 1 180px; height: 6px; border-radius: 3px; background: var(--sunken); overflow: hidden; display: flex; box-shadow: inset 0 0 0 1px var(--rule); }
.coverage-bar .track i { display: block; height: 100%; background: linear-gradient(90deg, var(--fire), var(--fire-hot)); }
.coverage-bar .track i.old { background: color-mix(in oklch, var(--fire) 35%, transparent); }

/* sparkle on treasure: a four-point star that glints a few times when a deal is on screen */
.sparkle { display: inline-block; width: 18px; height: 18px; color: var(--gold-bright); vertical-align: -2px; flex: none; }
@media (prefers-reduced-motion: no-preference) {
  .sparkle { animation: glint 2.4s var(--ease-out) 0.3s 3 both; transform-origin: center; }
  @keyframes glint {
    0%, 100% { transform: scale(0.7) rotate(0deg); opacity: 0.55; }
    18% { transform: scale(1.15) rotate(45deg); opacity: 1; }
    36% { transform: scale(0.8) rotate(90deg); opacity: 0.7; }
  }
}

/* ---------- price tape (the dragon's flame gauge) ---------- */
.tape { display: block; font-family: var(--font-data); }
.tape .scale-bg { fill: var(--sunken); }
.tape .tick { stroke: var(--rule-strong); stroke-width: 1; }
.tape .tick-label { fill: var(--muted); font-size: 10px; }
.tape .band-ok { fill: var(--gold); opacity: 0.55; }
.tape .band-over { fill: var(--danger); opacity: 0.35; }
.tape .bug { fill: var(--fire); }
.tape .bug-label { fill: var(--fire); font-size: 10px; font-weight: 700; }
.tape .bug-low { fill: var(--muted); }
.tape .readout { fill: var(--raised); stroke: var(--ink-2); stroke-width: 1.5; }
.tape .readout.ok { stroke: var(--gold); }
.tape .readout-text { fill: var(--ink); font-weight: 700; }
.tape .readout.ok + .readout-text { fill: var(--gold); }
.tape .trend { stroke: var(--gold); stroke-width: 3; stroke-linecap: round; }
.tape .trend.up { stroke: var(--danger); }
.tape .empty-text { fill: var(--muted); font-size: 10px; letter-spacing: 0.1em; }
@media (prefers-reduced-motion: no-preference) {
  .tape .roll { animation: tape-roll 0.9s var(--ease-out) both; }
  @keyframes tape-roll { from { transform: translateY(var(--roll-from, 40px)); opacity: 0.2; } to { transform: none; opacity: 1; } }
}

/* ---------- watch detail ---------- */
.detail { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 24px; align-items: start; }
.detail > *, .stack > *, .grid-2 > * { min-width: 0; }
.detail .rail { position: sticky; top: 84px; display: grid; gap: 12px; justify-items: center; }
.detail .rail .legend { font-size: 12px; color: var(--muted); display: grid; gap: 4px; width: 100%; }
.legend-dot { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.watch-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 10px; color: var(--ink-2); font-size: 15px; }
.watch-meta .data { color: var(--ink); }
.targets { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.best { display: grid; gap: 16px; }
.best .headline { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.best .big-price { font: 700 46px/1 var(--font-data); letter-spacing: -0.02em; color: var(--gold); text-shadow: 0 0 22px oklch(0.8 0.15 85 / 0.25); }
.best .scope { color: var(--muted); font-size: 14px; }
.score-badge {
  display: inline-grid; place-items: center; min-width: 60px; padding: 6px 8px; border-radius: var(--radius-sm);
  background: var(--sunken); color: var(--ink); font: 700 20px/1 var(--font-data); box-shadow: inset 0 0 0 1px var(--rule-strong);
}
.score-badge small { display: block; font: 600 10px/1 var(--font-body); letter-spacing: 0.08em; color: var(--muted); margin-top: 3px; }
.facts-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* leg timeline */
.leg { display: grid; grid-template-columns: 74px 1fr 74px; gap: 10px; align-items: center; }
.leg .end { display: grid; gap: 1px; }
.leg .end.right { text-align: right; }
.leg .end .t { font: 700 19px/1.1 var(--font-data); font-variant-numeric: tabular-nums; }
.leg .end .c { font: 700 13px/1.2 var(--font-data); letter-spacing: 0.06em; color: var(--ink-2); }
.leg .end .d { font-size: 12px; color: var(--muted); }
.leg .track { position: relative; height: 34px; }
.leg .track .line { position: absolute; top: 16px; left: 0; right: 0; height: 2px; background: var(--rule-strong); }
.leg .track .seg { position: absolute; top: 13px; height: 8px; border-radius: 4px; background: linear-gradient(90deg, var(--fire), var(--fire-hot)); }
.leg .track .stop { position: absolute; top: 10px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: var(--surface); border: 2px solid var(--ink-2); }
.leg .track .stop.warn { border-color: var(--frost); }
.leg .track .stop-label { position: absolute; top: -2px; transform: translateX(-50%); font: 700 10px/1 var(--font-data); color: var(--ink-2); white-space: nowrap; }
.leg .track .dur { position: absolute; bottom: -2px; left: 50%; transform: translateX(-50%); font: 400 11px/1 var(--font-data); color: var(--muted); background: var(--surface); padding: 0 4px; white-space: nowrap; }
.leg-meta { font-size: 13px; color: var(--muted); margin: 2px 0 0 84px; }
.leg-block { display: grid; gap: 4px; padding: 8px 0; }
.leg-block + .leg-block { border-top: 1px dashed var(--rule); }

/* score breakdown */
.breakdown { display: grid; gap: 6px; }
.breakdown .item { display: grid; grid-template-columns: 150px 1fr 58px; gap: 10px; align-items: center; font-size: 14px; }
.breakdown .bar { height: 6px; background: var(--sunken); border-radius: 3px; overflow: hidden; }
.breakdown .bar i { display: block; height: 100%; background: var(--fire); }
.breakdown .pts { text-align: right; font-family: var(--font-data); }
.breakdown .why { grid-column: 1 / -1; font-size: 13px; color: var(--muted); margin-top: -3px; }

/* ---------- price calendar: a heat map in the literal sense ---------- */
.calendar-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; overscroll-behavior-x: contain; }
.calendar { border-collapse: separate; border-spacing: 3px; font-family: var(--font-data); font-size: 12px; }
.calendar th { font: 600 12px/1.2 var(--font-body); color: var(--muted); padding: 2px 4px; white-space: nowrap; }
.calendar th.rowh { text-align: right; position: sticky; left: 0; background: var(--surface); z-index: 1; }
.calendar td { width: 58px; min-width: 54px; height: 36px; text-align: center; border-radius: 6px; position: relative; cursor: default; }
.calendar td.qualified {
  background: color-mix(in oklch, var(--fire) calc(var(--q, 0.5) * 45% + 10%), var(--gold-soft));
  color: var(--ink); font-weight: 700;
}
.calendar td.qualified.best { outline: 2px solid var(--gold-bright); outline-offset: -2px; box-shadow: 0 0 12px oklch(0.85 0.15 85 / 0.45); }
.calendar td.rejected { background: var(--surface); color: var(--muted); border: 1px solid var(--rule); }
.calendar td.rejected::after { content: ""; position: absolute; top: 3px; right: 3px; width: 5px; height: 5px; border-radius: 50%; background: var(--danger); }
.calendar td.unverified { background: var(--frost-soft); color: var(--frost); border: 1px dashed var(--frost); }
.calendar td.partial { background: repeating-linear-gradient(135deg, var(--hatch) 0 1px, var(--surface) 1px 7px); color: var(--muted); border: 1px solid var(--rule); }
.calendar td.empty { background: var(--sunken); color: var(--muted); }
.calendar td.error { background: repeating-linear-gradient(135deg, var(--danger-soft) 0 4px, transparent 4px 8px); color: var(--danger); }
.calendar td.unsearched { background: repeating-linear-gradient(135deg, var(--hatch) 0 1.5px, transparent 1.5px 6px); color: var(--muted); }
.calendar td.stale { background: repeating-linear-gradient(135deg, color-mix(in oklch, var(--frost) 30%, transparent) 0 1px, transparent 1px 7px), var(--surface); color: var(--muted); }
.calendar td.past { opacity: 0.25; }
.calendar td.not_yet_bookable { background: var(--sunken); color: var(--muted); border: 1px dashed var(--rule-strong); }
.calendar td.failed::before { content: ""; position: absolute; top: 0; left: 0; border-top: 7px solid var(--danger); border-right: 7px solid transparent; }
.calendar td.none { background: transparent; }
.calendar td[tabindex] { cursor: pointer; }
@media (hover: hover) and (pointer: fine) { .calendar td[tabindex]:hover { box-shadow: inset 0 0 0 2px var(--fire); } }
.unit-detail { padding: 12px 14px; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--raised); }
.rej.qualified .p { text-decoration: none; color: var(--gold); }
.rej .why b.q { color: var(--gold); }
.cal-legend { display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: 13px; color: var(--muted); margin-top: 12px; }
.cal-legend .sw { display: inline-block; width: 16px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -2px; }
.sw-qualified { background: linear-gradient(90deg, var(--gold-soft), var(--fire)); }
.sw-rejected { background: var(--surface); border: 1px solid var(--rule-strong); }
.sw-unverified { background: var(--frost-soft); border: 1px dashed var(--frost); }
.sw-partial { background: repeating-linear-gradient(135deg, var(--hatch) 0 1px, var(--surface) 1px 7px); border: 1px solid var(--rule); }
.sw-empty { background: var(--sunken); border: 1px solid var(--rule); }
.sw-not_yet_bookable { background: var(--sunken); border: 1px dashed var(--rule-strong); }
.sw-error { background: repeating-linear-gradient(135deg, var(--danger-soft) 0 3px, transparent 3px 6px); border: 1px solid var(--danger); }
.sw-unsearched { background: repeating-linear-gradient(135deg, var(--hatch) 0 1.5px, transparent 1.5px 5px); border: 1px solid var(--rule); }
.sw-stale { background: repeating-linear-gradient(135deg, color-mix(in oklch, var(--frost) 40%, transparent) 0 1px, transparent 1px 6px); border: 1px dotted var(--rule-strong); }
.cal-legend .sw.line { height: 3px; vertical-align: 3px; border: 0; }
.sw.line-q { background: var(--gold); }
.sw.line-any { background: repeating-linear-gradient(90deg, var(--muted) 0 4px, transparent 4px 7px); }
.sw.line-max { background: repeating-linear-gradient(90deg, var(--fire) 0 6px, transparent 6px 10px); }
.legend-dot.dot-alert { background: var(--fire); border-radius: 50%; }

/* ---------- lists / feed ---------- */
.feed { list-style: none; margin: 0; padding: 0; display: grid; }
.feed li { display: grid; grid-template-columns: 68px 1fr; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--rule); font-size: 14px; align-items: baseline; }
.feed li:last-child { border-bottom: 0; }
.feed li.day { grid-template-columns: 1fr; border-bottom: 0; padding-top: 18px; }
.feed time { font-family: var(--font-data); color: var(--muted); font-size: 13px; white-space: nowrap; }
.feed .k-alert { color: var(--fire); font-weight: 700; }
.feed .k-search_error { color: var(--danger); }
.feed .q { color: var(--gold); font-weight: 700; }
.rej-list { display: grid; gap: 0; }
.rej { display: grid; grid-template-columns: 82px 1fr auto; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--rule); align-items: baseline; }
.rej:last-child { border-bottom: 0; }
.rej .p { font: 700 15px/1 var(--font-data); color: var(--ink-2); text-decoration: line-through; text-decoration-color: color-mix(in oklch, var(--danger) 70%, transparent); text-decoration-thickness: 2px; }
.rej.unverified .p { text-decoration: none; color: var(--frost); }
.rej .why { font-size: 14px; }
.rej .why b { color: var(--danger); font-weight: 600; }
.rej.unverified .why b { color: var(--frost); }
.rej .meta { font-size: 13px; color: var(--muted); text-align: right; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-family: var(--font-data); }

/* ---------- alerts page ---------- */
.alert-list { display: grid; gap: 12px; }
.alert-card {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px 18px; align-items: center;
  padding: 16px 20px; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-lg);
}
.alert-card.fresh { border-color: color-mix(in oklch, var(--gold) 55%, var(--rule)); }
.alert-card .amount { font: 700 28px/1 var(--font-data); color: var(--gold); display: flex; align-items: center; gap: 6px; }
.alert-card .what { display: grid; gap: 4px; min-width: 0; }
.alert-card .what b { font-weight: 600; }
.alert-card .when { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 12px; }
.alert-card .acts { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.guard-list { display: grid; gap: 0; }
.guard {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 18px; align-items: center;
  padding: 14px 0; border-bottom: 1px solid var(--rule);
}
.guard:last-child { border-bottom: 0; }
.guard .who { display: grid; gap: 4px; min-width: 0; }
.guard .who a { color: var(--ink); font-weight: 600; text-decoration: none; }
@media (hover: hover) and (pointer: fine) { .guard .who a:hover { color: var(--fire); text-decoration: underline; } }
.guard .now { font-size: 14px; color: var(--muted); }
.guard .now b { font-family: var(--font-data); color: var(--ink); }
.guard .now b.hot { color: var(--gold); }
.price-edit { display: flex; align-items: center; gap: 8px; }
.price-edit label { font-size: 14px; color: var(--ink-2); white-space: nowrap; }
.money-input { position: relative; display: inline-flex; align-items: center; }
.money-input span { position: absolute; left: 12px; color: var(--muted); font-family: var(--font-data); pointer-events: none; }
.money-input input { width: 120px; padding-left: 30px; }
.alert-card .amount small { font: 600 11px/1 var(--font-body); color: var(--muted); align-self: flex-end; margin-left: 2px; }
.alert-card.tip .amount { color: var(--fire); }
.alert-card.error-fare { border-color: color-mix(in oklch, var(--danger) 55%, var(--rule)); }
.alert-card.tip .what b { overflow-wrap: anywhere; }
.deal-panel > header h2 { display: inline-flex; align-items: center; gap: 6px; }
.deal-panel > header h2 svg { color: var(--fire); }
.field-note { font-size: 13px; color: var(--frost); grid-column: 1 / -1; display: flex; gap: 6px; align-items: flex-start; }
.field-note svg { width: 16px; height: 16px; flex: none; margin-top: 2px; }
.field-note.bad { color: var(--danger); }

/* ---------- chart ---------- */
.chart svg { width: 100%; height: auto; display: block; }
.chart .axis { stroke: var(--rule); }
.chart .grid { stroke: var(--rule); stroke-dasharray: 2 4; }
.chart .label { fill: var(--muted); font: 400 10px var(--font-data); }
.chart .line-q { fill: none; stroke: var(--gold); stroke-width: 2.25; }
.chart .line-any { fill: none; stroke: var(--muted); stroke-width: 1.25; stroke-dasharray: 3 3; }
.chart .ceiling { stroke: var(--fire); stroke-width: 1.5; stroke-dasharray: 6 4; }
.chart .alertline { stroke: var(--fire); stroke-width: 1; }
.chart .alert-dot { fill: var(--fire); }
.chart .ceiling-label { fill: var(--fire); font: 700 10px var(--font-data); }

/* ---------- forms ---------- */
.field { display: grid; gap: 6px; }
.field > span, .field > label { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.field small { color: var(--muted); font-size: 13px; }
.input, select.input, textarea.input {
  width: 100%; min-height: 44px; padding: 9px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--control); background: var(--raised); color: var(--ink); font-size: 16px;
}
.input:focus { border-color: var(--fire); outline: none; box-shadow: 0 0 0 3px color-mix(in oklch, var(--fire) 28%, transparent); }
.input[aria-invalid="true"] { border-color: var(--danger); }
.input.num { font-family: var(--font-data); }
select.input { background-color: var(--raised); color: var(--ink); }
textarea.input { min-height: 96px; resize: vertical; line-height: 1.5; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr)); gap: 16px; align-items: start; }
.form-section { padding: 20px 0; border-top: 1px solid var(--rule); display: grid; gap: 16px; }
.form-section:first-child { border-top: 0; padding-top: 0; }
.toggle { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 15px; min-height: 32px; }
.toggle input { width: 20px; height: 20px; accent-color: var(--fire); flex: none; }
.seg-control { justify-self: start; display: inline-flex; flex-wrap: wrap; border: 1px solid var(--control); border-radius: var(--radius-sm); overflow: hidden; background: var(--raised); }
.seg-control button { border: 0; background: transparent; padding: 9px 14px; min-height: 42px; cursor: pointer; font-weight: 600; font-size: 14px; touch-action: manipulation; }
.seg-control button + button { border-left: 1px solid var(--control); }
.seg-control button[aria-pressed="true"] { background: var(--fire); color: var(--on-fire); }
.airport-picker { display: grid; gap: 8px; }
.airport-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ap-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 12px; border-radius: 999px; background: var(--fire-soft); color: var(--fire); font: 700 14px/1.6 var(--font-data); }
.ap-chip.alternate { background: var(--sunken); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--rule-strong); }
.ap-chip button { border: 0; background: transparent; cursor: pointer; color: inherit; padding: 2px 6px; min-height: 28px; font-size: 13px; font-family: var(--font-body); }
.suggest { position: relative; }
.suggest ul { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 4px; list-style: none; background: var(--raised); border: 1px solid var(--rule-strong); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); max-height: 280px; overflow: auto; }
.suggest li button { width: 100%; text-align: left; display: grid; grid-template-columns: 48px 1fr; gap: 8px; border: 0; background: transparent; padding: 10px 8px; border-radius: 4px; cursor: pointer; }
.suggest li button:hover, .suggest li button:focus { background: var(--sunken); }
.suggest li b { font-family: var(--font-data); }
.more-rules { margin-top: 14px; }
.more-rules > summary { cursor: pointer; min-height: 40px; display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--ink-2); list-style: none; }
.more-rules > summary::-webkit-details-marker { display: none; }
.more-rules > summary::before { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--fire); border-bottom: 2px solid var(--fire); transform: rotate(-45deg); transition: transform 0.15s var(--ease-out); flex: none; }
.more-rules[open] > summary::before { transform: rotate(45deg); }
.more-rules[open] > summary { margin-bottom: 10px; }
.more-rules > .field, .more-rules > .form-grid { margin-top: 10px; }
.row.hours { flex-wrap: nowrap; gap: 6px; }
.row.hours select { min-width: 0; flex: 1; }
.token-reveal .row { margin-top: 8px; flex-wrap: nowrap; }
.token-reveal input { flex: 1; min-width: 0; font-size: 14px; }
details > summary { cursor: pointer; }

/* NL composer: the trip chat */
.composer { display: grid; gap: 12px; }
.composer textarea { font-size: 17px; min-height: 110px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; gap: 6px; align-items: center; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--rule-strong); background: var(--raised); font-size: 14px; }
.chip b { font-weight: 700; }
.chip.warn { border-color: var(--frost); background: var(--frost-soft); color: var(--ink); }
.chip.unsupported { border-style: dashed; color: var(--muted); }
button.chip { cursor: pointer; min-height: 36px; }
@media (hover: hover) and (pointer: fine) { button.chip:hover { border-color: var(--fire); } }
.preview-box { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.metric { padding: 12px 14px; border-radius: var(--radius-sm); background: var(--sunken); }
.metric b { display: block; font: 700 22px/1.1 var(--font-data); }
.metric span { font-size: 13px; color: var(--muted); }

/* tables */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font: 600 13px/1.2 var(--font-body); color: var(--muted); padding: 8px 8px; border-bottom: 1px solid var(--rule); }
.table td { padding: 12px 8px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }

/* empty state */
.empty-state { text-align: center; padding: 56px 20px; display: grid; gap: 16px; justify-items: center; }
.empty-state svg { width: 72px; height: 72px; color: var(--fire); }
.empty-state p { max-width: 480px; color: var(--muted); margin: 0; }

/* toasts */
.toasts { position: fixed; bottom: calc(18px + var(--tabbar-h)); left: 50%; transform: translateX(-50%); z-index: 50; display: grid; gap: 8px; width: min(440px, calc(100vw - 32px)); }
.toast { padding: 12px 16px; border-radius: var(--radius-sm); background: var(--ink); color: var(--bg); box-shadow: var(--shadow-lg); font-size: 15px; }
.toast.error { background: var(--danger); color: oklch(0.99 0.01 75); }
@media (prefers-reduced-motion: no-preference) {
  .toast { animation: toast-in 0.22s var(--ease-out) both; }
  @keyframes toast-in { from { transform: translateY(8px) scale(0.97); opacity: 0; } }
}

/* auth */
.auth-card { max-width: 420px; margin: 8vh auto 0; }
.auth-card .panel { position: relative; overflow: hidden; isolation: isolate; }
.auth-card .panel .body { display: grid; gap: 16px; padding: 28px 24px; }
.auth-card .emblem { width: 72px; height: 72px; filter: drop-shadow(0 0 14px oklch(0.72 0.18 45 / 0.45)); }

.banner { padding: 12px 16px; border-radius: var(--radius-sm); background: var(--frost-soft); color: var(--ink); font-size: 14px; margin-bottom: 16px; border: 1px solid color-mix(in oklch, var(--frost) 45%, transparent); }
.banner.info { background: var(--sunken); border-color: var(--rule-strong); }
.banner.bad { background: var(--danger-soft); border-color: color-mix(in oklch, var(--danger) 45%, transparent); }
.skeleton { background: linear-gradient(90deg, var(--sunken), var(--surface), var(--sunken)); background-size: 200% 100%; border-radius: var(--radius); min-height: 90px; }
@media (prefers-reduced-motion: no-preference) { .skeleton { animation: shimmer 1.6s linear infinite; } @keyframes shimmer { to { background-position: -200% 0; } } }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .detail { grid-template-columns: 1fr; }
  .detail .rail { position: static; grid-auto-flow: column; justify-content: start; align-items: center; }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  :root { --tabbar-h: calc(64px + env(safe-area-inset-bottom)); }
  main { padding: 18px 16px calc(32px + var(--tabbar-h)); }
  .topbar { gap: 10px; padding: 8px 16px; padding-top: max(8px, env(safe-area-inset-top)); }
  .topbar .nav, .topbar .install span { display: none; }
  .topbar .new-top { display: inline-flex; }
  .sysline .label { display: none; }
  .brand b { font-size: 16px; }
  .brand svg { width: 30px; height: 30px; }
  .tabbar {
    display: grid; grid-template-columns: repeat(4, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    padding: 6px 8px env(safe-area-inset-bottom);
    background: color-mix(in oklch, var(--bg) 94%, transparent); backdrop-filter: blur(12px);
    border-top: 1px solid var(--rule);
  }
  .tabbar a {
    position: relative; display: grid; justify-items: center; gap: 2px; padding: 6px 4px; min-height: 52px;
    color: var(--muted); text-decoration: none; font-size: 12px; font-weight: 600; border-radius: var(--radius-sm);
    -webkit-tap-highlight-color: transparent;
  }
  .tabbar a svg { width: 24px; height: 24px; }
  .tabbar a[aria-current="page"] { color: var(--fire); }
  .tabbar a[aria-current="page"]::before { content: ""; position: absolute; top: -7px; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px; background: var(--fire); box-shadow: 0 0 10px var(--fire); }
  .tabbar .badge { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 18px; height: 18px; font-size: 11px; padding: 0 5px; }
  .lair { grid-template-columns: auto minmax(0, 1fr); padding: 18px; gap: 14px; }
  .lair .emblem { width: 60px; height: 60px; }
  .lair .lair-act { grid-column: 1 / -1; }
  .lair .lair-act .btn { width: 100%; }
  .page-head .spacer { display: none; }
  .page-head > .row { width: 100%; }
  .strip { grid-template-columns: minmax(0, 1fr) 100px; }
  .strip .title h3 { white-space: normal; flex-basis: 100%; }
  .strip .route { grid-column: 1 / -1; border-right: 0; border-bottom: 1px solid var(--rule); padding: 12px 16px 10px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
  .route .codes { font-size: 22px; }
  .strip .mid { padding: 14px 16px; }
  .best .big-price { font-size: 38px; }
  .leg { grid-template-columns: 58px 1fr 58px; }
  .leg-meta { margin-left: 0; }
  .breakdown .item { grid-template-columns: 110px 1fr 46px; }
  .rej { grid-template-columns: 70px 1fr; }
  .rej .meta { grid-column: 2; text-align: left; }
  .panel > header { padding: 14px 16px 0; }
  .panel > .body { padding: 14px 16px 16px; }
  .alert-card { grid-template-columns: minmax(0, 1fr); padding: 14px 16px; }
  .alert-card .acts { justify-content: stretch; }
  .alert-card .acts .btn { flex: 1; }
  .guard { grid-template-columns: minmax(0, 1fr); }
  /* Settings tables become stacked cards: name + status on top, speed, then the actions. */
  .table.stack-sm thead { display: none; }
  .table.stack-sm tr { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
  .table.stack-sm td { border: 0; padding: 0; }
  .table.stack-sm td:last-child { grid-column: 1 / -1; }
  .table.stack-sm td:last-child .row { flex-wrap: wrap; }
  .table.stack-sm td:last-child input { max-width: none !important; flex: 1 1 160px; }
}
@media (max-width: 380px) {
  .brand b { font-size: 14px; letter-spacing: 0.02em; }
  .brand svg { width: 26px; height: 26px; }
}
.brand b { white-space: nowrap; }
@media (prefers-contrast: more) {
  :root { --rule: var(--rule-strong); --muted: var(--ink-2); }
}
