:root {
  --bs-primary: #2459ad;
  --bs-primary-rgb: 36, 89, 173;
  --bs-body-color: #172026;
  --bs-body-bg: #f6f7f8;
  --bs-secondary-color: #66727c;
  --bs-secondary-rgb: 102, 114, 124;
  --bs-border-color: #dce2e7;
  --bs-link-color: #2459ad;
  --bs-link-color-rgb: 36, 89, 173;
  --bs-link-hover-color: #194588;
  --bs-link-hover-color-rgb: 25, 69, 136;
  --soft: #edf3fc;
  --highlight: #d64f3b;
  --action: #c44735;
  --action-hover: #ad3c2c;
  color-scheme: light;
  --bg: #f6f7f8;
  --panel: #ffffff;
  --text: #172026;
  --muted: #66727c;
  --line: #dce2e7;
  --accent: #2459ad;
  --accent-dark: #194588;
}

body { min-height: 100vh; display: flex; flex-direction: column; }
.site-header, .site-footer { background: #fff; border-bottom: 1px solid var(--line); }
.site-footer { margin-top: auto; border-top: 1px solid var(--line); border-bottom: 0; }
.site-header .brand { display: inline-flex; align-items: center; font-size: 28px; letter-spacing: -1px; }
.brand-mark { display: inline-grid; place-items: center; width: 34px; height: 34px; margin-right: 10px; border-radius: 9px; background: var(--accent); color: #fff; font-size: 27px; }
.brand-dot { color: var(--highlight); }
.skip-link { position: absolute; z-index: 20; padding: 12px; background: white; }

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--bs-font-sans-serif);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: auto minmax(260px, 720px);
  gap: 24px;
  align-items: center;
  padding: 18px clamp(16px, 4vw, 48px);
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
}

.brand {
  color: var(--text);
  font-size: 24px;
  font-weight: 800;
  text-decoration: none;
}

a {
  color: inherit;
}

