:root{--navy:#172a73;--blue:#2849b8;--paper:#f4f6fb;--ink:#172033;--muted:#687187;--line:#dce1ee;--white:#fff;--open:#cfd7dc;--accent:#3153c7}
*{box-sizing:border-box}html,body{height:100%;margin:0;font-family:Inter,Segoe UI,Arial,sans-serif;color:var(--ink);background:var(--paper)}
body{display:grid;grid-template-rows:auto 1fr}header{background:linear-gradient(120deg,#ffffff 0%,#f5f7ff 58%,#e9eeff 100%);color:var(--ink);padding:12px 22px;display:flex;align-items:center;justify-content:space-between;gap:18px;box-shadow:0 2px 16px #192c6b20;z-index:1000;border-bottom:1px solid #dbe1f3}header h1{font-size:20px;margin:0;color:#1d327d}.brand{display:flex;align-items:center;gap:18px}.brand img{width:255px;max-width:38vw;height:auto;display:block}.brand-copy{padding-left:18px;border-left:1px solid #cdd5ec}.sub{font-size:12px;color:#66718e;margin-top:4px}.badge{font-size:11px;font-weight:800;letter-spacing:.06em;background:#e7ecff;color:#263f9b;padding:7px 10px;border-radius:999px;white-space:nowrap}.app{display:grid;grid-template-columns:365px 1fr;min-height:0}aside{background:white;border-right:1px solid var(--line);display:flex;flex-direction:column;min-height:0;z-index:500}.controls{padding:14px;border-bottom:1px solid var(--line)}input,select{width:100%;border:1px solid #c8d4db;border-radius:9px;padding:10px 11px;font:inherit;background:#fff;color:var(--ink)}.controls .row{display:grid;grid-template-columns:1fr 1fr 85px;gap:8px;margin-top:8px}.zip-row{display:grid;grid-template-columns:1fr 92px;gap:8px;margin-top:8px}.zip-row button{border:0;border-radius:9px;background:#2849b8;color:#fff;font-weight:800;cursor:pointer}.zip-result{display:none;margin-top:8px;padding:9px 10px;border-radius:9px;border:1px solid #d9e1ef;background:#f7f9ff;font-size:11px;line-height:1.45}.zip-result.show{display:block}.zip-result.error{background:#fff3f3;border-color:#eccaca;color:#7d3030}.zip-result b{font-size:12px;color:#1d327d}.controls button{border:0;border-radius:9px;background:#eaf0f4;color:#24485f;font-weight:700;cursor:pointer}.summary{display:grid;grid-template-columns:repeat(3,1fr);gap:7px;margin-top:11px}.stat{background:#f3f7f9;border:1px solid #e1e8ec;border-radius:9px;padding:8px;text-align:center}.stat b{display:block;font-size:17px}.stat span{font-size:10px;color:var(--muted);text-transform:uppercase;letter-spacing:.06em}.rep-list{overflow:auto;padding:10px}.rep-card{border:1px solid var(--line);border-radius:11px;padding:10px 11px;margin-bottom:8px;cursor:pointer;background:#fff;transition:.15s}.rep-card:hover,.rep-card.active{border-color:#5e8da9;box-shadow:0 3px 12px #183c5220;transform:translateY(-1px)}.rep-head{display:flex;align-items:center;gap:8px}.dot{width:11px;height:11px;border-radius:50%;flex:0 0 auto}.rep-name{font-weight:780;font-size:14px}.rep-territory{font-size:11px;color:var(--muted);margin-top:5px;line-height:1.35}.count{margin-left:auto;font-size:10px;background:#edf2f5;color:#506875;padding:3px 6px;border-radius:999px}.type-pill{display:inline-block;margin-top:7px;padding:3px 7px;border-radius:999px;font-size:10px;font-weight:800;letter-spacing:.02em}.type-manufacturer{background:#e6f1ff;color:#20527d}.type-buyresell{background:#e8f6ec;color:#25613a}.type-hybrid{background:#fff1dd;color:#7a4b0f}.type-none{background:#eef0f2;color:#59656d}.type-open{background:#f4e9e9;color:#7b3f3f}#map{height:100%;min-height:500px;background:#dce9ef}.leaflet-container{font:13px Inter,Segoe UI,Arial,sans-serif}.leaflet-popup-content-wrapper{border-radius:12px}.leaflet-popup-content{margin:14px 16px}.popup h3{margin:0 0 4px;font-size:18px}.popup .area-name{color:#60727f;font-size:12px;margin-bottom:9px}.popup .assignment{padding:10px;border-radius:9px;margin:7px 0;background:#f4f7f9;border-left:4px solid var(--c)}.popup .rep-title{font-weight:800;font-size:14px}.popup .type-pill{margin:5px 0 7px}.office{margin-top:8px;padding-top:8px;border-top:1px solid #dfe6ea}.office:first-of-type{margin-top:4px}.office b{display:block;font-size:12px;margin-bottom:3px}.office div{font-size:12px;line-height:1.45}.phone{font-weight:700;color:#214c68}.website{font-size:11px;margin-top:3px;overflow-wrap:anywhere}.website a{color:#2849b8;text-decoration:none}.website a:hover{text-decoration:underline}.office-actions{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}.office-actions button,.office-actions a{border:1px solid #cfd8e8;background:#fff;color:#243d86;border-radius:7px;padding:6px 8px;font-size:10px;font-weight:800;text-decoration:none;cursor:pointer;line-height:1.1}.office-actions button:hover,.office-actions a:hover{background:#eef2ff;border-color:#8ca0db}.office-actions .primary{background:#2849b8;color:#fff;border-color:#2849b8}.copy-toast{position:fixed;right:18px;top:88px;z-index:2000;background:#173c2b;color:#fff;padding:10px 14px;border-radius:9px;font-size:12px;font-weight:800;box-shadow:0 8px 24px #0003;opacity:0;transform:translateY(-8px);pointer-events:none;transition:.2s}.copy-toast.show{opacity:1;transform:translateY(0)}.legend{background:white;padding:9px 11px;border-radius:9px;box-shadow:0 2px 10px #132f4130;line-height:1.7}.legend-title{font-weight:800;margin-bottom:3px}.legend-item{display:flex;align-items:center;gap:7px;font-size:11px}.legend-swatch{width:13px;height:13px;border-radius:3px;border:1px solid #ffffff88;box-shadow:0 0 0 1px #0002}.notice{position:absolute;right:14px;bottom:18px;z-index:600;background:#fffbea;border:1px solid #ead99b;border-radius:10px;padding:9px 11px;font-size:11px;color:#625319;max-width:315px;box-shadow:0 3px 12px #0002}.loading{position:absolute;inset:0;z-index:900;display:grid;place-items:center;background:#e8f0f4}.loading-card{background:white;padding:18px 22px;border-radius:12px;box-shadow:0 7px 30px #18394e30;font-weight:700}.error{color:#8b2f2f;max-width:520px;text-align:center;line-height:1.5}
.split-map-button{display:inline-flex;align-items:center;gap:6px;margin-top:9px;border:0;border-radius:8px;background:#172a73;color:#fff;padding:8px 10px;font-size:11px;font-weight:800;cursor:pointer}.split-map-button:hover{background:#2849b8}.map-modal{display:none;position:fixed;inset:0;z-index:3000;background:#07101dcc;backdrop-filter:blur(3px);padding:22px}.map-modal.show{display:grid;grid-template-rows:auto 1fr}.map-modal-bar{display:flex;align-items:center;justify-content:space-between;gap:12px;background:#fff;padding:10px 14px;border-radius:12px 12px 0 0}.map-modal-title{font-size:16px;font-weight:850;color:#1d327d}.map-modal-actions{display:flex;gap:7px}.map-modal-actions button{border:1px solid #cfd8e8;background:#fff;color:#243d86;border-radius:8px;padding:7px 10px;font-weight:800;cursor:pointer}.map-modal-stage{overflow:auto;background:#eef2f7;border-radius:0 0 12px 12px;display:grid;place-items:center;padding:18px}.map-modal-stage img{max-width:100%;max-height:calc(100vh - 110px);transform-origin:center;transition:transform .15s;box-shadow:0 10px 35px #0005;background:#fff}.split-summary{margin-top:7px;padding:8px 10px;border-radius:8px;background:#eef2ff;color:#263f7d;font-size:11px;line-height:1.45}

.state-modal{display:none;position:fixed;inset:0;z-index:2500;background:#07101dcc;backdrop-filter:blur(3px);padding:18px}.state-modal.show{display:grid;place-items:center}.state-modal-card{width:min(1240px,100%);max-height:calc(100vh - 36px);background:#fff;border-radius:14px;box-shadow:0 18px 60px #0006;overflow:hidden;display:grid;grid-template-rows:auto 1fr}.state-modal-bar{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:13px 16px;border-bottom:1px solid #dce1ee;background:linear-gradient(120deg,#fff,#eef2ff)}.state-modal-title{font-size:19px;font-weight:850;color:#1d327d}.state-modal-subtitle{font-size:11px;color:#687187;margin-top:3px}.state-modal-actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}.state-modal-actions button{border:1px solid #cfd8e8;background:#fff;color:#243d86;border-radius:8px;padding:8px 11px;font-weight:800;cursor:pointer}.state-modal-actions .primary{background:#172a73;color:#fff;border-color:#172a73}.state-modal-body{padding:15px;overflow:auto}.state-overview-note{margin-bottom:12px;padding:9px 11px;border-radius:9px;background:#f3f6ff;border:1px solid #dde4fb;color:#344a84;font-size:12px}.state-rep-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(285px,1fr));gap:13px;align-items:start}.state-rep-grid[data-count="2"]{grid-template-columns:repeat(2,minmax(0,1fr))}.state-rep-grid[data-count="3"]{grid-template-columns:repeat(3,minmax(0,1fr))}.state-rep-card{border:1px solid #dce1ee;border-top:5px solid var(--c);border-radius:11px;padding:12px;background:#fff;box-shadow:0 4px 16px #172a7310;min-width:0}.state-rep-card .state-rep-name{font-size:16px;font-weight:850;color:#172033}.state-rep-card .type-pill{margin:6px 0 8px}.state-coverage{background:#f6f8fb;border-radius:8px;padding:8px 9px;font-size:11px;line-height:1.45;color:#4f5d72;margin-bottom:5px}.state-coverage div+div{margin-top:4px;padding-top:4px;border-top:1px solid #e2e7ef}.state-rep-card .office{padding-top:7px;margin-top:7px}.state-rep-card .office-actions{gap:5px}.state-rep-card .office-actions button,.state-rep-card .office-actions a{padding:6px 7px}.state-empty{border:1px dashed #c8d1d8;border-radius:10px;padding:18px;text-align:center;color:#687187;background:#f8fafb}

@media(max-width:900px){.state-modal{padding:8px}.state-modal-card{max-height:calc(100vh - 16px)}.state-modal-bar{align-items:flex-start}.state-rep-grid[data-count="2"],.state-rep-grid[data-count="3"]{grid-template-columns:1fr}.state-modal-actions{max-width:170px}body{display:block}.app{display:block}.app aside{height:45vh;border-right:0;border-bottom:1px solid var(--line)}#map{height:55vh}.badge{display:none}.notice{display:none}.controls .row{grid-template-columns:1fr 1fr 80px}}

.county-modal{display:none;position:fixed;inset:0;z-index:2800;background:#07101dcc;backdrop-filter:blur(3px);padding:18px}.county-modal.show{display:grid;place-items:center}.county-card{width:min(1280px,100%);height:min(860px,calc(100vh - 36px));background:#fff;border-radius:14px;overflow:hidden;display:grid;grid-template-rows:auto 1fr;box-shadow:0 18px 60px #0006}.county-bar{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 15px;border-bottom:1px solid #dce1ee;background:linear-gradient(120deg,#fff,#eef2ff)}.county-title{font-size:18px;font-weight:850;color:#1d327d}.county-sub{font-size:11px;color:#687187;margin-top:3px}.county-actions{display:flex;gap:7px;flex-wrap:wrap}.county-actions button{border:1px solid #cfd8e8;background:#fff;color:#243d86;border-radius:8px;padding:8px 10px;font-weight:800;cursor:pointer}.county-layout{display:grid;grid-template-columns:minmax(0,1fr) 360px;min-height:0}.county-map-wrap{position:relative;min-width:0;background:#e8f0f4}.county-map{height:100%;min-height:520px}.county-loading{position:absolute;inset:0;display:grid;place-items:center;background:#e8f0f4;z-index:500}.county-loading.hidden{display:none}.county-side{overflow:auto;border-left:1px solid #dce1ee;padding:14px;background:#fbfcff}.county-side h3{margin:0 0 5px;color:#1d327d}.county-help{font-size:12px;line-height:1.45;color:#687187;margin-bottom:12px}.county-result{border:1px solid #dce1ee;border-radius:10px;padding:11px;background:#fff}.county-result.empty{color:#687187}.county-rep{border-left:5px solid var(--c);padding:9px 10px;margin-top:9px;border-radius:8px;background:#f7f9fc}.county-rep-name{font-weight:850}.county-note{margin-top:10px;padding:9px;border-radius:8px;background:#fff7df;border:1px solid #ecd994;color:#66551a;font-size:11px;line-height:1.45}.county-tooltip{font-weight:800}.state-modal-actions .county-primary{background:#2849b8;color:#fff;border-color:#2849b8}@media(max-width:900px){.county-modal{padding:6px}.county-card{height:calc(100vh - 12px)}.county-layout{grid-template-columns:1fr;grid-template-rows:minmax(360px,55vh) 1fr}.county-side{border-left:0;border-top:1px solid #dce1ee}.county-map{min-height:360px}}
#splitMapModal{display:none!important}



.county-lookup-panel{
  margin:14px 0 18px;
  padding:14px;
  border:1px solid rgba(0,0,0,.12);
  border-radius:12px;
  background:#fff;
}
.county-lookup-row{
  display:grid;
  grid-template-columns:1fr auto;
  gap:8px;
  margin-top:8px;
}
.county-lookup-panel input{
  width:100%;
  padding:10px 12px;
  border:1px solid #c9ced6;
  border-radius:8px;
  font-size:14px;
}
.county-lookup-panel button{
  padding:10px 14px;
  border:0;
  border-radius:8px;
  cursor:pointer;
  font-weight:600;
}
.county-lookup-result{
  margin-top:10px;
  font-size:14px;
  line-height:1.45;
}
.county-lookup-actions{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:10px;
}
@media (max-width:640px){
  .county-lookup-row{grid-template-columns:1fr;}
}

/* Territory polygons remain readable without external background tiles. */
#map, #countyMap { background: #e8f0f4; }
