:root { color-scheme: light; --bg1:#dbeafe; --bg2:#f5d0fe; --bg3:#fef3c7;
      --surface:rgba(255,255,255,.75); --text:#172033; --muted:#5b6475; --line:rgba(255,255,255,.72);
      --accent:#6d28d9; --accent2:#0284c7; --shadow:0 18px 50px rgba(51,37,91,.14); }
    :root[data-theme="dark"] { color-scheme:dark; --bg1:#0f172a; --bg2:#2e1065; --bg3:#172554;
      --surface:rgba(15,23,42,.76); --text:#f8fafc; --muted:#bac4d5; --line:rgba(255,255,255,.12);
      --accent:#c4b5fd; --accent2:#7dd3fc; --shadow:0 20px 55px rgba(0,0,0,.35); }
    * { box-sizing:border-box; }
    body { margin:0; min-height:100vh; color:var(--text); font:16px/1.5 system-ui,-apple-system,"Segoe UI",sans-serif;
      background:linear-gradient(135deg,var(--bg1),var(--bg2) 52%,var(--bg3)); background-attachment:fixed; }
    .page { width:min(calc(100% - 32px),calc(50% + 590px)); margin:auto; padding:54px 0 72px; }
    header { display:flex; align-items:flex-start; justify-content:space-between; gap:24px; margin-bottom:26px; }
    h1 { margin:0; font-size:clamp(2rem,5vw,3.7rem); line-height:1; letter-spacing:-.055em; }
    .subtitle { color:var(--muted); margin:.75rem 0 0; font-size:clamp(1.2rem,2.5vw,1.5rem); line-height:1.35; }
    .report-state { margin:.2rem 0 0; color:var(--muted); font-size:.92rem; }
    .report-state strong { color:var(--text); }
    .text-only-break,.text-separator { display:none; }
    button,select,input { font:inherit; color:var(--text); }
    .header-actions { display:grid; gap:9px; justify-items:stretch; }
    .theme,.home { min-height:44px; border:1px solid var(--line); border-radius:999px; padding:10px 15px; cursor:pointer;
      background:var(--surface); box-shadow:var(--shadow); white-space:nowrap; }
    .home { color:var(--text); text-align:center; text-decoration:none; font-weight:700; }
    .filters { display:flex; align-items:end; gap:18px;
      padding:18px; border:1px solid var(--line); border-radius:24px; background:var(--surface);
      backdrop-filter:blur(18px); box-shadow:var(--shadow); position:sticky; top:12px; z-index:2; }
    .filters label { min-width:0; }
    .search { flex:2 1 220px; }
    .year-filter,.session-filter { flex:0 0 80px; }
    .county-filter { flex:1 1 130px; }
    .pass-filter { flex:1 1 125px; }
    .secondary-filter { flex:1.4 1 190px; }
    .diagram-filter { flex:1 1 140px; }
    label { color:var(--muted); font-size:.78rem; font-weight:700; letter-spacing:.04em; text-transform:uppercase; }
    label span { display:block; margin:0 0 6px 4px; }
    input,select { width:100%; min-height:44px; border:1px solid var(--line); border-radius:13px;
      padding:9px 12px; background:color-mix(in srgb,var(--surface) 86%,transparent); outline:none; }
    input:focus,select:focus { border-color:var(--accent); box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 20%,transparent); }
    .summary { display:flex; justify-content:space-between; gap:16px; margin:24px 4px 14px; color:var(--muted); }
    .cards { display:grid; grid-template-columns:repeat(auto-fill,minmax(290px,1fr)); gap:18px; }
    .card { position:relative; overflow:hidden; min-height:290px; padding:23px; border:1px solid var(--line);
      border-radius:25px; background:var(--surface); backdrop-filter:blur(16px); box-shadow:var(--shadow);
      transition:transform .2s ease,box-shadow .2s ease; }
    .card:hover { transform:translateY(-4px); box-shadow:0 25px 60px rgba(51,37,91,.22); }
    .card::before { content:""; position:absolute; inset:0 0 auto; height:5px;
      background:linear-gradient(90deg,var(--accent),var(--accent2)); }
    .badge { display:inline-flex; padding:5px 10px; border-radius:999px; color:var(--accent);
      background:color-mix(in srgb,var(--accent) 12%,transparent); font-size:.78rem; font-weight:800; }
    .card h2 { margin:17px 0 6px; font-size:1.12rem; line-height:1.32; }
    .place { color:var(--muted); margin:0; }
    .rate { margin:18px 0 13px; font-size:2.2rem; font-weight:850; letter-spacing:-.04em; }
    .rate small { color:var(--muted); font-size:.78rem; font-weight:650; letter-spacing:0; }
    .stats { display:grid; grid-template-columns:repeat(3,1fr); gap:10px 8px; border-top:1px solid var(--line); padding-top:13px; }
    .stat { color:var(--muted); font-size:.72rem; } .stat strong { display:block; color:var(--text); font-size:.96rem; }
    .bucket-separator { grid-column:1/-1; border-top:1px solid var(--line); margin-top:3px; }
    .chart { grid-column:1/-1; }
    .chart-title { margin:0 0 10px; color:var(--muted); font-size:.72rem; font-weight:700; letter-spacing:.04em; text-transform:uppercase; }
    .empty { grid-column:1/-1; text-align:center; padding:55px; color:var(--muted); border:1px dashed var(--line); border-radius:24px; }
    footer { margin-top:38px; padding-top:22px; border-top:1px solid var(--line); text-align:center; color:var(--muted); font-size:.9rem; }
    footer a { color:var(--accent); font-weight:800; text-decoration:none; }
    footer a:hover { text-decoration:underline; }
    footer p { margin:5px 0 0; }
    .license-notice { max-width:760px; margin:10px auto 0; }
    @media (max-width:1100px) { .filters { display:grid; grid-template-columns:1fr 1fr; position:static; } .search { grid-column:1/-1; } }
    @media (max-width:560px) { .page{width:calc(100% - 20px);padding-top:30px} header{display:block}.header-actions{margin-top:18px;grid-template-columns:1fr 1fr}
      .theme,.home{width:100%}.filters{grid-template-columns:1fr;padding:14px;border-radius:18px}.search{grid-column:auto}.summary{display:block}.cards{grid-template-columns:1fr}.card{min-height:0;padding:19px}.pie-layout{grid-template-columns:88px 1fr}.pie-disc{width:88px}.bar-row{grid-template-columns:60px 1fr 54px} }
