:root {
  --bg: #eef2f6;
  --panel: #fff;
  --ink: #1a1f26;
  --muted: #6b7280;
  --line: #d8dee6;
  --accent: #1f6feb;
  --green: #2e9d3a;
  --blue: #1f5fd6;
  --black: #222;
  --snow: #3b82f6;
  --lift: #dc2626;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font: 14px/1.45 "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 10% -10%, #dbe7f8 0%, transparent 55%),
    radial-gradient(900px 400px at 90% 0%, #e8eef5 0%, transparent 50%),
    var(--bg);
}
header {
  position: sticky; top: 0; z-index: 20;
  display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
  padding: 10px 18px;
  background: rgba(232, 237, 243, .92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}
.brand { font-weight: 700; font-size: 18px; color: var(--ink); text-decoration: none; }
.nav { color: var(--ink); text-decoration: none; font-size: 14px; }
.nav:hover { text-decoration: underline; }
.nav.active { font-weight: 600; color: var(--accent); }
.muted { color: var(--muted); font-size: 13px; margin-left: auto; }
main { padding: 18px; display: grid; gap: 18px; max-width: 1400px; margin: 0 auto; }
main[hidden], footer[hidden], .load-progress[hidden] { display: none !important; }
.load-progress {
  min-height: 42vh;
  display: grid;
  place-items: center;
  padding: 28px 18px;
}
.load-progress-inner {
  width: min(420px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 20px 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06), 0 10px 30px rgba(20,40,70,.04);
}
.load-progress-label {
  font-weight: 600;
  margin-bottom: 12px;
  font-size: 15px;
}
.load-progress-track {
  height: 10px;
  border-radius: 999px;
  background: #e8edf3;
  overflow: hidden;
}
.load-progress-bar {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #60a5fa, var(--accent));
  transition: width .35s ease;
}
.load-progress-pct { margin-top: 8px; text-align: right; }
.panel {
  background: var(--panel);
  border-radius: 14px;
  padding: 16px 18px 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06), 0 10px 30px rgba(20,40,70,.04);
  border: 1px solid rgba(255,255,255,.7);
}
h1, h2 { margin: 0 0 6px; font-family: "League Spartan", "Montserrat", system-ui, sans-serif; letter-spacing: .01em; }
h1 { font-size: 26px; }
h2 { font-size: 20px; }
.page-title {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 16px;
  margin: 0 0 6px;
}
.page-title h1 { margin: 0; }
.update-status {
  margin: 0; font-size: 13px; font-variant-numeric: tabular-nums;
  letter-spacing: .01em;
}
.update-status .st-ok { color: var(--green); font-weight: 600; }
.update-status .st-fail { color: var(--lift); font-weight: 600; }
.lede { margin: 0 0 14px; color: var(--muted); max-width: 70ch; }
.hints { margin: 0 0 12px; padding-left: 18px; color: var(--muted); }
.hints li { margin-bottom: 4px; }
.table-wrap { overflow: auto; max-height: min(70vh, 720px); border: 1px solid var(--line); border-radius: 10px; }
table.stats { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; font-size: 13px; }
table.stats th, table.stats td { padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; text-align: right; }
table.stats th { position: sticky; top: 0; background: #f3f6fa; z-index: 2; font-weight: 600; font-size: 12px; }
table.stats th:first-child, table.stats td:first-child {
  text-align: left; position: sticky; left: 0; background: #fff; z-index: 1; font-weight: 600;
}
table.stats th:first-child { z-index: 3; background: #f3f6fa; }
table.stats tbody tr:hover td { background: #f7faff; }
table.stats tbody tr:hover td:first-child { background: #eef5ff; }
table.stats th.sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
table.stats th.sortable:hover { color: var(--accent); }
table.stats th.sorted { color: var(--accent); }
.speed-cov { font-size: 11px; font-weight: 500; }
.season-cell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.season-days-cell {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.season-pill {
  display: inline-block;
  min-width: 2.6em;
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.season-pill.season-open {
  background: #bbf7d0;
  color: #14532d;
}
.season-pill.season-closed {
  background: #fecaca;
  color: #7f1d1d;
}
.resort-open-mark {
  font-weight: 800;
  font-size: 0.95em;
  line-height: 1;
}
.resort-open-mark.open { color: #16a34a; }
.resort-open-mark.closed { color: #dc2626; }
.resort-open-mark.unknown { color: var(--muted, #94a3b8); }
.season-bar-wrap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.bar.season-bar {
  width: 56px;
  height: 8px;
  flex-shrink: 0;
}
.season-bar-fill {
  display: block;
  height: 100%;
  border-radius: 6px;
  min-width: 0;
}
.bar.season-bar-open .season-bar-fill {
  background: linear-gradient(90deg, #86efac, #16a34a);
}
.bar.season-bar-until .season-bar-fill {
  background: #fca5a5;
}
.bar.season-bar-closed .season-bar-fill {
  background: linear-gradient(90deg, #fca5a5, #dc2626);
}
.season-frac {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.open-of {
  font-size: 11px;
  font-weight: 500;
  margin-left: 2px;
}
.terrain { letter-spacing: -1px; font-size: 14px; }
.bar {
  display: inline-block; vertical-align: middle;
  width: 72px; height: 10px; border-radius: 6px; background: #e8edf3; overflow: hidden;
}
.bar > i { display: block; height: 100%; border-radius: 6px; }
.bar.snow > i { background: linear-gradient(90deg, #60a5fa, var(--snow)); }
.bar.trail > i { background: linear-gradient(90deg, #93c5fd, #2563eb); }
.bar.lift > i { background: linear-gradient(90deg, #fca5a5, var(--lift)); }
.bar.crowd > i { background: linear-gradient(90deg, #86efac, #16a34a); }
.toggle, .series { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 10px 0; }
.chart { width: 100%; min-height: 560px; }
footer { padding: 8px 18px 28px; max-width: 1400px; margin: 0 auto; }
.resort-link {
  background: none; border: 0; padding: 0; margin: 0;
  font: inherit; font-weight: 600; color: var(--accent);
  cursor: pointer; text-align: left; text-decoration: underline;
  text-underline-offset: 2px;
}
.resort-link:hover { color: #0b4fbf; }
.modal[hidden] { display: none; }
.modal {
  position: fixed; inset: 0; z-index: 40;
  display: grid; place-items: center; padding: 16px;
}
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(18, 28, 42, .42);
  backdrop-filter: blur(2px);
}
.modal-panel {
  position: relative; z-index: 1;
  width: min(920px, 100%);
  max-height: min(88vh, 900px);
  overflow: auto;
  background: var(--panel);
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.7);
  box-shadow: 0 12px 40px rgba(20,40,70,.22);
  padding: 14px 16px 18px;
}
.modal-head {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 8px; padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: var(--panel); z-index: 2;
}
.modal-head h2 { margin: 0; font-size: 22px; flex: 1; }
.modal-close {
  border: 1px solid var(--line); background: #f3f6fa; color: var(--ink);
  width: 34px; height: 34px; border-radius: 8px; font-size: 22px; line-height: 1;
  cursor: pointer;
}
.modal-close:hover { background: #e8eef5; }
.modal-body { display: grid; gap: 18px; }
.modal-body h3 { margin: 0 0 4px; font-size: 16px; }
.lede-sm { margin: 0 0 8px; font-size: 13px; }
.modal-table { max-height: 280px; }
.weather-summary {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px 12px; margin: 0 0 10px;
}
.weather-summary > div {
  background: #f3f6fa; border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 10px;
}
.weather-summary dt { margin: 0; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.weather-summary dd { margin: 2px 0 0; font-weight: 600; font-size: 15px; }
.status-open { color: var(--green); font-weight: 600; }
.status-closed { color: var(--lift); font-weight: 600; }
.status-hold { color: #b45309; font-weight: 600; }
.status-unknown { color: var(--muted); font-weight: 600; font-style: italic; }
@media (max-width: 700px) {
  .muted { margin-left: 0; width: 100%; }
  h1 { font-size: 22px; }
  .chart { min-height: 420px; }
  .modal-panel { max-height: 94vh; padding: 12px; }
  .modal-table { max-height: 220px; }
}
