:root,
html[data-theme="light"] {
  --bg: #f6f7fb;
  --panel: #ffffff;
  --panel-2: #f9fafc;
  --ink: #12161f;
  --muted: #5c657a;
  --line: #e3e7ef;
  --accent: #0b5cff;
  --actual: #111827;
  --band: rgba(11, 92, 255, 0.14);
  --grid: #eef1f6;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 8px 24px rgba(16, 24, 40, 0.06);
  --radius: 14px;
  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: #0c0f16;
  --panel: #121722;
  --panel-2: #171d2a;
  --ink: #e8ecf5;
  --muted: #98a2b8;
  --line: #232a38;
  --accent: #6d9bff;
  --actual: #e8ecf5;
  --band: rgba(109, 155, 255, 0.2);
  --grid: #1b2130;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 12px 32px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c0f16;
    --panel: #121722;
    --panel-2: #171d2a;
    --ink: #e8ecf5;
    --muted: #98a2b8;
    --line: #232a38;
    --accent: #6d9bff;
    --actual: #e8ecf5;
    --band: rgba(109, 155, 255, 0.2);
    --grid: #1b2130;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 12px 32px rgba(0, 0, 0, 0.35);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }

header.site {
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}

header.site .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
}

.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }

.brand svg { width: 34px; height: 34px; fill: var(--accent); flex: none; }
.brand svg path { stroke: #fff; fill: none; }

.brand h1 { margin: 0; font-size: 18px; letter-spacing: -0.01em; white-space: nowrap; }
.brand h1 span { color: var(--accent); }
.brand p { margin: 2px 0 0; color: var(--muted); font-size: 12.5px; }

.head-right { display: flex; align-items: center; gap: 10px; min-width: 0; }

.issue {
  display: flex; align-items: center; gap: 8px;
  color: var(--muted); font-size: 13px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.issue .dot {
  width: 8px; height: 8px; border-radius: 50%; flex: none;
  background: #22c55e; box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.15);
}

.theme {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; padding: 0; flex: none;
  border: 1px solid var(--line); border-radius: 9px;
  background: var(--panel); color: var(--muted); cursor: pointer;
}
.theme:hover { color: var(--ink); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.theme svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
html[data-theme="light"] .theme svg { transform: rotate(0deg); }

main { padding: 24px 0 36px; display: grid; gap: 16px; }

.intro p { margin: 0; color: var(--muted); font-size: 15px; }
.intro strong { color: var(--ink); }

.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card-head h2 { margin: 0; font-size: 15px; letter-spacing: 0.01em; }

.overview, .day, .error {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.overview { padding: 16px 16px 8px; }

.legend { display: flex; gap: 14px; color: var(--muted); font-size: 12px; flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.sw.actual { background: var(--actual); height: 3px; border-radius: 2px; }
.sw.band { background: var(--band); }
.sw.median { background: var(--accent); height: 3px; border-radius: 2px; }

.chart { position: relative; }
.chart svg { display: block; width: 100%; }
.axis-note { color: var(--muted); font-size: 11.5px; padding: 2px 0 6px; }

.tip {
  position: absolute; z-index: 3; pointer-events: none;
  min-width: 118px; padding: 7px 9px;
  background: var(--panel-2); color: var(--ink);
  border: 1px solid var(--line); border-radius: 9px;
  box-shadow: var(--shadow);
  font-size: 12px; line-height: 1.45;
  opacity: 0; transition: opacity 90ms ease;
}
.tip.on { opacity: 1; }
.tip .h { color: var(--muted); font-size: 11px; margin-bottom: 2px; white-space: nowrap; }
.tip .r { display: flex; justify-content: space-between; gap: 10px; font-variant-numeric: tabular-nums; }
.tip .r b { font-weight: 600; }
.tip .r.pub b { color: var(--actual); }
.tip .r.med b { color: var(--accent); }

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(158px, 1fr));
  gap: 10px;
}

.stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 13px;
  box-shadow: var(--shadow);
}
.stat .k { color: var(--muted); font-size: 12px; }
.stat .v { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat .s { color: var(--muted); font-size: 12px; margin-top: 2px; }

.days {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 12px;
}

.day { padding: 13px 13px 6px; }
.day .top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.day h3 { margin: 0; font-size: 15px; }
.day .date { color: var(--muted); font-size: 12.5px; }
.day .tag {
  font-size: 11px; font-weight: 600; letter-spacing: 0.02em;
  padding: 3px 7px; border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
}
.day.actual .tag {
  background: color-mix(in srgb, var(--ink) 10%, transparent);
  color: var(--ink);
}
.day .vals { display: flex; gap: 12px; color: var(--muted); font-size: 12.5px; margin: 3px 0 2px; flex-wrap: wrap; }
.day .vals b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }

.note p { color: var(--muted); font-size: 13px; margin: 0; max-width: 82ch; }
.note strong { color: var(--ink); }

.error { padding: 20px; }
.error h2 { margin: 0 0 6px; font-size: 16px; }
.error p { margin: 0; color: var(--muted); }

footer.site { border-top: 1px solid var(--line); padding: 16px 0 36px; color: var(--muted); font-size: 12.5px; }
footer.site .wrap { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

@media (max-width: 640px) {
  .brand p { display: none; }
  .brand h1 { font-size: 16px; }
  .issue { font-size: 12px; }
  main { padding-top: 16px; }
  .days { grid-template-columns: 1fr; }
  .overview { padding: 14px 12px 4px; }
}

@media (max-width: 420px) {
  .issue { display: none; }
}
