/*
VOICE   calm planning tool; matches the owner's reference (dark charcoal, teal accent, normal type sizes)
IDEA    a night-mode planning console: map is the main surface, data panels sit beside it
PICTURE the map of ranked towns, first thing on every screen
COLOUR  charcoal #12161b ground, panels #1a2129, teal #61c0bf accent and headings, teal gradient top bar
TYPE    Inter 15px body, headings 600 in teal; browser zoom handles larger text
LAYOUT  desktop: docked 380px list panel + map; phone: full map + bottom sheet
*/
:root{color-scheme:dark;
  --bg:#12161b;--panel:#1a2129;--card:#1f2731;--line:#2c3743;--ink:#e6edf3;--muted:#9aa7b4;
  --teal:#61c0bf;--teal2:#3ea3a6;--tealInk:#06292b;--amber:#f0a030}
*{box-sizing:border-box;min-width:0}
[hidden]{display:none!important}
html{scroll-padding-top:64px}
body{margin:0;background:var(--bg);color:var(--ink);font:15px/1.55 Inter,system-ui,-apple-system,"Segoe UI",sans-serif;overflow-x:clip}
h1,h2,h3{font-weight:600;line-height:1.2;color:var(--teal);text-wrap:balance}
h1{font-size:1.6rem;margin:0 0 .4rem}h2{font-size:1.15rem;margin:1.6rem 0 .6rem}h3{font-size:1rem;margin:0 0 .3rem}
a{color:var(--teal)}
:focus-visible{outline:2px solid var(--teal);outline-offset:2px}
.muted{color:var(--muted)}.lead{color:var(--muted);margin:0 0 .9rem;max-width:62ch}
.eyebrow{font-size:.72rem;letter-spacing:.06em;text-transform:uppercase;color:var(--muted);margin:0 0 .2rem}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
@media (prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important}}

