/* ==========================================================================
   Theme tokens: light by default, dark when the system asks for it.
   ========================================================================== */
:root {
  color-scheme: light dark;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, Segoe UI, Roboto, sans-serif;
  /* 4pt spacing scale and one radius family (continuous corners) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --radius-lg: 26px;
  --radius: 20px;
  --radius-sm: 14px;
  --radius-xs: 10px;
  --ease-apple: cubic-bezier(0.32, 0.72, 0, 1);
  /* spring-ish curve (slight overshoot) where linear() is supported */
  --spring: cubic-bezier(0.32, 0.72, 0, 1);
  --topbar-h: 64px;
  --nav-w: 112px;

  --ink: #0c1a2c;
  --ink-2: rgba(12, 26, 44, 0.74);
  --ink-3: rgba(12, 26, 44, 0.55);
  --text-shadow: 0 1px 1px rgba(255, 255, 255, 0.45);
  --accent: #0a6fd6;
  --accent-ink: #ffffff;
  --open: #12a258;
  --closed: #d63a3a;
  --unknown: #66758a;
  --warn: #b26a00;

  --glass: rgba(255, 255, 255, 0.52);
  --glass-strong: rgba(255, 255, 255, 0.82);
  --glass-hover: rgba(255, 255, 255, 0.68);
  --glass-border: rgba(255, 255, 255, 0.65);
  --glass-edge: rgba(15, 30, 60, 0.08);
  --line: rgba(15, 30, 60, 0.12);
  --input: rgba(255, 255, 255, 0.6);
  --active: rgba(255, 255, 255, 0.9);
  --shadow: 0 10px 30px rgba(20, 40, 80, 0.12);
  --scrim: rgba(255, 255, 255, 0.22);
  --hero-tint: rgba(255, 255, 255, 0.25);
  --alert-bg: rgba(255, 221, 166, 0.82);
  --alert-border: rgba(178, 106, 0, 0.35);
  --alert-ink: #4d2e00;
  --tooltip: rgba(255, 255, 255, 0.96);
  --chart-line: #0a6fd6;
  --chart-bar: #3d8ee6;
  --chart-cross: rgba(12, 26, 44, 0.45);
  --blur: blur(22px) saturate(160%);

  /* weather icon colours */
  --ic-sun: #f5b100;
  --ic-moon: #8a99ba;
  --ic-cloud: #b6c3d4;
  --ic-cloud-dark: #7f8ea4;
  --ic-rain: #2b86f0;
  --ic-snow: #7aa3d8;
  --ic-bolt: #f0b400;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f5f8fc;
    --ink-2: rgba(240, 245, 252, 0.78);
    --ink-3: rgba(232, 240, 250, 0.58);
    --text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
    --accent: #6cb6ff;
    --accent-ink: #04101f;
    --open: #3ddc8a;
    --closed: #ff6b6b;
    --unknown: #9aa7ba;
    --warn: #ffbd5c;

    --glass: rgba(16, 24, 40, 0.42);
    --glass-strong: rgba(14, 20, 34, 0.78);
    --glass-hover: rgba(30, 40, 60, 0.55);
    --glass-border: rgba(255, 255, 255, 0.12);
    --glass-edge: rgba(0, 0, 0, 0.2);
    --line: rgba(255, 255, 255, 0.12);
    --input: rgba(255, 255, 255, 0.08);
    --active: rgba(255, 255, 255, 0.16);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    --scrim: rgba(3, 8, 18, 0.22);
    --hero-tint: rgba(108, 182, 255, 0.12);
    --alert-bg: rgba(110, 66, 10, 0.62);
    --alert-border: rgba(255, 189, 92, 0.4);
    --alert-ink: #ffe3b8;
    --tooltip: rgba(14, 20, 34, 0.95);
    --chart-line: #7cc0ff;
    --chart-bar: #b9d7ff;
    --chart-cross: rgba(240, 245, 252, 0.5);

    --ic-sun: #ffc94a;
    --ic-moon: #dfe6f5;
    --ic-cloud: #dbe3ef;
    --ic-cloud-dark: #8f9bb0;
    --ic-rain: #6cb6ff;
    --ic-snow: #ffffff;
    --ic-bolt: #ffd23f;
  }
}

@supports (transition-timing-function: linear(0, 1)) {
  :root {
    --spring: linear(0, 0.009, 0.035 2.1%, 0.141 4.4%, 0.723 12.9%, 0.938 16.7%, 1.017 20.2%, 1.041 23.4%,
      1.042 26.7%, 1.016 33.2%, 1.001 39.4%, 0.996 46.9%, 1);
  }
}

/* ==========================================================================
   Base
   ========================================================================== */
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  background: transparent;
  min-height: 100vh;
  font-variant-numeric: tabular-nums;
}
/* Solid colour behind the sky (also what shows during overscroll bounce) */
html { background: #5f93d1; }
@media (prefers-color-scheme: dark) { html { background: #101b33; } }
a { color: var(--accent); }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h2 { font-size: 1.2rem; text-shadow: var(--text-shadow); }
h3 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); font-weight: 600; }
.muted { color: var(--ink-2); }
.small { font-size: 0.82rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
code { background: var(--input); padding: 1px 5px; border-radius: 5px; font-size: 0.9em; }
[hidden] { display: none !important; }

/* Animated weather backdrop */
/* Sized to the *large* viewport so the phone address bar hiding/showing during
   scroll never resizes it; own compositor layer so scrolling doesn't repaint it. */
#sky {
  position: fixed; top: 0; left: 0; z-index: -2; display: block;
  width: 100%; height: 100vh; height: 100lvh;
  transform: translateZ(0); will-change: transform; pointer-events: none;
}
.sky-scrim { position: fixed; top: 0; left: 0; right: 0; height: 100vh; height: 100lvh; z-index: -1; background: var(--scrim); pointer-events: none; transform: translateZ(0); }

/* Frosted glass, shared by every panel */
.glass, .card, .hero, .stat, .count, .day, .nws-period, .glance-card, .dialog, .chart-card, .hourly-strip,
.alert, .status-lists > div {
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow), 0 0 0 0.5px var(--glass-edge);
}

