:root {
  color-scheme: light;
  --ink: #15231f;
  --muted: #5d6c67;
  --paper: #f4f1e9;
  --surface: #fffdf8;
  --line: #d8d5ca;
  --accent: #f2c84b;
  --green: #0b7255;
  --red: #b5493f;
  --blue: #276b86;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); }
.shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 48px 0 72px; }
.hero { display: flex; justify-content: space-between; gap: 32px; align-items: flex-start; margin-bottom: 32px; }
h1, h2, h3, p { margin-top: 0; }
h1 { max-width: 780px; margin-bottom: 10px; font-size: clamp(2.4rem, 5vw, 4.8rem); line-height: .95; letter-spacing: -.055em; }
h2 { margin-bottom: 18px; font-size: 1.55rem; letter-spacing: -.025em; }
h3 { margin-bottom: 12px; font-size: .95rem; color: var(--muted); }
.lede { max-width: 640px; color: var(--muted); font-size: 1.05rem; }
.eyebrow { margin-bottom: 8px; color: var(--green); font-size: .74rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.badges { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.badge { display: inline-flex; padding: 8px 12px; border: 1px solid var(--ink); border-radius: 999px; font-size: .78rem; font-weight: 800; white-space: nowrap; }
.badge.synthetic { background: var(--accent); }
.badge.status { background: var(--surface); }
.period-panel, .panel, .chart-panel, .quality-panel, .error-state { border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: 0 10px 30px rgb(21 35 31 / 5%); }
.period-panel { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; padding: 20px; margin-bottom: 48px; }
.period-panel > div span { display: block; margin-bottom: 6px; color: var(--muted); font-size: .76rem; }
.period-panel form { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 10px; align-items: end; padding-top: 16px; border-top: 1px solid var(--line); }
label { display: grid; gap: 5px; color: var(--muted); font-size: .76rem; }
input, select, button, .button { min-height: 40px; border: 1px solid var(--line); border-radius: 9px; background: white; color: var(--ink); font: inherit; padding: 8px 11px; }
button, .button { border-color: var(--ink); background: var(--ink); color: white; cursor: pointer; font-weight: 750; text-decoration: none; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.section-heading { margin: 42px 0 18px; }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.kpi-card { min-height: 150px; padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.kpi-value { margin: 0; font-size: clamp(1.7rem, 3vw, 2.45rem); font-weight: 780; letter-spacing: -.045em; }
.card-note { margin-top: 10px; color: var(--red); font-size: .82rem; }
.chart-panel { padding: 22px; margin-top: 18px; overflow: hidden; }
.chart-panel .section-heading { margin-top: 0; }
.daily-chart { width: 100%; height: auto; overflow: visible; }
.axis { stroke: #aab2ae; stroke-width: 1; }
.line { fill: none; stroke-width: 4; stroke-linejoin: round; stroke-linecap: round; }
.line.cost { stroke: var(--blue); }
.line.conversions { stroke: var(--green); }
.chart-label { fill: var(--muted); font-size: 11px; text-anchor: middle; }
.legend { display: flex; gap: 18px; margin-top: 8px; color: var(--muted); font-size: .8rem; }
.legend span { display: flex; gap: 7px; align-items: center; }
.swatch { width: 22px; height: 3px; display: inline-block; }
.swatch.cost { background: var(--blue); }
.swatch.conversions { background: var(--green); }
.split-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 18px; }
.panel { padding: 22px; margin-top: 18px; }
ol, ul { margin: 0; padding-left: 22px; }
.ranked-item { padding: 10px 0; }
.ranked-item strong, .ranked-item span { display: block; }
.ranked-item span { margin-top: 4px; color: var(--muted); font-size: .83rem; }
.empty-state { color: var(--muted); }
.quality-panel { display: grid; grid-template-columns: .7fr 1.3fr; gap: 28px; margin-top: 18px; padding: 22px; border-left: 5px solid var(--accent); }
.quality-panel li { margin-bottom: 8px; }
.recommendations { display: grid; gap: 12px; }
.recommendation { display: grid; grid-template-columns: 42px 1fr; gap: 14px; padding: 20px; border-top: 1px solid var(--line); }
.priority { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 50%; background: var(--accent); font-weight: 850; }
.recommendation p { margin-bottom: 8px; color: var(--muted); }
.evidence-links a { color: var(--green); font-weight: 750; }
.evidence { margin-top: 32px; padding-top: 18px; border-top: 1px solid var(--line); }
.evidence summary { cursor: pointer; font-weight: 750; }
.evidence-list { margin-top: 14px; }
.evidence-list li { margin-bottom: 7px; scroll-margin-top: 20px; }
footer { padding: 24px 20px 44px; border-top: 1px solid var(--line); color: var(--muted); text-align: center; font-size: .78rem; }
footer p { margin-bottom: 5px; }
footer code { word-break: break-all; }
.error-shell { min-height: 70vh; }
.error-state { max-width: 720px; padding: 34px; margin-top: 26px; }
.error-state h1 { font-size: clamp(2rem, 4vw, 3.4rem); }
.error-state .button { display: inline-flex; align-items: center; margin-top: 14px; }

@media (max-width: 760px) {
  .shell { width: min(100% - 24px, 1180px); padding-top: 24px; }
  .hero, .quality-panel { display: block; }
  .badges { justify-content: flex-start; margin-top: 18px; }
  .period-panel, .split-grid { grid-template-columns: 1fr; }
  .period-panel form { grid-column: 1; }
  .quality-panel ul { margin-top: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
}