/* top bar */
.strip{position:sticky;top:0;z-index:20;display:flex;align-items:center;justify-content:space-between;gap:1rem;
  background:linear-gradient(90deg,#3ea3a6,#7fd3d1);color:var(--tealInk);padding:0 max(2vw,14px);height:48px}
.brand{color:var(--tealInk);text-decoration:none;font-weight:700;font-size:.95rem;letter-spacing:.02em;white-space:nowrap}
.brand span{font-weight:500;opacity:.75}
.nav{display:flex;gap:.15rem;align-items:center}
.nav a{color:var(--tealInk);text-decoration:none;font-size:.85rem;font-weight:500;padding:.4rem .7rem;border-radius:6px;white-space:nowrap}
.nav a[aria-current=page]{font-weight:700;background:rgba(255,255,255,.28)}
.nav a:hover{background:rgba(255,255,255,.18)}
.pill{background:var(--tealInk);color:#bfeeed;border-radius:99px;padding:0 .45em;font-size:.72rem;font-weight:600;margin-left:.2rem}

/* controls */
.btn{display:inline-flex;align-items:center;min-height:40px;padding:0 1rem;border-radius:99px;border:1px solid var(--teal);background:transparent;color:var(--teal);
  font:500 .9rem Inter,sans-serif;cursor:pointer;text-decoration:none}
.btn:hover{background:rgba(97,192,191,.12)}
.btn.primary{background:var(--teal);color:var(--tealInk);font-weight:600}
.link{background:none;border:0;color:var(--teal);font:500 .85rem Inter,sans-serif;text-decoration:underline;cursor:pointer;padding:.3rem 0}
label,legend{font-weight:500;display:block;margin-bottom:.3rem;font-size:.9rem}
input[type=search],select{width:100%;min-height:40px;font:.95rem Inter,sans-serif;padding:0 .75rem;border:1px solid var(--line);border-radius:8px;background:var(--bg);color:var(--ink)}
input[type=range]{width:100%;accent-color:var(--teal)}
fieldset{border:0;padding:0;margin:0}
.field{margin:.7rem 0}
.chips{display:flex;flex-wrap:wrap;gap:.4rem}
.chip{display:inline-flex;align-items:center;min-height:34px;padding:0 .8rem;border-radius:99px;border:1px solid var(--line);background:transparent;color:var(--ink);font:500 .85rem Inter,sans-serif;cursor:pointer;text-decoration:none}
.chip:hover{border-color:var(--teal)}
.chip[aria-pressed=true]{background:rgba(97,192,191,.18);border-color:var(--teal);color:var(--teal)}
.tag{display:inline-block;font-size:.72rem;font-weight:500;border-radius:99px;padding:.05rem .55rem;border:1px solid var(--teal2);color:var(--teal);vertical-align:middle}

/* finder: map first */
.finder{display:grid;grid-template-columns:380px minmax(0,1fr);height:calc(100dvh - 48px)}
.panel{grid-column:1;grid-row:1;overflow-y:auto;background:var(--panel);border-right:1px solid var(--line);padding:1rem 1.1rem 1.5rem}
.handle{display:none}
.mapwrap{grid-column:2;grid-row:1;position:relative}
#map{position:absolute;inset:0;background:#10161d}
.box{background:var(--card);border:1px solid var(--line);border-radius:10px;padding:0 .9rem .5rem;margin:.6rem 0}
.box summary{min-height:42px;display:flex;align-items:center;font-weight:600;font-size:.9rem;cursor:pointer}
.weights .w{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;column-gap:.6rem;margin:.4rem 0}
.weights .w label{margin:0}.weights output{font-size:.78rem;color:var(--muted)}
.weights .w input{grid-column:1/-1}
.soon{font-size:.8rem;color:var(--muted);margin:.4rem 0 .2rem}
.count{margin:.9rem 0 .2rem;font-size:.85rem;color:var(--muted)}
.list{list-style:none;margin:0;padding:0}
.list li{border-bottom:1px solid var(--line)}
.row{display:grid;grid-template-columns:1.8rem minmax(0,1fr) auto;gap:.6rem;align-items:center;width:100%;min-height:54px;padding:.45rem .3rem;
  background:none;border:0;color:inherit;text-align:left;font:inherit;cursor:pointer;border-radius:8px}
.row:hover,.row.hot{background:var(--card)}
.rank{font-size:.8rem;color:var(--muted);text-align:right}
.row strong{display:block;font-weight:600;font-size:.95rem}.row small{color:var(--muted);font-size:.78rem}
.score{font-weight:700;font-size:1.05rem;color:var(--teal);min-width:2.4ch;text-align:right}
.legend{position:absolute;right:10px;bottom:28px;display:flex;gap:.45rem;align-items:center;background:rgba(26,33,41,.92);border:1px solid var(--line);border-radius:8px;padding:.25rem .55rem;font-size:.75rem;color:var(--muted);z-index:2}
.legend i{width:80px;height:8px;border-radius:4px;background:linear-gradient(90deg,#f0a030,#6b7f99,#61c0bf)}
.mapnote{position:absolute;top:10px;left:10px;right:52px;margin:0;max-width:24rem;background:rgba(26,33,41,.92);border:1px solid var(--line);border-radius:8px;padding:.4rem .7rem;font-size:.78rem;color:var(--muted);z-index:2}
.reflabel{font:600 11px Inter,sans-serif;color:#cfe9e8;background:rgba(18,22,27,.8);padding:1px 5px;border-radius:4px;pointer-events:none;white-space:nowrap}
.maplibregl-popup-content{font:.85rem/1.4 Inter,sans-serif;color:#0b1a1f;padding:.5rem .7rem}
.maplibregl-ctrl-attrib{font-size:10px}
@media (max-width:900px){
  .finder{display:flex;flex-direction:column;height:calc(100dvh - 48px)}
  .mapwrap{flex:1 1 auto;min-height:0}
  .panel{flex:none;height:38dvh;border-right:0;border-top:1px solid var(--line);padding-top:0}
  .panel[data-state=full]{height:calc(100dvh - 48px - 90px)}
  .handle{display:flex;flex-direction:column;align-items:center;gap:.25rem;position:sticky;top:0;z-index:2;width:calc(100% + 2.2rem);margin:0 -1.1rem .3rem;
    padding:.45rem 0 .5rem;background:var(--panel);border:0;border-bottom:1px solid var(--line);color:var(--teal);font:600 .85rem Inter,sans-serif;cursor:pointer}
  .grip{width:40px;height:4px;border-radius:2px;background:var(--line)}
  .brand span{display:none}
  .nav a{padding:.4rem .5rem}
}

/* pages */
.page{padding:clamp(18px,3vw,40px) max(4vw,16px) 4rem;max-width:1140px;margin:0 auto}
.prose{max-width:760px}.prose li{margin:.3rem 0}
.back{display:inline-block;margin-bottom:.6rem;font-size:.9rem}
.townhead{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:1rem 2rem;align-items:end;border-bottom:1px solid var(--line);padding-bottom:1rem}
.townhead h1{font-size:clamp(1.7rem,3.2vw,2.4rem);margin:0}
.overall{font-weight:700;font-size:clamp(2.2rem,4.5vw,3rem);line-height:1;color:var(--teal);text-align:right}
.overall small{display:block;font-weight:500;font-size:.78rem;color:var(--muted);margin-top:.3rem}
.actions{display:flex;flex-wrap:wrap;gap:.5rem;margin:1rem 0}
.grid2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1.25rem 2rem;margin-top:1.25rem}
@media (max-width:760px){.grid2{grid-template-columns:minmax(0,1fr)}.townhead{grid-template-columns:minmax(0,1fr)}.overall{text-align:left}}
.card{background:var(--card);border:1px solid var(--line);border-radius:12px;padding:1rem 1.1rem}
.card h2{margin-top:0}
.bars{display:grid;gap:.65rem}
.bar{display:grid;grid-template-columns:9.5rem minmax(0,1fr) 3ch;gap:.6rem;align-items:center;font-size:.9rem}
.bar .t{height:8px;border-radius:4px;background:var(--line);overflow:hidden}.bar .t i{display:block;height:100%;background:var(--teal);border-radius:4px}
.bar b{text-align:right;font-weight:600}
.bar.na .t{background:repeating-linear-gradient(45deg,var(--line) 0 5px,transparent 5px 10px)}
.facts{width:100%;border-collapse:collapse;font-size:.9rem}
.facts th,.facts td{text-align:left;padding:.5rem .35rem;border-bottom:1px solid var(--line);vertical-align:top;font-weight:400}
.facts th{color:var(--muted)}
.facts td.n{text-align:right;white-space:nowrap;font-variant-numeric:tabular-nums;color:var(--ink)}
.note{font-size:.8rem;color:var(--muted)}
.fig{position:relative;height:210px;margin-top:.4rem;color:var(--muted)}.fig svg{position:absolute;inset:0;width:100%;height:100%}
.gap{border:1px dashed var(--line);border-radius:10px;padding:.9rem 1rem;color:var(--muted);font-size:.9rem}
.cmp{width:100%;border-collapse:collapse;margin-top:1rem;font-size:.9rem}
.cmp th,.cmp td{padding:.6rem .5rem;border-bottom:1px solid var(--line);text-align:right;font-variant-numeric:tabular-nums}
.cmp th:first-child,.cmp td:first-child{text-align:left;color:var(--muted)}
.cmp thead th{font-size:1rem;vertical-align:bottom}
.cmp td.best{color:var(--teal);font-weight:600}
.scroll{overflow-x:auto}
