:root {
  /* Always dark, like the app. Chart series is a darker lime that keeps marks readable on the dark surface. */
  color-scheme: dark;
  --page: #0e0f11;
  --surface-1: #17191c;
  --text-primary: #f2f3f5;
  --text-secondary: #a3a8b0;
  --muted: #898781;
  --grid: #2a2d33;
  --axis: #3a3e45;
  --border: rgba(255, 255, 255, 0.08);
  --series-1: #749f1c;
  --accent: #c8f03c;
  --on-accent: #10130a;
  --critical: #ff6b6b;
  --good-text: #c8f03c;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--page);
  color: var(--text-primary);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;
}
a { color: var(--accent); }
main { max-width: 760px; margin: 0 auto; padding: 16px; }
h1 { font-size: 1.6rem; margin: 8px 0 16px; letter-spacing: -0.01em; }
h2 { font-size: 1.15rem; margin: 24px 0 8px; }
.muted { color: var(--text-secondary); }
.small { font-size: 0.875rem; }

nav.top { background: var(--surface-1); border-bottom: 1px solid var(--border); }
nav.top div { max-width: 760px; margin: 0 auto; padding: 0 8px; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
nav.top a { white-space: nowrap; padding: 12px 10px; text-decoration: none; color: var(--text-secondary); }
nav.top a.on { color: var(--text-primary); font-weight: 600; box-shadow: inset 0 -2px var(--accent); }

.card { background: var(--surface-1); border: 1px solid var(--border); border-radius: 12px; padding: 12px 16px; margin: 8px 0; }
.card h3 { font-size: 1rem; margin: 0 0 6px; display: flex; justify-content: space-between; gap: 8px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.spread { justify-content: space-between; }

button, .button {
  font: inherit; border-radius: 999px; border: 1px solid var(--border); padding: 8px 16px;
  background: var(--surface-1); color: var(--text-primary); cursor: pointer; text-decoration: none; display: inline-block;
}
button.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
button.danger { color: var(--critical); }
button.link { border: 0; background: none; padding: 2px 6px; color: var(--muted); }
form.inline { display: inline; }
textarea, input[type=password], input[type=text] {
  font: inherit; width: 100%; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--axis); background: var(--surface-1); color: var(--text-primary);
}

ul.sets { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
ul.sets li { border-radius: 8px; padding: 2px 4px 2px 10px; background: var(--page); border: 1px solid var(--border); font-variant-numeric: tabular-nums; }
ul.sets li.planned { color: var(--muted); border-style: dashed; }
.replies { margin: 8px 0; padding: 0; list-style: none; }
.replies li.ok { color: var(--good-text); }
.replies li.bad { color: var(--critical); }

table { border-collapse: collapse; width: 100%; background: var(--surface-1); border-radius: 12px; overflow: hidden; }
th, td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--grid); }
th { color: var(--text-secondary); font-weight: 500; font-size: 0.875rem; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.tile { background: var(--surface-1); border: 1px solid var(--border); border-radius: 12px; padding: 12px 16px; }
.tile .label { color: var(--text-secondary); font-size: 0.875rem; }
.tile .value { font-size: 1.75rem; font-weight: 600; }

.chart-card { background: var(--surface-1); border: 1px solid var(--border); border-radius: 12px; padding: 12px; position: relative; }
svg.chart { width: 100%; max-width: 520px; height: auto; display: block; overflow: visible; }
svg.chart text { font-size: 13px; }
svg.chart text.axis { fill: var(--muted); font-variant-numeric: tabular-nums; }
svg.chart text.value { fill: var(--text-secondary); font-variant-numeric: tabular-nums; }
svg.chart text.label { fill: var(--text-primary); font-size: 14px; }
.gridline { stroke: var(--grid); stroke-width: 1; }
.baseline { stroke: var(--axis); stroke-width: 1; }
.series-line { fill: none; stroke: var(--series-1); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.series-dot { fill: var(--series-1); stroke: var(--surface-1); stroke-width: 2; }
.series-dot.on { r: 6; }
.series-bar { fill: var(--series-1); }
.hit-area { fill: transparent; }
.hit { outline: none; }
.hit:hover .series-bar, .hit:focus .series-bar { opacity: 0.75; }
.hit:focus-visible .hit-area { stroke: var(--axis); }
.crosshair { stroke: var(--axis); stroke-width: 1; visibility: hidden; }
.tooltip {
  position: absolute; pointer-events: none; background: var(--surface-1); border: 1px solid var(--border);
  border-radius: 8px; padding: 6px 10px; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12); font-size: 0.875rem; white-space: nowrap;
}
.tooltip strong { display: block; font-size: 1rem; }
.tooltip span { color: var(--text-secondary); }
details summary { cursor: pointer; color: var(--text-secondary); margin: 8px 0; }
.catalog li { margin: 4px 0; }
.lifts { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; }
.lifts span:last-child { text-align: right; }
a.primary-link { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
