:root {
  --bg: #fbf8f4;
  --panel: #ffffff;
  --border: #e6e1da;
  --text: #1f1d1a;
  --muted: #6b665f;
  --grid: #ece7e0;
  --series-0: #1f4e9c;
  --series-1: #6b3fa0;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141312;
    --panel: #1c1b19;
    --border: #2e2c29;
    --text: #ece8e2;
    --muted: #9c968d;
    --grid: #2a2825;
    --series-0: #7aa7f0;
    --series-1: #b692e6;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 16px;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.4 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 16px;
  max-width: 1200px;
  margin: 0 auto 16px;
}

h1 { font-size: 18px; font-weight: 600; margin: 0; }

nav { display: flex; gap: 4px; }
nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
}
nav a[aria-current='page'] { color: var(--text); background: var(--panel); font-weight: 600; }

main { display: grid; gap: 16px; max-width: 1200px; margin: 0 auto; }

section {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 12px 4px;
}
section h2 { font-size: 14px; font-weight: 600; margin: 0 0 4px; }
section .now { color: var(--muted); font-size: 12px; margin: 0 0 4px; }

svg { display: block; width: 100%; height: auto; overflow: visible; }
svg text { fill: var(--muted); font-size: 11px; }
svg .grid { stroke: var(--grid); }
svg .axis { stroke: var(--border); }
svg .line { fill: none; stroke-width: 2; stroke-linejoin: round; }
svg .s0 { stroke: var(--series-0); }
svg .s1 { stroke: var(--series-1); }

/* Hover and keyboard readout. touch-action keeps vertical page scroll working on a
   phone while a tap still reads a value. */
svg { touch-action: pan-y; cursor: crosshair; }
svg:focus { outline: none; }
svg:focus-visible { outline: 2px solid var(--series-0); outline-offset: 4px; border-radius: 4px; }
svg .cross line { stroke: var(--muted); stroke-width: 1; }
/* Surface ring so the marker reads on top of the line. */
svg .cross circle { stroke: var(--panel); stroke-width: 2; }
svg .cross circle.s0 { fill: var(--series-0); }
svg .cross circle.s1 { fill: var(--series-1); }

.tip {
  position: absolute;
  transform: translate(-50%, -100%);
  pointer-events: none;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 8px;
  box-shadow: 0 2px 8px rgb(0 0 0 / 0.12);
  white-space: nowrap;
  font-size: 12px;
  line-height: 1.3;
  text-align: center;
}
.tip strong { display: block; font-size: 14px; color: var(--text); font-variant-numeric: tabular-nums; }
.tip span { color: var(--muted); }

.empty { color: var(--muted); padding: 40px 0; text-align: center; }

footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 16px;
  max-width: 1200px;
  margin: 16px auto 0;
  color: var(--muted);
  font-size: 12px;
}