.search {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.search input {
  width: 100%;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 16px;
}

.search button {
  padding: 12px 16px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.search button:hover {
  background: var(--accent-dark);
}

.page {
  width: min(1180px, calc(100% - 32px));
  margin: 32px auto 64px;
}

.section-heading,
.area-heading,
.region summary,
.district summary,
.result-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.section-heading {
  margin-bottom: 20px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
}

.section-heading span,
.area-heading span,
small,
.result-row > span,
.empty {
  color: var(--muted);
}

.directory {
  display: grid;
  gap: 24px;
}

.area {
  padding: 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.area-heading {
  margin-bottom: 16px;
  padding-bottom: 14px;
}

.area-heading h2 {
  font-size: 22px;
}

.area-heading p {
  margin-top: 3px;
  color: var(--muted);
}

.region,
.district {
  border-top: 1px solid var(--line);
}

.region:first-of-type {
  border-top: 0;
}

.region summary,
.district summary {
  min-height: 46px;
  cursor: pointer;
}

.region summary {
  font-weight: 700;
}

.districts {
  padding: 0 0 10px 20px;
}

.municipalities {
  columns: 220px;
  column-gap: 28px;
  margin: 0;
  padding: 8px 0 16px 20px;
}

.municipalities li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  margin-bottom: 8px;
  break-inside: avoid;
}

.municipalities span,
.municipalities a {
  overflow-wrap: anywhere;
}

.municipalities a,
.result-row a,
.breadcrumbs a {
  color: var(--accent-dark);
  font-weight: 700;
  text-decoration: none;
}

.municipalities a:hover,
.result-row a:hover,
.breadcrumbs a:hover {
  text-decoration: underline;
}

.results {
  display: grid;
  gap: 10px;
}

.result-row {
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.result-row h2 {
  margin-bottom: 4px;
  font-size: 18px;
}

.result-row p {
  color: var(--muted);
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
  color: var(--muted);
}

.breadcrumbs span::before {
  content: "/";
  margin-right: 8px;
  color: var(--line);
}

.detail-page {
  display: grid;
  gap: 24px;
}

.detail-hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-end;
  padding: 0;
  background: transparent;
  border: 0;
}

.detail-hero p {
  margin-bottom: 8px;
  color: var(--accent-dark);
  font-weight: 700;
}

.detail-hero h1 {
  margin-bottom: 8px;
  font-size: 34px;
}

.detail-hero span {
  color: var(--muted);
}

.detail-counters {
  display: flex;
  gap: 12px;
}

.detail-counters div {
  min-width: 88px;
  padding: 12px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: center;
}

.detail-counters strong {
  display: block;
  margin-bottom: 3px;
  font-size: 24px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.detail-panel {
  padding: 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.detail-panel h2 {
  margin-bottom: 16px;
  font-size: 19px;
}

.facts {
  display: grid;
  gap: 12px;
  margin: 0;
}

.facts div {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 16px;
}

.facts dt {
  color: var(--muted);
}

.facts dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.post-source-filter {
  max-width: 100%;
  margin: 0 0 12px;
  padding: 3px 2px 5px;
  overflow-x: auto;
}

.post-source-buttons { vertical-align: top; }
.post-source-buttons > .btn {
  --bs-btn-border-radius: 10px;
  --bs-btn-color: #7b858e;
  --bs-btn-border-color: var(--line);
  --bs-btn-hover-color: #36424e;
  --bs-btn-hover-bg: #fff;
  --bs-btn-hover-border-color: #c8d0d7;
  --bs-btn-active-color: #35404b;
  --bs-btn-active-bg: #fff;
  --bs-btn-active-border-color: var(--line);
  --bs-btn-focus-shadow-rgb: 102, 114, 124;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

.post-source-buttons .btn-check:focus-visible + .btn { outline: 2px solid var(--muted); outline-offset: 2px; }

.posts {
  display: grid;
  gap: 12px;
}

.post-card {
  padding: 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow-wrap: anywhere;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  color: var(--muted);
  font-size: 14px;
}

.post-source { margin-left: auto; font-weight: 600; text-align: right; }

.post-card h3 {
  margin: 8px 0 0;
  font-size: 20px;
  line-height: 1.4;
}

.post-card a {
  color: #000;
  text-decoration: none;
}

.post-card a:hover {
  text-decoration: underline;
}

.post-card p {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.6;
}

.posts-pagination {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

.posts-pagination .pagination {
  --bs-pagination-color: var(--text);
  --bs-pagination-bg: var(--panel);
  --bs-pagination-border-color: var(--line);
  --bs-pagination-hover-color: var(--text);
  --bs-pagination-hover-bg: var(--bg);
  --bs-pagination-hover-border-color: var(--line);
  --bs-pagination-focus-color: var(--text);
  --bs-pagination-focus-bg: var(--bg);
  --bs-pagination-focus-box-shadow: 0 0 0 .2rem rgb(196 71 53 / .2);
  --bs-pagination-active-color: #fff;
  --bs-pagination-active-bg: var(--action);
  --bs-pagination-active-border-color: var(--action);
  --bs-pagination-disabled-color: var(--muted);
  --bs-pagination-disabled-bg: var(--bg);
  --bs-pagination-disabled-border-color: var(--line);
  flex-wrap: wrap;
  justify-content: center;
  row-gap: 6px;
}

.posts-pagination .page-link {
  min-width: 2rem;
  text-align: center;
  text-decoration: none;
}

#clanky {
  scroll-margin-top: 160px;
}

.zsj-list {
  padding-top: 12px;
}

.nested-empty {
  padding: 0 0 16px 20px;
}

@media (max-width: 700px) {
  .topbar {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .search {
    grid-template-columns: 1fr;
  }

  .section-heading,
  .area-heading,
  .result-row,
  .detail-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .facts div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .districts {
    padding-left: 0;
  }
}

/* Shared public theme, layered over Bootstrap components. */
.page { width: 100%; margin-top: 28px; margin-bottom: 64px; }
.header-top { display: flex; align-items: center; gap: 32px; padding-top: 16px; padding-bottom: 16px; }
.header-top .search { flex: 1; margin-left: auto; max-width: 640px; }
.header-top .search input { min-width: 0; }
.search-field { position: relative; flex: 1; min-width: 0; }
.search-suggestions { position: absolute; z-index: 1050; top: calc(100% + 4px); left: 0; right: 0; max-height: min(60vh, 440px); overflow-y: auto; margin: 0; padding: 4px 0; list-style: none; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 6px 18px #17202618; }
.search-suggestions a { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; color: var(--text); text-decoration: none; }
.search-suggestions small { font-size: 12px; }
.search-suggestions a:hover, .search-suggestions [aria-selected="true"] a { background: var(--soft); }
.region-nav { display: flex; justify-content: space-between; list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.region-button { display: block; text-decoration: none; border: 0; background: transparent; padding: 14px 18px; color: var(--text); font-weight: 600; white-space: nowrap; }
.district-link { flex: 1; color: inherit; text-decoration: none; }
@media (min-width: 992px) {
  .region-nav { flex-wrap: wrap; justify-content: space-between; }
  .region-button { padding: 14px 10px; font-size: 14px; }
}
.district-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.region-button:hover, .region-button[aria-expanded="true"] { background: var(--soft); color: var(--accent); }
.region-nav .dropdown-menu { --bs-dropdown-link-active-bg: var(--accent); }
.district-menu > summary { display: flex; justify-content: space-between; align-items: center; gap: 24px; cursor: pointer; list-style: none; }
.district-menu > summary::-webkit-details-marker { display: none; }
.district-menu[open] > summary { color: var(--accent); background: var(--soft); }
.municipality-menu { position: absolute; top: 0; left: 100%; min-width: 240px; max-width: 320px; max-height: 65vh; overflow-y: auto; list-style: none; padding: 8px 0; margin: 0; background: #fff; border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 6px 18px #17202612; }
.municipality-menu .dropdown-item { white-space: normal; }
.district-overview { font-weight: 600; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.region-nav > li:nth-last-child(-n+4) .municipality-menu { left: auto; right: 100%; }
.region-nav > li:last-child .dropdown-menu { right: 0; left: auto; }
@media (max-width: 991.98px) {
  .header-top { flex-wrap: wrap; gap: 12px; }
  .header-top .brand { order: 0; }
  .header-top > button { order: 1; margin-left: auto; }
  .header-top .search { order: 2; flex-basis: 100%; max-width: none; }
  .region-nav { display: block; padding: 8px 0; }
  .region-button { width: 100%; text-align: left; padding: 12px; }
  .region-nav .dropdown-menu { position: static !important; transform: none !important; width: 100%; border: 0; background: var(--bg); }
  .region-nav .municipality-menu { position: static; min-width: 0; max-width: none; margin: 0 12px; max-height: 45vh; box-shadow: none; }
}
.home-hero { padding: 42px 0 46px; max-width: 760px; }
.home-hero h1 { font-size: clamp(2rem, 4.5vw, 3.2rem); letter-spacing: -.04em; font-weight: 750; margin-bottom: 16px; line-height: 1.12; }
.eyebrow { font-size: 12px; color: var(--accent); font-weight: 700; letter-spacing: .13em; margin-bottom: 14px; }
.search { max-width: 760px; }
.search .form-control { font-size: 16px; border-color: #cbd3df; }
.search .btn-primary { --bs-btn-bg: var(--action); --bs-btn-border-color: var(--action); --bs-btn-hover-bg: var(--action-hover); --bs-btn-hover-border-color: var(--action-hover); --bs-btn-active-bg: var(--action-hover); --bs-btn-active-border-color: var(--action-hover); --bs-btn-focus-shadow-rgb: 196, 71, 53; background: var(--bs-btn-bg); font-weight: 600; }
.search .btn-primary:hover { background: var(--bs-btn-hover-bg); }
.search .form-control:focus { border-color: #6489c3; box-shadow: 0 0 0 .25rem #2459ad20; }
.directory.row { display: flex; gap: 0; }
.section-heading h1, .section-heading h2 { font-size: 23px; font-weight: 700; letter-spacing: -.02em; }
.section-heading { flex-wrap: wrap; gap: 8px; }
.section-heading > span { font-size: 14px; }
.area { padding: 24px; border-color: var(--line); border-radius: 12px; }
.area-heading h2 { font-size: 19px; font-weight: 700; }
.area-heading p { font-size: 12px; }
.area-heading span { font-size: 13px; white-space: nowrap; }
.region > summary, .district > summary { justify-content: flex-start; padding: 10px 0; }
.region > summary::before, .district > summary::before { content: '+'; color: var(--accent); font-weight: 500; width: 16px; flex-shrink: 0; }
.region[open] > summary::before, .district[open] > summary::before { content: '−'; }
summary small { margin-left: auto; font-weight: 400; text-align: right; }
.region > summary:hover, .district > summary:hover { color: var(--accent); }
.result-row { border-radius: 10px; padding: 20px 24px; }
.result-row:hover { border-color: #9aafd0; }
.detail-search { max-width: 620px; margin-bottom: 28px; }
.breadcrumbs { font-size: 13px; }
.detail-hero { margin-bottom: 24px; padding: 0; background: transparent; border: 0; align-items: center; }
.detail-hero h1 { margin: 0; font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 750; letter-spacing: -.03em; }
.municipality-heading { display: flex; align-items: center; gap: 12px; min-width: 0; max-width: 100%; }
.municipality-heading h1 { min-width: 0; overflow-wrap: anywhere; }
.municipality-crest { width: 40px; height: 40px; flex-shrink: 0; object-fit: contain; }
.crest-filters.search { grid-template-columns: minmax(0, 1fr) minmax(0, 240px) minmax(0, 240px) auto; max-width: none; }
.crest-filters > div { min-width: 0; }
.crest-filters .form-select { height: 100%; font-size: 16px; border-color: var(--line); }
.crest-gallery { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; list-style: none; padding: 0; margin: 0; }
.crest-gallery-item { display: flex; flex-direction: column; align-items: center; height: 100%; padding: 18px 8px; color: var(--text); text-align: center; text-decoration: none; border-radius: 8px; }
.crest-gallery-item:hover { background: var(--panel); color: var(--text); }
.crest-gallery-item:hover .crest-gallery-name { text-decoration: underline; }
.crest-gallery-item img { width: 56px; height: 64px; object-fit: contain; margin-bottom: 12px; }
.crest-gallery-name { font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.crest-gallery-item small { margin-top: 4px; font-size: 12px; }
@media (max-width: 991.98px) {
  .crest-filters.search { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; }
  .crest-filters > div:first-child { grid-column: 1 / -1; }
  .crest-gallery { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 575.98px) {
  .crest-filters.search { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .crest-filters > button { grid-column: 1 / -1; }
  .crest-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
}
.detail-counters div { background: #ffffffa6; border-color: #d9e4f5; }
.detail-grid { display: grid; grid-template-columns: 1fr; gap: 20px; }
.contract-card { padding: 10px 0; overflow-wrap: anywhere; }
.contract-card + .contract-card, .contracts-more .contract-card { border-top: 1px solid var(--border, #dee2e6); }
.contract-card h3 { font-size: 14px; line-height: 1.4; margin: 4px 0; }
.contract-card h3 a { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.contract-card p { font-size: 13px; margin: 6px 0; }
.contract-details { font-size: 12px; }
.contract-details summary { cursor: pointer; color: var(--bs-secondary-color, #6c757d); }
.contracts-source { margin-top: 10px; font-size: 12px; }
.contracts-source p { margin: 6px 0 0; }
.contracts-panel .post-meta { flex-wrap: wrap; gap: 4px 12px; }
.contracts-more > summary { cursor: pointer; font-size: 13px; padding: 8px 0; }
.detail-panel { border-radius: 12px; padding: 24px; }
.detail-panel h2 { font-weight: 700; font-size: 18px; }
.facts div { grid-template-columns: 90px minmax(0, 1fr); gap: 12px; font-size: 14px; }
.facts dt { font-weight: 400; }
.post-card { border-radius: 12px; padding: 24px; }
.post-card h3 { font-size: 21px; font-weight: 650; }
.post-card p { font-size: 15px; }
.posts-pagination { font-size: 14px; }
.detail-page > .section, .page > .section:last-child { margin-top: 32px; }
#clanky { scroll-margin-top: 24px; }
@media (max-width: 700px) {
  .page { margin-top: 16px; }
  .home-hero { padding: 26px 0 32px; }
  .home-hero .lead { font-size: 17px; }
  .area-heading { flex-direction: row; align-items: center; }
  .area, .detail-panel, .post-card { padding: 20px; }
  .detail-hero { padding: 0; gap: 16px; }
  .search .form-control { padding: 12px; }
  .search { gap: 6px !important; }
  .region > summary, .district > summary { gap: 8px; }
  summary small { font-size: 12px; }
}

/* Palette integration for Bootstrap surfaces and interaction states. */
.card, .list-group, .dropdown-menu { --bs-card-bg: var(--panel); --bs-list-group-bg: var(--panel); --bs-list-group-color: var(--text); --bs-dropdown-bg: var(--panel); --bs-dropdown-color: var(--text); }
.list-group { --bs-list-group-action-hover-bg: var(--soft); --bs-list-group-action-hover-color: var(--accent); --bs-list-group-action-active-bg: var(--soft); }
.dropdown-menu { --bs-dropdown-link-color: var(--text); --bs-dropdown-link-hover-bg: var(--soft); --bs-dropdown-link-hover-color: var(--accent); }
.form-control { background-color: var(--panel); }
.form-control:focus { background-color: var(--panel); }
.form-control::placeholder { color: var(--muted); opacity: 1; }
.area-heading a, .list-group-item a { color: var(--accent); }
.site-footer a { color: var(--text); }
.directory .area-heading a,
.directory .list-group-item a,
.page a.list-group-item,
.municipalities a,
.result-row a { color: var(--text); }
.directory .area-heading a:hover,
.directory .list-group-item a:hover,
.page a.list-group-item:hover,
.municipalities a:hover,
.result-row a:hover { color: var(--text); text-decoration: underline !important; }
a:focus-visible, summary:focus-visible, .region-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.population-value { font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 14px; }
.result-metadata { display: grid; gap: 4px; justify-items: end; margin-left: auto; }
.directory-table-wrapper { overflow-y: hidden; }
.directory-table { --bs-table-bg: var(--panel); --bs-table-color: var(--text); --bs-table-border-color: var(--line); --bs-table-hover-bg: var(--soft); --bs-table-hover-color: var(--text); }
.directory-table > :not(caption) > * > * { padding: 14px 18px; }
.directory-table thead { border: 1px solid var(--line); }
.directory-table thead th { --bs-table-bg: #eef1f3; color: var(--text); border-bottom: 2px solid var(--line); font-size: 13px; font-weight: 600; vertical-align: middle; }
.directory-table a { display: block; color: var(--text); text-decoration: none; }
.directory-table a:hover { text-decoration: underline; }
.directory-code, .directory-number { font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table-column-heading { display: flex; align-items: center; gap: 4px; }
.table-sort { display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: inherit; }
.text-end .table-column-heading { justify-content: flex-end; }
.table-sort:hover { color: var(--text); }
.table-sort:focus-visible { outline: 2px solid var(--action); outline-offset: 4px; border-radius: 2px; }
.table-sort-indicator { flex-shrink: 0; color: var(--muted); }
[aria-sort] .table-sort-indicator { color: var(--action); }
.table-filter-toggle { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 28px; height: 28px; padding: 0; border: 1px solid transparent; border-radius: 4px; background: transparent; color: var(--muted); }
.table-filter-toggle:hover { background: var(--panel); color: var(--text); }
.table-filter-toggle.is-active { border-color: var(--action); background: var(--panel); color: var(--action); }
.table-filter-toggle:focus-visible { outline: 2px solid var(--action); outline-offset: 2px; }
.table-filter-panel { position: fixed; inset: auto; margin: 0; width: 260px; max-width: calc(100vw - 24px); max-height: calc(100vh - 24px); overflow: auto; padding: 16px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--text); box-shadow: 0 5px 20px #17202620; font-size: 14px; font-weight: 400; text-align: left; }
.table-filter-panel .btn-link, .directory-table-tools .btn-link { color: var(--text); }
.directory-table-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 20px; padding-top: 16px; }
.directory-table-tools .page-link { color: var(--text); }
.directory-table-tools .active > .page-link { color: #fff; background: var(--text); border-color: var(--text); }
.directory-table-tools .disabled > .page-link { color: var(--muted); }
.population-preview { display: block; width: 100%; padding: 0; margin-top: 8px; color: var(--text); background: none; border: 0; text-align: left; text-decoration: none; }
.population-preview:focus-visible { outline: 2px solid var(--action); outline-offset: 5px; border-radius: 2px; }
.population-preview-caption { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 12px; }
.population-preview:hover .population-preview-caption { color: var(--action); }
.population-plot { display: block; position: relative; }
.population-chart { display: block; width: 100%; height: auto; overflow: visible; touch-action: pan-y; }
.population-hit-area { cursor: crosshair; }
.population-chart text { fill: var(--muted); font-family: inherit; font-size: 11px; font-variant-numeric: tabular-nums; }
.population-grid { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.population-line { fill: none; stroke: var(--action); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.population-point { fill: var(--action); }
.population-point--last { stroke: var(--panel); stroke-width: 1.5; }
.population-selection { visibility: hidden; pointer-events: none; }
.population-plot.is-active .population-selection { visibility: visible; }
.population-guide { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 4; vector-effect: non-scaling-stroke; }
.population-active-point { fill: var(--action); stroke: var(--panel); stroke-width: 2; vector-effect: non-scaling-stroke; }
.population-tooltip { position: absolute; z-index: 1; padding: 7px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--text); box-shadow: 0 3px 12px #17202614; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.4; white-space: nowrap; pointer-events: none; }
.population-tooltip[hidden] { display: none; }
.statistics-values { display: grid; margin-top: 16px; }
.statistics-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; width: 100%; padding: 12px 0; color: var(--text); background: none; border: 0; border-top: 1px solid var(--line); text-align: left; text-decoration: none; }
.statistics-row:last-child { padding-bottom: 0; }
.statistics-label { display: block; font-size: 14px; }
.statistics-year { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
.statistics-row strong { font-size: 23px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.statistics-row:hover .statistics-label { text-decoration: underline; }
.statistics-row[aria-disabled="true"]:hover .statistics-label { text-decoration: none; }
.statistics-movement-preview { display: flex; justify-content: space-between; gap: 12px; padding: 0 0 10px; color: var(--muted); font-size: 12px; text-decoration: none; }
.statistics-movement-preview strong { color: var(--text); font-weight: 600; white-space: nowrap; }
.statistics-movement-preview:hover > span { text-decoration: underline; }
.statistics-row:focus-visible, .statistics-mobile a:focus-visible, #statistics-chart:focus-visible { outline: 2px solid var(--action); outline-offset: 4px; border-radius: 2px; }
.statistics-mobile { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; }
.statistics-mobile > a, .statistics-mobile > span { color: var(--text); font-size: 13px; font-variant-numeric: tabular-nums; text-align: left; text-decoration: none; }
.statistics-mobile a > span:last-child { color: var(--action); }
.statistics-layout { display: grid; grid-template-columns: minmax(0, 1fr) 200px; gap: 24px; margin-bottom: 16px; }
.statistics-chart-container { position: relative; height: 340px; }
.statistics-controls { min-width: 0; }
.statistics-controls legend { margin-bottom: 12px; font-size: 15px; font-weight: 600; }
.statistics-choice { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 14px; cursor: pointer; }
.statistics-choice input { flex-shrink: 0; width: 16px; height: 16px; margin: 0; accent-color: var(--series-color); }
.statistics-choice:has(input:disabled) { color: var(--muted); cursor: default; }
.statistics-swatch { display: block; width: 16px; height: 3px; flex-shrink: 0; background: var(--series-color); }
.statistics-age-swatch { height: 9px; background: linear-gradient(to right, #245747 0 33.333%, #c44735 33.333% 66.666%, #7356a6 66.666%); }
.statistics-movement-swatch { height: 9px; background: linear-gradient(to right, #245747 0 50%, #547fa3 50%); }
.statistics-age-scale, .statistics-unemployment-metric { display: block; margin-bottom: 12px; color: var(--muted); font-size: 13px; }
.statistics-age-scale select, .statistics-unemployment-metric select { margin-top: 4px; }
.statistics-controls .age-sex-control { margin-bottom: 12px; }
.statistics-history-table { font-size: 14px; font-variant-numeric: tabular-nums; }
.statistics-history-table th[scope="row"] { font-weight: 400; }
.statistics-empty { padding: 80px 12px; text-align: center; }
.age-preview { display: block; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--text); text-decoration: none; }
.age-preview:focus-visible { outline: 2px solid var(--action); outline-offset: 4px; border-radius: 2px; }
.age-preview:hover .age-preview-heading > span:first-child { text-decoration: underline; }
.age-preview-heading, .age-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.age-preview-heading { margin-bottom: 10px; font-size: 14px; }
.age-preview-heading .statistics-year { margin: 0; }
.age-bar { display: flex; height: 14px; overflow: hidden; border-radius: 4px; background: var(--line); }
.age-bar > span { display: block; height: 100%; }
.age-legend { margin: 12px 0 0; font-size: 13px; font-variant-numeric: tabular-nums; }
.age-legend > div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 7px; }
.age-legend dt { font-weight: 400; }
.age-legend dd { margin: 0; white-space: nowrap; }
.age-legend dd > span { display: inline-block; min-width: 55px; text-align: right; }
.age-swatch { display: inline-block; width: 9px; height: 9px; margin-right: 7px; border-radius: 2px; }
.age-explorer { margin-top: 24px; scroll-margin-top: 20px; }
.age-heading { margin-bottom: 16px; }
.age-heading h2 { margin: 0; }
.age-controls, .age-sex-control { display: flex; align-items: center; gap: 12px; }
.age-sex-control select { min-width: 105px; }
.age-year-control { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.age-year-control select { width: auto; min-width: 85px; }
.age-summary { max-width: 600px; }
.age-explorer .age-bar { height: 24px; }
.age-explorer .age-legend { font-size: 14px; }
.age-history-heading { margin: 24px 0 12px; font-size: 16px; }
.age-history-share { display: block; font-size: 12px; }
.age-history tr[aria-current="true"] > * { background: var(--bs-tertiary-bg); }
[hidden] { display: none !important; }
@media (max-width: 767.98px) {
  .municipality-crest { width: 32px; height: 32px; }
  .statistics-layout { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .statistics-controls { order: -1; display: flex; flex-wrap: wrap; column-gap: 20px; }
  .statistics-controls legend { margin-bottom: 8px; }
  .statistics-controls p { flex-basis: 100%; }
  .statistics-age-scale, .statistics-unemployment-metric { flex-basis: 100%; }
  .statistics-age-scale select, .statistics-unemployment-metric select { max-width: 190px; }
  .statistics-controls .age-sex-control { flex-basis: 100%; }
  .statistics-controls .age-sex-control select { max-width: 150px; }
  .statistics-chart-container { height: 280px; }
}
@media (max-width: 700px) {
  .directory-table > :not(caption) > * > * { padding: 12px 10px; }
  .result-metadata { justify-items: start; margin-left: 0; }
}
.header-top > .btn-outline-secondary { --bs-btn-color: var(--accent); --bs-btn-border-color: var(--accent); --bs-btn-hover-bg: var(--accent); --bs-btn-hover-border-color: var(--accent); --bs-btn-active-bg: var(--accent); --bs-btn-active-border-color: var(--accent); --bs-btn-focus-shadow-rgb: 36, 89, 173; }
