@font-face {
  font-family: "Sofia Sans";
  src: url("/assets/fonts/sofia-sans-latin-wght-normal.woff2") format("woff2");
  font-weight: 1 1000;
  font-display: fallback;
}
@font-face {
  font-family: "Sofia Sans Extra Condensed";
  src: url("/assets/fonts/sofia-sans-extra-condensed-latin-wght-normal.woff2") format("woff2");
  font-weight: 1 1000;
  font-display: fallback;
}

:root {
  color-scheme: light;
  --lough: #0f2e3d;
  --lough-2: #173f50;
  --basalt: #17303a;
  --slate: #48616b;
  --mist: #e8eeef;
  --paper: #f5f8f8;
  --line: #c6d3d6;
  --whin: #f4c430;
  --whin-deep: #8a6a00;
  --regional: #2f6272;
  --on-lough: #e6f1f0;
  --on-lough-2: #a9c3c7;
  --condensed: "Sofia Sans Extra Condensed", "Arial Narrow", sans-serif;
  --sans: "Sofia Sans", system-ui, sans-serif;
  --gutter: 16px;
  --page: 1280px;
}
@media (min-width: 700px) { :root { --gutter: 32px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--basalt);
  font: 400 1.0625rem/1.55 var(--sans);
}
h1, h2, h3, p, dl, dd, ol, ul, fieldset { margin: 0; padding: 0; }
ol, ul { list-style: none; }
fieldset { border: 0; }
a { color: inherit; text-underline-offset: .16em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--lough); outline-offset: 2px; border-radius: 2px; }
.hero-map :focus-visible, .site-footer :focus-visible, .site-header--over nav :focus-visible { outline-color: var(--whin); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; background: var(--whin); color: var(--lough); padding: 8px 12px; z-index: 10; font-weight: 700; }
.skip:focus { top: 8px; }
.wrap { width: min(100% - 2 * var(--gutter), var(--page)); margin-inline: auto; }
.stale { background: var(--whin); color: var(--lough); padding: 10px var(--gutter); font-weight: 600; }
.stale[hidden] { display: none; }

/* Header */
.site-header {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  padding: 16px max(var(--gutter), calc((100% - var(--page)) / 2));
}
.wordmark {
  font: 800 1.75rem/1 var(--condensed);
  letter-spacing: .005em;
  text-decoration: none;
  white-space: nowrap;
}
.site-header nav { display: flex; gap: 18px; font-size: .95rem; }
.site-header nav a { text-decoration: none; border-bottom: 2px solid transparent; padding-block: 4px; }
.site-header nav a:hover { border-bottom-color: currentColor; }

/* Hero: calculator on the land side, the map out on the water */
.hero { container-type: inline-size; }
.hero { display: grid; grid-template-columns: minmax(0, 1fr); }
.hero-calc { padding: 8px var(--gutter) 36px; }
.hero h1 {
  font: 800 clamp(2.9rem, 12.5vw, 4.9rem)/.92 var(--condensed);
  letter-spacing: -.006em;
  color: var(--lough);
}
.hero-intro { margin-top: 10px; color: var(--slate); font-size: 1.0625rem; }
.calc { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; margin-top: 24px; }
.field label, legend { display: block; font-weight: 700; font-size: .95rem; margin-bottom: 6px; }
.money-input {
  display: flex; align-items: center; background: #fff;
  border: 2px solid var(--lough); border-radius: 4px; padding-left: 12px; height: 56px;
}
.money-input span { font: 700 1.6rem/1 var(--condensed); color: var(--slate); }
.money-input:focus-within { outline: 3px solid var(--whin); outline-offset: 1px; }
.money-input input {
  border: 0; outline: 0; background: transparent; width: 100%; height: 100%; padding: 0 10px 0 6px;
  font: 700 1.9rem/1 var(--condensed); color: var(--lough); font-variant-numeric: tabular-nums;
}
.money-input input[aria-invalid] { color: #9c2b16; }
.select-wrap { position: relative; }
.select-wrap::after {
  content: ""; position: absolute; right: 16px; top: 50%; width: 9px; height: 9px;
  border-right: 2px solid var(--lough); border-bottom: 2px solid var(--lough);
  transform: translateY(-70%) rotate(45deg); pointer-events: none;
}
select {
  appearance: none; width: 100%; height: 56px; background: #fff; color: var(--lough);
  border: 2px solid var(--lough); border-radius: 4px; padding: 0 38px 0 12px;
  font: 600 1.0625rem/1.2 var(--sans);
}
select:focus-visible { outline: 3px solid var(--whin); outline-offset: 1px; }

.slider { appearance: none; width: 100%; height: 28px; margin: 8px 0 0; background: transparent; cursor: pointer; display: block; }
.slider::-webkit-slider-runnable-track { height: 4px; background: var(--lough); border-radius: 2px; }
.slider::-moz-range-track { height: 4px; background: var(--lough); border-radius: 2px; }
.slider::-webkit-slider-thumb { appearance: none; width: 24px; height: 24px; margin-top: -10px; border-radius: 50%; background: var(--whin); border: 2px solid var(--lough); }
.slider::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: var(--whin); border: 2px solid var(--lough); }
.help { font-size: .9rem; line-height: 1.45; color: var(--slate); }
.help a { color: var(--basalt); }
.reductions summary { cursor: pointer; font-weight: 700; font-size: .95rem; width: fit-content; padding: 4px 0; }
.reductions fieldset { display: grid; gap: 6px; padding-top: 8px; }
.radio { display: flex; gap: 8px; align-items: flex-start; padding: 4px 0; cursor: pointer; }
.radio input { margin: .3em 0 0; width: 18px; height: 18px; accent-color: var(--lough); flex: none; }

