/* Upwind — an instrument, not a dashboard.
   Cool paper ground, slate-blue interaction, severity ramp drawn from smoke
   over sky rather than traffic lights. */

:root {
  --paper: #F2F4F1;
  --surface: #FFFFFF;
  --sunken: #E9ECE7;
  --ink: #16191A;
  --muted: #6E7671;
  --faint: #9AA199;
  --line: #E2E5E0;
  --accent: #2F5D74;
  --accent-soft: #E4EDF1;

  --clear: #3D7A5E;
  --moderate: #B8862B;
  --heavy: #A85433;
  --severe: #7C2F2C;
  --clear-bg: #E7F0EA;
  --moderate-bg: #F7EEDC;
  --heavy-bg: #F6E7DF;
  --severe-bg: #F2E1DF;

  --radius: 14px;
  --tab-h: 68px;
  --dock-inset: 12px;
  --e-out: cubic-bezier(.22, 1, .36, 1);
  --e-soft: cubic-bezier(.4, 0, .2, 1);
  --sans: "IBM Plex Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0;
  background:
    radial-gradient(120% 80% at 50% -10%, #E8EEF0 0%, transparent 55%),
    radial-gradient(90% 60% at 100% 100%, #E4EBE6 0%, transparent 45%),
    var(--sunken);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  overscroll-behavior-y: none;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(255,255,255,.55) 0%, rgba(242,244,241,.92) 28%, var(--paper) 100%);
  padding-bottom: calc(var(--tab-h) + var(--dock-inset) + env(safe-area-inset-bottom) + 8px);
  position: relative;
  box-shadow: 0 0 0 1px rgba(22, 25, 26, .04);
}

/* --- Header ------------------------------------------------------------- */
header {
  padding: 16px 18px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(242, 244, 241, .82);
  backdrop-filter: blur(14px) saturate(1.1);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  border-bottom: 1px solid transparent;
  transition: border-color .2s var(--e-soft), box-shadow .2s var(--e-soft);
}
header.scrolled {
  border-bottom-color: var(--line);
  box-shadow: 0 8px 20px rgba(22, 25, 26, .04);
}
.wordmark {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: none;
  font-weight: 700;
  line-height: 1.3;
}
.wordmark small {
  display: block;
  font-family: "Noto Serif Devanagari", Georgia, serif;
  font-weight: 400;
  font-size: 12px;
  letter-spacing: 0;
  color: var(--muted);
  margin-top: 2px;
}
.place {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.04em;
  background: none; border: none; padding: 6px 0; cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px;
  text-decoration-color: var(--line);
  transition: color .18s var(--e-soft), text-decoration-color .18s var(--e-soft);
}
.place:hover { color: var(--accent); text-decoration-color: var(--accent); }

/* --- Layout ------------------------------------------------------------- */
.screen { display: none; padding: 8px 16px 28px; }
.screen.on { display: block; animation: rise .28s var(--e-out); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  transition: transform .28s var(--e-out), box-shadow .28s var(--e-soft), border-color .2s var(--e-soft);
  box-shadow: 0 1px 0 rgba(255,255,255,.7) inset;
}
.card:hover {
  border-color: #D5DAD4;
  box-shadow: 0 10px 28px rgba(22, 25, 26, .05), 0 1px 0 rgba(255,255,255,.8) inset;
}
.card.flush { padding: 0; overflow: hidden; }

.eyebrow {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 0 0 8px;
}
h2 { font-size: 19px; font-weight: 600; margin: 0 0 6px; letter-spacing: -0.01em; }
h3 { font-size: 15px; font-weight: 600; margin: 0 0 6px; }
p { margin: 0 0 8px; }
.sub { color: var(--muted); font-size: 14px; }
.tiny { font-size: 12px; color: var(--faint); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* --- Verdict ------------------------------------------------------------ */
.verdict { border-left: 4px solid var(--muted); border-radius: var(--radius); }
.verdict.clear { border-left-color: var(--clear); background: var(--clear-bg); }
.verdict.watch { border-left-color: var(--moderate); background: var(--moderate-bg); }
.verdict.passes { border-left-color: var(--moderate); background: var(--moderate-bg); }
.verdict.rain_clears { border-left-color: var(--accent); background: var(--accent-soft); }
.verdict.lingers { border-left-color: var(--heavy); background: var(--heavy-bg); }
.verdict.settles { border-left-color: var(--severe); background: var(--severe-bg); }
.verdict.unhealthy { border-left-color: var(--severe); background: var(--severe-bg); }
.verdict h2 { font-size: 22px; line-height: 1.25; margin-bottom: 14px; }
.arrival {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  margin-top: 12px;
  color: var(--muted);
}

.verdict-gauges {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 2px;
}
.vgauge {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-width: 0;
}
.vgauge-ring {
  position: relative;
  width: 96px;
  height: 96px;
  margin-bottom: 8px;
}
.vgauge-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  display: block;
}
.vgauge-track {
  fill: none;
  stroke: rgba(22, 25, 26, .08);
  stroke-width: 7;
}
.vgauge-fill {
  fill: none;
  stroke: var(--muted);
  stroke-width: 7;
  stroke-linecap: round;
  stroke-dasharray: 251.3;
  stroke-dashoffset: 251.3;
  transition: stroke-dashoffset .7s var(--e-out), stroke .35s var(--e-soft);
}
.verdict.clear .vgauge-fill { stroke: var(--clear); }
.verdict.watch .vgauge-fill,
.verdict.passes .vgauge-fill { stroke: var(--moderate); }
.verdict.rain_clears .vgauge-fill { stroke: var(--accent); }
.verdict.lingers .vgauge-fill { stroke: var(--heavy); }
.verdict.settles .vgauge-fill,
.verdict.unhealthy .vgauge-fill { stroke: var(--severe); }
.vgauge-core {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-top: 2px;
}
.vgauge-val {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--ink);
}
.vgauge-unit {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-top: 3px;
}
.vgauge-label {
  font-size: 12.5px;
  font-weight: 600;
  margin: 0 0 2px;
  color: var(--ink);
}
.vgauge-meta {
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin: 0;
}

