:root, [data-theme="light"] {
  color-scheme: light;
  --ink: #1a1814;
  --dim: #6f675c;
  --line: #d9d0c3;
  --paper: #f3efe6;
  --card: #f7f4ee;
  --alert: #8a3b1a;
  --bar: #1a1814;
}
[data-theme="dark"] {
  color-scheme: dark;
  --ink: #e8e2d6;
  --dim: #9c9286;
  --line: #3c362e;
  --paper: #12100e;
  --card: #1a1714;
  --alert: #e0a07a;
  --bar: #e8e2d6;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--paper); color: var(--ink); }
body {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 14px;
  line-height: 1.45;
  max-width: 720px;
  margin: 0 auto;
  padding: 18px 14px calc(36px + env(safe-area-inset-bottom));
}
button, input { font: inherit; color: inherit; }
h2 {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  margin: 0;
}
.dim { color: var(--dim); }
.alert { color: var(--alert); }
.top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--ink);
}
.brand { letter-spacing: .04em; flex: 1; }
.top-tools { display: flex; align-items: center; gap: 14px; }
.clock { font-variant-numeric: tabular-nums; }
.switch {
  width: 46px;
  height: 26px;
  border: 1px solid var(--ink);
  background: var(--paper);
  padding: 2px;
  cursor: pointer;
  position: relative;
}
.switch-knob {
  display: block;
  width: 20px;
  height: 20px;
  background: var(--ink);
  transform: translateX(0);
}
.switch[aria-pressed="true"] .switch-knob { transform: translateX(20px); }
.models { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 0; }
.chip {
  border: 1px solid var(--line);
  background: transparent;
  min-height: 34px;
  padding: 6px 10px;
  cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.now, .day, .block, .sun {
  margin-top: 14px;
  padding: 14px 12px;
  background: var(--card);
  border: 1px solid var(--line);
}
.now { display: grid; grid-template-columns: 56px 1fr; gap: 10px; align-items: start; }
.now-icon svg { width: 52px; height: 52px; }
.now-temp { font-size: 52px; line-height: .88; letter-spacing: -0.04em; }
.now-desc { margin-top: 6px; }
.now-stats, .compare, .sensor, .flag, .meta { color: var(--dim); margin-top: 8px; }
.now-stats { display: flex; flex-wrap: wrap; gap: 6px 12px; }
.now-stats b, .compare b, .sensor b, .meta b, .st-kv b, .school-line b { color: var(--ink); font-weight: 500; }
.block-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.text-btn {
  border: 0;
  background: none;
  color: var(--dim);
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.chart-box { height: 200px; }
.chart-air { height: 168px; margin-top: 8px; }
.daily-row {
  display: grid;
  grid-template-columns: 52px 28px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
.daily-row:last-child { border-bottom: 0; }
.d-day { display: flex; flex-direction: column; }
.d-date { color: var(--dim); font-size: 11px; }
.d-ico svg { width: 22px; height: 22px; }
.d-temp { display: flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.d-bar { position: relative; flex: 1; height: 3px; background: var(--line); min-width: 36px; }
.d-bar span { position: absolute; top: 0; height: 3px; background: var(--bar); }
.d-meta { color: var(--dim); font-size: 12px; margin-top: 3px; }
.stations { display: grid; gap: 0; }
.station { padding: 12px 0; border-bottom: 1px solid var(--line); }
.station:last-child { border-bottom: 0; padding-bottom: 0; }
.st-addr { margin-bottom: 6px; }
.gauge { display: flex; align-items: center; gap: 8px; }
.gauge-track { display: flex; gap: 2px; }
.gauge-seg { width: 8px; height: 10px; background: var(--line); }
.gauge-seg.on { background: var(--ink); }
.gauge-seg.on.alert { background: var(--alert); }
.gauge-val { font-variant-numeric: tabular-nums; }
.gauge-val.alert { color: var(--alert); }
.st-grid, .inpost-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; margin-top: 8px; font-size: 12px; color: var(--dim); }
.inpost {
  margin: 0 0 4px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--ink);
}
.inpost-kicker { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }
.inpost-temp { font-size: 42px; line-height: .95; letter-spacing: -0.04em; margin: 4px 0; }
.inpost-grid b { color: var(--ink); font-weight: 500; }
.caption { color: var(--dim); font-size: 12px; margin: 0 0 8px; }
.school-row { display: grid; gap: 2px; margin-top: 12px; }
.school-when { letter-spacing: .08em; text-transform: uppercase; font-size: 11px; color: var(--dim); }
.school-verdict { font-size: 16px; }
.day-len { font-size: 32px; letter-spacing: -0.03em; line-height: 1.05; margin-top: 4px; }
.day-sub, .astro-row { color: var(--dim); margin-top: 6px; }
.day-sub b, .astro-row b { color: var(--ink); font-weight: 500; }
.sun { display: grid; gap: 4px; }
.sun h2 { margin-bottom: 8px; }
.foot { margin-top: 16px; color: var(--dim); font-size: 11px; display: grid; gap: 4px; }
@media (min-width: 720px) {
  body { padding: 28px 18px 48px; font-size: 13px; }
  .now { grid-template-columns: 72px 1fr; }
  .now-icon svg { width: 64px; height: 64px; }
  .now-temp { font-size: 64px; }
  .chart-box { height: 220px; }
  .st-grid, .inpost-grid { grid-template-columns: repeat(3, 1fr); }
}
