:root {
    --ink: #1d2433;
    --muted: #4b5568;
    --line: #d5dae3;
    --surface: #ffffff;
    --page: #f5f6f8;
    --accent: #b4520b;
    --accent-ink: #ffffff;
    --link: #1f4fa8;
    --focus: #ffbf47;
    --gap-bg: #fff2d6;
    --gap-ink: #6b4300;
    --ok: #1d6b3a;
}

* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--ink); background: var(--page); }
a { color: var(--link); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; }
.skip-link:focus { left: 16px; top: 8px; background: var(--surface); padding: 8px; z-index: 10; }

.site-header { background: var(--ink); color: #fff; }
.header-row { display: flex; flex-wrap: wrap; gap: 16px 24px; align-items: center; padding-top: 12px; padding-bottom: 12px; }
.brand { color: #fff; font-weight: 700; font-size: 1.15rem; text-decoration: none; }
.site-header nav { display: flex; gap: 16px; }
.site-header nav a { color: #fff; }
.gap-toggle { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.fixture-banner { background: var(--gap-bg); color: var(--gap-ink); padding: 8px 16px; margin-top: 12px; border-radius: 4px; }

main { padding-top: 24px; padding-bottom: 48px; }
h1 { font-size: 1.9rem; margin: 0 0 8px; }
.lede { color: var(--muted); margin-top: 0; }

.search-box { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 16px; margin: 16px 0 24px; }
.search-box label { display: block; font-weight: 600; margin-bottom: 8px; }
.search-row { display: flex; gap: 8px; }
.search-row input { flex: 1; min-width: 0; font: inherit; padding: 10px; border: 2px solid var(--ink); border-radius: 4px; }
button { font: inherit; font-weight: 600; background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 4px; padding: 10px 18px; cursor: pointer; }

.results-layout { display: grid; grid-template-columns: 240px 1fr; gap: 24px; }
@media (max-width: 720px) { .results-layout { grid-template-columns: 1fr; } }
.facets h2 { font-size: 1rem; margin: 0 0 6px; }
.facets ul { list-style: none; padding: 0; margin: 0 0 16px; }
.facets a[aria-current] { font-weight: 700; }
.count { color: var(--muted); }
.results { list-style: none; padding: 0; margin: 0; }
.result { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 14px 16px; margin-bottom: 12px; }
.result h2 { font-size: 1.1rem; margin: 0; }
.result p { margin: 4px 0; }
.result .address { font-weight: 600; }
.meta { display: flex; flex-wrap: wrap; gap: 4px 16px; color: var(--muted); font-size: 0.92rem; }
.pager { display: flex; gap: 16px; }

.tabs { display: flex; flex-wrap: wrap; gap: 2px; border-bottom: 2px solid var(--ink); margin-top: 16px; }
.tab { padding: 8px 14px; text-decoration: none; color: var(--ink); background: #e6e9ef; border-radius: 4px 4px 0 0; }
.tab.is-selected { background: var(--ink); color: #fff; font-weight: 600; }
.tab-panel { background: var(--surface); border: 1px solid var(--line); border-top: 0; padding: 16px; }
.field-table { width: 100%; border-collapse: collapse; }
.field-table th, .field-table td { text-align: left; vertical-align: top; padding: 8px; border-bottom: 1px solid var(--line); }
.field-table th { width: 30%; font-weight: 600; }
.gap { color: var(--muted); }
.gap-loud { background: var(--gap-bg); color: var(--gap-ink); padding: 1px 8px; border-radius: 10px; font-size: 0.88rem; font-weight: 600; }
.coming-soon { color: var(--muted); }

.table-scroll { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; }
.coverage { border-collapse: collapse; width: 100%; font-size: 0.92rem; }
.coverage th, .coverage td { padding: 6px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.coverage .rate { text-align: right; font-variant-numeric: tabular-nums; }
.rate-none { background: var(--gap-bg); color: var(--gap-ink); }
.rate-full { color: var(--ok); font-weight: 600; }

#blazor-error-ui { display: none; position: fixed; bottom: 0; left: 0; right: 0; background: #fde8e8; padding: 12px 16px; }
#blazor-error-ui .dismiss { cursor: pointer; float: right; }
.loading-progress, .loading-progress-text { display: none; }

/* Scaffold additions: chrome, search shell, forms, results, application and property pages */
.menu { padding-bottom: 8px; }
.menu-bar { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 0; padding: 0; align-items: center; }
.menu-bar a, .menu-bar button { color: #fff; background: none; border: 0; padding: 6px 0; font: inherit; font-weight: 500; cursor: pointer; }
.menu-bar button::after { content: " ▾"; }
.menu-bar .push { margin-left: auto; }
.has-menu { position: relative; }
.dropdown { position: absolute; z-index: 20; list-style: none; margin: 0; padding: 6px 0; min-width: 220px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 6px 18px rgb(0 0 0 / 15%); }
.dropdown a { display: block; color: var(--ink); padding: 8px 14px; }
.site-footer { border-top: 1px solid var(--line); background: var(--surface); color: var(--muted); padding: 16px 0 24px; }
.site-footer ul { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 20px; padding: 0; margin: 0 0 8px; }

.intro p { margin: 4px 0; color: var(--muted); }
.subnav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 2px; margin: 0; padding: 0; }
.search-tabs { margin-top: 16px; border-bottom: 2px solid var(--ink); }
.search-tabs a { display: block; padding: 8px 14px; text-decoration: none; color: var(--ink); background: #e6e9ef; border-radius: 4px 4px 0 0; }
.search-tabs a.is-current { background: var(--ink); color: #fff; font-weight: 600; }
.case-tabs { background: var(--surface); border: 1px solid var(--line); border-top: 0; padding: 8px 12px 0; }
.case-tabs a { display: block; padding: 6px 12px; text-decoration: none; color: var(--link); border-bottom: 3px solid transparent; }
.case-tabs a.is-current { color: var(--ink); font-weight: 600; border-bottom-color: var(--accent); }
.search-panel { background: var(--surface); border: 1px solid var(--line); border-top: 0; padding: 16px; margin-bottom: 24px; }

.search-form fieldset { border: 1px solid var(--line); border-radius: 6px; margin: 0 0 16px; padding: 8px 16px 12px; }
.search-form legend { font-size: 1.15rem; font-weight: 600; padding: 0 6px; }
.form-row { display: grid; grid-template-columns: 240px 1fr; gap: 6px 16px; align-items: start; padding: 6px 0; }
.form-row-wide { grid-template-columns: 1fr; }
@media (max-width: 720px) { .form-row { grid-template-columns: 1fr; } }
.form-row label, .range-label { font-weight: 600; padding-top: 8px; }
.form-control input, .form-control select, .sort-bar select { font: inherit; padding: 8px; border: 2px solid var(--ink); border-radius: 4px; width: 100%; max-width: 420px; background: #fff; }
.range { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.range input { width: auto; }
.range label { font-weight: 400; padding: 0; }
.hint { display: block; width: 100%; color: var(--gap-ink); font-size: 0.88rem; margin-top: 4px; }
.radios label { display: block; padding: 4px 0; }
.form-actions { display: flex; gap: 10px; }
button.secondary { background: #e6e9ef; color: var(--ink); }

.back { margin-top: 0; }
.gap-note { background: var(--gap-bg); color: var(--gap-ink); padding: 10px 14px; border-radius: 6px; }
.sort-bar { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 10px 14px; margin-bottom: 16px; }
.sort-bar label { font-weight: 600; }
.sort-bar select { width: auto; }
.view-toggle ul { gap: 8px; margin-bottom: 8px; }
.view-toggle a { padding: 4px 12px; border: 1px solid var(--line); border-radius: 14px; text-decoration: none; }
.view-toggle a.is-current { background: var(--ink); color: #fff; }
.pager { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; }
.pager .showing { margin-right: 8px; color: var(--muted); }
.pager .current { font-weight: 700; padding: 0 4px; }
.result-title { font-weight: 600; font-size: 1.05rem; }
.council { font-style: italic; }

.case-line { margin: 4px 0; }
.council-line { margin: 0 0 12px; color: var(--muted); }
.progress { list-style: none; display: flex; flex-wrap: wrap; gap: 0; padding: 0; margin: 0 0 8px; counter-reset: stage; }
.progress li { flex: 1 1 120px; padding: 8px 10px 8px 34px; position: relative; border-top: 4px solid var(--line); color: var(--muted); }
.progress li::before { counter-increment: stage; content: counter(stage); position: absolute; left: 6px; top: 8px; width: 20px; height: 20px; border-radius: 50%; background: var(--line); color: var(--ink); font-size: 0.8rem; text-align: center; line-height: 20px; }
.progress li.reached { border-top-color: var(--ok); color: var(--ink); }
.progress li.reached::before { background: var(--ok); color: #fff; }
.stage { display: block; font-weight: 600; }
.stage-date { font-size: 0.9rem; }
.subtabs { margin-top: 0; border-bottom-width: 1px; }
.subtabs .tab { background: transparent; color: var(--link); }
.subtabs .tab.is-selected { color: var(--ink); background: transparent; border-bottom: 3px solid var(--accent); }
.tab-panel .tab-panel { border: 0; padding: 12px 0 0; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); }
.related h3 { font-size: 1.05rem; margin: 16px 0 6px; }
.note { color: var(--muted); font-size: 0.92rem; }
.gate { border: 2px dashed var(--line); border-radius: 8px; padding: 16px; margin-top: 16px; }
.gate h2 { margin-top: 0; font-size: 1.2rem; }
.gate-preview { opacity: 0.75; }

.map { height: 420px; border: 1px solid var(--line); border-radius: 6px; }
.map-credit { font-size: 0.8rem; color: var(--muted); margin: 4px 0 8px; }
.map-list summary { cursor: pointer; font-weight: 600; }
.map-key { margin-top: 12px; border-collapse: collapse; }
.map-key caption { text-align: left; font-weight: 600; }
.map-key th, .map-key td { padding: 6px 10px; border: 1px solid var(--line); text-align: left; }
.key-marker { display: inline-block; width: 12px; height: 18px; border-radius: 6px 6px 6px 0; background: #2a81cb; transform: rotate(-45deg); }
.history { padding-left: 18px; }