/* ==========================================================================
   Top bar
   ========================================================================== */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 24px; position: sticky; top: 0; z-index: 30;
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border-bottom: 1px solid var(--glass-border);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand svg { width: 34px; height: 34px; color: var(--accent); }
.brand h1 { font-size: 1.15rem; }
.brand p { margin: 0; font-size: 0.8rem; color: var(--ink-3); }
.topbar-meta { display: flex; align-items: center; gap: 10px; font-size: 0.85rem; }

.btn {
  font: inherit; font-size: 0.85rem; font-weight: 600;
  border: 1px solid transparent; background: var(--accent); color: var(--accent-ink);
  border-radius: 999px; padding: 7px 14px; cursor: pointer;
  transition: transform 0.2s var(--ease-apple), background-color 0.2s;
}
.btn:active { transform: scale(0.96); }
.btn.ghost { background: var(--input); color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { background: var(--glass-hover); }
.btn.ghost.active { border-color: var(--accent); color: var(--accent); }
.topbar-meta .btn { white-space: nowrap; }

/* ==========================================================================
   Layout
   ========================================================================== */
main { max-width: 1280px; width: 100%; margin: 0 auto; padding: var(--space-5) var(--space-5) var(--space-6); min-width: 0; }
.view { display: grid; gap: var(--space-6); grid-template-columns: minmax(0, 1fr); }
.view > *, .status-panel > *, .card { min-width: 0; }
.section-title { font-size: 1.2rem; margin-bottom: var(--space-3); text-shadow: var(--text-shadow); }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; margin-bottom: var(--space-3); min-height: 36px; }
.card { border-radius: var(--radius); padding: 16px; }

/* Alerts banner */
.alerts { max-width: 1280px; margin: 16px auto 0; padding: 0 24px; display: grid; gap: 8px; }
.alert {
  background: var(--alert-bg); border-color: var(--alert-border); color: var(--alert-ink);
  border-radius: var(--radius); padding: var(--space-3) var(--space-4); font-size: 0.9rem;
}
.alert summary { cursor: pointer; font-weight: 600; }
.alert p { white-space: pre-line; margin: 8px 0 0; }

/* ==========================================================================
   Current conditions
   ========================================================================== */
