/* Chart tokens: categorical slots 1-2, blue sequential ramp, surfaces. */
:root {
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-neutral: #8f8e8a;
  --grid: rgba(11, 11, 11, 0.08);
  --text-secondary: #52514e;
  --cell-empty: #efeeeb;
  --surface-gap: #ffffff;
  --tooltip-bg: #1a1a19;
  --tooltip-fg: #f0efec;
  --ramp: #cde2fb, #9ec5f4, #6da7ec, #3987e5, #256abf, #184f95, #0d366b;
  --status-full: #cf2f2f;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --series-1: #3987e5;
    --series-2: #d95926;
    --series-neutral: #8a8984;
    --grid: rgba(240, 239, 236, 0.10);
    --text-secondary: #c3c2b7;
    --cell-empty: #262624;
    --surface-gap: #14161a;
    --tooltip-bg: #f0efec;
    --tooltip-fg: #1a1a19;
    --status-full: #e5484d;
  }
}
:root[data-theme="dark"] {
  --series-1: #3987e5;
  --series-2: #d95926;
  --series-neutral: #8a8984;
  --grid: rgba(240, 239, 236, 0.10);
  --text-secondary: #c3c2b7;
  --cell-empty: #262624;
  --surface-gap: #14161a;
  --tooltip-bg: #f0efec;
  --tooltip-fg: #1a1a19;
  --status-full: #e5484d;
}

.tabular { font-variant-numeric: tabular-nums; }
.status-table td { vertical-align: middle; }
.filters .control { margin-bottom: 0.25rem; }

/* Best days meters */
.day-row { display: grid; grid-template-columns: 6.5rem 1fr 3.5rem; align-items: center; gap: 0.75rem; margin-bottom: 0.4rem; }
.day-row .meter { height: 0.75rem; background: var(--cell-empty); border-radius: 4px; overflow: hidden; }
.day-row .meter > span { display: block; height: 100%; background: var(--series-1); border-radius: 0 4px 4px 0; }
.day-row .value { text-align: right; font-variant-numeric: tabular-nums; }
.day-row.is-best .day { font-weight: 700; }
.day-row .day small { color: var(--text-secondary); }

/* Station x weekday matrix */
.station-matrix th, .station-matrix td { text-align: center; font-variant-numeric: tabular-nums; white-space: nowrap; }
.station-matrix th:first-child, .station-matrix td:first-child { text-align: left; }
.station-matrix td.cell { border: 2px solid var(--surface-gap); border-radius: 4px; }

/* Heatmap */
.heatmap-scroll { overflow-x: auto; }
.heatmap { display: grid; grid-template-columns: 5.5rem repeat(48, minmax(12px, 1fr)); gap: 2px; min-width: 640px; font-size: 0.75rem; }
.heatmap .row-label { color: var(--text-secondary); align-self: center; padding-right: 0.5rem; }
.heatmap .col-label { color: var(--text-secondary); grid-column: span 4; text-align: left; padding-top: 2px; }
.heatmap .cell { height: 1.6rem; border-radius: 3px; background: var(--cell-empty); cursor: default; }
.heatmap .cell.is-target { outline: 2px solid var(--tooltip-bg); outline-offset: -2px; }
.heatmap .cell:hover { outline: 2px solid var(--text-secondary); outline-offset: -2px; }
.heatmap-legend { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.75rem; font-size: 0.75rem; color: var(--text-secondary); flex-wrap: wrap; }
.heatmap-legend .ramp { width: 10rem; height: 0.6rem; border-radius: 3px; background: linear-gradient(to right, var(--ramp)); }
.heatmap-legend .swatch { display: inline-block; width: 0.8rem; height: 0.8rem; border-radius: 2px; vertical-align: middle; }
.heatmap-legend .swatch.empty { background: var(--cell-empty); }
.heatmap-legend .swatch.full { background: var(--status-full); }
.day-row .meter > span.is-full { background: var(--status-full); }

/* Charts */
.chart-box { height: 100%; }
.chart-wrap { position: relative; height: 280px; }

.viz-tooltip {
  position: fixed; z-index: 50; pointer-events: none; max-width: 16rem;
  background: var(--tooltip-bg); color: var(--tooltip-fg);
  padding: 0.4rem 0.6rem; border-radius: 6px; font-size: 0.8rem; line-height: 1.35;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}
/* Bulma colors <strong> with its text token: keep the tooltip's own ink instead. */
.viz-tooltip strong, .viz-tooltip small { color: inherit; }
.viz-tooltip small { opacity: 0.8; }

/* Station history */
.station-row { cursor: pointer; }
.station-row:focus-visible { outline: 2px solid var(--series-1); outline-offset: -2px; }
.history-card { width: min(960px, calc(100vw - 32px)); }
.history-wrap { height: 320px; }

/* Station groups in the "now" table */
.status-table .group-row th { padding-top: 0.9rem; border-bottom-width: 1px; font-size: 0.9rem; }
.status-table tbody:first-of-type .group-row th { padding-top: 0.4rem; }
