/* Housing Explorer — site design system (home, area, neighbourhood, rankings, compare, about) */

:root {
  --bg: #f3f6f0;
  --surface: #fcfdfb;
  --surface-2: #eef3ea;
  --surface-3: #e3ebde;
  --border: #d3dfcb;
  --border-strong: #adc2a1;
  --text: #17201a;
  --text-2: #364733;
  --muted: #5b6b56;          /* ≥ 4.5:1 on --bg and --surface */
  --accent: #1e6e42;
  --accent-strong: #145031;
  --accent-soft: #e2eee5;
  --up: #1b6e3f;
  --down: #b3261e;
  --type-D: #b07d1f; --type-S: #c7364f; --type-T: #6d4fb3; --type-F: #2f6bd8;
  --bench: #8a948a;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(23, 32, 26, .05), 0 4px 16px rgba(23, 32, 26, .05);
  --font-display: 'DM Serif Display', Georgia, serif;
  --font-body: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --header-h: 60px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 12px); }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 var(--font-body); }
img, svg { max-width: 100%; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-strong); }
h1, h2, h3 { font-family: var(--font-display); font-weight: 400; line-height: 1.15; margin: 0; color: var(--text); letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 4.2vw, 3rem); }
h2 { font-size: clamp(1.45rem, 2.6vw, 1.9rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid #f2b705; outline-offset: 2px; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--text); color: #fff; padding: 8px 12px; border-radius: var(--radius-sm); z-index: 1000; }
.skip-link:focus { left: 8px; }
.wrap { max-width: 1180px; margin: 0 auto; padding-inline: 20px; }
.narrow { max-width: 720px; }
.muted { color: var(--muted); }
.fine { font-size: .82rem; color: var(--muted); margin-top: .75rem; }
.eyebrow { font: 600 .75rem/1 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin: 0 0 .6rem; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- buttons & inputs ---------- */
.btn { display: inline-flex; align-items: center; gap: .4em; border: 1px solid transparent; border-radius: 999px; padding: .6em 1.15em; font-weight: 600; cursor: pointer; text-decoration: none; line-height: 1.2; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-strong); color: #fff; }
.btn-secondary { background: var(--surface); color: var(--accent); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--accent-soft); }
.link-button { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; cursor: pointer; }
input[type=text], input[type=search], input[type=number], input[type=email], select, textarea {
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: .5em .7em; min-height: 42px;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.money-input { display: inline-flex; align-items: center; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding-left: .7em; }
.money-input span { color: var(--muted); font-weight: 600; }
.money-input input { border: 0; min-width: 0; width: 9.5em; font: 600 1.25rem var(--font-mono); padding: .35em .5em; background: transparent; box-shadow: none; }
.money-input-sm input { font-size: 1rem; width: 7.5em; }
.money-input:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input-suffix { display: inline-flex; align-items: center; gap: .35em; }
.input-suffix input { width: 5.5em; }
.check { display: inline-flex; align-items: center; gap: .45em; font-size: .92rem; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }

/* segmented buttons */
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 999px; padding: 3px; background: var(--surface); gap: 2px; }
.seg button { border: 0; background: transparent; border-radius: 999px; padding: .38em .9em; font-size: .88rem; cursor: pointer; color: var(--text-2); white-space: nowrap; }
.seg button[aria-pressed="true"] { background: var(--accent); color: #fff; }
.seg button:not([aria-pressed="true"]):hover { background: var(--surface-2); }
.seg-wrap { flex-wrap: wrap; border-radius: 18px; }

/* ---------- header ---------- */
.site-header { position: sticky; top: 0; z-index: 900; background: rgba(252, 253, 251, .94); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--border); }
.header-inner { max-width: 1180px; margin: 0 auto; padding: 0 20px; height: var(--header-h); display: flex; align-items: center; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font: 1.35rem var(--font-display); color: var(--text); text-decoration: none; white-space: nowrap; }
.brand-mark { display: block; width: 30px; height: 30px; flex: none; }
.brand-name span { color: var(--accent); }
.header-search { position: relative; flex: 1; max-width: 420px; }
.header-search input { width: 100%; border-radius: 999px; padding-left: 1rem; min-height: 40px; background: var(--surface-2); border-color: var(--border); }
.main-nav { display: flex; gap: 4px; margin-left: auto; }
.main-nav a { color: var(--text-2); text-decoration: none; padding: .45em .75em; border-radius: 999px; font-size: .93rem; font-weight: 500; white-space: nowrap; }
.main-nav a:hover { background: var(--surface-2); color: var(--text); }
.main-nav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }

/* search results dropdown */
.search-results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 12px 32px rgba(23, 32, 26, .14); z-index: 950; display: none; max-height: 420px; overflow-y: auto; padding: 6px; }
.search-results.open { display: block; }
.search-results a { display: flex; flex-direction: column; padding: .55em .75em; border-radius: var(--radius-sm); text-decoration: none; color: var(--text); }
.search-results a:hover, .search-results a[aria-selected="true"] { background: var(--accent-soft); }
.search-results .r-label { font-weight: 600; }
.search-results .r-sub { font-size: .82rem; color: var(--muted); }
.search-results .r-kind { font: 600 .66rem var(--font-mono); text-transform: uppercase; letter-spacing: .06em; color: var(--accent); }
.search-results .r-empty { padding: .7em .75em; color: var(--muted); font-size: .9rem; }

