/* Wind Watch — web (HANDOFF §4 tokens, §9 layout, §6.1/§6.4c/§6.5 chart) */

/* --- Tokens: light column (default) --------------------------------------- */
:root {
  color-scheme: light;
  --ground: #F4F5F7;
  --card: #FFFFFF;
  --hairline: #D9DDE3;
  --ink-primary: #0B0E12;
  --ink-body: #3A414B;
  --ink-secondary: #5F6975;
  --ink-old: #7A8390;
  --ink-disabled: #A0A8B2;
  --trust-amber: #B86E00;
  --sun: #E08A00;
  --link: #2A5F8F;
  --nbm-ink: #2A5F8F;   /* seam label / NBM tags; #9BB7D4 in dark */
  --nbm-tint: #2A86C4;  /* NBM region, 4.5 %; #4FA3D8 in dark */

  --bft-calm: #8A97A6;
  --bft-2: #2A86C4;
  --bft-3: #1E9E80;
  --bft-4: #5FA82E;
  --bft-5: #C9A800;
  --bft-6: #E07F12;
  --bft-7: #D6451A;
  --bft-8: #C7154B;
  --bft-9: #8C1FB3;
  --bft-10: #1B1B1F;

  /* day shading: light = black 8 % × (1 − day); dark = white 7 % × day */
  --shade-day: 0;
  --shade-night: 1;
  --chip-ink: #000000;
  --tip-shadow: rgba(0, 0, 0, 0.25);

  --font-text: -apple-system, system-ui, "Segoe UI", Roboto, sans-serif;
  --font-num: ui-rounded, -apple-system, system-ui, "Segoe UI", Roboto, sans-serif;
  --gutter: 24px;
  --radius-card: 10px;
}

/* --- Tokens: dark column ------------------------------------------------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-scheme="light"]) {
    color-scheme: dark;
    --ground: #0B0E12;
    --card: #171C23;
    --hairline: #2A2F36;
    --ink-primary: #FFFFFF;
    --ink-body: #C7CED8;
    --ink-secondary: #9AA4B1;
    --ink-old: #B8BEC7;
    --ink-disabled: #5C6B7A;
    --trust-amber: #FFB340;
    --sun: #FFB340;
    --link: #9BB7D4;
    --nbm-ink: #9BB7D4;
    --nbm-tint: #4FA3D8;
    --bft-calm: #5C6B7A;
    --bft-2: #4FA3D8;
    --bft-3: #3FC2A0;
    --bft-4: #8DD44A;
    --bft-5: #F2D13D;
    --bft-6: #F59A2B;
    --bft-7: #EC5A2A;
    --bft-8: #E0245E;
    --bft-9: #A32CD1;
    --bft-10: #F5F5F7;
    --shade-day: 1;
    --shade-night: 0;
    --tip-shadow: rgba(0, 0, 0, 0.5);
  }
}
/* ?scheme=dark forces the dark column (verification aid; same values as above) */
:root[data-scheme="dark"] {
  color-scheme: dark;
  --ground: #0B0E12;
  --card: #171C23;
  --hairline: #2A2F36;
  --ink-primary: #FFFFFF;
  --ink-body: #C7CED8;
  --ink-secondary: #9AA4B1;
  --ink-old: #B8BEC7;
  --ink-disabled: #5C6B7A;
  --trust-amber: #FFB340;
  --sun: #FFB340;
  --link: #9BB7D4;
  --nbm-ink: #9BB7D4;
  --nbm-tint: #4FA3D8;
  --bft-calm: #5C6B7A;
  --bft-2: #4FA3D8;
  --bft-3: #3FC2A0;
  --bft-4: #8DD44A;
  --bft-5: #F2D13D;
  --bft-6: #F59A2B;
  --bft-7: #EC5A2A;
  --bft-8: #E0245E;
  --bft-9: #A32CD1;
  --bft-10: #F5F5F7;
  --shade-day: 1;
  --shade-night: 0;
  --tip-shadow: rgba(0, 0, 0, 0.5);
}

