:root{
  --ink:#1c2b33; --muted:#5b6b73; --line:#e3e8eb;
  --brand:#1f4e5f; --brand-dark:#153946; --accent:#e8a13d;
  --bg:#f6f8f9; --card:#ffffff;
  --good:#2e7d52; --mid:#b98a1d; --low:#b3502e;
}
*{box-sizing:border-box; margin:0; padding:0;}
body{font-family:"Segoe UI", system-ui, -apple-system, sans-serif; color:var(--ink); background:var(--bg); line-height:1.5;}
a{color:var(--brand); text-decoration:none;}
a:hover{text-decoration:underline;}

/* ---------- header / footer ---------- */
header{background:var(--brand); color:#fff; padding:0 24px; display:flex; align-items:center; gap:28px; height:58px;}
.logo{font-size:19px; font-weight:700; color:#fff;}
.logo span{color:var(--accent);}
.logo:hover{text-decoration:none;}
header nav{margin-left:auto; display:flex; gap:6px;}
header nav a{color:#cfe0e6; font-size:15px; padding:8px 14px; border-radius:6px;}
header nav a:hover{background:rgba(255,255,255,.12); color:#fff; text-decoration:none;}
footer{max-width:1180px; margin:40px auto 0; padding:22px 24px 40px; border-top:1px solid var(--line); color:var(--muted); font-size:13.5px; display:flex; flex-wrap:wrap; gap:8px 24px;}
.foot-note{flex-basis:100%; font-size:12.5px;}

.view{max-width:1180px; margin:0 auto; padding:28px 24px 64px;}

/* ---------- hero split (home) ---------- */
.hero-split{display:grid; grid-template-columns:1fr 1.1fr; gap:0; border-radius:14px; overflow:hidden; border:1px solid var(--line); background:var(--card);}
.hero-copy{background:linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%); color:#fff; padding:38px 34px;}
.hero-copy h1{font-size:29px; line-height:1.2; margin-bottom:10px;}
.hero-sub{font-size:14.5px; color:#cfe0e6; margin-bottom:20px;}
.searchbox.stack{flex-direction:column; align-items:stretch;}
.searchbox.stack .pairline{display:flex; gap:8px;}
.searchbox.stack .pairline select{flex:1; min-width:0;}
.trysearches{margin-top:14px; font-size:13px; color:#9db4bd;}
.trysearches a{color:#e8c84d;}
.hero-map{position:relative; min-height:440px;}
#heromap{position:absolute; inset:0;}
.maplegend{position:absolute; right:10px; bottom:10px; z-index:500; background:rgba(255,255,255,.94); border:1px solid var(--line); border-radius:9px; padding:9px 12px; font-size:11.5px; display:flex; flex-direction:column; gap:3px;}
.maplegend b{font-size:11px; text-transform:uppercase; letter-spacing:.4px; color:var(--muted);}
.maplegend i{display:inline-block; width:10px; height:10px; border-radius:50%; margin-right:6px; vertical-align:-1px;}
.legend-hint{color:var(--muted); font-style:italic; margin-top:3px;}
.collegeblock{margin-bottom:10px; padding-bottom:6px; border-bottom:1px solid var(--line);}

/* ---------- hero / home ---------- */
.hero{background:linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%); border-radius:14px; color:#fff; padding:52px 48px 46px; margin-bottom:34px;}
.hero h1{font-size:34px; margin-bottom:8px; line-height:1.2;}
.hero p{font-size:17px; color:#cfe0e6; max-width:640px; margin-bottom:26px;}
.searchbox{background:#fff; border-radius:10px; padding:10px; display:flex; flex-wrap:wrap; gap:8px; max-width:880px;}
.searchbox select,.searchbox input{border:1px solid var(--line); border-radius:7px; padding:10px 12px; font-size:14px; color:var(--ink); flex:1; min-width:140px;}
.btn{background:var(--accent); color:#3a2a07; font-weight:700; border:none; border-radius:7px; padding:10px 26px; font-size:15px; cursor:pointer; display:inline-block;}
.btn:hover{filter:brightness(1.05); text-decoration:none;}
.btn.brand{background:var(--brand); color:#fff;}
.home-grid{display:grid; grid-template-columns:1.4fr 1fr; gap:26px; align-items:start;}
.panel{background:var(--card); border:1px solid var(--line); border-radius:12px; padding:22px;}
.panel h2{font-size:18px; margin-bottom:14px;}
.videowrap{position:relative; aspect-ratio:16/9; border-radius:10px; overflow:hidden; background:#22333b;}
.videowrap iframe{position:absolute; inset:0; width:100%; height:100%; border:0;}
.ep-title{font-size:16px; font-weight:600; margin-top:12px;}
.statelist{display:flex; flex-wrap:wrap; gap:6px 18px; font-size:14.5px;}
.statelist small{color:var(--muted);}

.mini-row{display:flex; align-items:center; justify-content:space-between; padding:11px 0; border-bottom:1px solid var(--line); gap:10px;}
.mini-row:last-child{border-bottom:none;}
.mini-name{font-weight:600; font-size:14.5px;}
.mini-name small{display:block; font-weight:400; color:var(--muted); font-size:12.5px;}

/* ---------- scorecard badge ---------- */
.badge{display:inline-flex; gap:5px;}
.badge .pip{width:34px; height:38px; border-radius:7px; color:#fff; display:flex; flex-direction:column; align-items:center; justify-content:center; font-weight:800; font-size:15px; line-height:1;}
.pip small{font-size:8.5px; font-weight:700; opacity:.85; margin-top:2px; letter-spacing:.3px;}
.pip.g{background:var(--good);} .pip.m{background:var(--mid);} .pip.l{background:var(--low);}
.badge.lg .pip{width:74px; height:84px; font-size:30px; border-radius:10px;}
.badge.lg .pip small{font-size:11px; margin-top:5px;}

/* ---------- search ---------- */
.chips{display:flex; flex-wrap:wrap; gap:8px; margin-bottom:14px; align-items:center;}
.chip{background:var(--card); border:1px solid var(--line); border-radius:999px; padding:6px 14px; font-size:13.5px; display:flex; gap:8px; align-items:center;}
.chip b{color:var(--brand);}
.chip.addf{border-style:dashed; color:var(--brand); cursor:pointer; background:none;}
.results-head{display:flex; align-items:center; justify-content:space-between; margin-bottom:14px; gap:12px; flex-wrap:wrap;}
.results-head h2{font-size:17px; font-weight:600;}
.results-head .count{color:var(--muted); font-weight:400;}
.sortwrap{display:flex; gap:8px; align-items:center; font-size:14px; color:var(--muted);}
.sortwrap select{border:1px solid var(--line); border-radius:7px; padding:7px 10px; font-size:13.5px; background:#fff;}
.sortwrap a.cur{font-weight:700;}
.split{display:grid; grid-template-columns:minmax(420px,1fr) minmax(360px,.85fr); gap:18px; align-items:start;}
.cards{display:flex; flex-direction:column; gap:12px; max-height:680px; overflow-y:auto; padding-right:4px;}
.tcard{display:block; background:var(--card); border:1px solid var(--line); border-radius:12px; padding:16px 18px; transition:box-shadow .15s, border-color .15s; color:var(--ink);}
.tcard:hover,.tcard.hl{border-color:var(--brand); box-shadow:0 3px 14px rgba(31,78,95,.13); text-decoration:none;}
.tcard .top{display:flex; justify-content:space-between; align-items:flex-start; gap:10px;}
.tname{font-size:16.5px; font-weight:700;}
.tname small{font-weight:500; color:var(--muted); font-size:12.5px; margin-left:6px;}
.visited-tag{font-size:11.5px; font-weight:700; color:var(--brand); background:#e3eef2; padding:3px 9px; border-radius:999px; white-space:nowrap;}
.hero-stat{margin:8px 0 4px;}
.hero-stat .val{font-size:24px; font-weight:800; color:var(--brand);}
.hero-stat .lbl{font-size:12px; color:var(--muted); text-transform:uppercase; letter-spacing:.4px;}
.statline{display:flex; gap:18px; flex-wrap:wrap; margin-top:6px; align-items:center;}
.statline div{font-size:13px; color:var(--muted);}
.statline b{color:var(--ink); font-weight:600;}
#searchmap{height:680px; border-radius:12px; border:1px solid var(--line); position:sticky; top:14px;}

/* ---------- filter drawer ---------- */
.scrim{display:none; position:fixed; inset:0; background:rgba(20,35,42,.45); z-index:40;}
.scrim.open{display:block;}
.drawer{position:fixed; top:0; right:-420px; width:400px; max-width:92vw; height:100vh; background:#fff; z-index:50; box-shadow:-6px 0 24px rgba(0,0,0,.18); transition:right .22s ease; display:flex; flex-direction:column;}
.drawer.open{right:0;}
.drawer .dhead{display:flex; align-items:center; justify-content:space-between; padding:18px 22px; border-bottom:1px solid var(--line);}
.drawer .dhead h3{font-size:17px;}
.drawer .dhead .close{border:none; background:none; font-size:22px; color:var(--muted); cursor:pointer;}
.drawer .dbody{flex:1; overflow-y:auto; padding:18px 22px;}
.fgroup{margin-bottom:22px;}
.fgroup h4{font-size:12.5px; text-transform:uppercase; letter-spacing:.6px; color:var(--muted); margin-bottom:10px;}
.frow{margin-bottom:12px;}
.frow label{display:block; font-size:13.5px; font-weight:600; margin-bottom:5px;}
.frow .pair{display:flex; gap:8px;}
.frow input,.frow select{width:100%; border:1px solid var(--line); border-radius:7px; padding:9px 11px; font-size:13.5px; background:#fff;}
.checkline{display:flex; align-items:center; gap:9px; font-size:14px; padding:6px 0;}
.checkline input{width:auto;}
.checkline label{font-weight:400; margin:0;}
.drawer .dfoot{padding:14px 22px; border-top:1px solid var(--line); display:flex; gap:10px; align-items:center;}
.drawer .dfoot .btn{flex:1;}
.linkbtn{background:none; border:none; color:var(--brand); font-size:14px; cursor:pointer; padding:10px 4px;}

/* ---------- city page ---------- */
.crumb{font-size:13.5px; color:var(--muted); margin-bottom:14px;}
.cityhead{display:flex; justify-content:space-between; align-items:flex-start; gap:20px; flex-wrap:wrap; margin-bottom:6px;}
.cityhead h1{font-size:32px; line-height:1.15;}
.cityhead .type{font-size:14px; color:var(--muted); margin-top:3px; text-transform:capitalize;}
.verdict{background:var(--card); border:1px solid var(--line); border-left:4px solid var(--accent); border-radius:10px; padding:14px 18px; margin:18px 0 22px; font-size:14.5px;}
.verdict b{color:var(--brand);}
.sponsor-note{font-size:12.5px; color:var(--muted); margin-top:8px;}
.citygrid{display:grid; grid-template-columns:1.5fr 1fr; gap:22px; align-items:start;}
.sectiontitle{margin-bottom:12px; font-size:16px;}
.statcards{display:grid; grid-template-columns:repeat(auto-fill,minmax(165px,1fr)); gap:12px; margin-bottom:22px;}
.stat{background:var(--card); border:1px solid var(--line); border-radius:10px; padding:14px 16px;}
.stat .v{font-size:21px; font-weight:800; color:var(--brand);}
.stat .k{font-size:12px; color:var(--muted); text-transform:uppercase; letter-spacing:.4px; margin-top:2px;}
.stat .ctx{font-size:12px; margin-top:6px;}
.ctx.up{color:var(--good);} .ctx.down{color:var(--low);} .ctx.flat{color:var(--muted);}
.section{background:var(--card); border:1px solid var(--line); border-radius:12px; padding:20px 22px; margin-bottom:18px;}
.section h3{font-size:16px; margin-bottom:12px;}
.muted{font-size:14px; color:var(--muted);}
.muted-sm{font-size:12px; color:var(--muted);}
.agency{padding:11px 0; border-bottom:1px solid var(--line);}
.agency:last-child{border-bottom:none;}
.alevel{font-size:11px; font-weight:700; letter-spacing:.5px; text-transform:uppercase; color:#fff; background:var(--brand); padding:2px 8px; border-radius:4px; margin-right:8px;}
.alevel.county{background:#3f6f82;} .alevel.region{background:#6b8d9c;} .alevel.state{background:#90a8b3;}
.agency a{font-weight:600;}
.agency .anote{font-size:13px; color:var(--muted); margin-top:2px;}
.distrow{display:flex; justify-content:space-between; font-size:14px; padding:8px 0; border-bottom:1px solid var(--line);}
.distrow:last-child{border-bottom:none;}
#citymap{height:260px; border-radius:10px; border:1px solid var(--line); margin-bottom:18px;}
.forwho{display:grid; grid-template-columns:1fr 1fr; gap:14px; margin-top:14px;}
.forwho .col{border-radius:9px; padding:13px 15px; font-size:13.5px;}
.forwho .yes{background:#ecf5ef; border:1px solid #cfe5d7;}
.forwho .no{background:#faf0ec; border:1px solid #ecd6cb;}
.forwho h4{font-size:13px; margin-bottom:7px;}
.forwho ul{margin-left:16px;}
.forwho li{margin-bottom:4px;}

/* ---------- state page ---------- */
.statetable{background:var(--card); border:1px solid var(--line); border-radius:12px; overflow:hidden;}
.strow{display:grid; grid-template-columns:2.2fr 1fr 1fr 1fr 1fr .8fr; gap:8px; padding:9px 16px; border-bottom:1px solid var(--line); font-size:14px;}
.strow:last-child{border-bottom:none;}
.sthead{background:var(--bg); font-weight:700; font-size:12.5px; text-transform:uppercase; letter-spacing:.4px; color:var(--muted);}

/* ---------- mobile ---------- */
.maptoggle{display:none;}
@media (max-width: 900px){
  .home-grid,.citygrid{grid-template-columns:1fr;}
  .split{display:block;}
  #searchmap{display:none; height:calc(100vh - 230px); position:static;}
  .cards{max-height:none; overflow:visible;}
  body.showmap #searchmap{display:block;}
  body.showmap .cards{display:none;}
  .maptoggle{display:flex; position:fixed; bottom:18px; left:50%; transform:translateX(-50%); z-index:30;
    background:var(--brand-dark); color:#fff; border:none; border-radius:999px; padding:12px 22px;
    font-size:14.5px; font-weight:700; gap:8px; align-items:center; box-shadow:0 4px 16px rgba(0,0,0,.3); cursor:pointer;}
}
@media (max-width: 900px){
  .hero-split{grid-template-columns:1fr;}
  .hero-map{min-height:340px;}
}
@media (max-width: 640px){
  header{padding:0 12px; gap:10px; height:52px;}
  .logo{font-size:15.5px;}
  header nav a{font-size:12.5px; padding:6px 8px;}
  .view{padding:18px 14px 96px;}
  .hero{padding:28px 20px 26px; border-radius:12px;}
  .hero h1{font-size:23px;}
  .hero p{font-size:15px;}
  .searchbox{flex-direction:column;}
  .searchbox select,.searchbox input,.searchbox .btn{width:100%; min-width:0;}
  .cityhead h1{font-size:25px;}
  .badge.lg .pip{width:56px; height:66px; font-size:23px;}
  .badge.lg .pip small{font-size:9px;}
  .statcards{grid-template-columns:1fr 1fr;}
  .forwho{grid-template-columns:1fr;}
  .results-head{flex-direction:column; align-items:flex-start;}
  .drawer{width:100vw; right:-100vw;}
  .drawer.open{right:0;}
  .strow{grid-template-columns:1.8fr 1fr 1fr .6fr; }
  .strow span:nth-child(4),.strow span:nth-child(5){display:none;}
}