.result { margin-top: 20px; }
.result-top { display: grid; gap: 14px; }
.result-error { font-weight: 700; font-size: 1.15rem; color: var(--lough); padding: 12px 0 24px; }
.bill {
  font: 800 clamp(5rem, 24vw, 8.25rem)/.84 var(--condensed);
  color: var(--lough);
  letter-spacing: -.012em;
}
.bill output { display: block; }
.bill-caption { font-size: 1.0625rem; margin-top: 8px; font-weight: 600; }
.monthly { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.monthly dt { font-size: .875rem; color: var(--slate); line-height: 1.3; }
.monthly dd { font-weight: 700; font-size: 1.0625rem; }
.split { display: flex; gap: 2px; height: 16px; margin-top: 18px; }
.split span { display: block; flex: 1 1 0; min-width: 2px; transition: flex-grow .16s ease-out; }
.split-regional { background: var(--regional); }
.split-district { background: var(--whin); box-shadow: inset 0 0 0 1px var(--whin-deep); }
.split-key { display: grid; gap: 4px; margin-top: 10px; }
.split-key div { display: flex; justify-content: space-between; gap: 12px; }
.split-key dd { font-weight: 700; }
.key-regional::before, .key-district::before, .split-key div > dt::before { content: none; }
.split-key dt { display: flex; gap: 8px; align-items: baseline; }
.split-key dt::before { content: ""; width: 10px; height: 10px; flex: none; transform: translateY(1px); }
.split-key .key-regional dt::before { content: ""; background: var(--regional); }
.split-key .key-district dt::before { content: ""; background: var(--whin); box-shadow: inset 0 0 0 1px var(--whin-deep); }
.split-key .key-district dt span { display: inline; }
.working { margin-top: 10px; font-size: .95rem; color: var(--slate); }
.cap-note { margin-top: 8px; padding-left: 10px; border-left: 3px solid var(--whin); font-size: .95rem; }
.source { margin-top: 12px; font-size: .84rem; line-height: 1.45; color: var(--slate); }
.source a { color: var(--basalt); }
.share {
  margin-top: 14px; min-height: 44px; padding: 8px 16px; cursor: pointer;
  background: var(--lough); color: #fff; border: 0; border-radius: 4px;
  font: 700 .95rem/1.2 var(--sans);
}
.share:hover { background: var(--lough-2); }

.hero-map { background: var(--lough); color: var(--on-lough); padding: 24px var(--gutter) 22px; }
.map { display: block; width: 100%; height: auto; overflow: visible; }
.area { cursor: pointer; outline: none; }
.area path { stroke: var(--lough); stroke-width: 1.4; stroke-linejoin: round; transition: fill .15s ease-out; }
.area:hover path { stroke: #fff; stroke-width: 2; }
.focus-ring { fill: none; stroke: #fff; stroke-width: 4; pointer-events: none; }
.focus-ring[hidden] { display: none; }
.area.is-selected path { fill: var(--whin); }
.area.is-selected path { stroke-width: 1.8; }
.area-label { display: none; font: 600 14.5px/1 var(--sans); pointer-events: none; }
.area-label.is-selected { fill: var(--lough); }
.area-figure { font: 800 22px/1 var(--condensed); }
.map-title { font: 800 clamp(1.7rem, 5.4vw, 2.3rem)/1.02 var(--condensed); color: #fff; margin-bottom: 18px; }
.map-caption { margin-top: 14px; font-size: .95rem; color: var(--on-lough-2); line-height: 1.45; }
.map-caption strong { color: #fff; font-weight: 700; }
.map-caption a { color: #fff; }

/* Compare */
.compare { padding: 44px 0; background: var(--mist); scroll-margin-top: 8px; }
.finding {
  font: 800 clamp(2.3rem, 8.4vw, 4.2rem)/1 var(--condensed);
  color: var(--lough);
  letter-spacing: -.004em;
}
.finding-sub { margin-top: 14px; color: var(--basalt); }
.legend { display: flex; gap: 18px; margin-top: 26px; font-size: .9rem; color: var(--slate); }
.legend span { display: flex; align-items: center; gap: 7px; }
.legend span::before { content: ""; width: 12px; height: 12px; }
.legend .key-regional::before { background: var(--regional); }
.legend .key-district::before { background: var(--whin); box-shadow: inset 0 0 0 1px var(--whin-deep); }
.ranking { margin-top: 8px; }
.rank-row {
  display: grid; align-items: center; column-gap: 10px;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  grid-template-areas: "n name bill" "n bar diff";
  padding: 11px 0; border-top: 1px solid var(--line);
}
.rank-row:last-child { border-bottom: 1px solid var(--line); }
.rank-n { grid-area: n; align-self: start; font: 700 1.2rem/1.35 var(--condensed); color: var(--slate); }
.rank-name { grid-area: name; font-weight: 700; line-height: 1.25; }
.rank-name a { text-decoration: none; }
.rank-name a:hover { text-decoration: underline; }
.rank-name small { display: block; font-weight: 400; font-size: .84rem; color: var(--slate); }
.rank-bar { grid-area: bar; display: block; width: 100%; height: 14px; margin-top: 6px; }
.bar-regional { fill: var(--regional); }
.bar-district { fill: var(--whin); }
.rank-bill, .rank-diff { font-variant-numeric: tabular-nums; }
.rank-bill { grid-area: bill; font: 800 1.5rem/1.1 var(--condensed); text-align: right; color: var(--lough); }
.rank-diff { grid-area: diff; font-size: .84rem; color: var(--slate); text-align: right; white-space: nowrap; align-self: end; }
.rank-row.is-selected { background: linear-gradient(90deg, var(--whin) 0 5px, transparent 5px); padding-left: 12px; margin-left: -12px; }

/* Leaves out, facts */
.leaves-out { padding: 40px 0 48px; }
.prose-grid { display: grid; gap: 12px; }
.leaves-out h2, .council-facts h2, .article h2 { font: 800 clamp(1.9rem, 6vw, 2.5rem)/1.02 var(--condensed); color: var(--lough); }
.council-facts { padding: 44px 0; background: var(--mist); }
.facts-grid { display: grid; gap: 36px; }
.fact-lead p { margin-top: 12px; }
.bands table { width: 100%; border-collapse: collapse; margin-top: 8px; }
caption { text-align: left; font-size: .9rem; color: var(--slate); padding-bottom: 8px; }
th, td { font-variant-numeric: tabular-nums; text-align: right; padding: 9px 0 9px 12px; border-top: 1px solid var(--line); font-weight: 400; }
th:first-child { text-align: left; padding-left: 0; font-weight: 700; }
thead th { font-weight: 700; font-size: .88rem; color: var(--slate); border-top: 0; vertical-align: bottom; line-height: 1.25; }

.neighbours { padding: 22px 0; border-top: 1px solid var(--line); }
.neighbours-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.neighbours a { font-weight: 700; text-decoration: none; line-height: 1.25; }
.neighbours a:hover { text-decoration: underline; }
.neighbours a span { display: block; font-weight: 400; font-size: .84rem; color: var(--slate); }
.neighbours a:last-child { text-align: right; }
.neighbours .all { grid-row: 2; grid-column: 1 / -1; text-align: center; }

/* Articles */
.article { padding: 22px 0 56px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 34px; }
.article h1 { font: 800 clamp(3rem, 12vw, 5rem)/.94 var(--condensed); color: var(--lough); }
.lede { font-size: 1.2rem; line-height: 1.42; margin-top: 14px; }
.article section { scroll-margin-top: 16px; }
.article section > * + * { margin-top: 12px; }
.article h3 { font-size: 1.0625rem; font-weight: 800; color: var(--lough); margin-top: 22px; }
.formula {
  font: 800 clamp(1.7rem, 6vw, 2.7rem)/1.06 var(--condensed);
  color: var(--lough); background: var(--whin); padding: 14px 16px; border-radius: 2px;
}
.cite { font-size: .9rem; color: var(--slate); }
.table-scroll { overflow-x: auto; }
.rates-table { border-collapse: collapse; width: 100%; min-width: 620px; }
.rates-table th:first-child a { text-decoration: none; }
.rates-table th:first-child a:hover { text-decoration: underline; }

/* Footer */
.site-footer { background: var(--lough); color: var(--on-lough); padding: 36px 0 26px; font-size: .95rem; }
.site-footer a { color: #fff; }
.footer-grid { display: grid; gap: 26px; }
.footer-grid p + p { margin-top: 8px; }
.footer-mark { font: 800 1.75rem/1 var(--condensed); margin-bottom: 10px; color: #fff; }
.footer-grid li { padding: 3px 0; }
.footer-councils > p { font-weight: 700; margin-bottom: 4px; color: #fff; }
.attribution { margin-top: 26px; padding-top: 16px; border-top: 1px solid #2c5361; font-size: .82rem; color: var(--on-lough-2); line-height: 1.45; }

/* Share card, used once to make og.png */
.og { width: 1200px; height: 630px; background: var(--lough); color: var(--on-lough); display: grid; grid-template-columns: 590px 1fr; overflow: hidden; }
.og-text { padding: 54px 20px 44px 60px; display: flex; flex-direction: column; }
.og .wordmark { color: var(--whin); font-size: 2.6rem; }
.og-line { font: 800 4.3rem/.98 var(--condensed); color: #fff; margin-top: 44px; }
.og-sub { margin-top: auto; font-size: 1.4rem; line-height: 1.3; }
.og-map { padding: 56px 40px 0 10px; }
.og .area-label { display: none; }

@media (min-width: 620px) {
  .calc { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 16px; }
  .calc .help, .reductions { grid-column: 1 / -1; }
  .rank-row {
    grid-template-columns: 26px minmax(170px, 2fr) minmax(120px, 3fr) 92px 92px;
    grid-template-areas: "n name bar bill diff";
    column-gap: 16px;
  }
  .rank-bar { margin-top: 0; height: 22px; }
  .rank-diff { align-self: center; }
  .rank-n { align-self: center; }
  .neighbours-row { grid-template-columns: 1fr auto 1fr; align-items: center; }
  .neighbours .all { grid-row: auto; grid-column: auto; }
}

@media (min-width: 1000px) {
  .site-header--over {
    position: absolute; inset: 0 0 auto 0; z-index: 2; padding-block: 22px;
    padding-inline: max(var(--gutter), calc((100% - var(--page)) / 2)) var(--gutter);
  }
  .site-header--over nav { color: var(--on-lough); }
  .hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 100vh; }
  .hero h1 { font-size: clamp(3.2rem, 5vw, 4.4rem); }
  .result-top { grid-template-columns: auto minmax(0, 1fr); gap: 26px; align-items: end; }
  .monthly { grid-template-columns: minmax(0, 1fr); padding-bottom: 2px; }
  .bill { font-size: clamp(5.4rem, 8.4vw, 7.4rem); }
  .calc { margin-top: 18px; gap: 12px 16px; }
  .hero-calc {
    padding: 72px 40px 32px max(var(--gutter), calc((100cqw - var(--page)) / 2));
  }
  .hero-map {
    padding: 78px var(--gutter) 30px;
    display: flex; flex-direction: column; justify-content: center;
  }
  .area-label { display: inline; }
  .finding { grid-column: 1 / -1; }
  .finding, .finding-sub { width: 88%; }
  .prose-grid { grid-template-columns: 1fr 2fr; gap: 32px; }
  .facts-grid { grid-template-columns: 1fr 1fr; gap: 64px; }
  .footer-grid { grid-template-columns: 2fr 1.2fr 3fr; gap: 48px; }
  .footer-councils ul { columns: 2; column-gap: 28px; }
  .article { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; padding-top: 36px; }
  .article > * { grid-column: 1 / span 8; }
  .article > section:has(.rates-table) { grid-column: 1 / span 10; }
}

@media (min-width: 1000px) and (max-width: 1199px) {
  /* Too small to read here: keep the figures, the caption names the selection. */
  .area-label tspan:not(.area-figure) { display: none; }
  .area-figure { font-size: 25px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

@media print {
  .hero-map, .site-footer, .share, .slider, .reductions, .site-header nav { display: none; }
}