/* ---------- home ---------- */
.hero { background: radial-gradient(1200px 400px at 70% -10%, #dcebdc 0%, transparent 60%), var(--bg); padding: 44px 0 32px; border-bottom: 1px solid var(--border); }
.hero-inner { max-width: 980px; }
.hero h1 { font-size: clamp(2rem, 4.2vw, 3rem); max-width: 24ch; }
.hero-sub { font-size: 1.12rem; color: var(--text-2); max-width: 60ch; margin: 1rem 0 1.6rem; }
.hero-search { position: relative; display: flex; gap: 8px; max-width: 680px; }
.hero-search input { flex: 1; min-height: 54px; font-size: 1.08rem; border-radius: 999px; padding-left: 1.3rem; box-shadow: var(--shadow); }
.hero-search .btn { min-height: 54px; padding-inline: 1.5em; }
.intents { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 28px; }
.intent { display: flex; flex-direction: column; gap: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; text-decoration: none; color: var(--text); box-shadow: var(--shadow); transition: border-color .15s, transform .15s; }
.intent:hover { border-color: var(--accent); color: var(--text); transform: translateY(-1px); }
.intent-k { font: 600 .72rem var(--font-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--accent); }
.intent-t { font: 1.18rem/1.25 var(--font-display); }
.intent-s { font-size: .9rem; color: var(--muted); }
.national-strip { background: var(--surface); border-bottom: 1px solid var(--border); }
.strip-inner { display: grid; grid-template-columns: repeat(4, 1fr); }
.strip-item { padding: 18px 16px; display: flex; flex-direction: column; gap: 2px; border-left: 1px solid var(--border); }
.strip-item:first-child { border-left: 0; padding-left: 0; }
.strip-k { font-size: .8rem; color: var(--muted); }
.strip-v { font: 1.6rem/1.2 var(--font-display); }
.strip-s { font-size: .85rem; color: var(--text-2); }
.uk-map { height: 640px; border-radius: var(--radius); }
.rank-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 1.2rem 0; }
.rank-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }
.rank-card h3 { font-size: 1.15rem; }
.rank-sub { font-size: .8rem; color: var(--muted); margin: .2rem 0 .6rem; }
.rank-card ol { margin: 0; padding-left: 1.2em; }
.rank-card li { padding: .25em 0; font-size: .93rem; }
.rank-card li span { float: right; font-family: var(--font-mono); font-size: .85rem; color: var(--text-2); }
.chip-list { list-style: none; padding: 0; margin: 1rem 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; gap: .5em; align-items: baseline; padding: .45em .9em; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface); text-decoration: none; color: var(--text); font-size: .93rem; }
.chip span { font-family: var(--font-mono); font-size: .82rem; color: var(--muted); }
.chip:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }

/* ---------- page head (area pages, rankings…) ---------- */
.page-head { background: var(--surface); border-bottom: 1px solid var(--border); padding: 18px 0 8px; }
.breadcrumb ol { list-style: none; padding: 0; margin: 0 0 .9rem; display: flex; flex-wrap: wrap; gap: .3em; font-size: .85rem; color: var(--muted); }
.breadcrumb li + li::before { content: '›'; margin-right: .3em; color: var(--border-strong); }
.breadcrumb a { color: var(--muted); }
.lede { font-size: 1.05rem; color: var(--text-2); margin: .6rem 0 1.2rem; max-width: 70ch; }
.summary { font-size: 1.02rem; color: var(--text-2); max-width: 78ch; margin: 1.2rem 0; }
.notice { background: #fff7e0; border: 1px solid #ecd28e; border-radius: var(--radius); padding: 12px 16px; margin: 1rem 0; }

.kpi-grid { display: grid; grid-template-columns: 1.35fr 1fr 1fr 1fr; gap: 12px; }
.kpi { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.kpi-main { background: var(--accent); border-color: var(--accent); color: #fff; }
.kpi-main .kpi-label, .kpi-main .kpi-note { color: #d6eadc; }
.kpi-main .chg { color: #fff; background: rgba(255, 255, 255, .16); }
.kpi-label { font: 600 .72rem var(--font-mono); text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.kpi-value { font: 2.4rem/1.05 var(--font-display); letter-spacing: -.01em; }
.kpi-value-sm { font-size: 1.85rem; }
.kpi-sub { font-size: .9rem; }
.kpi-note { font-size: .82rem; color: var(--muted); }
.kpi-compare { list-style: none; margin: .2rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .35rem; font-size: .92rem; }
.kpi-compare strong { font: 1.35rem var(--font-display); margin-right: .2em; }
.kpi-compare span { color: var(--muted); font-size: .82rem; }
.chg { font-family: var(--font-mono); font-weight: 600; font-size: .9em; padding: .05em .35em; border-radius: 4px; white-space: nowrap; }
.chg.up { color: var(--up); background: #e3f1e7; }
.chg.down { color: var(--down); background: #fbe9e7; }
.chg.flat { color: var(--muted); }

.section-nav { display: flex; gap: 6px; overflow-x: auto; padding: 8px 0 10px; margin-top: .4rem; scrollbar-width: none; }
.section-nav::-webkit-scrollbar { display: none; }
.section-nav a { flex: none; font-size: .88rem; padding: .35em .85em; border: 1px solid var(--border); border-radius: 999px; text-decoration: none; color: var(--text-2); background: var(--surface); }
.section-nav a:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- sections ---------- */
.content { padding-bottom: 48px; }
.section { padding: 40px 0 8px; border-bottom: 1px solid var(--border); }
.content > .section:last-child { border-bottom: 0; }
.section h2 { max-width: 30ch; }
.section-sub { color: var(--text-2); margin: .6rem 0 1.2rem; max-width: 75ch; }
.h3 { margin: 1.8rem 0 .8rem; font-size: 1.2rem; }

.table-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; }
.price-table th, .price-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.price-table thead th { font: 600 .74rem var(--font-mono); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--surface-2); white-space: nowrap; }
.price-table tbody th { font-weight: 600; white-space: nowrap; }
.price-table td { min-width: 110px; }
.price-table .v { display: block; font: 600 1.05rem var(--font-mono); font-variant-numeric: tabular-nums; }
.price-table .r { display: block; font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.price-table .na { color: var(--border-strong); }
.price-table .col-all { background: var(--surface-2); }
.price-table .row-sub th { font-weight: 500; color: var(--text-2); }
.price-table tbody tr:last-child > * { border-bottom: 0; }
.few { display: inline-block; margin-left: .4em; font: 600 .62rem var(--font-mono); text-transform: uppercase; letter-spacing: .04em; color: #8a5a00; background: #fff3d6; border-radius: 3px; padding: 0 .35em; vertical-align: middle; }
.price-table .few { display: block; margin: .2em 0 0; width: max-content; }

.data-table th, .data-table td { padding: 9px 12px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
.data-table thead th { font: 600 .74rem var(--font-mono); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--surface-2); position: sticky; top: 0; }
.data-table thead th.num, .data-table td.num, .data-table th.num { text-align: right; }
.data-table tbody th { font-weight: 500; }
.data-table tbody tr:hover { background: var(--surface-2); }
.data-table tr.current { background: var(--accent-soft); }
.data-table tr[data-low] td, .data-table tr[data-low] th a { opacity: .75; }
.data-table tbody tr:last-child > * { border-bottom: 0; }
.sortable th[data-sort] { cursor: pointer; user-select: none; }
.sortable th[data-sort]::after { content: '↕'; opacity: .35; margin-left: .3em; font-size: .9em; }
.sortable th[aria-sort="ascending"]::after { content: '↑'; opacity: 1; }
.sortable th[aria-sort="descending"]::after { content: '↓'; opacity: 1; }
#wardTable { max-height: 520px; }
.table-scroll:has(#wardTable) { max-height: 560px; overflow-y: auto; }
.mini-table { width: auto; margin-top: .3rem; }
.mini-table th { text-align: left; font-weight: 500; padding: .1em 1em .1em 0; color: var(--text-2); font-size: .9rem; }
.mini-table td { font-family: var(--font-mono); font-size: .9rem; }

/* budget tool */
.budget-tool { display: grid; grid-template-columns: minmax(240px, 300px) 1fr; gap: 24px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.budget-input { display: flex; flex-direction: column; gap: 10px; }
.budget-input label { font-weight: 600; }
.budget-input input[type=range] { width: 100%; accent-color: var(--accent); }
.budget-out p { margin: 0 0 .7rem; }
.budget-out .big { font: 1.6rem/1.25 var(--font-display); }
.budget-out ul { margin: .3rem 0 .8rem; padding-left: 1.1em; }
.budget-out li { margin: .15rem 0; }
.budget-out .wards-in-reach { columns: 2; column-gap: 24px; }
.mortgage { margin-top: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 0 20px; }
.mortgage summary { cursor: pointer; padding: 14px 0; font-weight: 600; color: var(--accent); }
.mortgage-grid { display: flex; flex-wrap: wrap; gap: 16px 24px; }
.mortgage-grid label { display: flex; flex-direction: column; gap: 4px; font-size: .9rem; color: var(--text-2); }
.mortgage-out { font: 1.3rem var(--font-display); margin: 1rem 0 .2rem; }

/* maps */
.map-panel { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; margin-bottom: 16px; }
.map-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 10px; font-size: .92rem; }
.map-toolbar select { min-height: 36px; padding: .25em .6em; }
.budget-inline { display: flex; align-items: center; gap: 8px; }
.ward-map { height: 440px; border-radius: var(--radius-sm); background: var(--surface-2); }
.legend { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: .8rem; color: var(--text-2); margin-top: 10px; }
.legend-scale { display: flex; height: 12px; border-radius: 3px; overflow: hidden; width: 260px; max-width: 60vw; }
.legend-scale span { flex: 1; }
.legend .nodata { display: inline-flex; align-items: center; gap: .35em; }
.legend .nodata::before { content: ''; width: 12px; height: 12px; border-radius: 2px; background: #e6e9e3; border: 1px solid #cfd5ca; }
.leaflet-container { font: inherit; background: #e9efe6; }
.leaflet-control-attribution { font-size: 10px !important; }
.ward-label { pointer-events: none; }
.ward-label span { display: block; transform: translate(-50%, -50%); white-space: nowrap; font: 600 11px/1.1 var(--font-body); color: #17201a; text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 2px #fff; }
.map-tip { font-size: .85rem; line-height: 1.4; }
.map-tip strong { display: block; font-size: .95rem; }
.leaflet-tooltip.tip { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: 0 6px 18px rgba(0, 0, 0, .12); color: var(--text); padding: 8px 10px; }

/* charts */
.chart-controls { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; margin-bottom: 12px; }
.chart-box { position: relative; height: 300px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; }
.chart-tall { height: 380px; }

/* sellers' calculator */
.since-bought { margin-top: 22px; background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: var(--radius); padding: 16px 20px; }
.since-bought h3 { font-size: 1.2rem; margin-bottom: .8rem; }
.since-inputs { display: flex; flex-wrap: wrap; gap: 14px 22px; }
.since-inputs label { display: flex; flex-direction: column; gap: 4px; font-size: .9rem; color: var(--text-2); }
.since-out { font-size: 1.08rem; margin: 1rem 0 0; }
.since-out strong { font-family: var(--font-display); font-weight: 400; font-size: 1.3rem; }

/* home value estimate */
.value-tool { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 20px 28px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.value-inputs { display: flex; flex-direction: column; gap: 14px; }
.value-inputs label { display: flex; flex-direction: column; gap: 4px; font-size: .9rem; color: var(--text-2); }
.value-inputs select { max-width: 16rem; }
.value-out p { margin: 0 0 .6rem; }
.value-figure { display: flex; flex-direction: column; }
.value-k { font: 600 .74rem var(--font-mono); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.value-figure strong { font: 400 2.4rem/1.1 var(--font-display); color: var(--accent-strong); }
.value-range strong { font-variant-numeric: tabular-nums; }
.value-basis { font-size: .9rem; color: var(--text-2); }
.value-none { color: var(--text-2); }

/* recent sales */
.recent-table th[scope="row"] { font-weight: 500; }
.recent-table td.price { font-weight: 600; font-variant-numeric: tabular-nums; }
.data-table .pc { margin-left: .5em; font: .78rem var(--font-mono); color: var(--muted); }
.tag { display: inline-block; margin-left: .45em; font: 600 .62rem var(--font-mono); text-transform: uppercase; letter-spacing: .04em; color: var(--text-2); background: var(--surface-3); border-radius: 3px; padding: 0 .35em; vertical-align: middle; }
.epc { display: inline-block; min-width: 1.7em; text-align: center; font: 700 .8rem/1.6 var(--font-mono); border-radius: 3px; color: #fff; }
.epc-a { background: #008054; } .epc-b { background: #19b459; } .epc-c { background: #8dce46; color: #17201a; }
.epc-d { background: #ffd500; color: #17201a; } .epc-e { background: #fcaa65; color: #17201a; }
.epc-f { background: #ef8023; color: #17201a; } .epc-g { background: #e9153b; }
.more-rows { margin-top: 10px; }
.more-rows summary { cursor: pointer; color: var(--accent); font-weight: 600; padding: 6px 0; }
.more-rows[open] summary { margin-bottom: 8px; }

/* CSS bar charts */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; }
.bars { display: flex; flex-direction: column; gap: 6px; }
.bar-row { display: grid; grid-template-columns: 7.5rem 1fr 3.2rem; gap: 10px; align-items: center; font-size: .9rem; }
.bars .bar-row:has(.bar-label:only-child) { grid-template-columns: 1fr; }
.bar-label { color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { position: relative; height: 18px; background: var(--surface-2); border-radius: 3px; }
.bar { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent); border-radius: 3px; }
.bar-cmp { position: absolute; left: 0; bottom: -4px; height: 3px; background: var(--text); border-radius: 2px; opacity: .55; }
.bar-val { font-family: var(--font-mono); font-size: .85rem; text-align: right; }
#energy .bar-row { grid-template-columns: 1.6rem 1fr 3.2rem; }
#energy .bar-label { font-weight: 700; }
.legend-inline { display: flex; align-items: center; gap: .4em; }
.swatch { display: inline-block; width: 14px; height: 10px; border-radius: 2px; margin-left: .6em; }
.swatch-area { background: linear-gradient(90deg, #008054, #ffd500, #e9153b); margin-left: 0; }
.swatch-cmp { height: 3px; background: var(--text); opacity: .55; }
.facts { margin: 0; padding-left: 1.1em; display: flex; flex-direction: column; gap: .7rem; }
.fact-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 16px; }
.fact { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.fact-k { font: 600 .72rem var(--font-mono); text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.fact-v { font: 1.7rem/1.2 var(--font-display); margin: .15rem 0; }
.fact-s { font-size: .86rem; color: var(--text-2); }

/* FAQ */
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 0 18px; margin-bottom: 8px; }
.faq summary { cursor: pointer; padding: 14px 0; font-weight: 600; }
.faq details p { color: var(--text-2); }
.explore-link { margin-top: 1.4rem; color: var(--text-2); }

/* rankings & compare */
.table-toolbar { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: end; margin: 20px 0 14px; }
.table-toolbar label { display: flex; flex-direction: column; gap: 4px; font-size: .88rem; color: var(--text-2); }
.rankings tbody th a { font-weight: 600; }
.table-scroll:has(.rankings) { max-height: 75vh; overflow-y: auto; }
.compare-picker { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 0 0 14px; }
.picker-search { position: relative; width: min(360px, 100%); }
.picker-search input { width: 100%; border-radius: 999px; }
.picked { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0; }
.picked li { display: inline-flex; align-items: center; gap: .4em; padding: .35em .5em .35em .9em; border-radius: 999px; color: #fff; font-weight: 600; font-size: .92rem; }
.picked button { background: rgba(255, 255, 255, .22); border: 0; color: #fff; border-radius: 999px; width: 24px; height: 24px; cursor: pointer; line-height: 1; }
.compare-table th, .compare-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.compare-table thead th { background: var(--surface-2); font-family: var(--font-display); font-weight: 400; font-size: 1.1rem; }
.compare-table tbody th { font-weight: 500; color: var(--text-2); white-space: nowrap; }
.compare-table td { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.compare-table td.best { background: var(--accent-soft); }
.compare-controls { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: end; margin: 14px 0; }
.compare-controls label { display: flex; flex-direction: column; gap: 4px; font-size: .88rem; color: var(--text-2); }

/* about */
.prose { padding-top: 10px; }
.prose > * { max-width: 760px; }
.about-q { padding: 22px 0 6px; border-bottom: 1px solid var(--border); }
.about-q h2 { font-size: 1.4rem; margin-bottom: .6rem; }
.about-q p, .about-q ul { color: var(--text-2); }
.about-q ul { padding-left: 1.2em; margin: 0 0 1em; }
.about-q li { margin: .3em 0; }

/* ---------- footer ---------- */
.site-footer { background: #17201a; color: #c9d4c4; margin-top: 40px; }
.site-footer .footer-inner { max-width: 1180px; margin: 0 auto; padding: 36px 20px 28px; display: grid; grid-template-columns: 2fr 1fr; gap: 24px 48px; }
.site-footer h2 { font: 600 .78rem var(--font-mono); text-transform: uppercase; letter-spacing: .08em; color: #fff; margin-bottom: .8rem; }
.site-footer ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: .5rem; font-size: .86rem; }
.site-footer a, .site-footer .link-button { color: #e4ecdf; }
.footer-disclaimer { grid-column: 1 / -1; font-size: .8rem; color: #9fb09a; border-top: 1px solid #2c392e; padding-top: 18px; margin: 0; }

/* contact modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(10, 16, 12, .5); z-index: 1000; display: none; }
.modal-backdrop.visible { display: block; }
.modal { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(480px, calc(100vw - 32px)); background: var(--surface); border-radius: var(--radius); padding: 20px 22px; z-index: 1001; display: none; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
.modal.visible { display: block; }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.modal-title { font-size: 1.4rem; }
.modal-close { background: none; border: 0; font-size: 1.6rem; cursor: pointer; color: var(--muted); }
.form-group { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.form-group label { font-size: .9rem; font-weight: 600; }
.form-status { font-size: .9rem; min-height: 1.2em; }
.form-status.success { color: var(--up); }
.form-status.error { color: var(--down); }
.form-actions { display: flex; justify-content: flex-end; }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .rank-grid { grid-template-columns: 1fr 1fr; }
  .fact-grid { grid-template-columns: 1fr 1fr; }
  .main-nav a { padding: .45em .55em; }
}
@media (max-width: 820px) {
  .site-header { position: relative; }
  .header-inner { flex-wrap: wrap; height: auto; padding-block: 8px; gap: 8px 12px; }
  .header-search { order: 3; flex-basis: 100%; max-width: none; }
  .main-nav { margin-left: auto; overflow-x: auto; }
  .main-nav a:last-child { display: none; }
  html { scroll-padding-top: 12px; }
  .intents { grid-template-columns: 1fr; }
  .value-tool { grid-template-columns: 1fr; }
  .recent-table th[scope="row"] { white-space: normal; min-width: 8.5em; }
  .recent-table .pc { display: block; margin-left: 0; }
  .strip-inner { grid-template-columns: 1fr 1fr; }
  .strip-item { border-left: 0; padding-left: 0; border-top: 1px solid var(--border); }
  .budget-tool { grid-template-columns: 1fr; }
  .two-col { grid-template-columns: 1fr; }
  .uk-map { height: 520px; }
  .site-footer .footer-inner { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  body { font-size: 15px; }
  .wrap { padding-inline: 16px; }
  .kpi-grid { grid-template-columns: 1fr; }
  .kpi-value { font-size: 2.1rem; }
  .rank-grid, .fact-grid { grid-template-columns: 1fr; }
  .hero { padding-top: 32px; }
  .hero-search .btn { display: none; }
  .budget-out .wards-in-reach { columns: 1; }
  .hide-sm { display: none; }
  .ward-map { height: 340px; }
  .uk-map { height: 440px; }
  .chart-box { height: 260px; }
  .chart-tall { height: 300px; }
  .bar-row { grid-template-columns: 6rem 1fr 2.8rem; }
  .main-nav a { font-size: .85rem; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
