:root {
  --bg: #f4f3fb;
  --card: #ffffff;
  --text: #17152b;
  --muted: #615d7a;
  --line: #e4e1f2;
  --accent: #0f766e;
  --accent-strong: #115e59;
  --accent-text: #ffffff;
  --accent-soft: #ccfbf1;
  --hero-a: #1e1b4b;
  --hero-b: #4c1d95;
  --hero-c: #0f766e;
  --short: #047857;
  --short-bg: #d1fae5;
  --mid: #a14207;
  --mid-bg: #fef3c7;
  --long: #be123c;
  --long-bg: #ffe4e6;
  --closed: #615d7a;
  --closed-bg: #eceaf3;
  --down: #047857;
  --up: #be123c;
  --error: #be123c;
  --shadow: 0 1px 2px rgb(23 21 43 / 6%), 0 4px 16px rgb(23 21 43 / 6%);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e0d19;
    --card: #191729;
    --text: #efedf9;
    --muted: #a39fbd;
    --line: #2b2842;
    --accent: #2dd4bf;
    --accent-strong: #5eead4;
    --accent-text: #042f2b;
    --accent-soft: #134e4a;
    --short: #34d399;
    --short-bg: #064e3b;
    --mid: #fbbf24;
    --mid-bg: #4a3209;
    --long: #fb7185;
    --long-bg: #4c1023;
    --closed: #9a96b3;
    --closed-bg: #24223a;
    --down: #34d399;
    --up: #fb7185;
    --error: #fb7185;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 4px 16px rgb(0 0 0 / 25%);
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
main, footer { max-width: 640px; margin: 0 auto; padding: 0 16px; }
h2 { margin: 0; font-size: 1.1rem; }
h3 {
  margin: 28px 4px 10px;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
}
.muted { color: var(--muted); margin: 2px 0 0; }
.small { font-size: .88rem; }
[hidden] { display: none !important; }

/* Hero */
.hero {
  color: #fff;
  background:
    radial-gradient(120% 140% at 100% 0%, rgb(45 212 191 / 45%) 0%, transparent 55%),
    radial-gradient(90% 120% at 0% 100%, rgb(236 72 153 / 35%) 0%, transparent 60%),
    linear-gradient(135deg, var(--hero-a), var(--hero-b) 60%, var(--hero-c));
  padding: calc(env(safe-area-inset-top) + 16px) 16px 60px;
}
.hero-inner { max-width: 640px; margin: 0 auto; padding: 0 4px; position: relative; }
.compact .hero { padding-bottom: 20px; }
.compact main { padding-top: 0; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { border-radius: 11px; box-shadow: 0 4px 14px rgb(0 0 0 / 30%); }
.brand h1 { margin: 0; font-size: 1.35rem; letter-spacing: -.01em; }
.brand p { margin: 0; opacity: .8; }
.live {
  display: inline-flex; align-items: center; gap: 8px;
  margin: 16px 0 0; padding: 5px 12px;
  border-radius: 999px; font-size: .85rem;
  background: rgb(255 255 255 / 14%);
  backdrop-filter: blur(6px);
}
.live .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 0 rgb(74 222 128 / 70%);
  animation: pulse 2s infinite;
}
.live.stale .dot { background: #fbbf24; animation: none; }
@keyframes pulse {
  70% { box-shadow: 0 0 0 8px rgb(74 222 128 / 0%); }
  100% { box-shadow: 0 0 0 0 rgb(74 222 128 / 0%); }
}
@media (prefers-reduced-motion: reduce) { .live .dot { animation: none; } }
.hero-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 14px 0 0; }
.hero-row .live { margin: 0; }
.stat {
  margin: 0; padding: 5px 12px; border-radius: 999px; font-size: .85rem;
  background: rgb(255 255 255 / 14%); backdrop-filter: blur(6px);
}
.stat strong { font-variant-numeric: tabular-nums; }

/* Cards */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px;
  box-shadow: var(--shadow);
}
.error {
  color: var(--error); margin: 12px 0 0; padding: 10px 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
}
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