.zone-tabs {
  display: inline-flex; flex-wrap: nowrap; gap: 2px; padding: 3px; margin-bottom: var(--space-4);
  max-width: 100%; overflow-x: auto; scrollbar-width: none;
  border-radius: 999px; border: 1px solid var(--glass-border); background: var(--glass);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: var(--shadow);
}
.zone-tabs::-webkit-scrollbar { display: none; }
.zone-tab {
  flex: none; white-space: nowrap;
  font: inherit; font-size: 0.85rem; border: 0; background: transparent;
  color: var(--ink-2); padding: 7px 14px; border-radius: 999px; cursor: pointer;
  transition: background-color 0.3s var(--ease-apple), color 0.3s, box-shadow 0.3s;
}
.zone-tab:hover { color: var(--ink); }
.zone-tab.active { background: var(--active); color: var(--ink); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.zone-tab small { color: var(--ink-3); margin-left: 4px; font-weight: 400; }
.current-grid { display: grid; grid-template-columns: minmax(280px, 1fr) 2fr; gap: var(--space-3); align-items: stretch; }
.hero {
  display: flex; align-items: center; gap: var(--space-5); padding: var(--space-5);
  border-radius: var(--radius);
  background-image: radial-gradient(120% 140% at 0% 0%, var(--hero-tint), transparent 70%);
}
.hero-icon { width: 96px; height: 96px; flex: none; filter: drop-shadow(0 4px 10px rgba(0,0,0,.15)); }
.hero-icon svg { width: 100%; height: 100%; }
.hero-temp { font-size: 4rem; font-weight: 300; line-height: 1; letter-spacing: -0.04em; }
.hero-temp small { font-size: 1.3rem; color: var(--ink-2); margin-left: 2px; vertical-align: top; font-weight: 400; }
.hero-cond { font-size: 1.15rem; font-weight: 500; margin-top: 4px; }
.stats { display: flex; flex-wrap: wrap; gap: var(--space-3); margin: 0; align-content: stretch; }
.stat { flex: 1 1 calc((100% - 2 * var(--space-3)) / 3); min-width: 130px; border-radius: var(--radius); padding: var(--space-3) var(--space-4); display: flex; flex-direction: column; justify-content: center; min-height: 76px; }
.stat dt { font-size: 0.72rem; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.stat dd { margin: 4px 0 0; font-size: 1.3rem; font-weight: 600; white-space: nowrap; }
.stat dd small { font-size: 0.8rem; color: var(--ink-2); font-weight: 500; }
.wind-arrow { display: inline-block; width: 16px; height: 16px; margin-left: 6px; vertical-align: -2px; }

/* Home: at a glance */
.glance-grid { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.glance-card {
  flex: 1 1 190px; min-height: 120px;
  display: grid; gap: var(--space-1); align-content: center; padding: var(--space-4); border-radius: var(--radius);
  color: var(--ink); text-decoration: none; transition: transform 0.35s var(--spring), background-color 0.2s;
}
.glance-card:hover { background-color: var(--glass-hover); transform: translateY(-2px); }
.glance-card .lbl { font-size: 0.72rem; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.glance-card .n { font-size: 1.7rem; font-weight: 600; }
.glance-card .n small { font-size: 0.95rem; color: var(--ink-2); font-weight: 500; }
.glance-card .small-n { font-size: 1.05rem; }
.glance-today { grid-template-columns: 48px 1fr; align-items: center; gap: 12px; }
.glance-today svg { width: 48px; height: 48px; }
.glance-map { background-image: radial-gradient(120% 140% at 100% 0%, var(--hero-tint), transparent 70%); }

/* ==========================================================================
   Map
   ========================================================================== */
.map-controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.seg {
  display: inline-flex; border: 1px solid var(--glass-border); border-radius: 999px; overflow: hidden; padding: 2px;
  background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
}
.seg-btn { font: inherit; font-size: 0.85rem; background: transparent; color: var(--ink-2); border: 0; padding: 6px 13px; border-radius: 999px; cursor: pointer; }
.seg-btn.active { background: var(--active); color: var(--ink); font-weight: 600; }
.select { display: inline-flex; align-items: center; gap: 6px; font-size: 0.85rem; color: var(--ink-2); text-shadow: var(--text-shadow); }
.select select {
  font: inherit; background: var(--glass-strong); color: var(--ink); border: 1px solid var(--glass-border);
  border-radius: 999px; padding: 6px 10px;
}
.map-wrap {
  position: relative; height: min(72vh, 680px); min-height: 420px;
  border-radius: var(--radius); overflow: hidden; border: 1px solid var(--glass-border); background: #0d1626;
  box-shadow: var(--shadow);
}
#view-map .map-wrap { height: calc(100dvh - var(--topbar-h) - 150px); min-height: 420px; }
.shell[data-nav="top"] #view-map .map-wrap { height: calc(100dvh - var(--topbar-h) - 220px); }
#map { position: absolute; inset: 0; }
#fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2; }
.fog-layer, .cloud-layer { position: absolute; inset: 0; pointer-events: none; z-index: 1; opacity: 0; transition: opacity 1.2s ease; }
.fog-layer {
  background:
    radial-gradient(60% 40% at 30% 70%, rgba(220,228,238,.55), transparent 70%),
    radial-gradient(50% 35% at 75% 55%, rgba(220,228,238,.5), transparent 70%),
    linear-gradient(180deg, rgba(210,218,230,.65), rgba(210,218,230,.35));
  animation: drift 40s linear infinite alternate;
}
.cloud-layer {
  background:
    radial-gradient(35% 22% at 20% 18%, rgba(255,255,255,.35), transparent 70%),
    radial-gradient(30% 18% at 65% 10%, rgba(255,255,255,.3), transparent 70%),
    radial-gradient(40% 20% at 90% 30%, rgba(255,255,255,.25), transparent 70%),
    linear-gradient(180deg, rgba(90,100,120,.35), transparent 55%);
  background-size: 200% 100%;
  animation: clouds 90s linear infinite;
}
@keyframes drift { from { transform: translateX(-3%); } to { transform: translateX(3%); } }
@keyframes clouds { from { background-position: 0 0; } to { background-position: 200% 0; } }

.map-badge, .legend, .zone-marker {
  background: var(--glass-strong); color: var(--ink);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border);
}
.map-badge {
  position: absolute; top: 12px; left: 12px; z-index: 3;
  display: flex; align-items: center; gap: var(--space-3); border-radius: var(--radius-sm); padding: var(--space-2) var(--space-3); font-size: 0.85rem;
}
.map-badge svg { width: 34px; height: 34px; }
.map-badge strong { font-size: 1rem; }
.legend {
  position: absolute; bottom: 12px; left: 12px; z-index: 3;
  border-radius: var(--radius-sm); padding: var(--space-2) var(--space-3); font-size: 0.8rem; display: grid; gap: var(--space-1);
}
.legend-row { display: flex; align-items: center; gap: 8px; }
.swatch { width: 22px; height: 4px; border-radius: 2px; flex: none; }
.swatch.dashed { background: repeating-linear-gradient(90deg, currentColor 0 5px, transparent 5px 8px) !important; height: 3px; }
.map-note {
  position: absolute; top: 12px; right: 56px; z-index: 3; max-width: 340px;
  background: var(--alert-bg); color: var(--alert-ink); border: 1px solid var(--alert-border);
  border-radius: 12px; padding: 8px 12px; font-size: 0.82rem;
}
.zone-pin { display: flex; flex-direction: column; align-items: center; pointer-events: auto; }
.zone-stem { width: 2px; height: 18px; background: rgba(255,255,255,.8); }
.zone-dot {
  width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 2px solid #0b1220;
  box-shadow: 0 0 0 2px rgba(255,255,255,.35); margin-bottom: -5px;
}
.zone-marker {
  border-radius: 12px; padding: 4px 9px 4px 4px; font-size: 0.78rem; display: flex; align-items: center; gap: 4px;
  white-space: nowrap; box-shadow: 0 4px 12px rgba(0,0,0,.3);
}
.zone-marker svg { width: 26px; height: 26px; }
.zone-marker b { font-size: 0.9rem; }
.maplibregl-ctrl-attrib { font-size: 10px; }

/* ==========================================================================
   Runs & lifts
   ========================================================================== */
.status-panel { display: grid; gap: 12px; }
.counts { display: flex; gap: var(--space-3); flex-wrap: wrap; }
.count { flex: 0 1 180px; border-radius: var(--radius); padding: var(--space-3) var(--space-4); }
.count .n { font-size: 1.6rem; font-weight: 600; }
.count .n small { font-size: 0.9rem; color: var(--ink-2); font-weight: 500; }
.count .lbl { font-size: 0.72rem; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.search {
  font: inherit; width: 100%; max-width: 360px; background: var(--glass-strong); color: var(--ink);
  border: 1px solid var(--glass-border); border-radius: 999px; padding: 9px 16px;
}
.status-lists { display: grid; grid-template-columns: minmax(240px, 1fr) 2fr; gap: var(--space-3); align-items: stretch; }
.status-lists > div { border-radius: var(--radius); padding: var(--space-4); }
.run-list {
  list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  max-height: 360px; overflow: auto;
}
.status-lists > div:first-child .run-list { grid-template-columns: 1fr; }
.run-item {
  display: flex; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-3); border-radius: var(--radius-xs);
  background: var(--input); border: 1px solid transparent; cursor: pointer; font-size: 0.88rem;
  transition: background-color 0.15s;
}
.run-item:hover { background: var(--glass-hover); border-color: var(--line); }
.run-item .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill { font-size: 0.72rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; display: inline-flex; align-items: center; gap: 4px; }
.pill.open { background: color-mix(in srgb, var(--open) 16%, transparent); color: var(--open); }
.pill.closed { background: color-mix(in srgb, var(--closed) 15%, transparent); color: var(--closed); }
.pill.unknown { background: color-mix(in srgb, var(--unknown) 16%, transparent); color: var(--unknown); }
.diff { width: 12px; height: 12px; flex: none; display: inline-block; }
.groomed { color: var(--accent); font-size: 0.72rem; font-weight: 600; white-space: nowrap; }

/* ==========================================================================
   Forecast
   ========================================================================== */
.chart-card { display: grid; gap: var(--space-2); border-radius: var(--radius); padding: var(--space-4) var(--space-5); }
.chart-title { margin-top: 4px; }
.chart { position: relative; height: 170px; }
.chart.short { height: 90px; }
.chart svg { width: 100%; height: 100%; display: block; overflow: visible; }
.chart .grid line { stroke: var(--line); stroke-width: 1; }
.chart .axis text { fill: var(--ink-3); font-size: 11px; }
.chart .line { stroke: var(--chart-line); }
.chart .dot { fill: var(--chart-line); stroke: var(--glass-strong); }
.chart .bar { fill: var(--chart-bar); }
.chart .freeze { stroke: var(--chart-line); }
.chart .cross { stroke: var(--chart-cross); }
.chart .empty { fill: var(--ink-3); }
.hourly-strip {
  display: flex; gap: var(--space-1); overflow-x: auto; padding: var(--space-3); margin-top: var(--space-3); border-radius: var(--radius);
  scroll-snap-type: x proximity;
}
.hour {
  flex: none; width: 72px; text-align: center; border-radius: var(--radius-sm); padding: var(--space-2) var(--space-1);
  scroll-snap-align: start; font-size: 0.8rem;
}
.hour:first-child { background: var(--input); }
.hour svg { width: 32px; height: 32px; display: block; margin: 4px auto; }
.hour .t { font-size: 1.05rem; font-weight: 600; }
.hour .p { color: var(--accent); font-size: 0.72rem; min-height: 1em; }
.feels { color: var(--ink-2); font-size: 0.72rem; }

.daily { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: var(--space-3); }
.day { border-radius: var(--radius); padding: var(--space-4) var(--space-2); text-align: center; display: grid; gap: var(--space-1); align-content: start; }
.day .dname { font-weight: 600; }
.day svg { width: 48px; height: 48px; margin: 4px auto; }
.day .hi { font-size: 1.2rem; font-weight: 600; }
.day .lo { color: var(--ink-2); }
.day .snow { color: var(--accent); font-weight: 600; font-size: 0.85rem; }
.day .meta { color: var(--ink-3); font-size: 0.75rem; }

.nws { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--space-3); }
.nws-period { border-radius: var(--radius); padding: var(--space-4); font-size: 0.88rem; }
.nws-period h4 { margin: 0 0 4px; font-size: 0.95rem; }
.nws-period p { margin: 0; color: var(--ink-2); }

/* Tooltips & popups */
.tooltip {
  position: fixed; z-index: 50; pointer-events: none; background: var(--tooltip); color: var(--ink);
  border: 1px solid var(--line); border-radius: 10px; padding: 6px 9px; font-size: 0.8rem; box-shadow: 0 6px 18px rgba(0,0,0,.25);
  white-space: nowrap;
}
.maplibregl-popup-content { background: var(--tooltip); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; font-family: var(--font); }
.maplibregl-popup-tip { border-top-color: var(--tooltip) !important; border-bottom-color: var(--tooltip) !important; }
.maplibregl-popup-close-button { color: var(--ink-2); }

footer { padding: 20px 24px 32px; color: var(--ink-2); font-size: 0.8rem; text-align: center; text-shadow: var(--text-shadow); }
footer p { max-width: 900px; margin: 0 auto; }

/* ==========================================================================
   Alerts dialog
   ========================================================================== */
.dialog { color: var(--ink); background: var(--glass-strong); border-radius: var(--radius-lg); padding: 0; width: min(440px, calc(100vw - 32px)); }
.dialog[open] { animation: dialog-in 0.45s var(--spring); }
@keyframes dialog-in { from { opacity: 0; transform: scale(0.94) translateY(8px); } }
.dialog::backdrop { background: rgba(3, 8, 18, 0.35); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.dialog-head h2 { font-size: 1.05rem; text-shadow: none; }
.alerts-form, .ios-hint { padding: 14px 16px 18px; display: grid; gap: 12px; }
.ios-hint ol { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.ios-hint p, .alerts-form p { margin: 0; }
.pref { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-3); background: var(--input); border-radius: var(--radius-sm); cursor: pointer; }
.pref select { font: inherit; background: var(--glass-strong); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; }
.pref input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--accent); flex: none; }
.dialog-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.alerts-msg { min-height: 1.2em; font-size: 0.85rem; color: var(--ink-2); }
.alerts-msg.ok { color: var(--open); }
.alerts-msg.warn { color: var(--warn); }

/* ==========================================================================
   Tab bar: a full-height sidebar, or a floating capsule at the top
   (inspired by the iPadOS sidebar / tab bar).
   ========================================================================== */
.shell { display: grid; grid-template-columns: var(--nav-w) minmax(0, 1fr); align-items: start; }

.sidenav {
  position: sticky; top: calc(var(--topbar-h) + 12px); z-index: 20;
  margin: var(--space-3) 0 var(--space-3) var(--space-3);
  height: calc(100dvh - var(--topbar-h) - 24px);
  display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-2);
  border-radius: var(--radius-lg);
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow), 0 0 0 0.5px var(--glass-edge);
  view-transition-name: tabbar;
}
.nav-items { position: relative; display: flex; flex-direction: column; gap: var(--space-1); flex: 1; min-height: 0; }

