:root {
  --bg: #0E1217;
  --surface: #171C22;
  --surface-2: #1F262E;
  --line: #29313B;
  --text: #E7ECF1;
  --muted: #8A94A3;
  --faint: #5A6472;
  --accent: #FFD60A;            /* set per-status from JS */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --radius: 20px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}

body {
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  padding: env(safe-area-inset-top) 16px env(safe-area-inset-bottom);
}

.app {
  width: 100%;
  max-width: 520px;
  padding: 22px 0 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ---- top bar ---- */
.topbar { display: flex; align-items: flex-start; justify-content: space-between; }
.place-name { display: block; font-size: 19px; font-weight: 650; letter-spacing: -0.01em; }
.place-sub { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }
.live { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); }
.live .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #32D74B; box-shadow: 0 0 0 0 rgba(50,215,75,.6);
  animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(50,215,75,.5); }
  70% { box-shadow: 0 0 0 7px rgba(50,215,75,0); }
  100% { box-shadow: 0 0 0 0 rgba(50,215,75,0); }
}

/* ---- location pills ---- */
.pills {
  display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px;
  scrollbar-width: none; -ms-overflow-style: none;
}
.pills::-webkit-scrollbar { display: none; }
.pill {
  flex: 0 0 auto; border: 1px solid var(--line); background: var(--surface);
  color: var(--muted); font-size: 13.5px; font-weight: 550;
  padding: 8px 14px; border-radius: 999px; cursor: pointer;
  white-space: nowrap; transition: color .15s, border-color .15s, background .15s;
}
.pill:hover { color: var(--text); }
.pill[aria-selected="true"] {
  color: #0E1217; background: var(--text); border-color: var(--text);
}

/* ---- hero gauge ---- */
.hero { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 6px 0 2px; }
.gauge { position: relative; width: 240px; height: 240px; }
.gauge-svg { width: 100%; height: 100%; transform: rotate(135deg); }
.gauge-svg circle { fill: none; stroke-width: 11; stroke-linecap: round; }
.track { stroke: var(--surface-2); stroke-dasharray: 254.5 339.3; }
.value {
  stroke: var(--accent); stroke-dasharray: 0 339.3;
  transition: stroke-dasharray .7s cubic-bezier(.22,.61,.36,1), stroke .5s;
  filter: drop-shadow(0 0 6px color-mix(in srgb, var(--accent) 45%, transparent));
}
.gauge-center {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2px;
}
.count { font-size: 66px; font-weight: 700; letter-spacing: -0.03em; line-height: 1; }
.count-label { font-size: 13px; color: var(--muted); }

.status-line { display: flex; align-items: center; gap: 10px; font-size: 17px; }
.status { font-weight: 650; color: var(--accent); }
.trend { color: var(--muted); font-size: 15px; }
.pct { color: var(--muted); font-size: 15px; }
.today-hours { font-size: 13px; color: var(--faint); margin-top: 2px; }

/* closed state on the gauge */
.count.closed { font-size: 34px; font-weight: 620; color: var(--muted); letter-spacing: -0.01em; }
.status.closed-status { color: var(--muted); }

/* greyed closed spans on the chart */
.closed-region { fill: var(--surface-2); opacity: .5; }

/* ---- curve card ---- */
.curve-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 16px 18px;
}
.readout { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; min-height: 24px; }
.readout-time { font-size: 15px; font-weight: 650; }
.readout-body { font-size: 14px; color: var(--muted); }

.chart-wrap { position: relative; }
.chart { width: 100%; height: 148px; display: block; touch-action: none; cursor: crosshair; }
.area { fill: url(#areaFill); stroke: none; }
.line { fill: none; stroke: var(--accent); stroke-width: 2; vector-effect: non-scaling-stroke; }
.actual-line { fill: none; stroke: var(--text); stroke-width: 2.5; vector-effect: non-scaling-stroke; opacity: .9; }
.now-line { stroke: var(--faint); stroke-width: 1; stroke-dasharray: 2 3; vector-effect: non-scaling-stroke; }
.scrub-line { stroke: var(--text); stroke-width: 1; opacity: .55; vector-effect: non-scaling-stroke; }
.scrub-dot { fill: var(--accent); stroke: var(--bg); stroke-width: 2; }

.axis { display: flex; justify-content: space-between; margin-top: 6px; font-size: 11.5px; color: var(--faint); }

.quiet { margin-top: 14px; font-size: 13.5px; color: var(--muted); line-height: 1.45; }

/* ---- footer ---- */
.foot { text-align: center; font-size: 12px; color: var(--faint); line-height: 1.5; }

.loading { opacity: .5; }

@media (prefers-reduced-motion: reduce) {
  .value { transition: none; }
  .live .dot { animation: none; }
}
