* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input { font: inherit; color: inherit; }
b { font-weight: 600; }
a { color: inherit; }

.app { max-width: 480px; margin: 0 auto; min-height: 100vh; position: relative; }

/* ---------- Page chrome ---------- */
.page { padding-top: calc(env(safe-area-inset-top) + 12px); padding-bottom: calc(env(safe-area-inset-bottom) + 96px); }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 20px 0; }
.page-head.titled { align-items: flex-end; padding-bottom: 14px; }
.place { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.place-name { font-size: 17px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page-title { font-size: 28px; font-weight: 600; letter-spacing: -.4px; }
.sub { font-size: 12px; color: var(--muted); }
.sub.stale { color: var(--stale); font-weight: 600; }
.round-btn { width: 44px; height: 44px; flex: none; border-radius: 22px; background: var(--chip); display: flex; align-items: center; justify-content: center; }

.stack { display: flex; flex-direction: column; gap: 12px; padding: 12px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-card); padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.card.dashed { border-style: dashed; border-color: var(--faint); }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.eyebrow { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.note { font-size: 12px; color: var(--muted); }
.muted { color: var(--muted); }
.ink2 { color: var(--ink-2); }
.tabular { font-variant-numeric: tabular-nums; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.thirds { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.kv { font-size: 13px; color: var(--muted); }
.kv .v { font-size: 15px; color: var(--ink); font-weight: 500; margin-top: 2px; }
.kv.lg .v { font-size: 16px; }
.divider-top { border-top: 1px solid var(--line-2); padding-top: 14px; }

/* ---------- Feels-like hero ---------- */
.hero { padding: 18px 20px 8px; }
.hero-label { font-size: 13px; color: var(--muted); font-weight: 500; }
.hero-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.hero-temp { font-size: 100px; font-weight: 200; line-height: .9; letter-spacing: -5px; white-space: nowrap; }
.hero-temp.dim { color: var(--ink-2); }
.hero-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; padding-bottom: 8px; }
.hero-actual { display: flex; align-items: center; gap: 6px; font-size: 15px; color: var(--ink-2); }
.cond { display: flex; }
.hero-actual b { color: var(--ink); }
.hero-reason { font-size: 15px; color: var(--ink-2); margin-top: 10px; }

/* ---------- Chips and scale colours ---------- */
.badge { font-size: 12px; font-weight: 600; padding: 5px 9px; border-radius: 6px; white-space: nowrap; background: var(--c); color: var(--on); }
.swatch { width: 10px; height: 10px; border-radius: 2px; background: var(--c); flex: none; display: inline-block; }
.swatch.sm { width: 8px; height: 8px; }
.swatch.storm { background: repeating-linear-gradient(135deg, var(--icon) 0 2px, var(--card) 2px 4px); }
.flag-label { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; white-space: nowrap; }

.c-green { --c: var(--s-green); --on: var(--on-green); }
.c-yellow { --c: var(--s-yellow); --on: var(--on-yellow); }
.c-orange { --c: var(--s-orange); --on: var(--on-orange); }
.c-red { --c: var(--s-red); --on: var(--on-red); }
.c-violet { --c: var(--s-violet); --on: var(--on-violet); }
.c-black { --c: var(--s-black); --on: var(--on-black); }
.c-hi-caution { --c: var(--hi-caution); --on: var(--on-hi-caution); }
.c-hi-extremeCaution { --c: var(--hi-extreme-caution); --on: var(--on-hi-extreme-caution); }
.c-hi-danger { --c: var(--hi-danger); --on: var(--on-hi-danger); }
.c-hi-extremeDanger { --c: var(--hi-extreme-danger); --on: var(--on-hi-extreme-danger); }

/* ---------- UV ---------- */
.big-value { display: flex; align-items: baseline; gap: 10px; }
.big-value .n { font-size: 44px; font-weight: 300; line-height: 1; }
.big-value .l { font-size: 17px; font-weight: 600; }
.uv-scale { position: relative; display: grid; grid-template-columns: 3fr 3fr 2fr 3fr 1.5fr; gap: 2px; height: 8px; }
.uv-scale > div { background: var(--c); }
.uv-scale > div:first-child { border-radius: 4px 0 0 4px; }
.uv-scale > div:nth-child(5) { border-radius: 0 4px 4px 0; }
.uv-scale .marker { position: absolute; top: -4px; width: 4px; height: 16px; border-radius: 2px; background: var(--ink); box-shadow: 0 0 0 2px var(--card); margin-left: -2px; }

/* ---------- Vitamin D ---------- */
.vit { display: flex; flex-direction: column; gap: 10px; }
.vit-head { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); gap: 8px; }
.vit-head .link { color: var(--ink); font-weight: 500; min-height: 24px; }
.vit-bar { position: relative; height: 28px; background: var(--track); border-radius: 6px; overflow: hidden; }
.vit-bar .fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--s-yellow); }
.vit-bar .burn { position: absolute; top: 0; bottom: 0; width: 3px; background: var(--burn-mark); }
.vit-nums { display: flex; justify-content: space-between; font-size: 14px; }
.burn-text { color: var(--burn); }
.warn { font-size: 13px; padding: 10px 12px; border-radius: 8px; background: var(--warn-bg); color: var(--warn-fg); line-height: 1.4; }
.big-min { font-size: 34px; font-weight: 300; line-height: 1.05; }
.big-min small { font-size: 15px; font-weight: 500; }

/* ---------- Run outlook timeline ---------- */
.run-best { display: flex; flex-direction: column; gap: 4px; }
.run-best .when { font-size: 24px; font-weight: 500; letter-spacing: -.3px; }
.run-best .when.none { font-size: 22px; letter-spacing: 0; line-height: 1.2; }
.run-best .why { font-size: 13px; color: var(--ink-2); line-height: 1.45; }
.run-alert { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; margin-top: 2px; }
.run-note { display: flex; align-items: center; gap: 8px; margin-top: 4px; padding: 8px 10px; border-radius: 8px; font-size: 13px; line-height: 1.4; background: var(--advisory-tint); }
.run-note.watch { background: var(--watch-tint); }
.timeline { position: relative; padding-top: 20px; }
.timeline .bracket { position: absolute; top: 2px; height: 12px; border: 1.5px solid var(--ink); border-bottom: none; border-radius: 3px 3px 0 0; }
.timeline .storm-mark { position: absolute; top: 0; font-size: 10px; font-weight: 600; color: var(--ink-2); border-top: 1.5px dashed var(--ink-2); padding-top: 2px; text-align: center; overflow: hidden; white-space: nowrap; }
.bars { display: flex; gap: 2px; align-items: flex-end; height: 64px; position: relative; }
/* Blocking warnings: tint plus a solid red outline behind the bars, labelled above (6c). */
.timeline .alert-band, .alert-swatch { background: color-mix(in oklch, var(--s-red) 12%, transparent); border: 1.5px solid var(--s-red); }
.timeline .alert-band { position: absolute; top: 16px; bottom: 18px; border-radius: 5px; }
.timeline .alert-band-label { position: absolute; top: 0; z-index: 1; font-size: 10px; font-weight: 700; line-height: 14px; color: var(--alert-ink); white-space: nowrap; background: var(--card); padding-right: 4px; }
.alert-swatch { width: 12px; height: 8px; border-radius: 2px; flex: none; display: inline-block; }
.legend .legend-warning { color: var(--ink); font-weight: 600; }
.bars > div { flex: 1; border-radius: 2px; background: var(--c); }
.bars > div.storm { background: repeating-linear-gradient(135deg, var(--c) 0 3px, var(--hatch-gap) 3px 5px); }
.bar-labels { display: flex; margin-top: 6px; }
.bar-labels > div { flex: 1; font-size: 10px; color: var(--muted); white-space: nowrap; }
.legend { display: flex; flex-wrap: wrap; gap: 10px; font-size: 11px; color: var(--muted); }
.legend span { display: flex; align-items: center; gap: 4px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Sun summary ---------- */
.sun-card { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; font-size: 12px; color: var(--muted); }
.sun-card .v { font-size: 16px; color: var(--ink); font-weight: 500; margin-top: 2px; }
.day-progress { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; }
.day-progress .track { flex: 1; height: 4px; background: var(--line-2); border-radius: 2px; position: relative; }
.day-progress .track > div { position: absolute; left: 0; top: 0; bottom: 0; background: var(--ink); border-radius: 2px; }
.day-progress span { color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; }
.details { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; padding: 4px 6px; font-size: 11px; color: var(--muted); text-align: center; }
.details .v { font-size: 14px; color: var(--ink); margin-top: 2px; }
.details .v.bad { color: var(--alert-ink); font-weight: 600; }

/* ---------- Buttons and controls ---------- */
.btn { min-height: 44px; padding: 0 14px; border-radius: 10px; background: var(--track); display: inline-flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 500; }
.btn.primary { background: var(--sel-bg); color: var(--sel-fg); font-weight: 600; }
.btn.lg { min-height: 52px; padding: 0 28px; border-radius: 12px; font-size: 16px; font-weight: 600; }
.btn.block { width: 100%; }
.btn.icon-btn { gap: 8px; }
.btn.ghost { background: none; color: var(--ink-2); font-weight: 500; padding: 0 20px; }
.btn.danger { background: var(--destructive); color: #fff; font-weight: 600; }
.btn[disabled] { background: var(--line); color: var(--icon); cursor: default; }
.seg { display: flex; padding: 3px; background: var(--chip); border-radius: 10px; font-size: 13px; }
.seg.track { background: var(--track); }
.seg > button { min-height: 38px; padding: 0 14px; white-space: nowrap; display: flex; align-items: center; justify-content: center; border-radius: 8px; color: var(--ink-2); flex: 1; }
.seg > button[aria-pressed="true"] { background: var(--seg-on); color: var(--ink); font-weight: 600; box-shadow: var(--seg-shadow); }
.seg.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; }
.seg.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); }
.chips6 { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.chips6 > button { min-height: 44px; border-radius: 10px; border: 1px solid var(--line-3); background: var(--card); font-size: 15px; font-weight: 600; }
.chips6 > button[aria-pressed="true"] { background: var(--sel-bg); color: var(--sel-fg); border-color: var(--sel-bg); }
.switch { width: 51px; height: 31px; border-radius: 16px; background: var(--line-3); padding: 2px; flex: none; transition: background .2s; }
.switch > div { width: 27px; height: 27px; border-radius: 14px; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .2s; }
.switch[aria-checked="true"] { background: var(--s-green); }
.switch[aria-checked="true"] > div { transform: translateX(20px); }
.switch[disabled] { opacity: .6; cursor: default; background: var(--line-2); }
.switch[disabled] > div { background: var(--card); box-shadow: none; }

/* ---------- Hourly ---------- */
.summary { margin: 0 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-card); overflow: hidden; }
.summary-body { padding: 0 16px; }
.sum-alert { display: flex; align-items: stretch; width: 100%; min-height: 52px; text-align: left; border-bottom: 1px solid var(--line-2); }
.sum-alert.warning { background: var(--warn-row); }
.sum-alert .edge { width: 4px; flex: none; background: var(--c); }
.sum-alert-main { flex: 1; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 0 14px 0 12px; min-width: 0; }
.sum-alert-main .k { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; min-width: 0; }
.sum-alert-main .v { font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.summary-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 48px; border-bottom: 1px solid var(--line-2); }
.summary-row:last-child { border-bottom: none; }
.summary-row .k { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); white-space: nowrap; }
.summary-row .v { font-size: 15px; font-weight: 500; text-align: right; }
.summary-row .v.strong { font-weight: 600; }
.htable-head, .hrow { display: grid; grid-template-columns: 62px 20px minmax(0, 1fr) 54px 40px 28px; gap: 8px; align-items: center; padding: 0 16px; }
.htable-head { padding-top: 18px; padding-bottom: 6px; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.hrow { min-height: 44px; border-bottom: 1px solid var(--line-2); }
.hrow.best { background: var(--best-tint); }
.hrow .t { display: flex; flex-direction: column; gap: 1px; font-size: 14px; white-space: nowrap; }
.hrow .t.now { font-weight: 700; }
.hrow .tag { font-size: 9px; font-weight: 700; letter-spacing: .06em; color: var(--best-tag); }
.hrow.warned { background: var(--warn-row); }
.hrow .tag.warn-tag { color: var(--alert-ink); }
.hrow .w { display: flex; align-items: center; gap: 8px; }
.hrow .w .track { flex: 1; height: 8px; background: var(--track); border-radius: 4px; overflow: hidden; }
.hrow .w .track > div { height: 100%; background: var(--c); border-radius: 4px; }
.hrow .w .num { font-size: 14px; font-weight: 500; width: 34px; text-align: right; }
.hrow .flag { font-size: 12px; color: var(--ink-2); }
.hrow .storm { font-size: 13px; }
.hrow .storm.hi { font-weight: 700; }
.uv-chip { width: 26px; height: 22px; border-radius: 5px; background: var(--c); color: var(--on); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; }
.uv-chip.zero { background: transparent; color: var(--muted); }
.day-divider { padding: 16px 16px 6px; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; border-bottom: 1px solid var(--line); }

/* ---------- Sun & UV ---------- */
.chart { display: block; width: 100%; height: auto; overflow: visible; }
.chart .axis { stroke: var(--line-3); }
.chart .sun { stroke: var(--ink); fill: none; stroke-width: 1.5; }
.chart .uvl { stroke: var(--uv-line); fill: none; stroke-width: 1.5; }
.chart .uva { fill: var(--uv-area); }
.chart .noon { stroke: var(--faint); stroke-dasharray: 2 3; }
.chart .now { stroke: var(--ink); stroke-width: 1.5; }
.chart .dot { fill: var(--card); stroke: var(--ink); stroke-width: 2; }
.chart text { fill: var(--muted); font-size: 10px; font-family: var(--font); }
.chart-legend { display: flex; gap: 14px; font-size: 11px; color: var(--muted); flex-wrap: wrap; }
.chart-legend span { display: flex; align-items: center; gap: 5px; }
.countdown-box { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; background: var(--bg); border-radius: 10px; padding: 10px 12px; }
.countdown-box .big { font-size: 20px; font-weight: 500; font-variant-numeric: tabular-nums; }
.win-bar { position: relative; height: 36px; background: var(--track); border-radius: 8px; overflow: hidden; }
.win-bar .top, .win-bar .bottom { position: absolute; height: 18px; }
.win-bar .top { top: 0; background: var(--s-orange); }
.win-bar .bottom { bottom: 0; background: var(--s-yellow); }
.win-bar .nowline { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--ink); }
.axis-labels { display: flex; justify-content: space-between; font-size: 10px; color: var(--muted); margin-top: -6px; }
.win-rows { display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.win-rows > div { display: flex; justify-content: space-between; gap: 10px; }
.win-rows .k { display: flex; align-items: center; gap: 8px; color: var(--ink-2); }
.win-rows b { white-space: nowrap; }

/* ---------- Settings ---------- */
.group-label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding: 12px 8px 4px; }
.group { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-row); padding: 0 16px; }
.group.pad { padding: 8px; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 50px; font-size: 15px; border-bottom: 1px solid var(--line-2); width: 100%; text-align: left; }
.row:last-child { border-bottom: none; }
.place-row { gap: 0; }
.place-row .pick { flex: 1; display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 50px; text-align: left; }
.place-row .star { width: 44px; height: 44px; margin-right: -12px; display: flex; align-items: center; justify-content: center; color: var(--icon); flex: none; }
.place-row .star[aria-pressed="true"] { color: var(--ink); }
.place-row .star[aria-pressed="true"] svg { fill: currentColor; }
.row .val { color: var(--muted); display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.settings-list { display: flex; flex-direction: column; gap: 6px; padding: 0 12px; }
.footer { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 20px 0 0; }
.footer .reset { min-height: 44px; font-size: 15px; font-weight: 500; color: var(--destructive-text); }

/* ---------- Tab bar ---------- */
.tabbar { position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; width: 100%; max-width: 480px; z-index: 10; background: var(--tabbar); border-top: 1px solid var(--line); padding: 8px 8px calc(env(safe-area-inset-bottom) + 10px); display: grid; grid-template-columns: repeat(4, 1fr); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.tab { display: flex; flex-direction: column; align-items: center; gap: 3px; min-height: 44px; font-size: 11px; color: var(--muted); }
.tab[aria-current="page"] { color: var(--ink); font-weight: 600; }

/* ---------- States ---------- */
.banner { margin: 14px 12px 0; padding: 10px 10px 10px 14px; border-radius: 12px; background: #12161d; color: #fff; display: flex; align-items: center; gap: 12px; }
:root[data-theme="dark"] .banner { background: #2c323d; }
.banner .txt { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.banner .txt b { font-size: 14px; }
.banner .txt span { font-size: 12px; color: #c3c8d1; }
.banner .btn { background: rgba(255, 255, 255, .14); color: #fff; font-weight: 600; }
.banner .btn.close { background: transparent; padding: 0 10px; font-weight: 500; color: #c3c8d1; }

/* ---------- NWS alerts (6a–6e): warning red, watch orange, advisory yellow, statement neutral ---------- */
.c-none { --c: var(--line-3); --on: var(--ink); }
.icon { display: block; flex: none; }
.lvl { align-self: flex-start; font-size: 10px; font-weight: 700; letter-spacing: .08em; padding: 3px 6px; border-radius: 4px; white-space: nowrap; background: var(--c); color: var(--on); }
.lvl.c-none { background: var(--chip); }
.alerts { display: flex; flex-direction: column; gap: 8px; margin: 14px 12px 0; }
.alerts.flush { margin: 0; }
.alert { display: flex; align-items: stretch; min-height: 68px; width: 100%; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-row); overflow: hidden; }
.alert.warning { background: var(--warn-row); }
.alert .edge { width: 5px; flex: none; background: var(--c); }
.alert-main { flex: 1; display: flex; align-items: center; gap: 12px; padding: 10px 12px; min-width: 0; }
.alert .txt { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.alert .txt b { font-size: 15px; font-weight: 600; line-height: 1.2; }
.alert .txt > span:last-child { font-size: 13px; color: var(--ink-2); }
.alert .chev { font-size: 22px; color: var(--muted); line-height: 1; }
.alerts-more { display: flex; align-items: center; justify-content: space-between; min-height: 44px; padding: 0 14px; border-radius: var(--radius-control); background: var(--chip); font-size: 14px; width: 100%; }
.alerts-more > span:first-child { display: flex; align-items: center; gap: 8px; }
.alerts-more b { font-weight: 500; }
.alerts-more .lvl, .run-note .lvl { align-self: center; }
.alerts-note { margin: 14px 12px 0; display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: var(--radius-control); border: 1px dashed var(--faint); font-size: 13px; line-height: 1.45; color: var(--ink-2); }
.alerts-note .icon { color: var(--muted); margin-top: 1px; }
/* Detail sheet (6b): facts box, NWS text, "What to do" in the warn tint, Close pinned. */
.alert-head { display: flex; align-items: center; gap: 8px; }
.alert-head.warning .icon { color: var(--alert-ink); }
.sheet h2.alert-h { font-size: 24px; letter-spacing: -.3px; line-height: 1.15; margin-top: -6px; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14px; padding: 12px 14px; background: var(--bg); border-radius: var(--radius-control); }
.facts > span:nth-child(2) { font-weight: 500; }
.alert-body { display: flex; flex-direction: column; gap: 10px; }
.sheet .alert-body p { font-size: 15px; line-height: 1.5; }
.todo { border-radius: var(--radius-control); background: var(--warn-bg); color: var(--warn-fg); padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.todo-h { font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.sheet .todo p { font-size: 15px; line-height: 1.5; color: inherit; }
.sheet.has-foot { padding: 10px 0 0; gap: 0; overflow: hidden; }
.sheet-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 20px 16px; display: flex; flex-direction: column; gap: 14px; }
.sheet-foot { flex: none; padding: 12px 20px calc(env(safe-area-inset-bottom) + 34px); border-top: 1px solid var(--line-2); }
.btn.close-btn { background: var(--track); font-weight: 500; }
.sk { background: var(--skeleton); border-radius: 6px; }
.card .sk { background: var(--skeleton-2); }
.empty { margin: auto 24px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding-top: 18vh; }
.empty .dash { font-size: 64px; font-weight: 200; color: var(--faint); letter-spacing: -3px; line-height: 1; }
.empty h2 { font-size: 19px; font-weight: 600; margin: 0; }
.empty p { font-size: 14px; color: var(--ink-2); line-height: 1.45; max-width: 290px; margin: 0; }
.empty .code { font-size: 11px; color: var(--muted); font-family: var(--mono); }

/* ---------- Onboarding ---------- */
.ob { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; padding-top: calc(env(safe-area-inset-top) + 12px); }
.ob-progress { display: flex; gap: 6px; padding: 12px 24px 0; }
.ob-progress > div { flex: 1; height: 4px; border-radius: 2px; background: var(--line-3); }
.ob-progress > div.on { background: var(--ink); }
.ob-head { padding: 28px 24px 0; display: flex; flex-direction: column; gap: 8px; }
.ob-head .step { font-size: 13px; color: var(--muted); font-weight: 500; }
.ob-head h1 { font-size: 30px; font-weight: 600; letter-spacing: -.5px; line-height: 1.1; margin: 0; }
.ob-head p { font-size: 15px; color: var(--ink-2); line-height: 1.4; margin: 0; }
.ob-body { padding: 24px 24px 0; display: flex; flex-direction: column; gap: 14px; }
.ob-foot { margin-top: auto; padding: 24px 24px calc(env(safe-area-inset-bottom) + 40px); display: flex; justify-content: space-between; }
.ob-foot.end { justify-content: flex-end; }
.or { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--muted); }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.radio-list { display: flex; flex-direction: column; gap: 8px; }
.radio { display: flex; align-items: center; gap: 14px; min-height: 56px; padding: 0 16px; border-radius: 12px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line-3); text-align: left; width: 100%; }
.radio[aria-checked="true"] { box-shadow: inset 0 0 0 2px var(--ink); }
.radio .dot { width: 22px; height: 22px; border-radius: 11px; border: 2px solid var(--faint); flex: none; }
.radio[aria-checked="true"] .dot { border: 6px solid var(--ink); }
.radio .lbl { display: flex; flex-direction: column; gap: 1px; }
.radio .lbl b { font-size: 15px; }
.radio .lbl span { font-size: 13px; color: var(--muted); }
.unit-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.unit-card { border-radius: 16px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line-3); padding: 20px 16px; display: flex; flex-direction: column; gap: 6px; min-height: 150px; text-align: left; }
.unit-card[aria-checked="true"] { box-shadow: inset 0 0 0 2px var(--ink); }
.unit-card .u { font-size: 13px; font-weight: 600; }
.unit-card .n { font-size: 52px; font-weight: 200; line-height: 1; letter-spacing: -2px; }
.unit-card .s { font-size: 13px; color: var(--muted); }

/* ---------- Search ---------- */
.search { background: var(--card); border: 1px solid var(--line-3); border-radius: 12px; overflow: hidden; }
.search:focus-within { border: 2px solid var(--ink); }
.search-field { display: flex; align-items: center; gap: 10px; min-height: 50px; padding: 0 14px; }
.search-field input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 16px; }
.search-field .clear { font-size: 13px; color: var(--muted); min-height: 44px; }
.result { display: flex; flex-direction: column; justify-content: center; min-height: 56px; padding: 0 14px; border-top: 1px solid var(--line-2); width: 100%; text-align: left; }
.result:hover, .result.active { background: var(--track); }
.result .n { font-size: 15px; }
.result .d { font-size: 12px; color: var(--muted); }
.result.selected { background: var(--track); box-shadow: inset 3px 0 0 var(--ink); }

/* ---------- Sheets ---------- */
.scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 20; animation: fade .15s ease-out; }
.sheet { position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; width: 100%; max-width: 480px; z-index: 21; background: var(--card); border-radius: 22px 22px 0 0; padding: 10px 20px calc(env(safe-area-inset-bottom) + 34px); display: flex; flex-direction: column; gap: 14px; box-shadow: 0 -8px 30px rgba(0, 0, 0, .18); max-height: 92vh; overflow-y: auto; animation: rise .2s ease-out; }
.sheet .grab { width: 36px; height: 5px; border-radius: 3px; background: var(--line-3); margin: 0 auto 4px; flex: none; }
.sheet h2 { font-size: 20px; font-weight: 600; margin: 0; }
.sheet p { font-size: 15px; color: var(--ink-2); line-height: 1.45; margin: 0; }
.sheet.full { top: 0; border-radius: 0; background: var(--bg); padding: calc(env(safe-area-inset-top) + 12px) 0 calc(env(safe-area-inset-bottom) + 24px); gap: 0; max-height: none; box-shadow: none; animation: none; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 12px 0 20px; }
.sheet-head h2 { font-size: 22px; }
.sheet-head button { min-height: 44px; padding: 0 10px; font-size: 15px; font-weight: 500; }
.sheet .pad-x { padding: 0 16px; }
.alert-card { margin: 16px 16px 0; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.alert-card .title { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 600; }
.alert-card .bang { width: 28px; height: 28px; border-radius: 14px; background: var(--alert-badge-bg); color: var(--alert-badge-fg); display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 700; }
.alert-card p { font-size: 14px; color: var(--ink-2); line-height: 1.45; margin: 0; }
.no-results { padding: 40px 32px 0; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.no-results b { font-size: 17px; }
.no-results span { font-size: 14px; color: var(--muted); line-height: 1.45; }
.time-input { min-height: 52px; border-radius: 12px; border: 1px solid var(--line-3); background: var(--bg); padding: 0 14px; font-size: 20px; }

@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translate(-50%, 24px); opacity: .6; } }
@media (prefers-reduced-motion: reduce) { .scrim, .sheet { animation: none; } }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.stale { color: var(--stale); font-weight: 600; }