/* Sliding highlight behind the active tab */
.nav-indicator {
  position: absolute; left: 0; top: 0; width: 0; height: 0; border-radius: var(--radius);
  background: var(--active);
  box-shadow: 0 1px 3px rgba(0,0,0,.12), inset 0 0 0 0.5px var(--glass-border);
  transition: transform 0.55s var(--spring), width 0.55s var(--spring), height 0.55s var(--spring), border-radius 0.4s;
  pointer-events: none; z-index: 0;
}
.nav-indicator.no-anim { transition: none; }

.nav-item {
  position: relative; z-index: 1;
  /* side: each tab takes an equal share of the full height */
  flex: 1 1 0; min-height: 56px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px;
  padding: var(--space-2) var(--space-1); border-radius: var(--radius); text-align: center; line-height: 1.15;
  color: var(--ink-2); text-decoration: none; font-size: 0.74rem; font-weight: 600; letter-spacing: 0.01em;
  transition: color 0.25s, transform 0.3s var(--spring);
  -webkit-tap-highlight-color: transparent;
}
.nav-item svg {
  width: 26px; height: 26px;
  fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
  transition: transform 0.45s var(--spring);
}
.nav-item:hover { color: var(--ink); }
.nav-item:active svg { transform: scale(0.9); }
.nav-item.active { color: var(--accent); }
.nav-item:focus-visible, .nav-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Sidebar toggle button (SF Symbols "sidebar.left" style) */
.nav-toggle {
  flex: none; align-self: center; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  color: var(--ink-2); background: var(--input); border: 1px solid var(--line);
  transition: transform 0.35s var(--spring), background-color 0.2s, color 0.2s;
  view-transition-name: tabtoggle;
  -webkit-tap-highlight-color: transparent;
}
.nav-toggle:hover { color: var(--ink); background: var(--glass-hover); }
.nav-toggle:active { transform: scale(0.88); }
.nav-toggle svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.nav-toggle .panel { transition: opacity 0.3s, transform 0.45s var(--spring); transform-origin: 8px 12px; }
.shell[data-nav="top"] .nav-toggle .panel { opacity: 0.35; transform: scaleX(0.4); }

