/* Neutral civic look: no organisation colours. System fonts only. */
:root {
  color-scheme: light;
  --ink: #1b2430;
  --ink-2: #4a5565;
  --line: #d5dae1;
  --bg: #ffffff;
  --bg-2: #f4f6f8;
  --accent: #1f5f6b;
  --accent-ink: #ffffff;
  --demo-bg: #ffdd57;
  --demo-ink: #1b1b1b;
  /* categorical slots, fixed order = fixed category (validated set) */
  --cat-long_term_empty: #257de0;
  --cat-unfinished_shell: #f47230;
  --cat-residence_programme: #00b894;
  --cat-seasonal_shortlet: #f2a600;
  --cat-awaiting_redevelopment: #ee7fac;
}
* { box-sizing: border-box; }
html { scroll-padding-top: 6rem; }
body {
  margin: 0;
  font: 1rem/1.6 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
a { color: var(--accent); }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid #0b57d0; outline-offset: 2px; }
img { max-width: 100%; }

.skip { position: absolute; left: -999rem; }
.skip:focus { left: .5rem; top: 3.5rem; z-index: 3000; background: #fff; padding: .5rem; }

/* Demo banner: stays at the top of the window on every page */
.demo-banner {
  position: sticky; top: 0; z-index: 2000;
  background: var(--demo-bg); color: var(--demo-ink);
  border-bottom: 2px solid #1b1b1b;
  padding: .45rem 1rem; text-align: center;
  font-weight: 700; font-size: .95rem; line-height: 1.35;
}

.site-header { border-bottom: 1px solid var(--line); background: var(--bg); }
.wrap { max-width: 68rem; margin: 0 auto; padding: 0 1rem; }
.head-row { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; padding: .6rem 0; }
.brand { font-size: 1.5rem; font-weight: 800; letter-spacing: .01em; color: var(--ink); text-decoration: none; }
.brand small { display: block; font-size: .78rem; font-weight: 500; color: var(--ink-2); letter-spacing: 0; }
.site-nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: .15rem .9rem; margin: 0; padding: 0 0 .6rem; }
.site-nav a { display: inline-block; padding: .3rem 0; color: var(--ink); text-decoration: none; border-bottom: 3px solid transparent; font-size: .95rem; }
.site-nav a:hover { border-bottom-color: var(--line); }
.site-nav a[aria-current="page"] { border-bottom-color: var(--accent); font-weight: 700; }

main { padding: 1.5rem 0 3rem; }
h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); line-height: 1.2; margin: .2rem 0 1rem; }
h2 { font-size: 1.35rem; margin: 2rem 0 .5rem; line-height: 1.3; }
h3 { font-size: 1.08rem; margin: 1.2rem 0 .3rem; }
p, li { max-width: 46rem; }
.lead { font-size: 1.15rem; color: var(--ink); }
.muted { color: var(--ink-2); }
.small { font-size: .88rem; }

