:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #172033;
  background: #f4f7fb;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --border: #dbe2ec;
  --muted: #5b667a;
  --accent: #0969da;
}

* { box-sizing: border-box; }

body { margin: 0; }

main {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0 28px;
}

.page-header { margin-bottom: 28px; }
.page-header h1 { margin: 4px 0 10px; font-size: clamp(2rem, 5vw, 3rem); letter-spacing: -0.04em; }
.page-header p { max-width: 720px; color: var(--muted); line-height: 1.6; }
.page-header .eyebrow { margin: 0; color: var(--accent); font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }

.controls, .chart-section {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 4px 18px rgb(23 32 51 / 4%);
}

.controls { display: grid; gap: 20px; padding: 20px; margin-bottom: 24px; }
.range-presets, .date-range, .project-toggles { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
button, input {
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #fff;
  color: inherit;
  font: inherit;
}
button { padding: 7px 13px; cursor: pointer; }
button:hover, button.selected { border-color: var(--accent); color: var(--accent); }
button:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.date-range { gap: 12px; }
.date-range label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .9rem; }
input { padding: 6px 9px; }
.scale-toggle { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); }
.scale-toggle input { min-height: auto; accent-color: var(--accent); }
fieldset { padding: 0; border: 0; }
legend { margin-bottom: 10px; font-weight: 650; }
.project-toggles label { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border: 1px solid var(--border); border-radius: 7px; }
.project-toggles input { min-height: auto; accent-color: var(--accent); }

.status { min-height: 1.4em; color: var(--muted); }
.error { padding: 12px; border: 1px solid #ffb4b4; border-radius: 8px; background: #fff3f3; color: #a10e0e; }
.chart-section { padding: 20px; margin: 20px 0; }
.chart-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.chart-heading h2 { margin: 0; font-size: 1.25rem; }
.chart-heading p { margin: 5px 0 0; color: var(--muted); font-size: .9rem; }
.chart-heading .scale-note { font-size: .8rem; }
.chart-wrap { position: relative; height: min(52vw, 400px); min-height: 250px; margin-top: 14px; }
footer { padding: 8px 0; color: var(--muted); font-size: .9rem; line-height: 1.5; }
a { color: var(--accent); }

@media (max-width: 640px) {
  main { padding-top: 28px; }
  .controls, .chart-section { padding: 15px; }
  .chart-heading { align-items: flex-start; }
  .date-range { align-items: flex-start; }
  .date-range label { width: 100%; justify-content: space-between; }
  .chart-wrap { height: 300px; }
}