/* --- Base ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink-primary);
  font-family: var(--font-text);
  font-size: 15px;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
.page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 32px var(--gutter) 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.num {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}
.hidden { display: none !important; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* --- Brand lockup row (HANDOFF §10a, Web-Desktop / Web-Phone) -------------- */
.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--card);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-tile { flex: none; display: block; }
.wordmark {
  font-family: ui-rounded, -apple-system, "SF Pro Rounded", system-ui, sans-serif;
  font-size: 26px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink-primary);
  white-space: nowrap;
}
.wordmark-watch { font-weight: 500; color: var(--ink-secondary); }
.brand-right { display: inline-flex; align-items: center; gap: 16px; min-width: 0; }

/* --- Header + hero cluster (HANDOFF §9, §8.1) ----------------------------- */
.header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px 32px;
  flex-wrap: wrap;
}
.header-left { min-width: 0; }
h1 {
  font-size: 32px;
  font-weight: 700;
  line-height: 38px;
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}
.trust {
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  color: var(--ink-secondary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 20px;
}
.trust.amber { color: var(--trust-amber); font-weight: 600; }
.trust .seg-amber { color: var(--trust-amber); font-weight: 600; }
.trust .glyph { width: 16px; height: 16px; flex: none; }
.trust .glyph path, .trust .glyph line { stroke: currentColor; }
.trust .glyph circle { fill: currentColor; }

.ring {
  width: 14px; height: 14px; flex: none;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ring { animation-duration: 2.4s; } }

.hero {
  display: flex;
  align-items: flex-end;
  gap: 18px;
  flex-wrap: wrap;
}
.hero-main {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.hero-kn {
  font-size: 72px;
  font-weight: 800;
  line-height: 64px;
  letter-spacing: -0.03em;
}
.hero-kn.dash { color: var(--ink-disabled); font-weight: 400; }
.hero-unit {
  font-size: 20px;
  font-weight: 600;
  color: var(--ink-secondary);
}
.hero-side {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-bottom: 4px;
}
.hero-gust { font-size: 26px; font-weight: 700; line-height: 28px; }
.hero-gust .g { font-size: 17px; font-weight: 600; color: var(--ink-secondary); margin-right: 4px; }
.hero-dir {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 17px;
  line-height: 22px;
  font-weight: 600;
}
.hero-dir svg { width: 18px; height: 18px; display: block; }
.hero-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  padding-bottom: 4px;
}
.chip-peak {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--card);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.chip-peak .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.pill { width: 48px; height: 6px; border-radius: 3px; }
.arrow { fill: currentColor; }

/* --- Summary / body ------------------------------------------------------- */
.summary {
  font-size: 16px;
  line-height: 22px;
  color: var(--ink-body);
  margin: 0;
  max-width: 760px;
}

/* --- Chart card (HANDOFF §9, §6) ------------------------------------------ */
.card {
  background: var(--card);
  border-radius: var(--radius-card);
  padding: 16px 28px 20px;
}
.chart-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 10px;
}
.chart-head-left { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; flex: 1; min-width: 0; }
.chart-head.range-7d .chart-head-left { justify-content: flex-start; }
.chart-head { align-items: center; }
.chart-head h2 { font-size: 15px; font-weight: 700; color: var(--ink-primary); margin: 0; white-space: nowrap; }

