:root {
  --ink: #101820;
  --ink-2: #17232d;
  --paper: #f3f4f2;
  --white: #fff;
  --red: #be262b;
  --red-bright: #d53236;
  --muted: #66717a;
  --line: rgba(16, 24, 32, .15);
  --header: 82px;
  --sidebar: 430px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; overflow: hidden; color: var(--ink); background: var(--paper); font-family: "Manrope", sans-serif; font-size: 16px; }
button, input, select { font: inherit; }
button, summary, select { cursor: pointer; }
.skip-link { position: fixed; top: -5rem; left: 1rem; z-index: 2000; padding: .75rem 1rem; background: #fff; }
.skip-link:focus { top: 1rem; }

.map-header { height: var(--header); display: grid; grid-template-columns: var(--sidebar) 1fr auto; align-items: center; gap: 1.5rem; padding: 0 2rem 0 1.4rem; background: #fff; border-bottom: 1px solid var(--line); position: relative; z-index: 1100; }
.brand { width: 255px; }
.brand img { display: block; width: 100%; }
.map-title { display: flex; gap: .8rem; align-items: baseline; padding-left: 1.2rem; border-left: 1px solid var(--line); font-family: "Barlow Condensed", sans-serif; text-transform: uppercase; }
.map-title span { color: var(--red); font-size: .8rem; font-weight: 700; letter-spacing: .13em; }
.map-title strong { font-size: 1.2rem; letter-spacing: .045em; }
.home-link { display: inline-flex; align-items: center; gap: .45rem; color: var(--ink); text-decoration: none; font-family: "Barlow Condensed", sans-serif; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.home-link svg { width: 1.15rem; height: 1.15rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.home-link:hover { color: var(--red); }

.map-app { height: calc(100% - var(--header)); display: grid; grid-template-columns: var(--sidebar) 1fr; }
.sidebar { min-height: 0; display: flex; flex-direction: column; background: var(--paper); border-right: 1px solid var(--line); position: relative; z-index: 1000; box-shadow: 8px 0 25px rgba(16,24,32,.08); }
.search-panel { padding: 1.45rem 1.45rem 1.1rem; background: #fff; border-bottom: 1px solid var(--line); }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; }
.eyebrow { display: block; margin-bottom: .35rem; color: var(--red); font-family: "Barlow Condensed", sans-serif; font-size: .8rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
h1, h2 { margin: 0; font-family: "Barlow Condensed", sans-serif; text-transform: uppercase; }
h1 { font-size: 2rem; line-height: 1; letter-spacing: -.01em; }
.intro { margin: .7rem 0 1rem; color: var(--muted); font-size: .82rem; line-height: 1.5; }
.search-form label { display: block; margin-bottom: .35rem; font-family: "Barlow Condensed", sans-serif; font-size: .83rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.search-row { display: grid; grid-template-columns: 1fr auto; }
.search-row input { min-width: 0; height: 46px; padding: 0 .75rem; color: var(--ink); background: #fff; border: 1px solid #b8bec2; border-right: 0; border-radius: 0; }
.search-row button, .filter-actions button:first-child { padding: 0 1rem; color: #fff; background: var(--red); border: 1px solid var(--red); font-family: "Barlow Condensed", sans-serif; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.search-row button:hover, .filter-actions button:first-child:hover { background: var(--ink); border-color: var(--ink); }
.search-row input:focus, select:focus, .filter-grid input:focus { outline: 3px solid rgba(190,38,43,.2); border-color: var(--red); }
.quick-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-top: .65rem; }
.quick-actions button { padding: .58rem .5rem; color: #34414a; background: #f3f4f2; border: 1px solid var(--line); font-size: .76rem; font-weight: 700; }
.quick-actions button:hover { color: var(--red); border-color: var(--red); }
.quick-actions span { margin-right: .2rem; color: var(--red); font-size: 1rem; }
.filters { margin-top: .75rem; border-top: 1px solid var(--line); }
.filters summary { padding: .65rem 0 0; color: var(--ink); font-family: "Barlow Condensed", sans-serif; font-size: .9rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.filter-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .55rem; margin-top: .65rem; }
.filter-grid label:first-child { grid-column: 1 / -1; }
.filter-grid label { color: var(--muted); font-size: .72rem; font-weight: 700; }
.filter-grid select, .filter-grid input { width: 100%; height: 38px; margin-top: .2rem; padding: 0 .5rem; color: var(--ink); background: #fff; border: 1px solid #b8bec2; border-radius: 0; }
.filter-actions { display: flex; gap: .5rem; margin-top: .65rem; }
.filter-actions button { min-height: 36px; padding: .35rem .8rem; border: 1px solid var(--line); }
.filter-actions button:last-child { background: transparent; }

.results-panel { min-height: 0; display: flex; flex: 1; flex-direction: column; padding: 1rem 1.1rem 0; }
.results-heading { display: flex; align-items: baseline; justify-content: space-between; padding: 0 .25rem .7rem; }
.results-heading h2 { font-size: 1rem; letter-spacing: .07em; }
.results-heading span { color: var(--muted); font-size: .75rem; }
.results { min-height: 0; overflow-y: auto; padding: 0 .2rem 1rem; scrollbar-width: thin; }
.loading-card, .empty-card { padding: 1.25rem; background: #fff; border: 1px solid var(--line); }
.loading-card strong, .empty-card strong { display: block; font-family: "Barlow Condensed", sans-serif; font-size: 1.05rem; text-transform: uppercase; }
.loading-card p, .empty-card p { margin: .4rem 0 0; color: var(--muted); font-size: .8rem; line-height: 1.5; }
.loader { display: block; width: 25px; height: 25px; margin-bottom: .8rem; border: 3px solid #e4e6e4; border-top-color: var(--red); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.result-card { width: 100%; display: block; margin-bottom: .5rem; padding: .8rem .9rem; text-align: left; color: var(--ink); background: #fff; border: 1px solid var(--line); border-left: 3px solid transparent; }
.result-card:hover, .result-card:focus-visible { border-left-color: var(--red); outline: none; }
.result-card strong { display: block; font-family: "Barlow Condensed", sans-serif; font-size: 1.05rem; line-height: 1.15; text-transform: uppercase; }
.result-card span { display: block; margin-top: .28rem; color: var(--muted); font-size: .72rem; }
.result-card .result-label { margin: 0 0 .25rem; color: var(--red); font-family: "Barlow Condensed", sans-serif; font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }

.site-detail { padding-bottom: 1rem; }
.back-button { margin-bottom: .8rem; padding: 0; color: var(--red); background: none; border: 0; font-weight: 700; }
.site-detail header { padding: 1rem; color: #fff; background: var(--ink); }
.site-detail header span { color: #e78184; font-family: "Barlow Condensed", sans-serif; font-size: .76rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.site-detail h2 { margin: .35rem 0 .55rem; font-size: 1.65rem; line-height: 1.05; }
.site-detail header p { margin: 0; color: #b9c0c5; font-size: .75rem; }
.site-stats { display: grid; grid-template-columns: repeat(3, 1fr); background: #fff; border: 1px solid var(--line); border-top: 0; }
.site-stats div { padding: .65rem .45rem; text-align: center; border-right: 1px solid var(--line); }
.site-stats div:last-child { border: 0; }
.site-stats strong { display: block; font-family: "Barlow Condensed", sans-serif; font-size: 1rem; }
.site-stats span { color: var(--muted); font-size: .62rem; text-transform: uppercase; }
.licence-list-title { margin: 1rem 0 .5rem; font-family: "Barlow Condensed", sans-serif; font-size: .84rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.licence-card { background: #fff; border: 1px solid var(--line); border-bottom: 0; }
.licence-card:last-of-type { border-bottom: 1px solid var(--line); }
.licence-summary { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .8rem; align-items: center; padding: .8rem; list-style: none; }
.licence-summary::-webkit-details-marker { display: none; }
.licence-summary:hover, .licence-summary:focus-visible { background: #f8f8f7; outline: none; }
.licence-summary:focus-visible { box-shadow: inset 3px 0 var(--red); }
.licence-summary-copy, .licence-holder, .licence-meta { display: block; }
.licence-top { display: flex; justify-content: space-between; gap: 1rem; }
.licence-top strong { font-family: "Barlow Condensed", sans-serif; font-size: 1rem; }
.licence-top span { color: var(--red); font-family: "Barlow Condensed", sans-serif; font-size: .72rem; font-weight: 700; }
.licence-holder { margin: .25rem 0; font-size: .76rem; font-weight: 700; }
.licence-meta { margin: 0; color: var(--muted); font-size: .7rem; line-height: 1.45; }
.licence-expand { display: grid; justify-items: center; gap: .15rem; color: var(--red); font-family: "Barlow Condensed", sans-serif; font-size: .62rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.licence-expand svg { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s ease; }
.licence-card[open] .licence-expand svg { transform: rotate(180deg); }
.licence-card[open] .licence-expand span { font-size: 0; }
.licence-card[open] .licence-expand span::after { content: "Hide"; font-size: .62rem; }
.assignment-panel { padding: 0 .8rem .8rem; border-top: 1px solid var(--line); background: #f6f7f5; }
.assignment-row { padding: .8rem 0; border-bottom: 1px solid var(--line); }
.assignment-row:last-child { padding-bottom: 0; border-bottom: 0; }
.assignment-heading { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .25rem .75rem; }
.assignment-heading strong { font-family: "Barlow Condensed", sans-serif; font-size: .82rem; text-transform: uppercase; }
.assignment-heading span { color: var(--muted); font-size: .62rem; }
.assignment-frequency { margin: .25rem 0 .6rem; color: var(--red); font-family: "Barlow Condensed", sans-serif; font-size: 1rem; font-weight: 700; }
.assignment-row dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .45rem .8rem; margin: 0; }
.assignment-row dl div { min-width: 0; }
.assignment-row dt { color: var(--muted); font-size: .58rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.assignment-row dd { margin: .08rem 0 0; overflow-wrap: anywhere; font-size: .68rem; }
.assignment-empty { margin: .8rem 0 0; color: var(--muted); font-size: .72rem; }
.assignment-loading { display: flex; align-items: center; gap: .6rem; padding-top: .8rem; color: var(--muted); font-size: .7rem; }
.assignment-loading .loader { width: 18px; height: 18px; margin: 0; border-width: 2px; }
.official-link { display: block; margin-top: .8rem; padding: .72rem; text-align: center; color: #fff; background: var(--red); font-family: "Barlow Condensed", sans-serif; font-weight: 700; letter-spacing: .06em; text-decoration: none; text-transform: uppercase; }
.official-link:hover { background: var(--ink); }

.data-note { display: grid; gap: .15rem; padding: .65rem 1.35rem; background: #e8eae7; border-top: 1px solid var(--line); font-size: .63rem; line-height: 1.4; }
.data-note strong { color: var(--ink); }
.data-note span { color: var(--muted); }
.data-note a { color: var(--red); font-weight: 700; text-decoration: none; }

.map-stage { min-width: 0; position: relative; }
#map { width: 100%; height: 100%; background: #dfe3e3; }
.map-status { position: absolute; z-index: 600; top: 1rem; left: 50%; transform: translateX(-50%); padding: .55rem .8rem; color: #fff; background: rgba(16,24,32,.92); box-shadow: 0 4px 15px rgba(16,24,32,.15); font-size: .72rem; font-weight: 700; pointer-events: none; }
.legend { position: absolute; z-index: 600; right: .8rem; bottom: 1.6rem; display: grid; gap: .3rem; padding: .55rem .7rem; background: rgba(255,255,255,.94); box-shadow: 0 3px 12px rgba(16,24,32,.15); font-size: .64rem; }
.legend span { display: flex; align-items: center; gap: .4rem; }
.legend i { width: 11px; height: 11px; display: inline-block; border-radius: 50%; }
.legend-site { background: var(--red); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--red); }
.legend-cluster { background: var(--ink); }
.mobile-search, .mobile-close { display: none; }

.radio-site-icon { width: 13px !important; height: 13px !important; margin: -6px 0 0 -6px !important; background: var(--red); border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px var(--red), 0 2px 5px rgba(16,24,32,.35); }
.marker-cluster div { color: #fff; background: var(--ink); font-family: "Barlow Condensed", sans-serif; font-weight: 700; }
.marker-cluster-small, .marker-cluster-medium, .marker-cluster-large { background: rgba(190,38,43,.36); }
.leaflet-control-zoom a { color: var(--ink); }
.leaflet-control-attribution { font-size: 9px; }
.leaflet-control-layers {
  border: 0;
  border-radius: 0;
  box-shadow: 0 4px 18px rgba(16,24,32,.2);
  font-family: "Manrope", sans-serif;
}
.leaflet-control-layers-toggle {
  width: 48px;
  height: 48px;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cpath d='m24 10 16 8-16 8-16-8 16-8Z' fill='none' stroke='%23101820' stroke-width='2.6' stroke-linejoin='round'/%3E%3Cpath d='m9 24 15 7 15-7M9 30l15 7 15-7' fill='none' stroke='%23be262b' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-position: center;
  background-repeat: no-repeat;
  background-size: 34px 34px;
}
.leaflet-retina .leaflet-control-layers-toggle { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cpath d='m24 10 16 8-16 8-16-8 16-8Z' fill='none' stroke='%23101820' stroke-width='2.6' stroke-linejoin='round'/%3E%3Cpath d='m9 24 15 7 15-7M9 30l15 7 15-7' fill='none' stroke='%23be262b' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.leaflet-control-layers-expanded { min-width: 146px; padding: .65rem .75rem; }
.leaflet-control-layers-base { display: grid; gap: .25rem; }
.leaflet-control-layers label { margin: 0; color: var(--ink); font-size: .75rem; font-weight: 700; }
.leaflet-control-layers-selector { accent-color: var(--red); }

@media (max-width: 900px) {
  :root { --header: 68px; }
  .map-header { grid-template-columns: 1fr auto; padding: 0 1rem; }
  .brand { width: 205px; }
  .map-title { display: none; }
  .map-app { display: block; position: relative; }
  .sidebar { width: min(92vw, 430px); height: 100%; position: absolute; left: 0; top: 0; transform: translateX(-105%); transition: transform .22s ease; }
  .sidebar.open { transform: translateX(0); }
  .map-stage { width: 100%; height: 100%; }
  .mobile-search { display: block; position: absolute; z-index: 700; top: 1rem; left: 1rem; padding: .7rem .9rem; color: #fff; background: var(--red); border: 0; box-shadow: 0 4px 15px rgba(16,24,32,.2); font-family: "Barlow Condensed", sans-serif; font-weight: 700; text-transform: uppercase; }
  .mobile-close { display: block; padding: 0 .25rem; color: var(--muted); background: none; border: 0; font-size: 2rem; line-height: 1; }
  .map-status { top: 1rem; right: 1rem; left: auto; transform: none; max-width: 55%; text-align: right; }
}

@media (max-width: 520px) {
  .home-link { font-size: .82rem; }
  .search-panel { padding: 1.1rem; }
  h1 { font-size: 1.75rem; }
  .intro { display: none; }
  .data-note { padding-inline: 1.1rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