button, select { font: inherit; }
button {
  border: 0; border-radius: 999px;
  padding: 11px 20px;
  background: var(--accent); color: var(--accent-text);
  font-weight: 650; cursor: pointer;
  transition: transform .1s ease, background .15s ease;
}
button:active { transform: scale(.97); }
button.secondary { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
button:disabled { opacity: .5; cursor: default; }
button:focus-visible, select:focus-visible, summary:focus-visible, input:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
select {
  appearance: none;
  padding: 7px 30px 7px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  color: var(--text);
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%238a879c' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 11px center,
    var(--bg);
}

/* Shortest chips */
.chips { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: flex; align-items: center; gap: 10px;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 8px 14px 8px 8px; box-shadow: var(--shadow);
}
.chip .badge { width: 44px; height: 44px; font-size: 1.05rem; border-radius: 12px; }
.badge.open { background: var(--short-bg); color: var(--short); font-size: .8rem; font-weight: 700; }
.chip span { font-weight: 600; white-space: nowrap; }

/* Ride lists */
.rides { list-style: none; margin: 0; padding: 0; background: var(--card); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; box-shadow: var(--shadow); }
.ride + .ride { border-top: 1px solid var(--line); }
.ride-main { display: flex; align-items: center; gap: 14px; padding: 12px 12px 12px 14px; min-height: 72px; }
.badge {
  flex: none; width: 54px; height: 54px; border-radius: 15px;
  display: grid; place-content: center; text-align: center; line-height: 1;
  font-weight: 750; font-size: 1.3rem; font-variant-numeric: tabular-nums;
}
.badge small { display: block; font-size: .7rem; font-weight: 600; letter-spacing: .04em; margin-top: 3px; opacity: .85; }
.badge.short { background: var(--short-bg); color: var(--short); }
.badge.mid { background: var(--mid-bg); color: var(--mid); }
.badge.long { background: var(--long-bg); color: var(--long); }
.badge.closed { background: var(--closed-bg); color: var(--closed); font-size: .72rem; font-weight: 650; letter-spacing: .03em; text-transform: uppercase; }
.ride-text { flex: 1; min-width: 0; }
.ride-name { font-weight: 620; overflow-wrap: anywhere; }
.ride-meta { font-size: .85rem; color: var(--muted); margin-top: 2px; display: flex; gap: 8px; flex-wrap: wrap; }
.trend { font-weight: 650; font-variant-numeric: tabular-nums; }
.trend.down { color: var(--down); }
.trend.up { color: var(--up); }
.spark-wrap { display: flex; align-items: flex-end; gap: 10px; padding: 0 14px 12px 82px; margin-top: -4px; }
.spark-wrap.pending { font-size: .78rem; color: var(--muted); }
.spark-plot { flex: 1; min-width: 0; display: grid; gap: 2px; }
.spark { width: 100%; height: 36px; overflow: visible; }
.spark-axis { display: flex; justify-content: space-between; font-size: .75rem; color: var(--muted); }
.spark .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.spark .area { fill: currentColor; opacity: .14; stroke: none; }
.spark.short { color: var(--short); }
.spark.mid { color: var(--mid); }
.spark.long { color: var(--long); }
.spark .gap { fill: var(--closed-bg); }
.spark .base { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.spark-range { display: grid; text-align: right; font-size: .75rem; line-height: 1.25; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.spark-range strong { font-size: .8rem; font-weight: 650; color: var(--text); }
.ride.closed .ride-name { color: var(--muted); }
.empty { color: var(--muted); text-align: center; padding: 24px 8px; }

footer { padding-top: 28px; padding-bottom: calc(env(safe-area-inset-bottom) + 32px); font-size: .85rem; color: var(--muted); text-align: center; }
footer p { margin: 4px 0; }
footer a { color: inherit; }

/* Status page */
.status { display: grid; gap: 14px; padding-top: 16px; }
.status h2 { display: flex; align-items: center; gap: 8px; }
.status h3 { margin: 16px 0 6px; font-size: .85rem; color: var(--muted); font-weight: 600; }
.status .muted { color: var(--muted); }
.pill { font-size: .75rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--closed-bg); color: var(--closed); }
.pill.ok { background: var(--short-bg); color: var(--short); }
.pill.bad { background: var(--long-bg); color: var(--long); }
.kv { display: grid; grid-template-columns: minmax(0, 11rem) minmax(0, 1fr); gap: 6px 12px; margin: 12px 0 0; font-size: .9rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.updates { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: .9rem; font-variant-numeric: tabular-nums; }
.updates th { text-align: left; color: var(--muted); font-weight: 600; font-size: .8rem; padding: 4px 6px 4px 0; border-bottom: 1px solid var(--line); }
.updates td { padding: 6px 6px 6px 0; border-bottom: 1px solid var(--line); }
.names { margin: 0; padding-left: 18px; font-size: .9rem; }
.names li.muted { list-style: none; margin-left: -18px; }

/* Visits page */
.visits { display: grid; gap: 14px; padding-top: 16px; }
.visits h2 { font-size: 1.05rem; }
.visits h3 { margin: 14px 4px 0; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.tile {
  display: grid; gap: 2px; padding: 14px 16px;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow);
}
.tile-label { font-size: .8rem; color: var(--muted); }
.tile strong { font-size: 1.35rem; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.tile-note { font-size: .8rem; color: var(--muted); }
.hbars { display: grid; gap: 8px; margin-top: 14px; }
.hbar { display: grid; grid-template-columns: minmax(0, 9rem) 1fr 2.2rem; align-items: center; gap: 10px; font-size: .9rem; border-radius: 6px; }
.hbar:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hbar-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { height: 14px; }
.hbar-fill { display: block; height: 100%; width: var(--w); min-width: 4px; background: var(--accent); border-radius: 0 4px 4px 0; }
.hbar:hover .hbar-fill { background: var(--accent-strong); }
.hbar-value { text-align: right; font-variant-numeric: tabular-nums; font-weight: 650; }
.vbars { display: flex; align-items: flex-end; gap: 2px; height: 150px; margin-top: 14px; overflow-x: auto; }
.vbar {
  flex: 1 0 28px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 2px;
  color: inherit; text-decoration: none; font-size: .72rem; font-variant-numeric: tabular-nums;
}
.vbar-fill { width: 70%; max-width: 32px; height: calc(var(--h) * .72); min-height: 2px; background: var(--accent); border-radius: 4px 4px 0 0; }
.vbar:hover .vbar-fill, .vbar:focus-visible .vbar-fill { background: var(--accent-strong); }
.vbar-label { color: var(--muted); white-space: nowrap; border-top: 1px solid var(--line); width: 100%; text-align: center; padding-top: 3px; }
.visit-list { display: grid; gap: 10px; }
.visit summary { cursor: pointer; display: grid; gap: 2px; list-style: none; }
.visit summary::-webkit-details-marker { display: none; }
.visit summary::after { content: "Show"; justify-self: start; font-size: .8rem; color: var(--accent-strong); margin-top: 4px; }
.visit[open] summary::after { content: "Hide"; }
.visit-day { font-weight: 650; }
.visit-meta { font-size: .88rem; color: var(--muted); }
.visit h4 { margin: 18px 0 6px; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.visit .num { text-align: right; }
.visit td.up { color: var(--up); }
.visit td.down { color: var(--down); }
.waits { list-style: none; margin: 0; padding: 0; }
.waits li { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.waits li:first-child { border-top: 0; }
.waits .badge { width: 46px; height: 46px; font-size: 1.05rem; border-radius: 12px; }
.waits .ride-text { display: grid; }
.waits li.ridden .ride-name::after { content: " · ridden"; font-weight: 500; font-size: .8rem; color: var(--accent-strong); }
.waits .spark { flex: none; width: 110px; height: 32px; }
.spark .rode { stroke: var(--text); stroke-width: 1; opacity: .45; vector-effect: non-scaling-stroke; }
@media (max-width: 420px) { .waits .spark { width: 72px; } .hbar { grid-template-columns: minmax(0, 7rem) 1fr 2rem; } }
.apple-button { min-height: 40px; margin-top: 12px; }

/* Opening hours */
.hours-list { list-style: none; margin: 0; padding: 0; background: var(--card); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; box-shadow: var(--shadow); }
.hours-list li { display: flex; justify-content: space-between; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--line); }
.hours-list li:first-child { border-top: 0; }
.hours-list .day { font-weight: 600; }
.hours-list .when { color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; display: flex; flex-direction: column; }
.hours-list .when small { font-size: 0.8rem; color: var(--muted); }
.hours-list .today .when { color: inherit; }

/* Marketing site */
.site-nav { display: flex; align-items: center; gap: 20px; }
.site-nav .brand { margin-right: auto; color: inherit; text-decoration: none; font-weight: 700; font-size: 1.1rem; }
.site-nav .brand img { width: 32px; height: 32px; border-radius: 9px; }
.site-nav a { color: inherit; text-decoration: none; font-weight: 600; }
.site-nav a:hover { text-decoration: underline; }
.page-title { margin: 28px 0 0; font-size: 1.6rem; letter-spacing: -.01em; }
.page-title.big { font-size: 2.3rem; line-height: 1.1; }
.lede { margin: 10px 0 0; max-width: 34em; opacity: .9; font-size: 1.05rem; }
.hero .actions { margin-top: 22px; }
.compact .hero .page-title { margin-top: 20px; }
a.button, span.button {
  display: inline-block; padding: 11px 20px; border-radius: 999px;
  background: var(--accent); color: var(--accent-text);
  font-weight: 650; text-decoration: none;
}
a.button:hover { background: var(--accent-strong); }
a.button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hero a.button, .hero span.button { background: #fff; color: #17152b; }
.hero a.button:hover { background: #e9e6fb; }
.button.soon { background: rgb(255 255 255 / 18%); color: #fff; box-shadow: inset 0 0 0 1px rgb(255 255 255 / 35%); }
.card span.button.soon { background: var(--closed-bg); color: var(--muted); box-shadow: none; }
.button.secondary { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
a.button.secondary:hover { background: var(--closed-bg); }
.hero a.button.ghost { background: transparent; color: #fff; box-shadow: inset 0 0 0 1px rgb(255 255 255 / 45%); }
.hero a.button.ghost:hover { background: rgb(255 255 255 / 14%); }
main > section { margin-top: 8px; }
.board-status { margin: 18px 0 0; }
.board-status .live, .board-status .stat { background: var(--card); border: 1px solid var(--line); backdrop-filter: none; }
.board-status .live { padding: 5px 12px; }
.cta { margin-top: 28px; }
.cta h2, .faq h2, .features h2 { font-size: 1.05rem; }
.cta p { margin: 8px 0 0; }
.steps { margin: 0; padding: 18px 18px 18px 40px; display: grid; gap: 12px; }
.features { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.features p { margin: 6px 0 0; color: var(--muted); }
.faq .card h2:not(:first-child) { margin-top: 18px; }
.faq .card p { margin: 6px 0 0; }
.park-links { list-style: none; margin: 0; padding: 4px 18px; }
.park-links li { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.park-links li:first-child { border-top: 0; }
.park-links a { font-weight: 600; color: inherit; }
main a, footer a { text-underline-offset: 2px; }

/* Admin */
.admin main, .admin .hero-inner { max-width: 1040px; }
.admin-nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 4px; }
.admin .status > * { min-width: 0; }
.admin .status > p:first-child { margin: 0; }
.scroll { overflow-x: auto; }
.override { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.override input {
  font: inherit; font-size: .9rem; min-width: 8rem; flex: 1;
  padding: 6px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text);
}
.override button { padding: 6px 12px; font-size: .85rem; }
.ride-list { list-style: none; margin: 8px 0 0; padding: 0; }
.ride-list li { padding: 12px 0; border-top: 1px solid var(--line); display: grid; gap: 6px; }
.ride-list li:first-child { border-top: 0; }
.ride-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pill.chosen { background: var(--mid-bg); color: var(--mid); }
.ride-list details summary, .card details summary { cursor: pointer; color: var(--muted); font-size: .88rem; }
.ride-list details .override { margin-top: 8px; }
.admin .card > p:first-child { margin-top: 0; }