/* ---- Top: floating capsule tab bar ---- */
.shell[data-nav="top"] { display: block; }
.shell[data-nav="top"] .sidenav {
  position: sticky; top: calc(var(--topbar-h) + 10px);
  width: max-content; max-width: calc(100% - 24px); height: auto;
  margin: 10px auto 0; flex-direction: row; align-items: center; gap: 4px;
  padding: 5px; border-radius: 999px;
}
.shell[data-nav="top"] .nav-items { flex-direction: row; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.shell[data-nav="top"] .nav-items::-webkit-scrollbar { display: none; }
.shell[data-nav="top"] .nav-item {
  flex: none; min-height: 0; flex-direction: row; gap: 7px; padding: 8px 15px; border-radius: 999px;
  font-size: 0.88rem; white-space: nowrap;
}
.shell[data-nav="top"] .nav-item svg { width: 20px; height: 20px; }
.shell[data-nav="top"] .nav-indicator { border-radius: 999px; }
.shell[data-nav="top"] .nav-toggle { width: 38px; height: 38px; }

/* ---- Morph animation (View Transitions) ---- */
::view-transition-group(*) { animation-duration: 0.6s; animation-timing-function: var(--spring); }
::view-transition-old(*), ::view-transition-new(*) { animation-duration: 0.35s; animation-timing-function: ease; }
::view-transition-old(root), ::view-transition-new(root) { animation: none; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 900px) {
  .current-grid { grid-template-columns: 1fr; }
  .daily { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .status-lists { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  :root { --nav-w: 72px; }
  .sidenav { margin: 8px 0 8px 8px; padding: 6px; border-radius: 22px; height: calc(100dvh - var(--topbar-h) - 16px); top: calc(var(--topbar-h) + 8px); }
  .nav-item { font-size: 0.64rem; gap: 4px; padding: 6px 2px; }
  .nav-item svg { width: 22px; height: 22px; }
  .nav-toggle { width: 40px; height: 40px; }
  .shell[data-nav="side"] main { padding: 14px 12px 32px; }
  .shell[data-nav="top"] .nav-item { padding: 8px 11px; font-size: 0.8rem; }
  .shell[data-nav="top"] .nav-item span { display: none; }
  .shell[data-nav="top"] .nav-item.active span { display: inline; }
  #view-map .map-wrap { height: calc(100dvh - var(--topbar-h) - 190px); min-height: 360px; }
}
@media (max-width: 560px) {
  .topbar { padding: 10px 12px; gap: 8px; }
  .brand { gap: 8px; min-width: 0; }
  .brand svg { width: 28px; height: 28px; }
  .brand h1 { font-size: 1rem; white-space: nowrap; }
  .brand p { font-size: 0.72rem; white-space: nowrap; }
  .topbar-meta { gap: 6px; }
  .topbar-meta #updated, #refresh { display: none; }
  .topbar-meta .btn-label { display: none; }
  .topbar-meta .btn { padding: 7px 10px; font-size: 1rem; }
  main { padding: 16px; }
  .alerts { padding: 0 16px; }
  .hero-temp { font-size: 3.3rem; }
  .map-badge { font-size: 0.78rem; }
  .legend { bottom: 34px; }
}
@media (prefers-reduced-motion: reduce) {
  .fog-layer, .cloud-layer { animation: none; }
  .nav-indicator, .nav-item, .nav-item svg, .nav-toggle, .glance-card { transition: none; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}

/* ==========================================================================
   Squircle corners (Apple "continuous" corners) where the browser supports it
   ========================================================================== */
@supports (corner-shape: squircle) {
  :root { --radius-lg: 34px; --radius: 26px; --radius-sm: 18px; --radius-xs: 13px; }
  .card, .hero, .stat, .count, .day, .nws-period, .glance-card, .dialog, .chart-card, .hourly-strip,
  .alert, .status-lists > div, .sidenav, .nav-item, .nav-indicator, .hour, .run-item, .map-wrap,
  .map-badge, .legend, .zone-marker, .pref, .map-note, .tooltip, .maplibregl-popup-content {
    corner-shape: squircle;
  }
  /* pills stay pills */
  .shell[data-nav="top"] .sidenav, .shell[data-nav="top"] .nav-item, .shell[data-nav="top"] .nav-indicator { corner-shape: round; }
}

/* ==========================================================================
   Mountain search
   ========================================================================== */
.brand { cursor: pointer; min-width: 0; }
.brand h1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.resort-dialog { width: min(520px, calc(100vw - 24px)); }
.resort-body { padding: var(--space-4); display: grid; gap: var(--space-3); }
.resort-search { max-width: none; font-size: 1rem; padding: 11px 16px; }
.resort-results { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; max-height: min(52vh, 420px); overflow: auto; }
.resort-head { padding: var(--space-2) var(--space-2) var(--space-1); font-size: 0.75rem; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.resort-row {
  display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm); color: var(--ink); text-decoration: none;
}
.resort-row:hover, .resort-row:focus-visible { background: var(--input); outline: none; }
.resort-flag { font-size: 1.4rem; width: 28px; text-align: center; flex: none; }
.resort-text { display: grid; min-width: 0; flex: 1; }
.resort-text b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.units-pick { border: 0; margin: 0; padding: var(--space-2) 0 0; display: flex; flex-wrap: wrap; gap: var(--space-3); border-top: 1px solid var(--line); font-size: 0.88rem; }
.units-pick legend { padding: 0; margin-bottom: var(--space-1); float: left; width: 100%; }
.units-pick label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.units-pick input { accent-color: var(--accent); }

/* Alerts: per-mountain settings */
.alerts-resort { margin: var(--space-1) 0 0; }
.my-resorts { list-style: none; margin: var(--space-2) 0 0; padding: 0; display: grid; gap: var(--space-1); }
.my-resorts li { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2) var(--space-3); background: var(--input); border-radius: var(--radius-sm); font-size: 0.88rem; }
.my-resorts li a { color: var(--ink); text-decoration: none; font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.my-resorts li .muted { font-size: 0.78rem; white-space: nowrap; }
.my-resorts li button { font: inherit; font-size: 0.8rem; border: 0; background: transparent; color: var(--closed); cursor: pointer; padding: 4px 6px; border-radius: 8px; }
.my-resorts li button:hover { background: color-mix(in srgb, var(--closed) 12%, transparent); }

/* ==========================================================================
   "Gathering mountain information" progress
   ========================================================================== */
.spinner {
  display: inline-block; width: 14px; height: 14px; flex: none; border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--ink) 25%, transparent); border-top-color: var(--accent);
  animation: spin 0.8s linear infinite; vertical-align: -2px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.gather {
  position: fixed; left: 50%; top: calc(var(--topbar-h) + 10px); z-index: 40;
  transform: translateX(-50%);
  display: flex; align-items: center; gap: var(--space-2); max-width: calc(100vw - 24px);
  padding: 8px 14px 10px; border-radius: 999px; font-size: 0.82rem; font-weight: 500; white-space: nowrap;
  background: var(--glass-strong); color: var(--ink); border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: var(--shadow);
  transition: opacity 0.4s, transform 0.5s var(--spring);
}
#gatherText { overflow: hidden; text-overflow: ellipsis; }
.gather-track { position: absolute; left: 14px; right: 14px; bottom: 4px; height: 2px; border-radius: 2px; background: var(--line); overflow: hidden; }
.gather-bar { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.5s var(--ease-apple); }
.gather.done { opacity: 0; transform: translate(-50%, -12px); pointer-events: none; }
.map-loading {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 4;
  display: flex; align-items: center; gap: var(--space-2); padding: 10px 16px; border-radius: 999px;
  background: var(--glass-strong); color: var(--ink); border: 1px solid var(--glass-border); font-size: 0.88rem; font-weight: 500;
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: var(--shadow);
}
.gathering-row { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-2); list-style: none; }
.glance-card.gathering .n { display: flex; align-items: center; gap: var(--space-2); }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } }

