:root {
    color-scheme: light;
    --bb-indigo: #4338ca;
    --bb-indigo-dark: #25125b;
    --bb-lilac: #8b5cf6;
    --bb-ink: #11111f;
    --bb-paper: #fbfaf6;
    --bb-water: #eeecfb;
    --bb-border: #cbc8d2;
    --bb-grey: #686674;
    --bb-danger: #ef595b;
    --bb-poor: #e9822a;
    --bb-warning: #d4aa32;
    --bb-success: #5b9665;
    --bb-limited: #57469a;
    --bb-panel-radius: 15px;
    --bb-shadow: 0 18px 48px rgb(37 18 91 / 0.13), 0 2px 6px rgb(17 17 31 / 0.08);
    --font-display: "Playfair Display", Georgia, serif;
    --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
}

* {
    box-sizing: border-box;
}

html,
body,
.map-app,
.map-canvas {
    width: 100%;
    height: 100%;
    min-height: 100%;
    margin: 0;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    overflow: hidden;
    color: var(--bb-ink);
    background: var(--bb-water);
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
}

button,
input {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
a:focus-visible,
.leaflet-interactive:focus-visible {
    outline: 3px solid rgb(99 102 241 / 0.38);
    outline-offset: 3px;
}

[hidden] {
    display: none !important;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.map-app {
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.map-canvas {
    position: absolute;
    inset: 0;
    z-index: 0;
    background-color: var(--bb-water);
    background-image:
        radial-gradient(circle at 16% 20%, rgb(139 92 246 / 0.08), transparent 26%),
        radial-gradient(circle at 82% 72%, rgb(67 56 202 / 0.07), transparent 28%),
        repeating-radial-gradient(ellipse at 60% 45%, transparent 0 22px, rgb(67 56 202 / 0.04) 23px, transparent 24px 38px);
}

.map-canvas::before {
    position: absolute;
    z-index: 200;
    inset: 0;
    pointer-events: none;
    content: "";
    opacity: 0.28;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.11'/%3E%3C/svg%3E");
    mix-blend-mode: multiply;
}

.leaflet-container {
    color: var(--bb-ink);
    background: transparent;
    font-family: var(--font-body);
}

.leaflet-tile-pane {
    opacity: 0;
    filter: grayscale(1) sepia(0.3) hue-rotate(210deg) saturate(1.65) brightness(0.68) contrast(1.05);
    transition: opacity 360ms ease;
}

.map-app[data-map-level="published"] .leaflet-tile-pane {
    opacity: 0.72;
}

.leaflet-control-attribution {
    color: #4d4962;
    background: rgb(251 250 246 / 0.86) !important;
    border: 1px solid rgb(203 200 210 / 0.75);
    border-radius: 7px 0 0;
    font-size: 10px !important;
    backdrop-filter: blur(10px);
}

.leaflet-control-attribution a {
    color: var(--bb-indigo);
}

.leaflet-bar {
    overflow: hidden;
    border: 1px solid var(--bb-ink) !important;
    border-radius: 9px !important;
    box-shadow: 0 9px 24px rgb(37 18 91 / 0.16) !important;
}

.leaflet-bar a,
.leaflet-bar a:hover {
    width: 38px;
    height: 38px;
    color: var(--bb-ink);
    background: rgb(251 250 246 / 0.97);
    border-bottom-color: var(--bb-border);
    font-family: var(--font-body);
    font-size: 22px;
    line-height: 38px;
}

.leaflet-bottom.leaflet-right {
    right: 18px;
    bottom: 30px;
}

.app-surface {
    background: rgb(251 250 246 / 0.98);
    border: 1px solid var(--bb-ink);
    border-radius: var(--bb-panel-radius);
    box-shadow: var(--bb-shadow);
}

.control-panel {
    position: absolute;
    z-index: 600;
    top: 14px;
    bottom: 14px;
    left: 14px;
    display: flex;
    width: min(310px, calc(100vw - 28px));
    flex-direction: column;
    padding: 22px 22px 18px;
    overflow-y: auto;
    scrollbar-width: thin;
}

.brand-row {
    display: flex;
    align-items: center;
    gap: 11px;
}

.brand-mark {
    display: block;
    width: 58px;
    height: 58px;
    border-radius: 0;
}

.brand-name {
    max-width: 175px;
    color: var(--bb-ink);
    font-family: var(--font-display);
    font-size: 1.56rem;
    font-weight: 700;
    line-height: 0.92;
    letter-spacing: -0.04em;
}

.mobile-total {
    display: none;
}

.panel-introduction {
    margin-top: 28px;
    padding-bottom: 21px;
    border-bottom: 1px solid var(--bb-border);
}

h1,
h2 {
    margin: 0;
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: -0.04em;
}

h1 {
    font-size: clamp(2.35rem, 4vw, 3rem);
    line-height: 0.98;
}

h2 {
    font-size: clamp(2.45rem, 4vw, 3.4rem);
    line-height: 0.96;
}

.intro-copy {
    max-width: 245px;
    margin: 13px 0 0;
    color: #393745;
    font-size: 0.92rem;
    line-height: 1.5;
}

.headline-total {
    display: grid;
    gap: 1px;
    padding: 20px 0;
}

.headline-total strong {
    color: var(--bb-indigo);
    font-family: var(--font-display);
    font-size: 2.75rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.035em;
}

.headline-total span {
    color: #393745;
    font-size: 0.84rem;
    font-weight: 600;
}

.finder-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
}

.postcode-search {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 48px;
    gap: 6px;
}

.postcode-icon {
    display: none;
}

.postcode-search input {
    width: 100%;
    min-width: 0;
    height: 48px;
    padding: 0 13px;
    color: var(--bb-ink);
    background: #fff;
    border: 1px solid #94919e;
    border-radius: 8px;
    font-size: 0.94rem;
}

.postcode-search input::placeholder {
    color: #73707d;
}

.search-button,
.location-button,
.filter-button,
.layer-toggle,
.icon-button,
.mobile-tool-button,
.detail-zoom {
    cursor: pointer;
}

.search-button {
    display: grid;
    width: 48px;
    height: 48px;
    padding: 0;
    color: #fff;
    background: var(--bb-indigo);
    border: 1px solid var(--bb-indigo);
    border-radius: 8px;
    place-items: center;
    box-shadow: 0 8px 17px rgb(67 56 202 / 0.22);
}

.search-button:hover,
.detail-zoom:hover {
    background: #352bad;
}

.search-button svg,
.location-button svg,
.mobile-tool-button svg,
.icon-button svg,
.detail-zoom svg,
.detail-privacy svg,
.source-status svg {
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.search-button svg {
    width: 22px;
    height: 22px;
}

.location-button {
    display: flex;
    width: 100%;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #fff;
    background: var(--bb-indigo);
    border: 1px solid var(--bb-indigo);
    border-radius: 8px;
    font-size: 0.84rem;
    font-weight: 600;
}

.location-button svg {
    width: 18px;
    height: 18px;
}

.mobile-tool-button {
    display: none;
}

.filter-tray {
    display: grid;
    gap: 10px;
    padding: 18px 0;
    border-bottom: 1px solid var(--bb-border);
}

.filter-control {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    overflow: hidden;
    border: 1px solid var(--bb-ink);
    border-radius: 8px;
}

.filter-button {
    grid-column: span 2;
    min-height: 42px;
    padding: 4px 7px;
    color: var(--bb-ink);
    background: transparent;
    border: 0;
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1.15;
}

.filter-button:not(:first-child):not(:nth-child(4)) {
    border-left: 1px solid var(--bb-ink);
}

.filter-button:nth-child(n + 4) {
    grid-column: span 3;
    border-top: 1px solid var(--bb-ink);
}

.filter-button.is-active {
    color: #fff;
    background: var(--bb-indigo);
}

.filter-label-compact {
    display: none;
}

.layer-toggle {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    width: 100%;
    min-height: 52px;
    align-items: center;
    gap: 9px;
    padding: 7px 4px;
    color: var(--bb-ink);
    text-align: left;
    background: transparent;
    border: 0;
}

.rail-icon {
    position: relative;
    display: flex;
    width: 27px;
    height: 17px;
    align-items: center;
    justify-content: space-around;
    border-top: 3px solid currentColor;
    border-bottom: 3px solid currentColor;
}

.rail-icon i {
    width: 2px;
    height: 17px;
    margin-top: -3px;
    background: currentColor;
}

.layer-toggle-copy {
    display: grid;
    min-width: 0;
    gap: 2px;
}

.layer-toggle strong {
    font-size: 0.79rem;
    font-weight: 600;
}

.layer-toggle small {
    overflow: hidden;
    color: var(--bb-grey);
    font-family: var(--font-mono);
    font-size: 0.49rem;
    letter-spacing: 0.02em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.toggle-track {
    position: relative;
    display: block;
    width: 38px;
    height: 22px;
    background: #d8d5de;
    border: 1px solid #918e9b;
    border-radius: 999px;
    transition: background 160ms ease;
}

.toggle-track span {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: #fff;
    border: 1px solid #a3a0ad;
    border-radius: 50%;
    transition: transform 160ms ease;
}

.layer-toggle.is-active .toggle-track {
    background: var(--bb-indigo);
    border-color: var(--bb-indigo);
}

.layer-toggle.is-active .toggle-track span {
    transform: translateX(16px);
}

.panel-label,
.detail-eyebrow,
.ranking h3 {
    margin: 0;
    color: var(--bb-indigo);
    font-family: var(--font-mono);
    font-size: 0.67rem;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.legend {
    display: grid;
    gap: 9px;
    padding: 18px 0 12px;
}

.legend > div {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #393745;
    font-size: 0.73rem;
}

.legend .panel-label {
    margin-bottom: 3px;
    color: var(--bb-ink);
}

.legend-swatch {
    display: block;
    width: 27px;
    height: 27px;
    flex: 0 0 auto;
    border: 1px solid rgb(17 17 31 / 0.2);
    border-radius: 5px;
}

.legend-swatch--none { background: var(--bb-danger); }
.legend-swatch--poor { background: var(--bb-poor); }
.legend-swatch--usable { background: var(--bb-warning); }
.legend-swatch--good { background: var(--bb-success); }
.legend-swatch--limited {
    background: var(--bb-limited);
    border-style: dashed;
    border-color: #fff;
    box-shadow: 0 0 0 1px var(--bb-limited);
}

.legend-line {
    width: 28px;
    height: 0;
    border-top: 3px solid var(--bb-indigo);
    box-shadow: 0 -2px 0 #fff, 0 2px 0 #fff;
}

.privacy-summary {
    margin-top: auto;
    padding-top: 12px;
    color: var(--bb-grey);
    font-size: 0.67rem;
    line-height: 1.5;
}

.privacy-summary p {
    margin: 0;
}

.text-button {
    margin-top: 6px;
    padding: 0;
    color: var(--bb-indigo);
    background: transparent;
    border: 0;
    cursor: pointer;
    font-size: inherit;
    font-weight: 600;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.map-level-label {
    position: absolute;
    z-index: 550;
    top: 26px;
    left: 342px;
    padding: 9px 13px;
    color: var(--bb-indigo);
    background: rgb(251 250 246 / 0.76);
    border: 1px solid rgb(67 56 202 / 0.24);
    border-radius: 8px;
    font-family: var(--font-mono);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    backdrop-filter: blur(12px);
}

.detail-panel {
    position: absolute;
    z-index: 650;
    top: 20px;
    right: 20px;
    width: min(370px, calc(100vw - 40px));
    max-height: calc(100dvh - 40px);
    padding: 27px 25px 22px;
    overflow-y: auto;
    animation: detail-enter 220ms ease-out;
    scrollbar-width: thin;
}

@keyframes detail-enter {
    from { opacity: 0; transform: translateX(18px); }
    to { opacity: 1; transform: translateX(0); }
}

.sheet-handle {
    display: none;
}

.icon-button {
    display: grid;
    width: 42px;
    height: 42px;
    padding: 0;
    color: var(--bb-ink);
    background: transparent;
    border: 1px solid var(--bb-ink);
    border-radius: 50%;
    place-items: center;
}

.icon-button:hover {
    color: #fff;
    background: var(--bb-indigo);
    border-color: var(--bb-indigo);
}

.icon-button svg {
    width: 20px;
    height: 20px;
}

.detail-close {
    position: absolute;
    top: 19px;
    right: 18px;
}

.detail-eyebrow {
    margin-bottom: 13px;
}

.detail-panel h2 {
    padding-right: 46px;
}

.detail-verdict {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-top: 16px;
    font-family: var(--font-display);
    font-size: 1.18rem;
    font-weight: 700;
}

.detail-verdict i {
    display: block;
    width: 13px;
    height: 13px;
    flex: 0 0 auto;
    background: currentColor;
    border: 3px solid rgb(255 255 255 / 0.65);
    border-radius: 50%;
    box-shadow: 0 0 0 1px currentColor;
}

.detail-verdict[data-tone="none"] { color: #cf343d; }
.detail-verdict[data-tone="poor"] { color: #c86416; }
.detail-verdict[data-tone="usable"] { color: #9b7413; }
.detail-verdict[data-tone="good"] { color: #3e7d50; }
.detail-verdict[data-tone="limited"] { color: var(--bb-limited); }

.detail-context {
    margin: 7px 0 0;
    color: #484552;
    font-size: 0.78rem;
    line-height: 1.45;
}

.source-status {
    display: grid;
    grid-template-columns: 25px minmax(0, 1fr);
    gap: 10px;
    margin-top: 18px;
    padding: 12px;
    color: #654c0b;
    background: #fff7dd;
    border: 1px solid #c69b22;
    border-radius: 9px;
}

.source-status.is-complete {
    color: #2f6f46;
    background: #eef8ef;
    border-color: #5b9665;
}

.source-status svg {
    width: 21px;
    height: 21px;
}

.source-status strong {
    display: block;
    font-size: 0.75rem;
}

.source-status p {
    margin: 4px 0 0;
    color: #5e5a64;
    font-size: 0.65rem;
    line-height: 1.45;
}

.detail-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 20px 0 0;
    padding: 0;
    border-top: 1px solid var(--bb-border);
    border-bottom: 1px solid var(--bb-border);
}

.detail-metrics > div {
    min-width: 0;
    padding: 14px 13px 13px 0;
}

.detail-metrics > div:nth-child(even) {
    padding-right: 0;
    padding-left: 13px;
    border-left: 1px solid var(--bb-border);
}

.detail-metrics > div:nth-child(3) {
    grid-column: 1 / -1;
    padding-left: 0;
    border-top: 1px solid var(--bb-border);
}

.detail-metrics dt,
.detail-metrics dd {
    margin: 0;
}

.detail-metrics dt {
    color: var(--bb-grey);
    font-family: var(--font-mono);
    font-size: 0.53rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.detail-metrics dd {
    margin-top: 6px;
    color: var(--bb-indigo);
    font-family: var(--font-display);
    font-size: 1.85rem;
    font-weight: 700;
    line-height: 1;
}

.detail-metrics dd small {
    font-family: var(--font-body);
    font-size: 0.72rem;
    font-weight: 600;
}

.detail-metrics > div > small {
    display: block;
    margin-top: 5px;
    color: var(--bb-grey);
    font-size: 0.57rem;
    line-height: 1.3;
}

.cell-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.cell-metrics > div,
.cell-metrics > div:nth-child(even),
.cell-metrics > div:nth-child(3) {
    grid-column: auto;
    padding: 14px 9px;
    border-top: 0;
    border-left: 1px solid var(--bb-border);
}

.cell-metrics > div:first-child {
    padding-left: 0;
    border-left: 0;
}

.cell-metrics dd {
    font-size: 1.45rem;
}

.cell-metrics.is-filtered {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.cell-metrics.is-filtered > div,
.cell-metrics.is-filtered > div:nth-child(even),
.cell-metrics.is-filtered > div:nth-child(3) {
    grid-column: auto;
    padding: 13px 12px;
    border-top: 1px solid var(--bb-border);
    border-left: 0;
}

.cell-metrics.is-filtered > div:nth-child(-n + 2) {
    border-top: 0;
}

.cell-metrics.is-filtered > div:nth-child(odd) {
    padding-left: 0;
}

.cell-metrics.is-filtered > div:nth-child(even) {
    padding-right: 0;
    border-left: 1px solid var(--bb-border);
}

.detail-breakdown {
    display: flex;
    flex-wrap: wrap;
    gap: 7px 14px;
    padding: 14px 0;
    color: #4d4a58;
    border-bottom: 1px solid var(--bb-border);
    font-size: 0.66rem;
}

.detail-breakdown span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.detail-breakdown i {
    width: 8px;
    height: 8px;
    background: currentColor;
    border-radius: 50%;
}

.detail-breakdown--none { color: var(--bb-danger); }
.detail-breakdown--poor { color: var(--bb-poor); }

.ranking {
    margin-top: 21px;
}

.ranking h3 {
    color: var(--bb-ink);
}

.ranking ol {
    padding: 0;
    margin: 8px 0 0;
    list-style: none;
    border-top: 1px solid var(--bb-border);
}

.ranking li {
    display: grid;
    grid-template-columns: 31px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    border-bottom: 1px solid var(--bb-border);
    cursor: pointer;
    transition: color 140ms ease, background 140ms ease;
}

.ranking li:hover,
.ranking li:focus-visible {
    color: var(--bb-indigo);
    background: rgb(67 56 202 / 0.055);
    outline: 0;
}

.ranking-number {
    color: var(--bb-indigo);
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    text-align: center;
}

.ranking-copy {
    display: grid;
    min-width: 0;
    gap: 2px;
}

.ranking-copy strong {
    overflow: hidden;
    font-size: 0.78rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ranking-copy small,
.ranking-share {
    color: var(--bb-grey);
    font-family: var(--font-mono);
    font-size: 0.5rem;
}

.ranking-share {
    color: var(--bb-indigo);
    font-weight: 700;
}

.ranking-empty {
    margin: 10px 0 0;
    padding: 13px;
    color: var(--bb-grey);
    background: #f4f2ed;
    border: 1px solid var(--bb-border);
    border-radius: 8px;
    font-size: 0.7rem;
    line-height: 1.45;
}

.detail-zoom {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 20px;
    width: 100%;
    min-height: 50px;
    align-items: center;
    gap: 10px;
    margin-top: 17px;
    padding: 0 15px 0 19px;
    color: #fff;
    background: var(--bb-indigo);
    border: 1px solid var(--bb-indigo);
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    text-align: center;
}

.detail-zoom svg {
    width: 19px;
    height: 19px;
}

.detail-method {
    margin: 17px 0 0;
    color: var(--bb-grey);
    font-size: 0.6rem;
    line-height: 1.5;
}

.detail-privacy {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr);
    align-items: start;
    gap: 9px;
    margin: 16px 0 0;
    padding-top: 14px;
    color: #4e4b58;
    border-top: 1px solid var(--bb-border);
    font-size: 0.62rem;
    line-height: 1.45;
}

.detail-privacy svg {
    width: 22px;
    height: 22px;
    color: var(--bb-indigo);
}

.live-status {
    position: absolute;
    z-index: 560;
    bottom: 20px;
    left: 342px;
    display: flex;
    min-height: 36px;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    border-color: rgb(17 17 31 / 0.36);
    border-radius: 9px;
    font-family: var(--font-mono);
    font-size: 0.58rem;
    letter-spacing: 0.03em;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--bb-success);
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgb(91 150 101 / 0.13);
}

.live-status.is-loading .status-dot {
    background: var(--bb-warning);
    animation: status-pulse 1s ease-in-out infinite;
}

.live-status.is-error .status-dot {
    background: var(--bb-danger);
}

@keyframes status-pulse {
    50% { opacity: 0.4; }
}

.map-message {
    position: absolute;
    z-index: 700;
    top: 50%;
    left: 50%;
    max-width: min(340px, calc(100vw - 36px));
    padding: 16px 18px;
    transform: translate(-50%, -50%);
    text-align: center;
}

.map-message p {
    margin: 0;
    color: #403d49;
    font-size: 0.82rem;
    line-height: 1.45;
}

.method-dialog {
    width: min(620px, calc(100vw - 32px));
    max-height: min(760px, calc(100dvh - 32px));
    padding: 30px;
    overflow-y: auto;
    color: var(--bb-ink);
}

.method-dialog::backdrop {
    background: rgb(37 18 91 / 0.42);
    backdrop-filter: blur(5px);
}

.method-dialog h2 {
    padding-right: 44px;
}

.method-dialog p:not(.detail-eyebrow) {
    margin: 16px 0 0;
    color: #4e4b58;
    font-size: 0.82rem;
    line-height: 1.65;
}

.method-dialog a {
    display: inline-block;
    margin-top: 18px;
    color: var(--bb-indigo);
    font-size: 0.8rem;
    font-weight: 600;
}

.dialog-close {
    position: absolute;
    top: 18px;
    right: 18px;
}

.bb-boundary {
    cursor: pointer;
    filter: drop-shadow(0 2px 2px rgb(37 18 91 / 0.13));
    transition: fill-opacity 160ms ease, stroke-width 160ms ease, filter 160ms ease;
}

.bb-boundary:hover,
.bb-boundary:focus {
    fill-opacity: 0.98 !important;
    stroke-width: 2.8px !important;
    filter: drop-shadow(0 5px 8px rgb(37 18 91 / 0.26));
}

.bb-boundary.is-selected {
    stroke: #fff !important;
    stroke-width: 4px !important;
    filter: drop-shadow(0 0 0.5px var(--bb-ink)) drop-shadow(0 6px 10px rgb(37 18 91 / 0.34));
}

.bb-boundary.is-limited {
    stroke-dasharray: 5 5;
}

.bb-region-label {
    color: #fff;
    background: transparent;
    border: 0;
    box-shadow: none;
    font-family: var(--font-mono);
    font-size: 0.59rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-align: center;
    text-shadow: 0 1px 3px rgb(37 18 91 / 0.75);
    text-transform: uppercase;
}

.bb-region-label::before {
    display: none;
}

.bb-hover-label {
    padding: 6px 8px;
    color: var(--bb-ink);
    background: var(--bb-paper);
    border: 1px solid var(--bb-ink);
    border-radius: 6px;
    box-shadow: 0 8px 20px rgb(37 18 91 / 0.18);
    font-family: var(--font-body);
    font-size: 0.68rem;
    font-weight: 600;
}

.bb-hover-label::before {
    border-top-color: var(--bb-ink) !important;
}

.bb-evidence-marker {
    cursor: pointer;
    filter: drop-shadow(0 0 5px rgb(255 255 255 / 0.95)) drop-shadow(0 4px 7px rgb(37 18 91 / 0.38));
    transition: filter 140ms ease, stroke-width 140ms ease;
}

.bb-evidence-marker:hover,
.bb-evidence-marker:focus,
.bb-evidence-marker--selected {
    stroke-width: 4px !important;
    filter: drop-shadow(0 0 9px #fff) drop-shadow(0 7px 10px rgb(37 18 91 / 0.48));
}

.bb-major-rail-line {
    transition: opacity 180ms ease;
}

@media (max-width: 1080px) and (min-width: 761px) {
    .control-panel {
        width: 286px;
        padding-right: 18px;
        padding-left: 18px;
    }

    .map-level-label,
    .live-status {
        left: 318px;
    }

    .detail-panel {
        width: 340px;
    }

    .brand-name {
        font-size: 1.4rem;
    }
}

@media (max-height: 820px) and (min-width: 761px) {
    .control-panel {
        padding: 14px 19px 10px;
    }

    .brand-mark {
        width: 44px;
        height: 44px;
    }

    .brand-name {
        font-size: 1.32rem;
    }

    .panel-introduction {
        margin-top: 14px;
        padding-bottom: 12px;
    }

    h1 {
        font-size: 2.35rem;
    }

    .intro-copy {
        margin-top: 8px;
        font-size: 0.8rem;
    }

    .headline-total {
        padding: 9px 0;
    }

    .headline-total strong {
        font-size: 2.25rem;
    }

    .filter-tray {
        gap: 6px;
        padding: 10px 0;
    }

    .filter-button {
        min-height: 39px;
        font-size: 0.64rem;
    }

    .layer-toggle {
        min-height: 42px;
    }

    .legend {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 5px 8px;
        padding: 10px 0 7px;
    }

    .legend .panel-label,
    .legend .rail-legend {
        grid-column: 1 / -1;
    }

    .legend > div {
        gap: 6px;
        font-size: 0.62rem;
        line-height: 1.2;
    }

    .legend-swatch {
        width: 18px;
        height: 18px;
    }

    .privacy-summary {
        padding-top: 7px;
        font-size: 0.58rem;
    }
}

@media (max-width: 760px) {
    body {
        background: var(--bb-indigo-dark);
    }

    .map-canvas {
        background-color: var(--bb-indigo-dark);
        background-image:
            radial-gradient(circle at 72% 28%, rgb(139 92 246 / 0.24), transparent 34%),
            repeating-radial-gradient(ellipse at 50% 45%, transparent 0 24px, rgb(255 255 255 / 0.035) 25px, transparent 26px 43px);
    }

    .map-canvas::before {
        z-index: 200;
        opacity: 0.16;
        mix-blend-mode: screen;
    }

    .map-app[data-map-level="published"] .leaflet-tile-pane {
        opacity: 0.48;
    }

    .control-panel {
        position: absolute;
        top: max(8px, env(safe-area-inset-top));
        right: 9px;
        bottom: auto;
        left: 9px;
        width: auto;
        padding: 12px;
        overflow: visible;
        border-radius: 14px;
    }

    .brand-row {
        min-height: 49px;
    }

    .brand-mark {
        width: 47px;
        height: 47px;
    }

    .brand-name {
        max-width: 150px;
        font-size: 1.25rem;
        line-height: 0.9;
    }

    .mobile-total {
        display: grid;
        margin-left: auto;
        justify-items: end;
        gap: 1px;
    }

    .mobile-total strong {
        color: var(--bb-indigo);
        font-family: var(--font-display);
        font-size: 1.32rem;
        line-height: 1;
    }

    .mobile-total span {
        color: var(--bb-grey);
        font-family: var(--font-mono);
        font-size: 0.46rem;
        font-weight: 700;
        letter-spacing: 0.08em;
        text-transform: uppercase;
    }

    .mobile-total i {
        display: inline-block;
        width: 5px;
        height: 5px;
        margin: 0 3px 1px;
        background: var(--bb-success);
        border-radius: 50%;
    }

    .panel-introduction,
    .headline-total {
        display: none;
    }

    .finder-row {
        grid-template-columns: minmax(0, 1fr) 45px 45px 45px;
        gap: 0;
        margin-top: 10px;
        overflow: hidden;
        border: 1px solid #8f8c98;
        border-radius: 9px;
    }

    .finder-row > *,
    .postcode-search {
        min-width: 0;
    }

    .postcode-search {
        display: block;
    }

    .postcode-icon {
        position: absolute;
        z-index: 2;
        top: 13px;
        left: 12px;
        display: block;
        width: 19px;
        height: 19px;
        fill: none;
        stroke: var(--bb-ink);
        stroke-linecap: round;
        stroke-linejoin: round;
        stroke-width: 1.8;
    }

    .postcode-search input {
        height: 45px;
        padding: 0 8px 0 39px;
        border: 0;
        border-radius: 0;
        font-size: 16px;
    }

    .search-button {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
    }

    .location-button,
    .mobile-tool-button {
        display: grid;
        width: 45px;
        height: 45px;
        min-height: 45px;
        padding: 0;
        color: var(--bb-indigo-dark);
        background: var(--bb-paper);
        border: 0;
        border-left: 1px solid #8f8c98;
        border-radius: 0;
        place-items: center;
    }

    .location-button span {
        display: none;
    }

    .location-button svg,
    .mobile-tool-button svg {
        width: 22px;
        height: 22px;
    }

    .mobile-tool-button.is-active {
        color: #fff;
        background: var(--bb-indigo);
    }

    .filter-tray,
    .legend {
        position: absolute;
        z-index: 30;
        top: calc(100% + 7px);
        right: 0;
        left: 0;
        display: none;
        padding: 12px;
        background: var(--bb-paper);
        border: 1px solid var(--bb-ink);
        border-radius: 10px;
        box-shadow: var(--bb-shadow);
    }

    .filter-tray.is-open {
        display: grid;
    }

    .legend.is-open {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px 14px;
    }

    .legend.is-open .panel-label,
    .legend.is-open .rail-legend {
        grid-column: 1 / -1;
    }

    .legend-swatch {
        width: 20px;
        height: 20px;
    }

    .privacy-summary {
        display: none;
    }

    .map-level-label {
        top: calc(max(8px, env(safe-area-inset-top)) + 128px);
        left: 18px;
        padding: 8px 11px;
        color: #fff;
        background: rgb(20 10 56 / 0.78);
        border-color: rgb(255 255 255 / 0.22);
        box-shadow: 0 8px 20px rgb(9 4 30 / 0.24);
        backdrop-filter: blur(10px);
    }

    .detail-panel {
        position: absolute;
        top: auto;
        right: 0;
        bottom: 0;
        left: 0;
        width: auto;
        max-height: min(47dvh, 520px);
        padding: 28px 20px max(20px, env(safe-area-inset-bottom));
        overflow-x: hidden;
        border-right: 0;
        border-bottom: 0;
        border-left: 0;
        border-radius: 24px 24px 0 0;
        animation: detail-mobile-enter 230ms ease-out;
    }

    body.has-detail .map-canvas {
        bottom: min(47dvh, 520px);
        height: calc(100% - min(47dvh, 520px));
        min-height: 0;
    }

    @keyframes detail-mobile-enter {
        from { opacity: 0; transform: translateY(24px); }
        to { opacity: 1; transform: translateY(0); }
    }

    .sheet-handle {
        position: absolute;
        top: 9px;
        left: 50%;
        display: block;
        width: 38px;
        height: 5px;
        background: #a3a0aa;
        border-radius: 999px;
        transform: translateX(-50%);
    }

    .detail-close {
        top: 19px;
        right: 16px;
    }

    .detail-eyebrow {
        margin-bottom: 8px;
    }

    h2 {
        font-size: clamp(2.25rem, 12vw, 3rem);
    }

    .detail-verdict {
        margin-top: 12px;
    }

    .source-status {
        margin-top: 12px;
        padding: 9px 10px;
    }

    .source-status p {
        margin-top: 2px;
        font-size: 0.59rem;
        line-height: 1.35;
    }

    .detail-metrics {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        margin-top: 12px;
    }

    .detail-metrics > div {
        padding: 9px 8px 9px 0;
    }

    .detail-metrics > div:nth-child(even) {
        padding-right: 8px;
        padding-left: 8px;
    }

    .detail-metrics > div:nth-child(3) {
        grid-column: auto;
        padding: 9px 0 9px 8px;
        border-top: 0;
        border-left: 1px solid var(--bb-border);
    }

    .detail-metrics dd {
        font-size: 1.35rem;
    }

    .detail-metrics dd small {
        font-size: 0.6rem;
    }

    .detail-metrics > div > small {
        font-size: 0.5rem;
        line-height: 1.25;
    }

    .ranking {
        margin-top: 17px;
    }

    .live-status {
        bottom: calc(18px + env(safe-area-inset-bottom));
        left: 16px;
        min-height: 31px;
        padding: 0 9px;
        color: #fff;
        background: rgb(20 10 56 / 0.78);
        border-color: rgb(255 255 255 / 0.22);
    }

    body.has-detail .live-status {
        display: none;
    }

    .leaflet-bottom.leaflet-right {
        right: 13px;
        bottom: calc(60px + env(safe-area-inset-bottom));
    }

    body.has-detail .leaflet-bottom.leaflet-right {
        bottom: 12px;
    }

    .leaflet-control-attribution {
        max-width: 76vw;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .bb-region-label { font-size: 0.52rem; }
    .bb-region-label--subregion { font-size: 0.48rem; }
}

@media (max-width: 360px) {
    .brand-name {
        max-width: 120px;
        font-size: 1.06rem;
    }

    .mobile-total strong {
        font-size: 1.14rem;
    }

    .control-panel {
        right: 6px;
        left: 6px;
    }

    .finder-row {
        grid-template-columns: minmax(0, 1fr) 42px 42px 42px;
    }

    .location-button,
    .mobile-tool-button {
        width: 42px;
    }

    .detail-panel {
        padding-right: 16px;
        padding-left: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