.btn {
  display: inline-block; background: var(--accent); color: var(--accent-ink);
  padding: .7rem 1.2rem; border-radius: .4rem; border: 0; font: inherit; font-weight: 700;
  text-decoration: none; cursor: pointer;
}
.btn:hover { background: #17494f; }
.btn.secondary { background: #fff; color: var(--accent); border: 2px solid var(--accent); padding: .45rem .9rem; }

.tag {
  display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  background: var(--demo-bg); color: var(--demo-ink); border: 1px solid #1b1b1b; border-radius: .25rem; padding: 0 .35rem;
}
.callout { border-left: 5px solid var(--accent); background: var(--bg-2); padding: .8rem 1rem; margin: 1.2rem 0; max-width: 46rem; }
.callout.warn { border-left-color: #1b1b1b; background: #fff7d6; }

/* Home: three figures */
.figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1rem; margin: 1.5rem 0; padding: 0; list-style: none; }
.figure { border: 1px solid var(--line); border-radius: .5rem; padding: 1rem 1.1rem; background: var(--bg); max-width: none; }
.figure .num { display: block; font-size: 2.4rem; font-weight: 800; line-height: 1.1; }
.figure .what { display: block; margin: .3rem 0 .5rem; }
.figure .src { font-size: .82rem; color: var(--ink-2); }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 1rem; padding: 0; list-style: none; }
.card { border: 1px solid var(--line); border-radius: .5rem; padding: 1rem 1.1rem; max-width: none; }
.card h3 { margin-top: 0; }

/* Status ladder */
.ladder { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1rem; counter-reset: step; }
.ladder li { border: 1px solid var(--line); border-top: 6px solid var(--accent); border-radius: .5rem; padding: 1rem; max-width: none; }
.ladder li::before { counter-increment: step; content: "Step " counter(step); font-size: .8rem; font-weight: 700; color: var(--ink-2); text-transform: uppercase; letter-spacing: .05em; }
.ladder h3 { margin: .2rem 0 .4rem; font-size: 1.25rem; }

table { border-collapse: collapse; width: 100%; max-width: 46rem; margin: .8rem 0; font-size: .95rem; }
th, td { text-align: left; padding: .4rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 700; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; }
caption { text-align: left; font-weight: 700; padding-bottom: .3rem; }

/* Category swatch: colour plus a text label, never colour alone */
.swatch { display: inline-block; width: .85rem; height: .85rem; border-radius: 50%; border: 1.5px solid #1b2430; vertical-align: -1px; margin-right: .35rem; }
.swatch.long_term_empty { background: var(--cat-long_term_empty); }
.swatch.unfinished_shell { background: var(--cat-unfinished_shell); }
.swatch.residence_programme { background: var(--cat-residence_programme); }
.swatch.seasonal_shortlet { background: var(--cat-seasonal_shortlet); }
.swatch.awaiting_redevelopment { background: var(--cat-awaiting_redevelopment); }

/* Map page */
.map-layout { display: grid; grid-template-columns: 17rem 1fr; gap: 1rem; align-items: start; }
.panel { border: 1px solid var(--line); border-radius: .5rem; padding: .8rem .9rem; background: var(--bg); }
.panel h2 { font-size: 1rem; margin: 0 0 .4rem; }
.panel + .panel { margin-top: 1rem; }
fieldset { border: 0; padding: 0; margin: 0 0 .8rem; }
legend { font-weight: 700; padding: 0; margin-bottom: .2rem; }
.check { display: block; padding: .15rem 0; font-size: .93rem; }
.check input { margin-right: .4rem; }
#map, #pick-map { width: 100%; border: 1px solid var(--line); border-radius: .5rem; background: #e8ecef; }
#map { height: min(72vh, 44rem); min-height: 24rem; }
#pick-map { height: 20rem; }
.map-legend { font-size: .85rem; margin-top: .6rem; }
.map-legend ul { list-style: none; padding: 0; margin: .3rem 0; display: flex; flex-wrap: wrap; gap: .2rem 1rem; }
.map-legend li { max-width: none; }
.summary-table { font-size: .88rem; }
.summary-table td, .summary-table th { padding: .2rem .3rem; }
select, input[type="text"], input[type="date"], textarea {
  font: inherit; padding: .45rem .5rem; border: 1px solid #6b7686; border-radius: .3rem; width: 100%; max-width: 30rem; background: #fff; color: var(--ink);
}
label.field { display: block; font-weight: 700; margin: 1rem 0 .25rem; }
.hint { font-size: .88rem; color: var(--ink-2); margin: 0 0 .3rem; }

/* Leaflet marker: category colour plus the status initial */
.pin { display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; border: 2px solid #1b2430; box-shadow: 0 0 0 2px #fff; }
/* the letter sits on a white disc so it reads on every category colour */
.pin b { display: flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 50%; background: #fff; color: #1b2430; font-size: 11px; font-weight: 800; line-height: 1; }
.pin.long_term_empty { background: var(--cat-long_term_empty); }
.pin.unfinished_shell { background: var(--cat-unfinished_shell); }
.pin.residence_programme { background: var(--cat-residence_programme); }
.pin.seasonal_shortlet { background: var(--cat-seasonal_shortlet); }
.pin.awaiting_redevelopment { background: var(--cat-awaiting_redevelopment); }
.leaflet-div-icon.pin-wrap { background: none; border: 0; }
.report-card h3 { margin: .1rem 0 .3rem; font-size: 1.05rem; }
.report-card dl { margin: .4rem 0; display: grid; grid-template-columns: auto 1fr; gap: .1rem .6rem; font-size: .88rem; }
.report-card dt { color: var(--ink-2); }
.report-card dd { margin: 0; }
.report-card ul { list-style: none; padding: 0; margin: .3rem 0; font-size: .88rem; }
.report-card .yes::before { content: "✓ "; font-weight: 800; }
.report-card .no::before { content: "– "; }
.report-card .no { color: var(--ink-2); }
.report-card .note { font-size: .85rem; border-top: 1px solid var(--line); padding-top: .3rem; margin-top: .3rem; }
.leaflet-popup-content { margin: .7rem .8rem; }
.leaflet-container { font: inherit; }

/* Locality brief */
.brief { border: 2px solid #1b1b1b; border-radius: .3rem; padding: 1.2rem 1.4rem; margin: 1rem 0; position: relative; background: #fff; }
.brief-stamp { background: var(--demo-bg); border: 2px solid #1b1b1b; font-weight: 800; padding: .3rem .6rem; margin: -.2rem 0 .8rem; font-size: .9rem; }
.brief h2 { margin-top: .2rem; font-size: 1.5rem; }
.brief-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 1.2rem; }
.kpis { display: flex; flex-wrap: wrap; gap: .6rem 2rem; list-style: none; padding: 0; margin: .5rem 0 1rem; }
.kpis li { max-width: none; }
.kpis b { display: block; font-size: 1.9rem; line-height: 1.1; }
.chart-box { position: relative; height: 15rem; }
.status-msg { border: 2px solid #1b1b1b; background: #fff7d6; padding: .8rem 1rem; font-weight: 700; margin: 1rem 0; max-width: 30rem; }
[hidden] { display: none !important; }

.site-footer { border-top: 1px solid var(--line); background: var(--bg-2); padding: 1.2rem 0 2rem; font-size: .9rem; color: var(--ink-2); }
.site-footer strong { color: var(--ink); }

@media (max-width: 760px) {
  .map-layout { grid-template-columns: 1fr; }
  #map { height: 62vh; }
  .demo-banner { font-size: .82rem; padding: .35rem .6rem; }
  .figure .num { font-size: 2rem; }
}
@media print {
  .site-nav, .skip, .btn { display: none; }
  .demo-banner { position: static; }
}