/* ==========================================================================
   Phones
   ========================================================================== */
.legend details summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; align-items: center; gap: 6px; }
.legend details summary::-webkit-details-marker { display: none; }
.legend details summary::after { content: "▾"; font-size: 0.75em; color: var(--ink-3); transition: transform 0.3s var(--ease-apple); }
.legend details:not([open]) summary::after { transform: rotate(-90deg); }
.legend details[open] summary { margin-bottom: var(--space-1); }

/* Notch / home-indicator safe areas (installed app and iPhone landscape) */
.topbar { padding-top: max(10px, env(safe-area-inset-top)); padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); }

@media (max-width: 760px) {
  :root { --blur: blur(16px) saturate(150%); }

  /* Tabs become an iOS-style bottom tab bar (the toggle still moves them to the top) */
  .shell[data-nav="side"] { display: block; }
  .shell[data-nav="side"] .sidenav {
    position: fixed; top: auto; left: max(8px, env(safe-area-inset-left)); right: max(8px, env(safe-area-inset-right));
    bottom: calc(8px + env(safe-area-inset-bottom));
    height: auto; margin: 0; z-index: 30;
    flex-direction: row; align-items: center; gap: 4px; padding: 5px; border-radius: 28px;
  }
  .shell[data-nav="side"] .nav-items { flex-direction: row; gap: 2px; }
  .shell[data-nav="side"] .nav-item { flex: 1 1 0; min-height: 52px; padding: 6px 2px; gap: 3px; font-size: 0.64rem; border-radius: 22px; }
  .shell[data-nav="side"] .nav-item svg { width: 23px; height: 23px; }
  .shell[data-nav="side"] .nav-indicator { border-radius: 22px; }
  .shell[data-nav="side"] .nav-toggle { width: 40px; height: 40px; }
  .shell[data-nav="side"] main { padding: 14px 14px calc(92px + env(safe-area-inset-bottom)); }
  .shell[data-nav="side"] #view-map .map-wrap { height: calc(100dvh - var(--topbar-h) - 190px - env(safe-area-inset-bottom)); }
  .shell[data-nav="top"] main { padding: 14px 14px calc(24px + env(safe-area-inset-bottom)); }

  /* iOS zooms into inputs under 16px */
  input, select, textarea { font-size: 16px !important; }

  /* Comfortable layout */
  .hero { padding: var(--space-4); gap: var(--space-4); }
  .hero-icon { width: 76px; height: 76px; }
  .counts .count { flex: 1 1 130px; }
  .run-list { max-height: none; }
  .glance-card { flex-basis: 150px; min-height: 104px; }
  .map-badge { top: 8px; left: 8px; padding: 6px 10px; gap: 8px; font-size: 0.76rem; max-width: calc(100% - 64px); }
  .map-badge svg { width: 28px; height: 28px; }
  .legend { left: 8px; bottom: 28px; font-size: 0.76rem; }
  .zone-marker { font-size: 0.7rem; padding: 3px 7px 3px 3px; }
  .zone-marker svg { width: 22px; height: 22px; }
  .map-controls { width: 100%; justify-content: space-between; }
  .gather { font-size: 0.76rem; }

  /* Dialogs become bottom sheets */
  .dialog {
    width: 100%; max-width: 100%; margin: auto 0 0; border-radius: 26px 26px 0 0;
    padding-bottom: env(safe-area-inset-bottom); max-height: 88dvh; overflow: auto;
  }
  .dialog[open] { animation: sheet-in 0.45s var(--spring); }
  @keyframes sheet-in { from { transform: translateY(40px); opacity: 0.4; } }
  .resort-results { max-height: 50dvh; }
}