/* Two-segment controls: range (28 px, chart head) and °F | °C (24 px, footer). */
.seg {
  display: inline-flex;
  flex: none;
  padding: 2px;
  border-radius: 8px;
  background: var(--ground);
  box-shadow: inset 0 0 0 1px var(--hairline);
}
.seg button {
  min-width: 52px;
  height: 28px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-secondary);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 0 10px;
}
.seg button[aria-checked="true"] { background: var(--hairline); color: var(--ink-primary); }
.seg button:focus-visible { outline: 2px solid var(--ink-primary); outline-offset: 1px; }
.seg-unit { border-radius: 6px; background: var(--card); }
.seg-unit button { min-width: 36px; height: 24px; border-radius: 4px; font-size: 12px; padding: 0 8px; }
.unit-ctl { display: inline-flex; align-items: center; gap: 10px; }
.chart-hint { font-size: 12px; font-weight: 500; color: var(--ink-secondary); }
.chart-wrap { position: relative; }
.chart {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  touch-action: pan-y;
  outline: none;
}
.chart:focus-visible { outline: 2px solid var(--ink-primary); outline-offset: 6px; border-radius: 4px; }
.chart text { font-family: var(--font-text); fill: var(--ink-primary); }
.chart .shade-day { opacity: var(--shade-day); }
.chart .shade-night { opacity: var(--shade-night); }
.chart .grid { stroke: var(--ink-primary); stroke-opacity: 0.12; stroke-width: 1; }
.chart .grid-label { fill-opacity: 0.45; }
.chart .sun { fill: var(--sun); }
.chart .sun-set { fill: none; stroke: var(--sun); stroke-width: 1.5; }
.chart .bar { transition: fill-opacity 80ms linear; }
.chart.selecting .bar { fill-opacity: 0.45; }
.chart.selecting .bar.selected { fill-opacity: 1; }
.chart .bar-inset { fill: none; stroke: var(--bft-8); stroke-width: 2; }
.chart .sel-rule { stroke: var(--ink-primary); stroke-width: 1.5; }
.chart .sel-outline { fill: none; stroke: var(--ink-primary); stroke-width: 1.5; }
.chart .gust-line { fill: none; stroke: var(--ink-primary); stroke-opacity: 0.75; stroke-width: 1.5; stroke-linejoin: round; }
.chart .gust-cap { stroke: var(--ink-primary); stroke-width: 1.5; stroke-linecap: round; }
.chart .arrow { fill: var(--ink-primary); fill-opacity: 0.9; }
.chart .tick { stroke: var(--ink-primary); stroke-opacity: 0.5; stroke-width: 1; }
.chart .tick-label { fill-opacity: 0.6; }
.chart .day-divider { stroke: var(--ink-primary); stroke-opacity: 0.28; stroke-width: 1; stroke-dasharray: 2 3; }
.chart .day-label { font-weight: 700; fill-opacity: 0.75; }
.chart .now-rule { stroke: var(--ink-primary); stroke-width: 1.5; }
.chart .now-label { font-weight: 600; }
.chart .edge-rule { stroke: var(--ink-primary); stroke-opacity: 0.7; stroke-width: 1; stroke-dasharray: 3 3; }
.chart .edge-label { font-weight: 600; fill-opacity: 0.7; }

/* 7 d (spec §12a): NBM tint 4.5 %, bars 70 %, gust line dashed 4/3 at 60 %. */
.chart .nbm-tint { fill: var(--nbm-tint); fill-opacity: 0.045; }
.chart .bar.nbm { fill-opacity: 0.7; }
.chart.selecting .bar.nbm { fill-opacity: 0.35; }
.chart.selecting .bar.nbm.selected { fill-opacity: 1; }
.chart .gust-nbm { stroke-opacity: 0.6; stroke-dasharray: 4 3; }
.chart .seam-label { font-weight: 600; fill: var(--nbm-ink); }
.chart .day-label-bottom { font-weight: 600; fill-opacity: 0.6; }
/* Stale NBM desaturates only its own region (and the run label in the trust line). */
.chart.nbm-stale .nbm { filter: saturate(0.35); opacity: 0.7; }

/* Sky band (spec §12b, sky_reference.py): cloud tones, rain ticks. */
.chart .sky-clear { fill: var(--sun); fill-opacity: 0.22; }
.chart .sky-partly { fill: var(--ink-secondary); fill-opacity: 0.28; }
.chart .sky-overcast { fill: var(--ink-secondary); fill-opacity: 0.6; }
.chart .sky-rain { stroke: var(--bft-2); stroke-width: 2; stroke-linecap: round; }

/* Tooltip card (HANDOFF §6.4c; Web-Desktop artboard) */
.tip {
  position: absolute;
  top: 44px;
  left: 0;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 14px;
  border-radius: 10px;
  background: var(--ground);
  box-shadow: 0 0 0 1.5px var(--ink-primary), 0 8px 24px var(--tip-shadow);
  white-space: nowrap;
  pointer-events: none;
  z-index: 2;
  font-variant-numeric: tabular-nums;
}
.tip-when { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; }
.tip-bar { width: 2px; height: 14px; background: var(--ink-primary); border-radius: 1px; }
.tip-kn { display: flex; align-items: baseline; gap: 4px; }
.tip-kn .n { font-size: 28px; line-height: 30px; font-weight: 800; letter-spacing: -0.02em; }
.tip-kn .u { font-size: 13px; font-weight: 600; color: var(--ink-secondary); }
.tip-gust { font-size: 20px; line-height: 22px; font-weight: 700; }
.tip-gust .g { color: var(--ink-secondary); font-size: 13px; font-weight: 600; margin-right: 4px; }
.tip-dir { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; }
.tip-dir svg { width: 16px; height: 16px; display: block; }
.tip .chip { font-size: 12px; font-weight: 700; min-width: 24px; padding: 2px 0; }
.tip-tag { color: var(--nbm-ink); }
.tip-cond { font-weight: 500; color: var(--ink-secondary); }