/* --- Ventilation lid: the signature ------------------------------------- */
.lid { width: 100%; height: 132px; display: block; }
.lid-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 4px;
}
.lid-head .eyebrow { margin: 0; }
.lid-badge {
  font-family: var(--mono); font-size: 10px; letter-spacing: .1em;
  text-transform: uppercase; font-weight: 500;
  padding: 3px 8px; border-radius: 4px; flex: none;
}
.lid-legend {
  display: flex; justify-content: space-between;
  font-family: var(--mono); font-size: 11px; color: var(--muted);
  margin-top: 6px;
}
.lid-card.pools {
  border-left: 4px solid var(--severe);
  background: var(--severe-bg);
}
.lid-card.pools .lid-badge {
  background: var(--severe); color: #fff;
}
.lid-card.pools .lid-legend,
.lid-card.pools #lidNote { color: var(--severe); }
.lid-card.lingers {
  border-left: 4px solid var(--heavy);
  background: var(--heavy-bg);
}
.lid-card.lingers .lid-badge {
  background: var(--heavy); color: #fff;
}
.lid-card.lingers .lid-legend,
.lid-card.lingers #lidNote { color: var(--heavy); }
.lid-card.clears {
  border-left: 4px solid var(--clear);
  background: var(--clear-bg);
}
.lid-card.clears .lid-badge {
  background: var(--clear); color: #fff;
}
.lid-card.clears .lid-legend,
.lid-card.clears #lidNote { color: var(--clear); }