/* ==========================================================================
   Liquid Glass (Apple-style): system SF type, translucent glass with a
   bright specular rim and soft depth, capsule controls, continuous corners.
   ========================================================================== */
:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", "Inter", system-ui, sans-serif;
  --glass: rgba(255, 255, 255, 0.34);
  --glass-strong: rgba(255, 255, 255, 0.72);
  --glass-hover: rgba(255, 255, 255, 0.5);
  --glass-border: rgba(255, 255, 255, 0.55);
  --glass-edge: rgba(0, 0, 0, 0.06);
  --rim: rgba(255, 255, 255, 0.85);         /* specular top edge */
  --rim-low: rgba(255, 255, 255, 0.25);     /* faint bottom edge */
  --sheen: linear-gradient(160deg, rgba(255, 255, 255, 0.55) 0%, rgba(255, 255, 255, 0.12) 38%, rgba(255, 255, 255, 0) 60%, rgba(255, 255, 255, 0.10) 100%);
  --shadow: 0 10px 30px rgba(15, 30, 60, 0.12), 0 1px 3px rgba(15, 30, 60, 0.08);
  --blur: blur(28px) saturate(185%) brightness(1.04);
  --active: rgba(255, 255, 255, 0.92);
  --accent: #007aff;
  --open: #248a3d;
  --closed: #d70015;
  --warn: #b25000;
  --ink: #1d1d1f;
  --ink-2: rgba(29, 29, 31, 0.68);
  --ink-3: rgba(29, 29, 31, 0.48);
  --radius-lg: 30px;
  --radius: 24px;
  --radius-sm: 18px;
  --radius-xs: 13px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --glass: rgba(28, 30, 38, 0.38);
    --glass-strong: rgba(28, 30, 38, 0.74);
    --glass-hover: rgba(52, 56, 68, 0.5);
    --glass-border: rgba(255, 255, 255, 0.16);
    --glass-edge: rgba(0, 0, 0, 0.3);
    --rim: rgba(255, 255, 255, 0.32);
    --rim-low: rgba(255, 255, 255, 0.06);
    --sheen: linear-gradient(160deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0.04) 40%, rgba(255, 255, 255, 0) 62%, rgba(255, 255, 255, 0.05) 100%);
    --shadow: 0 12px 34px rgba(0, 0, 0, 0.35), 0 1px 3px rgba(0, 0, 0, 0.3);
    --blur: blur(28px) saturate(170%) brightness(0.96);
    --active: rgba(255, 255, 255, 0.18);
    --accent: #0a84ff;
    --open: #30d158;
    --closed: #ff453a;
    --warn: #ff9f0a;
    --ink: #f5f5f7;
    --ink-2: rgba(245, 245, 247, 0.72);
    --ink-3: rgba(245, 245, 247, 0.5);
  }
}