.bft-calm { fill: var(--bft-calm); background: var(--bft-calm); }
.bft-2 { fill: var(--bft-2); background: var(--bft-2); }
.bft-3 { fill: var(--bft-3); background: var(--bft-3); }
.bft-4 { fill: var(--bft-4); background: var(--bft-4); }
.bft-5 { fill: var(--bft-5); background: var(--bft-5); }
.bft-6 { fill: var(--bft-6); background: var(--bft-6); }
.bft-7 { fill: var(--bft-7); background: var(--bft-7); }
.bft-8 { fill: var(--bft-8); background: var(--bft-8); }
.bft-9 { fill: var(--bft-9); background: var(--bft-9); }
.bft-10 { fill: var(--bft-10); background: var(--bft-10); box-shadow: 0 0 0 2px var(--bft-8) inset; }

.legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 22px;
  margin-top: 14px;
  font-size: 12px;
  color: var(--ink-secondary);
}
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-item .swatch { width: 12px; height: 12px; border-radius: 2px; display: block; }
.legend-gust { margin-left: 8px; }
.legend-gust svg { display: block; width: 22px; height: 12px; }
.legend-item .arrow { display: block; width: 12px; height: 12px; fill: var(--ink-primary); }
.legend-item .sundot { width: 6px; height: 6px; border-radius: 50%; background: var(--sun); }
.legend-item .sunring { width: 6px; height: 6px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--sun); margin-left: -2px; }
.legend-item .nbm-swatch { width: 14px; height: 12px; border-radius: 2px; background: var(--nbm-tint); opacity: 0.35; }
.legend-nbm { color: var(--nbm-ink); }