/* --- Timeline strip ----------------------------------------------------- */
.strip-wrap { position: relative; padding-top: 4px; }
.strip {
  display: flex; gap: 2px; height: 30px; margin: 10px 0 4px;
  cursor: crosshair; align-items: stretch;
}
.strip i {
  flex: 1; border-radius: 2px; background: var(--sunken);
  transform-origin: bottom; will-change: transform, opacity;
}
.strip i.s0 { background: #CBDCCE; }
.strip i.s1 { background: #E8D6A8; }
.strip i.s2 { background: #E2B192; }
.strip i.s3 { background: #C08079; }
.strip i.s4 { background: #8E4340; }
.axis { display: flex; justify-content: space-between; font-family: var(--mono);
        font-size: 10.5px; color: var(--faint); }
.tip {
  position: absolute; top: -36px; left: 0; opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--paper); border-radius: 6px;
  padding: 5px 8px; font-family: var(--mono); font-size: 10px;
  white-space: nowrap; z-index: 6;
}
.tip::after {
  content: ""; position: absolute; bottom: -4px; left: 10px;
  width: 8px; height: 8px; background: var(--ink); transform: rotate(45deg);
  border-radius: 1px;
}
.cw {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: var(--clear-bg); border: 1px solid #C5D9CC; border-radius: var(--radius);
  padding: 12px; cursor: pointer; text-align: left; margin-top: 8px;
  position: relative; overflow: hidden; font: inherit; color: inherit;
}
.cw .band {
  position: absolute; inset: 0; transform: scaleX(0); transform-origin: left;
  opacity: .35; background: #CBDCCE;
}
.cw .dot { position: relative; width: 8px; height: 8px; border-radius: 50%;
           background: var(--clear); flex: none; }
.cw .txt {
  position: relative; flex: 1; font-size: 14.5px; font-weight: 500; color: var(--clear);
}
.cw .act {
  position: relative; font-family: var(--mono); font-size: 10px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--clear);
  opacity: 0; transform: translateX(-6px);
}
.lid-badge.pulse { animation: bp 2.6s ease infinite; }
@keyframes bp {
  0%, 100% { box-shadow: 0 0 0 0 rgba(124, 47, 44, .35); }
  60% { box-shadow: 0 0 0 7px rgba(124, 47, 44, 0); }
}
.replaybar {
  display: none; align-items: center; gap: 8px; margin-bottom: 4px;
  font-family: var(--mono); font-size: 11px; letter-spacing: .04em; color: var(--accent);
  padding: 8px 10px; border-radius: var(--radius);
  border: 1px solid #CFE0E7; background: var(--accent-soft);
}
.replaybar.on { display: flex; }

/* --- Numbers ------------------------------------------------------------ */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { background: var(--sunken); border-radius: 8px; padding: 10px 12px; }
.stat b {
  display: block; font-size: 24px; font-weight: 600;
  font-variant-numeric: tabular-nums; letter-spacing: -0.02em; line-height: 1.15;
}
.stat span { font-family: var(--mono); font-size: 10px; letter-spacing: .1em;
             text-transform: uppercase; color: var(--muted); }
.stat.good b { color: var(--clear); }

/* --- Lists -------------------------------------------------------------- */
.rows { display: flex; flex-direction: column; }
.row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line);
}
.row:last-child { border-bottom: none; }
.row .lead { display: flex; align-items: center; gap: 10px; min-width: 0; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dot.clear { background: var(--clear); }
.dot.watch { background: var(--moderate); }
.dot.unhealthy { background: var(--severe); }
.dot.passes { background: var(--moderate); }
.dot.rain_clears { background: var(--accent); }
.dot.lingers { background: var(--heavy); }
.dot.settles { background: var(--severe); }
.row .name { font-size: 14.5px; overflow: hidden; text-overflow: ellipsis;
             white-space: nowrap; }
.row .meta { font-family: var(--mono); font-size: 11.5px; color: var(--muted);
             text-align: right; flex: none; }

.advice-block { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.advice-block:first-of-type { margin-top: 0; padding-top: 0; border-top: none; }
.advice-block h3 {
  font-family: var(--mono); font-size: 11px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted); font-weight: 500; margin: 0 0 8px;
}
ul.advice { margin: 0; padding-left: 18px; }
ul.advice li { margin-bottom: 6px; font-size: 14.5px; }
ul.advice li:last-child { margin-bottom: 0; }

/* --- Controls ----------------------------------------------------------- */
button, select, input {
  font-family: inherit; font-size: 15px; color: var(--ink);
}
.btn {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 12px 16px; border-radius: 12px;
  border: 1px solid var(--ink); background: var(--ink); color: var(--paper);
  font-weight: 500; cursor: pointer;
  transition: transform .16s var(--e-out), box-shadow .2s var(--e-soft);
}
.btn:hover { box-shadow: 0 8px 18px rgba(22, 25, 26, .12); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn:active { transform: scale(0.99); }
.btn[disabled] { opacity: .5; }
.btn .bl { position: relative; z-index: 2; display: inline-flex; align-items: center; gap: 8px; }
.btn .rip {
  position: absolute; border-radius: 50%;
  background: rgba(242, 244, 241, .28); transform: scale(0);
  pointer-events: none; z-index: 1;
}
.btn.ghost .rip { background: rgba(22, 25, 26, .1); }
.btn.done { background: var(--clear); border-color: var(--clear); color: #fff; }
.btn .spin {
  width: 13px; height: 13px;
  border: 2px solid rgba(242, 244, 241, .3); border-top-color: var(--paper);
  border-radius: 50%; display: none;
}
.btn.busy .spin { display: block; animation: sp .7s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }
.header-right { display: flex; align-items: center; gap: 8px; min-width: 0; }
.day-chip {
  font-size: 11px; letter-spacing: .04em; color: var(--accent);
  border: 1px solid #CFE0E7; background: var(--accent-soft);
  padding: 6px 10px; white-space: nowrap; max-width: 42vw; overflow: hidden;
  text-overflow: ellipsis; cursor: pointer; font-family: inherit;
  border-radius: 999px;
  transition: transform .18s var(--e-out), border-color .18s var(--e-soft), background .18s var(--e-soft);
}
.day-chip:hover { border-color: var(--accent); transform: translateY(-1px); }
.day-chip:active { transform: scale(.97); }
.day-panel-top {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
}
.day-panel-top h3 { margin: 2px 0 0; font-size: 18px; font-weight: 600; }
.day-panel-toggle { width: auto; padding: 8px 12px; flex: none; }
.day-panel-body { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.day-picks {
  display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 4px;
}
.day-pick {
  font-family: var(--mono); font-size: 11px; letter-spacing: .02em;
  padding: 8px 10px; border: 1px solid var(--line); background: var(--paper);
  color: var(--ink); cursor: pointer; border-radius: var(--radius);
}
.day-pick[aria-pressed="true"] {
  border-color: var(--accent); background: var(--accent-soft); color: var(--accent);
}
.day-pick small { display: block; color: var(--muted); margin-top: 2px; font-size: 10px; }
.day-actions { display: flex; gap: 8px; margin-top: 12px; }
.day-actions .btn { flex: 1; }
.suggest-wrap { position: relative; margin-bottom: 4px; }
.suggest {
  position: absolute; left: 0; right: 0; top: calc(100% - 2px); z-index: 20;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 0 0 var(--radius) var(--radius); max-height: 220px;
  overflow: auto; box-shadow: none;
}
.suggest .row {
  cursor: pointer; padding: 10px 12px; border-bottom: 1px solid var(--line);
}
.suggest .row:last-child { border-bottom: none; }
.suggest .row:hover, .suggest .row:focus {
  background: var(--accent-soft); outline: none;
}
.route-map {
  height: 260px; width: 100%; border: 1px solid var(--line);
  border-radius: var(--radius); margin: 10px 0 12px; z-index: 1;
}
.route.best { border: 1px solid #CFE0E7; background: var(--accent-soft);
  border-radius: var(--radius); padding: 10px 12px; margin-bottom: 8px; }
.route.alt { border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px 12px; margin-bottom: 8px; opacity: .92; }
.route .why { font-size: 13px; color: var(--muted); margin: 6px 0 0; }
.steps { list-style: none; padding: 0; margin: 8px 0 0; }
.steps li {
  display: grid; grid-template-columns: 28px 1fr auto; gap: 8px;
  align-items: start; padding: 8px 0; border-bottom: 1px solid var(--line);
  font-size: 13.5px;
}
.steps li:last-child { border-bottom: none; }
.steps .n {
  font-family: var(--mono); font-size: 11px; color: var(--accent);
  padding-top: 2px;
}
.steps .meta { font-family: var(--mono); font-size: 11px; color: var(--faint);
  white-space: nowrap; }
.nav-links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.nav-links a {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .04em;
  color: var(--accent); border: 1px solid #CFE0E7; background: var(--accent-soft);
  padding: 8px 10px; text-decoration: none; border-radius: var(--radius);
}
.reason-list { margin: 8px 0 0; padding-left: 18px; }
.reason-list li { margin-bottom: 6px; font-size: 13.5px; color: var(--ink); }
.field {
  width: 100%; padding: 11px 12px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--surface); margin-bottom: 10px;
  transition: border-color .18s var(--e-soft), box-shadow .18s var(--e-soft);
}
.field:focus {
  outline: none; border-color: #A8C0CC;
  box-shadow: 0 0 0 3px rgba(47, 93, 116, .12);
}
label.lbl { display: block; font-family: var(--mono); font-size: 10.5px;
            letter-spacing: .14em; text-transform: uppercase; color: var(--faint);
            margin: 0 0 6px; }
.seg { position: relative; display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.seg .ind {
  position: absolute; top: 0; left: 0; height: 40px;
  background: var(--ink); border-radius: 7px; z-index: 0; pointer-events: none;
}
.seg button {
  position: relative; z-index: 1;
  flex: 1 1 auto; padding: 9px 10px; border-radius: 7px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); font-size: 13.5px;
  transition: color .18s ease, border-color .18s ease, background .18s ease;
}
.seg button[aria-pressed="true"] {
  color: var(--paper); border-color: transparent; background: transparent;
}
.slider { width: 100%; margin: 6px 0 2px; accent-color: var(--accent); }

/* --- Map ---------------------------------------------------------------- */
#map { height: 58vh; min-height: 320px; border-radius: calc(var(--radius) + 2px);
       border: 1px solid var(--line); overflow: hidden; }
.leaflet-container { background: #DDE3DC; font-family: var(--sans); }
.mapbar { display: flex; align-items: center; gap: 10px; margin: 10px 0 2px; }
.mapbar .btn { width: auto; padding: 8px 12px; }

/* --- Gap chart ---------------------------------------------------------- */
.bars { display: flex; align-items: flex-end; gap: 3px; height: 116px; }
.bars i.stack { flex: 1; position: relative; height: 100%;
                display: flex; align-items: flex-end; gap: 1px; }
.bars u, .bars s { flex: 1; display: block; min-height: 2px; text-decoration: none;
                   border-radius: 2px 2px 0 0; }
.bars u { background: var(--severe); }          /* when burning happens */
.bars s { background: var(--accent); opacity: .5; }  /* when the satellite sees */
.legend { display: flex; gap: 14px; font-family: var(--mono); font-size: 10.5px;
          color: var(--muted); margin-top: 8px; }
.legend b { display: inline-block; width: 9px; height: 9px; border-radius: 2px;
            margin-right: 5px; vertical-align: -1px; }

/* --- Route results ------------------------------------------------------ */
.route { border: 1px solid var(--line); border-radius: 8px; padding: 12px;
         margin-bottom: 8px; background: var(--surface); }
.route.best { border-color: var(--ink); border-width: 2px; }
.badge { display: inline-block; font-family: var(--mono); font-size: 10px;
         letter-spacing: .12em; text-transform: uppercase; padding: 3px 7px;
         border-radius: 4px; background: var(--accent-soft); color: var(--accent); }

/* --- Tabs: floating dock ------------------------------------------------ */
nav.tabs {
  position: fixed;
  bottom: calc(var(--dock-inset) + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  width: min(calc(100% - 24px), 456px);
  height: var(--tab-h);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  gap: 2px;
  padding: 6px;
  z-index: 900;
  background: rgba(255, 255, 255, .88);
  border: 1px solid rgba(226, 229, 224, .95);
  border-radius: 24px;
  box-shadow:
    0 14px 36px rgba(22, 25, 26, .12),
    0 2px 8px rgba(22, 25, 26, .06),
    inset 0 1px 0 rgba(255, 255, 255, .9);
  backdrop-filter: blur(18px) saturate(1.15);
  -webkit-backdrop-filter: blur(18px) saturate(1.15);
}
nav.tabs .tind {
  position: absolute;
  top: 0; left: 0;
  width: 64px; height: 56px;
  background: linear-gradient(180deg, #EEF3F5 0%, #E4EDF1 100%);
  border: 1px solid #D5E3EA;
  border-radius: 18px;
  z-index: 0;
  will-change: transform, width, height;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
  pointer-events: none;
}
nav.tabs button {
  position: relative; z-index: 1;
  border: none; background: none; cursor: pointer; color: var(--faint);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; font-family: var(--mono); font-size: 9px; letter-spacing: .1em;
  text-transform: uppercase; padding: 6px 2px; min-height: 56px;
  border-radius: 18px;
  transition: color .22s var(--e-soft);
}
nav.tabs button .ic {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 10px;
  transition: transform .22s var(--e-out), background .22s var(--e-soft);
}
nav.tabs button svg {
  width: 20px; height: 20px; stroke: currentColor;
  stroke-width: 1.7; fill: none;
}
nav.tabs button[aria-current="true"],
nav.tabs button[aria-current="page"] { color: var(--accent); }
nav.tabs button[aria-current="true"] .ic,
nav.tabs button[aria-current="page"] .ic {
  background: rgba(47, 93, 116, .08);
}
nav.tabs button:active .ic { transform: scale(.92); }

/* --- Toast / motion helpers --------------------------------------------- */
.toastzone {
  position: fixed; left: 0; right: 0;
  bottom: calc(var(--tab-h) + var(--dock-inset) + env(safe-area-inset-bottom) + 14px);
  display: flex; justify-content: center; pointer-events: none; z-index: 1000;
}
.toast {
  background: var(--ink); color: var(--paper); padding: 11px 16px;
  border-radius: 999px; font-family: var(--mono); font-size: 12px;
  display: flex; gap: 8px; opacity: 0; transform: translateY(16px);
  box-shadow: 0 10px 28px rgba(22, 25, 26, .2);
}

/* --- Sheet -------------------------------------------------------------- */
.sheet-bg { position: fixed; inset: 0; background: rgba(20,24,22,.45);
            z-index: 1000; display: flex; align-items: flex-end;
            justify-content: center; }
.sheet { width: 100%; max-width: 480px; background: var(--paper);
         border-radius: 16px 16px 0 0; padding: 18px 18px 26px;
         max-height: 86vh; overflow-y: auto; animation: up .2s ease-out; }
@keyframes up { from { transform: translateY(14px); opacity: .6; } }

.skeleton { height: 14px; border-radius: 4px; background: var(--sunken);
            margin-bottom: 8px; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .5; } }

.empty { text-align: center; padding: 28px 12px; color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