body { letter-spacing: -0.005em; }
h1, h2, h3 { letter-spacing: -0.015em; }
h2, .section-title { font-size: 1.45rem; font-weight: 700; letter-spacing: -0.02em; }
h3 { letter-spacing: 0.04em; font-weight: 600; }
.hero-temp { font-weight: 200; letter-spacing: -0.05em; font-size: 4.6rem; }
.hero-cond { font-weight: 600; }

/* The glass material: blur + saturation, sheen gradient, bright rim on top */
.glass, .card, .hero, .stat, .count, .day, .nws-period, .glance-card, .dialog, .chart-card, .hourly-strip,
.alert, .status-lists > div, .map-badge, .legend, .zone-marker, .gather, .map-loading, .sidenav, .topbar,
.zone-tabs, .seg, .btn.ghost, .nav-toggle, .tooltip, .maplibregl-popup-content {
  background-color: var(--glass);
  background-image: var(--sheen);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 0 var(--rim), inset 0 -1px 0 var(--rim-low), var(--shadow);
}
.alert { background-color: var(--alert-bg); }
.topbar { border-width: 0 0 1px; box-shadow: inset 0 -1px 0 var(--rim-low), 0 1px 12px rgba(0, 0, 0, 0.05); }
.dialog, .tooltip, .maplibregl-popup-content, .map-badge, .legend, .zone-marker { background-color: var(--glass-strong); }
.maplibregl-popup-tip { display: none; }

/* Floating capsule tab bar & sidebar */
.sidenav { border-radius: var(--radius-lg); }
.nav-item { font-weight: 600; }
.nav-indicator {
  background: var(--active);
  box-shadow: inset 0 1px 0 var(--rim), 0 2px 8px rgba(0, 0, 0, 0.10);
}
.nav-toggle { border-radius: 50%; }

/* Capsule buttons */
.btn { border-radius: 999px; font-weight: 600; letter-spacing: -0.01em; box-shadow: inset 0 1px 0 rgba(255,255,255,0.35), 0 4px 14px color-mix(in srgb, var(--accent) 35%, transparent); }
.btn.ghost { color: var(--ink); font-weight: 600; }
.btn:active { transform: scale(0.95); }

/* Segmented controls with a raised glass thumb */
.zone-tabs { padding: 4px; }
.zone-tab, .seg-btn { font-weight: 600; }
.zone-tab.active, .seg-btn.active {
  background: var(--active); color: var(--ink);
  box-shadow: inset 0 1px 0 var(--rim), 0 2px 8px rgba(0, 0, 0, 0.12);
}

/* Inputs */
.search, .select select, .pref select {
  background: var(--glass-strong); border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.06);
}
.search:focus { outline: none; box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 30%, transparent); }

/* Lists */
.run-item { background: color-mix(in srgb, var(--glass-strong) 55%, transparent); border: 1px solid transparent; }
.run-item:hover { background: var(--glass-hover); border-color: var(--glass-border); }
.pill.open { background: color-mix(in srgb, var(--open) 16%, transparent); }
.pill.closed { background: color-mix(in srgb, var(--closed) 14%, transparent); }

/* ---------- Ski score (Activity-ring style) ---------- */
.score-card {
  flex: 2 1 340px; grid-template-columns: 112px 1fr; align-items: center; gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
}
.score-ring { width: 112px; height: 112px; overflow: visible; }
.score-track { fill: none; stroke: color-mix(in srgb, var(--ink) 10%, transparent); stroke-width: 12; }
.score-prog {
  fill: none; stroke-width: 12; stroke-linecap: round;
  transform: rotate(-90deg); transform-origin: 60px 60px;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.18));
  animation: ring-fill 1.2s var(--spring) both;
}
@keyframes ring-fill { from { stroke-dashoffset: var(--full); } }
.score-num { text-anchor: middle; font-size: 34px; font-weight: 700; fill: var(--ink); letter-spacing: -0.03em; }
.score-of { text-anchor: middle; font-size: 12px; font-weight: 600; fill: var(--ink-3); }
.score-text { display: grid; gap: 4px; min-width: 0; }
.score-verdict { font-size: 1.35rem; font-weight: 700; letter-spacing: -0.02em; }
.score-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.score-chips span {
  font-size: 0.78rem; font-weight: 600; color: var(--ink-2); padding: 3px 9px; border-radius: 999px;
  background: color-mix(in srgb, var(--glass-strong) 70%, transparent); box-shadow: inset 0 1px 0 var(--rim);
}
@media (max-width: 760px) {
  :root { --blur: blur(18px) saturate(170%); }
  .score-card { grid-template-columns: 92px 1fr; padding: var(--space-4); }
  .score-ring { width: 92px; height: 92px; }
  .score-verdict { font-size: 1.15rem; }
  .hero-temp { font-size: 3.8rem; }
}
@media (prefers-reduced-motion: reduce) { .score-prog { animation: none; } }
