/* LocalCast web dashboard. No external fonts or libraries: it must work offline on the LAN.
   Colors are the dataviz reference palette (validated light + dark, 2 series + grey), as roles. */

:root {
  color-scheme: light;
  --page: #f9f9f7;
  --surface: #fcfcfb;
  --surface-2: #f3f2ee;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #706e69;           /* 4.96:1 on the surface (was #898781, 3.50) */
  --grid: #e1e0d9;
  --axis: #c3c2b7;
  --border: rgba(11, 11, 11, 0.10);
  --accent: #2a78d6;           /* series 1: forecast */
  --link: #1f6cc8;             /* link text: 5.07:1 (the accent is 4.30 for 12 px text) */
  --accent-wash: rgba(42, 120, 214, 0.12);
  --series-2: #eb6834;         /* series 2: gusts */
  --history: #85837d;          /* de-emphasis: observed past; 3.69:1 (was #9a9892, 2.81) */
  --good-text: #006300;
  --bad-text: #b3261e;
  --good: #0ca30c;
  --warning: #fab219;
  --serious: #ec835a;
  --critical: #d03b3b;
  --sun: #f2a900;
  --cloud: #b9b8b3;
  --cloud-dark: #8d8c87;
  --shadow: 0 1px 2px rgba(11, 11, 11, 0.04), 0 4px 16px rgba(11, 11, 11, 0.04);
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --page: #0d0d0d;
    --surface: #1a1a19;
    --surface-2: #232322;
    --ink: #ffffff;
    --ink-2: #c3c2b7;
    --muted: #898781;
    --grid: #2c2c2a;
    --axis: #383835;
    --border: rgba(255, 255, 255, 0.10);
    --accent: #3987e5;
    --link: #3987e5;
    --accent-wash: rgba(57, 135, 229, 0.18);
    --series-2: #d95926;
    --history: #7c7b76;
    --good-text: #0ca30c;
    --bad-text: #e66767;
    --cloud: #8d8c87;
    --cloud-dark: #6b6a66;
    --shadow: none;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d0d0d; --surface: #1a1a19; --surface-2: #232322; --ink: #ffffff; --ink-2: #c3c2b7;
  --grid: #2c2c2a; --axis: #383835; --border: rgba(255, 255, 255, 0.10); --accent: #3987e5; --link: #3987e5;
  --accent-wash: rgba(57, 135, 229, 0.18); --series-2: #d95926; --history: #7c7b76;
  --good-text: #0ca30c; --bad-text: #e66767; --cloud: #8d8c87; --cloud-dark: #6b6a66; --shadow: none;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--link); }
button { font: inherit; color: inherit; }
.boot { padding: 48px 24px; color: var(--ink-2); text-align: center; }

/* ---------- layout ---------- */
.wrap { max-width: 1240px; margin: 0 auto; padding: 16px 16px 40px; }
.grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1000px) {
  .grid { grid-template-columns: minmax(0, 1.75fr) minmax(320px, 1fr); align-items: start; }
  .col { display: grid; gap: 16px; }
}
.col { display: grid; gap: 16px; min-width: 0; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 20px;
  box-shadow: var(--shadow);
  min-width: 0;
}
.card h2 {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head h2 { margin: 0; }
.sub { color: var(--ink-2); font-size: 13px; }
.muted { color: var(--muted); }

/* ---------- header ---------- */
.top { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; margin: 4px 2px 16px; }
.top h1 { margin: 0; font-size: 26px; line-height: 1.15; font-weight: 650; letter-spacing: -0.01em; }
.top .where { color: var(--ink-2); font-size: 14px; margin-top: 2px; }
.top-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: 999px; font-size: 13px;
  background: var(--surface); border: 1px solid var(--border); color: var(--ink-2); text-decoration: none;
}
.pill:hover { background: var(--surface-2); }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
.lvl-ok { background: var(--good); }
.lvl-warn { background: var(--warning); }
.lvl-error { background: var(--critical); }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: transparent; padding: 5px 12px; font-size: 13px; cursor: pointer; color: var(--ink-2); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--surface); }
.seg button:focus-visible, .pill:focus-visible, .chart-stack:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.banner {
  display: none; margin: 0 2px 16px; padding: 10px 14px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border); color: var(--ink-2); font-size: 14px;
}
.banner.show { display: flex; align-items: center; gap: 8px; }
.stale .grid, .stale .both { opacity: 0.6; transition: opacity 0.3s; }