/* --- Table (Web-Desktop / Web-Phone artboards) ---------------------------- */
/* HANDOFF §6.4d: a <details> card, closed by default, 52 px summary row. */
.table-card { background: var(--card); border-radius: 10px; min-width: 0; }
.table-card > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  min-height: 52px;
  box-sizing: border-box;
  border-radius: 10px;
}
.table-card > summary::-webkit-details-marker { display: none; }
.table-card > summary:focus-visible { outline: 2px solid var(--ink-primary); outline-offset: 2px; }
.table-summary { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.table-title { font-size: 16px; font-weight: 700; color: var(--ink-primary); white-space: nowrap; }
.table-caption { font-size: 13px; color: var(--ink-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.table-card .chev { color: var(--ink-secondary); flex: none; transition: transform 0.2s ease; }
.table-card[open] .chev { transform: rotate(180deg); }
.table-card .table-wrap { padding: 0 12px 12px; }
.table-card th { background: var(--card); }
@media (prefers-reduced-motion: no-preference) {
  .table-card[open] .table-wrap { animation: table-open 0.25s ease-out; }
}
@keyframes table-open { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; min-width: 0; }
table {
  border-collapse: collapse;
  width: 100%;
  min-width: 560px;
  font-size: 15px;
}
table.compact { min-width: 0; }
th, td {
  text-align: left;
  padding: 9px 10px;
  border-bottom: 1px solid var(--card);
  white-space: nowrap;
}
th.r, td.r { text-align: right; }
th {
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-secondary);
  border-bottom: 1px solid var(--hairline);
  position: sticky;
  top: 0;
  background: var(--ground);
  z-index: 1;
}
tr.day-row th { padding-top: 14px; }
td.hour { color: var(--ink-secondary); }
td.kn { font-weight: 700; }
td.gust { color: var(--ink-body); font-weight: 400; }
td.dir > span { display: inline-flex; align-items: center; gap: 8px; }
td.dir svg { width: 14px; height: 14px; display: block; }
.chip {
  display: inline-block;
  min-width: 26px;
  padding: 2px 0;
  border-radius: 6px;
  color: var(--chip-ink);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  line-height: 16px;
}
.chip.bft-10 { color: #FFFFFF; }
:root[data-scheme="dark"] .chip.bft-10 { color: #000000; }
@media (prefers-color-scheme: dark) { :root:not([data-scheme="light"]) .chip.bft-10 { color: #000000; } }
tr.now td { background: color-mix(in srgb, var(--card) 70%, transparent); }
tr.now td.hour { color: var(--ink-primary); font-weight: 600; }
table.compact th, table.compact td { padding: 10px 8px; }
table.compact th { padding: 6px 8px; }
table.compact tr.day-row th { padding-top: 14px; }
.tag-nbm { font-family: var(--font-text); font-size: 11px; font-weight: 600; color: var(--nbm-ink); margin-left: 2px; }
tr.nbm-row th { padding-top: 14px; color: var(--nbm-ink); position: static; }
td.temp { color: var(--ink-body); font-weight: 600; }
@media (max-width: 359px) { .temp { display: none; } }

/* --- Footer --------------------------------------------------------------- */
.footer {
  display: flex;
  justify-content: space-between;
  gap: 8px 24px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--ink-secondary);
  padding-top: 8px;
  border-top: 1px solid var(--hairline);
}
.footer a { color: var(--link); text-decoration: none; }
.footer a:hover { color: var(--ink-primary); }
.footer .trying { display: inline-flex; align-items: center; gap: 8px; }
.credit { margin: 0; text-align: center; font-size: 13px; color: var(--ink-secondary); }
.credit a { color: var(--link); text-decoration: none; }
.credit a:hover { color: var(--ink-primary); }

/* --- App awareness (docs/design/web-app-awareness/HANDOFF.md) ------------- */
/* Header link (§1.2): beside the tagline on desktop, replaces it < 600 px. */
.app-link { font-size: 12px; font-weight: 600; color: var(--link); text-decoration: none; white-space: nowrap; }
.app-link:hover { color: var(--ink-primary); }

/* Our strip (§1.4): iOS non-Safari only; collapses to 0 over 200 ms on ✕. */
.app-strip { overflow: hidden; transition: height 200ms ease, margin-bottom 200ms ease, opacity 200ms ease; }
.app-strip-inner {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 10px 10px 12px;
  border-radius: var(--radius-card);
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--hairline);
}
.app-strip-icon { flex: none; display: block; }
.app-strip-text { flex: 1; min-width: 0; font-size: 14px; line-height: 18px; font-weight: 600; }
.app-strip-sub { font-weight: 500; color: var(--ink-secondary); }
.app-strip-get {
  flex: none; font-size: 14px; font-weight: 700; white-space: nowrap; text-decoration: none;
  color: var(--ink-primary); background: var(--hairline); padding: 6px 12px; border-radius: 999px;
}
.app-strip-close {
  flex: none; width: 32px; height: 32px; margin-right: -4px; padding: 0; border: 0;
  background: transparent; color: var(--ink-secondary); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
@media (prefers-reduced-motion: reduce) { .app-strip { transition: none; } }

/* Persistent card above the footer (§1.3). Desktop: one wrapping row. */
.app-card {
  display: flex; align-items: center; flex-wrap: wrap; gap: 24px;
  padding: 20px 24px;
  border-radius: var(--radius-card);
  background: var(--card);
}
.app-card-head { display: contents; }
.app-icon { flex: none; display: block; }
.app-icon-40 { display: none; }
.app-card-text { display: flex; flex-direction: column; gap: 6px; flex: 1 1 260px; min-width: 0; }
.app-card-title { font-size: 17px; line-height: 22px; font-weight: 700; }
.app-card-body { font-size: 14px; line-height: 19px; color: var(--ink-secondary); }
.app-card-url { margin-top: 4px; font-size: 13px; color: var(--ink-secondary); text-decoration: none; }
.app-card-url:hover { color: var(--ink-primary); }
.app-card-art { display: flex; align-items: center; gap: 22px; }
.app-card-fig { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.app-card-fig figcaption { font-size: 11px; line-height: 14px; color: var(--ink-disabled); }
.app-card .cap-narrow { display: none; }
.qr { display: block; }
.app-card-store { display: none; justify-content: center; margin-top: 2px; }
.store-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 999px;
  background: var(--ink-primary); color: var(--ground);
  font-size: 15px; font-weight: 700; white-space: nowrap; text-decoration: none;
}

/* The complication drawing (§2): black plate, always the dark ramp. */
.comp-host { min-height: 64px; }
.comp-mini {
  position: relative; overflow: hidden;
  background: #000000; border-radius: 10px; color: #FFFFFF;
  display: flex; flex-direction: column;
}
.cm-row {
  height: 28px; flex: none; padding: 0 8px; box-sizing: border-box;
  display: flex; align-items: baseline; padding-top: 6px; white-space: nowrap;
  font-family: var(--font-text); font-variant-numeric: tabular-nums;
}
.cm-kn { font-family: var(--font-num); font-size: 20px; line-height: 16px; font-weight: 800; }
.cm-kn.cm-dash { color: #9AA4B1; font-weight: 400; }
.cm-g { font-family: var(--font-num); font-size: 10px; font-weight: 700; opacity: 0.9; margin-left: 2px; }
.cm-arrow { margin-left: 6px; align-self: center; position: relative; top: 1px; }
.cm-from { font-size: 9px; font-weight: 600; margin-left: 3px; }
.cm-asof { margin-left: auto; padding-left: 8px; font-size: 10px; font-weight: 500; color: #9AA4B1; }
.cm-bars { display: block; flex: none; }

/* --- Trust-state treatments (HANDOFF §3) ---------------------------------- */
.state-old .num,
.state-old .hero-kn,
.state-old .hero-gust,
.state-old .hero-dir,
.state-old td.kn,
.state-old td.gust,
.state-old td.dir,
.state-horizon td.kn,
.state-horizon td.gust,
.state-horizon td.dir { color: var(--ink-old); }
.state-old .chart,
.state-old .pill,
.state-old .chip,
.state-old .chip-peak .dot,
.state-old .hero-dir svg,
.state-horizon .chart,
.state-old .comp-mini .cm-bars,
.state-old .comp-mini .cm-row,
.state-horizon .comp-mini .cm-bars,
.state-horizon .chip { filter: saturate(0.35); opacity: 0.7; }

/* --- Breakpoints ---------------------------------------------------------- */
@media (max-width: 699px) {
  .header { flex-direction: column; align-items: stretch; }
  .hero { justify-content: space-between; gap: 14px; }
  .hero-right { align-items: flex-start; padding-bottom: 0; }
}
@media (max-width: 599px) {
  :root { --gutter: 16px; }
  .brand { gap: 9px; }
  .brand-tile { width: 24px; height: 24px; }
  .wordmark { font-size: 22px; }
  .app-card { flex-direction: column; align-items: stretch; flex-wrap: nowrap; gap: 12px; padding: 16px; }
  .app-card-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
  .app-icon-48 { display: none; }
  .app-icon-40 { display: block; }
  .app-card-text { display: contents; }
  .app-card-title { flex: 1 1 0; min-width: 0; font-size: 16px; line-height: 21px; }
  .app-card-body { flex: 1 0 100%; font-size: 13px; line-height: 18px; }
  .app-card-url, .app-card-qr, .app-card .cap-wide { display: none; }
  .app-card .cap-narrow { display: inline; }
  .app-card-art { display: block; }
  .app-card-comp, .comp-host { width: 100%; }
  .comp-host { min-height: 76px; }
  .app-card-store { display: flex; }
  .page { padding: 24px var(--gutter) 32px; gap: 16px; }
  h1 { font-size: 28px; line-height: 34px; }
  .trust { font-size: 13px; line-height: 18px; }
  .summary { font-size: 15px; line-height: 20px; }
  .chip-peak { white-space: normal; }
  .card { padding: 10px 0 12px; }
  .legend, .chart-hint { display: none; }
  .chart-head { padding: 0 16px; margin-bottom: 8px; }
  .table-card > summary { padding: 14px 16px; }
  .table-summary { gap: 10px; }
  .table-card .table-wrap { padding: 0 8px 12px; }
  .tip { gap: 6px 12px; padding: 8px 12px; flex-wrap: wrap; justify-content: center; width: max-content; max-width: 100%; }
}
/* Inside the table card the row rules switch from `card` to `hairline` so they stay visible. */
.table-card td { border-bottom-color: color-mix(in srgb, var(--hairline) 60%, transparent); }
.table-card tr.now td { background: color-mix(in srgb, var(--ground) 40%, transparent); }