/* ---------- both sites side by side ---------- */
/* series slots 1-2 of the validated palette: the site's identity, carried by keys and marks only */
.k-s1, .range .fill.f-s1 { background: var(--accent); }
.k-s2, .range .fill.f-s2 { background: var(--series-2); }
.c-line, .c-obs { fill: none; stroke-linejoin: round; stroke-linecap: round; }
.c-line { stroke-width: 2; }
.c-obs { stroke-width: 1.5; stroke-dasharray: 3 3; }
.c-s1 { stroke: var(--accent); }
.c-s2 { stroke: var(--series-2); }
.c-dot.d-s2 { fill: var(--series-2); }
.key-dash { width: 16px; height: 0; border-top: 2px dashed var(--ink-2); display: inline-block; }
.both { display: grid; gap: 16px; }
.pair { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) { .pair { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.card h2 .key-line { margin-right: 8px; vertical-align: middle; width: 14px; height: 4px; }
.mini-main { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.mini-icon { flex: none; width: 64px; height: 64px; }
.mini-temp { font-size: 52px; line-height: 0.95; font-weight: 600; letter-spacing: -0.03em; }
.mini-stats { margin-bottom: 12px; }
.mini .hero-foot { padding-top: 10px; }
.cmp-now { margin: -4px 0 10px; }
.cmp-scroll { overflow-x: auto; scrollbar-width: thin; padding-bottom: 6px; }
.cmp-grid { display: grid; --cmp-label: 112px; gap: 2px; align-items: center; }
.cmp-lab { position: sticky; left: 0; z-index: 1; background: var(--surface); display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; min-width: 0; padding-right: 6px; }
.cmp-lab span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmp-t { font-size: 12px; color: var(--ink-2); text-align: center; white-space: nowrap; }
.cmp-c { text-align: center; padding: 6px 2px; border-radius: 10px; }
.cmp-c.now { background: var(--surface-2); }
.cmp-c svg { width: 26px; height: 26px; display: block; margin: 0 auto 2px; }
.cmp-c .v { font-weight: 600; font-variant-numeric: tabular-nums; }
.cmp-c .p { font-size: 11px; color: var(--ink-2); min-height: 15px; }
.cdays { display: grid; }
.cday { display: grid; grid-template-columns: 58px minmax(0, 1fr); align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--grid); }
.cday:last-child { border-bottom: 0; }
.cday .dn { font-weight: 600; }
.cd-rows { display: grid; gap: 2px; }
.cd-row { display: grid; grid-template-columns: 26px 38px 38px minmax(60px, 1fr) 38px; align-items: center; gap: 8px; min-height: 26px; }
.cd-row svg { width: 24px; height: 24px; }
.cd-row .pp { font-size: 12px; color: var(--ink-2); text-align: center; }
.cd-row .lo { color: var(--ink-2); text-align: right; font-variant-numeric: tabular-nums; }
.cd-row .hi { font-weight: 600; font-variant-numeric: tabular-nums; }
@media (max-width: 520px) {
  .cmp-grid { --cmp-label: 100px; }
  .mini-temp { font-size: 44px; }
  .cday { grid-template-columns: 44px minmax(0, 1fr); gap: 6px; }
  .cd-row { grid-template-columns: 24px 32px 34px minmax(40px, 1fr) 34px; gap: 6px; }
}

/* ---------- hero ---------- */
.hero { display: grid; gap: 18px 28px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .hero { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); } }
.hero-main { display: flex; align-items: center; gap: 18px; }
.hero-icon { flex: none; width: 88px; height: 88px; }
.hero-temp { font-size: 76px; line-height: 0.95; font-weight: 600; letter-spacing: -0.03em; }
.hero-cond { font-size: 19px; font-weight: 550; margin-top: 6px; }
.hero-hl { color: var(--ink-2); margin-top: 2px; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 16px; align-content: center; }
.stat .k { font-size: 12px; color: var(--ink-2); display: flex; align-items: center; gap: 5px; }
/* values may wrap at a space: unbroken, "30.02 inHg" ran into the sunrise beside it at ~1000 px */
.stat .v { font-size: 18px; font-weight: 600; margin-top: 1px; display: flex; align-items: center; gap: 5px; overflow-wrap: anywhere; }
.stat .v svg { flex: none; }
.stat .v small { font-size: 12px; font-weight: 500; color: var(--ink-2); }
.tag { font-size: 10.5px; font-weight: 600; padding: 0 5px; border-radius: 5px; background: var(--surface-2); color: var(--ink-2); line-height: 16px; }
.hero-foot { grid-column: 1 / -1; display: flex; gap: 6px 14px; flex-wrap: wrap; font-size: 13px; color: var(--ink-2); border-top: 1px solid var(--grid); padding-top: 12px; }
.hero-foot .ml { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
/* tomorrow (v0.28.2): the hero's layout, smaller */
.tmrw-icon { flex: none; width: 64px; height: 64px; }
.tmrw-temp { font-size: 44px; line-height: 1; font-weight: 600; letter-spacing: -0.02em; }
.tmrw-lo { color: var(--ink-2); font-weight: 500; }
.tmrw .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tmrw .stat .v { flex-wrap: wrap; gap: 0 6px; }
.tmrw .stat .v small { white-space: nowrap; }   /* "gusts 13 mph" moves down whole, never splits */

/* ---------- hazards ---------- */
.hazards { display: flex; gap: 10px; flex-wrap: wrap; }
.hazard {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px 8px 10px;
  border-radius: 12px; background: var(--surface); border: 1px solid var(--border); font-size: 14px;
}
.hazard b { font-weight: 600; }
.hazard .sub { font-size: 13px; }

/* ---------- ask localcast ---------- */
.ask-form { display: flex; gap: 8px; align-items: flex-end; }
.ask-form textarea {
  flex: 1; min-width: 0; resize: vertical; font: inherit; font-size: 14px; line-height: 1.4;
  padding: 8px 10px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--ink);
}
.ask-form textarea:focus-visible, .ask-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.ask-btn {
  border: 0; border-radius: 10px; padding: 9px 16px; font: inherit; font-size: 14px; font-weight: 600;
  background: var(--ink); color: var(--surface); cursor: pointer;
}
.ask-btn[disabled], .ask-form textarea[disabled] { opacity: 0.6; cursor: default; }
.ask-out { margin: 12px 0 0; }
.ask-by { margin: -6px 0 10px; }
.ask-out > .sub { margin: 0 0 6px; }

/* ---------- what just happened (unusual weather) ---------- */
.events { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.events li + li { border-top: 1px solid var(--grid); padding-top: 12px; }
.ev-t { display: flex; align-items: baseline; gap: 4px 10px; flex-wrap: wrap; }
.ev-t b { font-weight: 600; }
.ev-t .key-line { align-self: center; }
.events p { margin: 4px 0 0; color: var(--ink); line-height: 1.45; }

/* ---------- hourly strip ---------- */
.strip { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: thin; padding-bottom: 6px; margin: 0 -6px; }
.hr { flex: none; width: 62px; text-align: center; padding: 8px 2px; border-radius: 10px; }
.hr.now { background: var(--surface-2); }
.hr .t { font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.hr svg { width: 32px; height: 32px; margin: 6px auto 4px; display: block; }
.hr .v { font-weight: 600; }
.hr .p { font-size: 12px; color: var(--ink-2); min-height: 17px; display: flex; align-items: center; justify-content: center; gap: 2px; }
.hr.sun .v { font-size: 13px; font-weight: 500; }
/* how much rain this hour (v0.24.0); bold from moderate rain, 0.10 in an hour */
.hr .amt { font-size: 11px; color: var(--ink-2); min-height: 15px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.hr .amt.strong { color: var(--ink); font-weight: 700; }
.hr .rh { font-size: 11px; color: var(--ink-2); min-height: 15px; font-variant-numeric: tabular-nums; }
.drop { width: 7px; height: 9px; flex: none; fill: var(--accent); }
.hr .drop, .day .drop { width: 7px; height: 9px; margin: 0 2px 0 0; display: inline-block; }
.mini-key { display: flex; gap: 12px; font-size: 12px; color: var(--ink-2); }
.mini-key span { display: inline-flex; align-items: center; gap: 4px; }
.mini-key .rh { font-weight: 400; font-size: 11px; }

/* ---------- charts ---------- */
.chart-host { position: relative; }
.chart-block + .chart-block { margin-top: 8px; }
.legend .ttl-t b { color: var(--ink); font-weight: 600; font-size: 13px; }
.c-grid { stroke: var(--grid); stroke-width: 1; shape-rendering: crispEdges; }
.c-day { stroke: var(--axis); stroke-width: 1; shape-rendering: crispEdges; }
.c-axis { stroke: var(--axis); stroke-width: 1; shape-rendering: crispEdges; }
.c-now { stroke: var(--ink-2); stroke-width: 1; shape-rendering: crispEdges; opacity: 0.45; }
.c-cross { stroke: var(--ink); stroke-width: 1; shape-rendering: crispEdges; opacity: 0.6; }
.c-band { fill: var(--accent-wash); stroke: none; }
.c-hist, .c-fc, .c-gust { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.c-hist { stroke: var(--history); }
.c-fc { stroke: var(--accent); }
.c-gust { stroke: var(--series-2); }
.c-bar { fill: var(--accent); }
.c-dot { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.k-hist { background: var(--history); }
.k-fc, .k-bar { background: var(--accent); }
.k-gust { background: var(--series-2); }
.k-band { background: var(--accent-wash); }
.chart-stack { position: relative; outline: none; border-radius: 8px; touch-action: pan-y; }
.chart { display: block; width: 100%; overflow: visible; }
.chart text { font-size: 11px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.chart .lbl { fill: var(--ink-2); font-size: 11px; font-weight: 600; }
.chart .ttl { fill: var(--ink-2); font-size: 12px; font-weight: 600; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12px; color: var(--ink-2); margin: 2px 0 8px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.key-line { width: 16px; height: 2px; border-radius: 2px; display: inline-block; }
.key-wash { width: 14px; height: 10px; border-radius: 3px; display: inline-block; }
.key-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.tip {
  position: absolute; pointer-events: none; z-index: 5; min-width: 160px; max-width: 240px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.14); padding: 9px 11px; font-size: 13px; display: none;
}
.tip.show { display: block; }
.tip .when { font-size: 12px; color: var(--ink-2); margin-bottom: 4px; }
.tip .row { display: flex; align-items: center; gap: 8px; margin: 2px 0; }
.tip .row b { font-weight: 650; font-variant-numeric: tabular-nums; }
.tip .row span.l { color: var(--ink-2); }
.tbl-wrap { overflow: auto; max-height: 460px; border: 1px solid var(--grid); border-radius: 10px; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { padding: 6px 10px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--grid); font-variant-numeric: tabular-nums; }
th:first-child, td:first-child { text-align: left; }
thead th { position: sticky; top: 0; background: var(--surface); color: var(--ink-2); font-weight: 600; font-size: 12px; }
tbody tr:last-child td { border-bottom: 0; }

/* ---------- weather icons (pictograms, not data marks) ---------- */
.i-sun { fill: var(--sun); }
.i-ray { fill: none; stroke: var(--sun); stroke-width: 3.5; stroke-linecap: round; }
.i-moon { fill: #cfcab9; }
.i-cloud { fill: var(--cloud); }
.i-cloud2 { fill: var(--cloud-dark); }
.i-drop { fill: none; stroke: var(--accent); stroke-width: 3.5; stroke-linecap: round; }
.i-flake { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; }
.i-bolt { fill: var(--warning); }
.i-fog { fill: none; stroke: var(--cloud-dark); stroke-width: 4; stroke-linecap: round; }
.i-horizon { fill: none; stroke: var(--ink-2); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.i-arrow { fill: var(--ink-2); }

/* ---------- 10-day ---------- */
.days { display: grid; }
/* 7 columns: day, sky, rain chance, low, the bar, high, humidity. At its narrowest (the 320 px side
   column of a 1000 px window) the card holds ~304 px: the fixed parts take 242 + 36 of gaps */
.day { display: grid; grid-template-columns: 46px 28px 46px 32px minmax(40px, 1fr) 32px 30px; align-items: center; gap: 6px; padding: 7px 0; border-bottom: 1px solid var(--grid); }
.day:last-child { border-bottom: 0; }
.day .dn { font-weight: 600; }
.day svg { width: 28px; height: 28px; }
.day .pp { font-size: 12px; color: var(--ink-2); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.25; }
.day .pp .pc { display: inline-flex; align-items: center; }
.day .pp .amt { font-size: 11px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.day .rh { font-size: 12px; color: var(--ink-2); text-align: right; font-variant-numeric: tabular-nums; }
.day .lo { color: var(--ink-2); text-align: right; font-variant-numeric: tabular-nums; }
.day .hi { font-weight: 600; font-variant-numeric: tabular-nums; }
.range { position: relative; height: 6px; border-radius: 3px; background: var(--surface-2); }
.range .fill { position: absolute; top: 0; bottom: 0; border-radius: 3px; background: var(--accent); }
.range .now { position: absolute; top: 50%; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 2px var(--surface); }

/* ---------- digest ---------- */
.digest p { margin: 0 0 8px; }
.digest ul { margin: 0 0 8px; padding-left: 18px; }
.digest li { margin: 2px 0; }
.digest .via { font-size: 12px; color: var(--ink-2); }

/* ---------- accuracy ---------- */
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.kpi { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; }
.kpi .k { font-size: 12px; color: var(--ink-2); }
.kpi .v { font-size: 24px; font-weight: 650; line-height: 1.2; margin-top: 2px; }
.kpi .d { font-size: 12px; color: var(--ink-2); }
.good-text { color: var(--good-text); }
.bad-text { color: var(--bad-text); }
details { margin-top: 12px; }
summary { cursor: pointer; color: var(--ink-2); font-size: 13px; border-radius: 6px; padding: 3px 0; }
/* small text links still get a 24 px tall tap target (audit 2026-11-21: 16-19 px at phone width) */
footer a, .note a, a.sub { display: inline-block; padding: 4px 0; }
.note { font-size: 12px; color: var(--ink-2); margin-top: 10px; }

/* ---------- health ---------- */
.checks { display: grid; gap: 2px; }
.check { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 8px; padding: 6px 0; align-items: start; }
.check .ico { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; color: #fff; margin-top: 1px; }
.check .ico.lvl-warn { color: #3a2a00; }
.check .n { font-weight: 600; font-size: 14px; }
.check .dt { font-size: 13px; color: var(--ink-2); overflow-wrap: anywhere; }

/* ---------- panel ---------- */
.panel img { width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--grid); background: #fff; image-rendering: pixelated; display: block; }

footer { margin: 18px 2px 0; font-size: 12px; color: var(--muted); display: flex; gap: 6px 14px; flex-wrap: wrap; }
footer a { color: var(--ink-2); }

/* ---------- small buttons (the briefing's Refresh, History's navigation) ---------- */
.btn-sm {
  border: 1px solid var(--border); border-radius: 999px; padding: 4px 12px; font-size: 13px; line-height: 1.35;
  background: var(--surface); color: var(--ink-2); cursor: pointer;
}
.btn-sm:hover:not([disabled]) { background: var(--surface-2); color: var(--ink); }
.btn-sm[disabled] { opacity: 0.45; cursor: default; }
.btn-sm:focus-visible, .hday:focus-visible, .hmon:focus-visible, .hdate:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- history ---------- */
.hist { display: grid; gap: 16px; }
.hist.loading .card:not(.hist-top) { opacity: 0.55; transition: opacity 0.2s; }
.hist-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; margin-bottom: 14px; }
.hist-nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hist-nav .hist-title { margin: 0 4px; font-size: 18px; font-weight: 650; letter-spacing: -0.01em; text-transform: none; color: var(--ink); }
.hdate { font: inherit; font-size: 13px; padding: 3px 8px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--ink); }
.kpis.hist-kpis { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.hist-top .note { margin: 10px 0 0; }
.hsky { display: flex; align-items: center; gap: 6px; }
.hdays, .hmons { display: grid; }
.hday, .hmon {
  display: grid; align-items: center; gap: 8px; width: 100%; text-align: left; cursor: pointer;
  padding: 7px 6px; border: 0; border-bottom: 1px solid var(--grid); border-radius: 0; background: none;
}
.hday { grid-template-columns: 62px 28px 38px minmax(60px, 1fr) 38px 64px; }
.hmon { grid-template-columns: 48px 38px minmax(60px, 1fr) 38px 72px; }
.hday:hover, .hmon:hover { background: var(--surface-2); }
.hday:last-child, .hmon:last-child { border-bottom: 0; }
.hday.gap { cursor: default; grid-template-columns: 62px minmax(0, 1fr); }
.hday.gap:hover { background: none; }
.hday .dn, .hmon .dn { font-weight: 600; }
.hday svg { width: 26px; height: 26px; }
.hday .lo, .hmon .lo { color: var(--ink-2); text-align: right; font-variant-numeric: tabular-nums; }
.hday .hi, .hmon .hi { font-weight: 600; font-variant-numeric: tabular-nums; }
.hday .rn, .hmon .rn { font-size: 12px; color: var(--ink-2); text-align: right; font-variant-numeric: tabular-nums; }
.hist .card > p { margin: 0 0 6px; }
.brief + .brief { border-top: 1px solid var(--grid); margin-top: 10px; padding-top: 10px; }
.brief > .sub { margin: 0 0 6px; }
@media (max-width: 520px) {
  .hday { grid-template-columns: 58px 24px 30px minmax(40px, 1fr) 30px 50px; gap: 6px; }
  .hmon { grid-template-columns: 38px 32px minmax(40px, 1fr) 32px 60px; gap: 6px; }
  .hist-nav .hist-title { font-size: 16px; }
}

@media (max-width: 520px) {
  .wrap { padding: 12px 10px 32px; }
  .card { padding: 14px 14px; border-radius: 14px; }
  .hero-temp { font-size: 64px; }
  .hero-icon { width: 72px; height: 72px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .day { grid-template-columns: 44px 26px 42px 32px minmax(36px, 1fr) 32px 30px; gap: 6px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
