:root {
  --ink: #14231f;
  --ink-strong: #071d17;
  --muted: #5f7068;
  --muted-2: #63726b;
  --canvas: #f4f6f3;
  --surface: #ffffff;
  --surface-soft: #f8faf8;
  --surface-green: #eff7f3;
  --line: #dfe5e0;
  --line-strong: #cfd8d2;
  --green: #08785d;
  --green-dark: #075b48;
  --green-ink: #064638;
  --green-soft: #dcefe7;
  --amber: #da7a24;
  --amber-soft: #fff0df;
  --blue: #3867d6;
  --shadow-sm: 0 1px 2px rgba(10, 31, 24, .04), 0 6px 18px rgba(10, 31, 24, .035);
  --shadow-md: 0 18px 48px rgba(12, 37, 29, .08);
  --focus: rgba(8, 120, 93, .24);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--canvas); color: var(--ink); font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 14px; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; left: 16px; top: 10px; z-index: 3000; padding: 10px 14px; border-radius: 9px; color: white; background: var(--ink-strong); font-size: 12px; font-weight: 750; text-decoration: none; transform: translateY(-160%); transition: transform .15s; }
.skip-link:focus { transform: translateY(0); }

.loading-bar { position: fixed; inset: 0 0 auto; z-index: 2000; height: 3px; overflow: hidden; pointer-events: none; opacity: 0; transition: opacity .15s; }
.loading-bar i { display: block; width: 34%; height: 100%; background: var(--green); transform: translateX(-120%); }
.is-loading .loading-bar { opacity: 1; }
.is-loading .loading-bar i { animation: loading-slide 1.05s ease-in-out infinite; }
@keyframes loading-slide { 50% { transform: translateX(190%); } 100% { transform: translateX(410%); } }

.topbar { position: sticky; top: 0; z-index: 900; height: 64px; border-bottom: 1px solid rgba(207, 216, 210, .9); background: rgba(255, 255, 255, .94); backdrop-filter: blur(18px) saturate(150%); }
.topbar-inner { width: min(1540px, calc(100% - 48px)); height: 100%; margin: 0 auto; display: flex; align-items: center; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: inherit; text-decoration: none; margin-right: auto; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: var(--ink-strong); color: #c9f7e3; font: 800 12px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: -.4px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.07); }
.brand-copy b, .brand-copy small { display: block; }
.brand-copy b { font-size: 15px; line-height: 1.2; letter-spacing: -.3px; }
.brand-copy small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.topbar-actions { display: flex; align-items: center; gap: 18px; }
.product-mode { display: inline-flex; min-height: 26px; align-items: center; padding: 0 9px; border: 1px solid var(--line); border-radius: 999px; color: #52635c; background: var(--surface-soft); font-size: 10px; font-weight: 720; white-space: nowrap; }
.source-note { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }

.primary-btn, .secondary-btn { min-height: 42px; border: 0; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 16px; font-weight: 750; font-size: 12px; text-decoration: none; transition: transform .15s, background .15s, box-shadow .15s; }
.primary-btn { color: white; background: var(--green); box-shadow: 0 7px 18px rgba(8, 120, 93, .18); }
.primary-btn:hover { background: var(--green-dark); box-shadow: 0 9px 22px rgba(8, 120, 93, .23); transform: translateY(-1px); }
.primary-btn:active, .secondary-btn:active { transform: translateY(0); }
.primary-btn:disabled { opacity: .55; cursor: wait; transform: none; }
.secondary-btn { color: var(--green-ink); background: var(--green-soft); white-space: nowrap; }
.secondary-btn:hover { background: #cae8dc; }
.refresh-icon { font-size: 18px; line-height: 1; }

main { width: min(1540px, calc(100% - 48px)); margin: 0 auto; padding: 22px 0 58px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 40px; padding: 0 2px 18px; }
.eyebrow, .section-kicker { margin: 0 0 7px; color: var(--green); font-size: 9px; line-height: 1.2; font-weight: 850; text-transform: uppercase; letter-spacing: 1.35px; }
h1 { margin: 0; color: var(--ink-strong); font-size: clamp(30px, 3.2vw, 42px); line-height: 1.04; font-weight: 780; letter-spacing: -1.8px; }
.page-lead { max-width: 760px; margin: 8px 0 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.coverage-note { min-width: 170px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.62); }
.coverage-note span, .coverage-note small { display: block; color: var(--muted); font-size: 10px; }
.coverage-note strong { display: block; margin: 4px 0 2px; font-size: 15px; letter-spacing: -.3px; }

.changes-summary { margin: 0 0 16px; padding: 17px 19px; display: flex; align-items: flex-start; gap: 15px; border: 1px solid #c8ded5; border-radius: var(--radius-md); background: #fbfefc; box-shadow: var(--shadow-sm); }
.changes-summary-icon { flex: 0 0 38px; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; color: var(--green-dark); background: var(--green-soft); font-size: 18px; font-weight: 850; }
.changes-summary-copy { min-width: 0; flex: 1; }
.changes-summary-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.changes-summary-copy h2 { margin: 0; color: var(--ink-strong); font-size: 16px; letter-spacing: -.45px; }
.changes-summary-period { flex: 0 0 auto; color: var(--muted); font-size: 9px; line-height: 1.4; }
.changes-summary-items { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.changes-summary-item { min-height: 30px; padding: 5px 9px; border: 1px solid transparent; border-radius: 8px; color: var(--green-ink); background: var(--green-soft); font-size: 10px; font-weight: 750; }
.changes-summary-item b { margin-left: 4px; font: 800 9px/1 ui-monospace, SFMono-Regular, Menlo, monospace; }
.changes-summary-item:hover { border-color: #9bc8b7; }
.changes-summary-item.active { color: white; background: var(--green-dark); }
.changes-feed { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin-top: 11px; }
.change-event { position: relative; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 12px; padding: 11px 38px 11px 12px; border: 1px solid var(--line); border-radius: 10px; color: inherit; background: white; text-align: left; }
.change-event:hover { border-color: #a9c8bc; background: #f7fcf9; }
.change-event-kind { color: var(--green); font-size: 8px; font-weight: 850; text-transform: uppercase; letter-spacing: .55px; }
.change-event strong { min-width: 0; overflow: hidden; color: var(--ink-strong); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.change-event-preview { min-width: 0; overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.change-event time { grid-column: 2; grid-row: 1; color: var(--muted-2); font-size: 8px; white-space: nowrap; }
.change-event i { position: absolute; right: 13px; top: 50%; color: var(--green); font-size: 15px; font-style: normal; transform: translateY(-50%); }
.changes-more { min-height: 34px; margin-top: 9px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 9px; color: var(--green-ink); background: white; font-size: 10px; font-weight: 750; }
.changes-empty { grid-column: 1 / -1; margin: 0; padding: 11px 0; color: var(--muted); font-size: 10px; }
.changes-summary-copy > p:last-child { margin: 9px 0 0; color: var(--muted); font-size: 9px; line-height: 1.45; }

.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin-bottom: 14px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-sm); }
.kpi-card { min-height: 92px; padding: 15px 17px; display: flex; align-items: center; gap: 13px; border: 0; border-right: 1px solid var(--line); border-radius: 0; background: transparent; box-shadow: none; position: relative; }
.kpi-card:last-child { border-right: 0; }
.kpi-card::after { display: none; }
.kpi-primary { background: #fbfefc; }
.kpi-icon { position: relative; z-index: 1; flex: 0 0 34px; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: var(--green-dark); background: var(--green-soft); font-size: 16px; font-weight: 850; }
.kpi-icon.success { color: #18765c; background: #e6f3ed; }
.kpi-icon.warning { color: #ad5a10; background: var(--amber-soft); }
.kpi-icon.location { color: #365db8; background: #e8eefc; }
.kpi-card > div:last-child { min-width: 0; position: relative; z-index: 1; }
.kpi-card span, .kpi-card small { display: block; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-card span { font-size: 10px; font-weight: 750; }
.kpi-card strong { display: block; margin: 5px 0 3px; color: var(--ink-strong); font: 760 26px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: -1.5px; }
.kpi-card small { font-size: 9px; }

.filter-panel { padding: 16px 18px 14px; border: 1px solid #d8e0db; border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-sm); }
.filter-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 12px; }
.filter-header h2, .workspace-head h2 { margin: 0; color: var(--ink-strong); font-size: 18px; letter-spacing: -.65px; }
.filter-actions { display: flex; align-items: center; gap: 8px; }
.filter-count { color: var(--muted); font-size: 10px; font-weight: 650; }
.filter-toggle { display: none; min-height: 34px; padding: 0 11px; border: 1px solid var(--line); border-radius: 9px; color: var(--green-ink); background: var(--surface); font-size: 11px; font-weight: 750; }
.reset-btn { min-height: 34px; padding: 0 11px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: var(--surface-soft); font-size: 10px; font-weight: 700; }
.reset-btn:hover { color: var(--ink); border-color: var(--line-strong); background: #f0f3f0; }
.reset-btn:disabled { opacity: .45; cursor: default; }
.reset-btn span { margin-right: 4px; font-size: 15px; vertical-align: -1px; }
.filter-grid { display: grid; grid-template-columns: 1.35fr .95fr 1.05fr 1.3fr; gap: 11px; }
.filter-grid label > span, .date-filter > span, .status-filter legend { display: block; margin: 0 0 6px; color: var(--muted); font-size: 9px; font-weight: 760; letter-spacing: .3px; }
.filter-grid input:not([type=checkbox]), .filter-grid select { width: 100%; height: 42px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); color: var(--ink); background: var(--surface-soft); padding: 0 12px; outline: none; transition: border .15s, box-shadow .15s, background .15s; }
.filter-grid input:hover, .filter-grid select:hover { border-color: #b6c4bc; background: var(--surface); }
.filter-grid input:focus, .filter-grid select:focus { border-color: #64a995; background: var(--surface); box-shadow: 0 0 0 3px rgba(8,120,93,.1); }
.filter-grid input::placeholder { color: #929e98; }
.input-with-icon { position: relative; }
.input-with-icon i { position: absolute; z-index: 1; left: 13px; top: 9px; color: #7f8e87; font-style: normal; font-size: 20px; line-height: 1; }
.input-with-icon input { padding-left: 38px !important; }
.date-filter > div { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 6px; }
.date-filter b { color: var(--muted-2); font-weight: 500; }
.filter-footer { display: flex; align-items: center; gap: 16px; min-height: 46px; padding-top: 12px; margin-top: 12px; border-top: 1px solid var(--line); }
.status-filter { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; margin: 0; padding: 0; border: 0; }
.status-filter legend { float: left; margin: 0 3px 0 0; }
.status-filter label { min-height: 32px; display: inline-flex; align-items: center; gap: 7px; padding: 0 10px; border: 1px solid var(--line); border-radius: 999px; color: #44554e; background: var(--surface-soft); font-size: 10px; font-weight: 650; white-space: nowrap; cursor: pointer; }
.status-filter input { position: absolute; opacity: 0; pointer-events: none; }
.check { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.status-filter input:not(:checked) + .check { background: #a6b1ab; box-shadow: 0 0 0 3px #e8ece9; }
.status-filter input:focus-visible + .check { outline: 3px solid rgba(8,120,93,.25); outline-offset: 3px; }
.check.amber { background: var(--amber); box-shadow: 0 0 0 3px var(--amber-soft); }
.filter-chips { min-width: 0; flex: 1; display: flex; flex-wrap: wrap; gap: 6px; }
.filter-chip { max-width: 260px; padding: 6px 9px; border-radius: 7px; color: #52635b; background: #f0f4f1; font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.filter-chip:is(button) { border: 0; display: inline-flex; align-items: center; gap: 6px; text-align: left; }
.filter-chip:is(button):hover { color: var(--green-ink); background: var(--green-soft); }
.filter-chip:is(button) span { font-size: 14px; line-height: 1; }
.filter-error { margin: 10px 0 0; padding: 9px 11px; border-radius: 9px; color: #8b302c; background: #fff0ef; font-size: 11px; font-weight: 650; }
[aria-invalid="true"] { border-color: #c85850 !important; box-shadow: 0 0 0 3px rgba(200,88,80,.1) !important; }

.workspace { margin-top: 14px; }
.workspace-head { position: sticky; top: 64px; z-index: 700; min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 8px 2px 9px; border-bottom: 1px solid var(--line); background: rgba(244,246,243,.94); backdrop-filter: blur(14px) saturate(140%); }
.workspace-head > div > p:last-child { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.data-state { min-height: 58px; margin-top: 13px; padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border: 1px solid #e5cfc4; border-radius: 12px; color: #603f32; background: #fff8f2; }
.data-state > div { min-width: 0; }
.data-state strong, .data-state span { display: block; }
.data-state strong { font-size: 13px; }
.data-state span { margin-top: 3px; color: #80665c; font-size: 11px; line-height: 1.4; }
.data-state button { flex: 0 0 auto; min-height: 38px; padding: 0 13px; border: 1px solid #dbc1b5; border-radius: 9px; color: #684638; background: white; font-size: 11px; font-weight: 750; }
.tabs { display: inline-flex; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 11px; background: #e9eeea; }
.tab { min-height: 38px; padding: 0 12px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; font-size: 11px; font-weight: 750; white-space: nowrap; transition: color .15s, background .15s, box-shadow .15s; }
.tab:hover { color: var(--ink); }
.tab.active { color: var(--green-ink); background: var(--surface); box-shadow: 0 1px 4px rgba(20, 40, 33, .09); }
.tab span { margin-right: 4px; font-size: 13px; }
.view { display: none; padding-top: 13px; scroll-margin-top: 140px; }
.view.active { display: block; }

.map-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 13px; }
.map-card, .ranking-card, .chart-card, .table-card { border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-sm); overflow: hidden; }
.panel-heading { display: flex; align-items: start; justify-content: space-between; gap: 18px; }
.panel-heading h3 { margin: 0; color: var(--ink-strong); font-size: 16px; line-height: 1.25; letter-spacing: -.45px; }
.panel-heading p:not(.section-kicker) { margin: 4px 0 0; color: var(--muted); font-size: 10px; line-height: 1.4; }
.map-heading { min-height: 68px; align-items: center; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.map-status { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px 13px; }
.status-key { color: var(--muted); font-size: 9px; white-space: nowrap; }
.legend-dot { display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; }
.green { background: var(--green); }
.orange { background: var(--amber); }
.blue { background: var(--blue); }
#map {
  height: 560px;
  background-color: #e5eee9;
  background-image:
    linear-gradient(rgba(83, 121, 108, .08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(83, 121, 108, .08) 1px, transparent 1px);
  background-size: 64px 64px;
}
#map.leaflet-container { background-color: transparent; }
#map .leaflet-overlay-pane path { vector-effect: non-scaling-stroke; }
.map-quality { min-height: 34px; display: flex; align-items: center; padding: 0 16px; border-top: 1px solid var(--line); color: var(--muted); background: var(--surface-soft); font-size: 9px; }
.ranking-card { display: flex; flex-direction: column; padding: 18px; }
.metric-badge { flex: 0 0 auto; padding: 6px 8px; border-radius: 8px; color: var(--green-ink); background: var(--green-soft); font: 750 10px ui-monospace, SFMono-Regular, Menlo, monospace; white-space: nowrap; }
.ranking-list { display: grid; gap: 13px; margin-top: 20px; }
.rank-row { width: 100%; padding: 0; border: 0; color: inherit; background: transparent; text-align: left; cursor: pointer; }
.rank-row:focus-visible { outline: 3px solid rgba(8,120,93,.2); outline-offset: 5px; border-radius: 4px; }
.rank-row.disabled { opacity: .48; cursor: default; }
.rank-row > div:first-child { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 6px; color: #40514a; font-size: 10px; }
.rank-row b { color: var(--ink); font: 750 10px ui-monospace, SFMono-Regular, Menlo, monospace; }
.rank-bar { height: 5px; border-radius: 99px; overflow: hidden; background: #edf1ee; }
.rank-bar i { display: block; height: 100%; border-radius: inherit; background: var(--green); transition: width .25s ease; }
.panel-note { margin: auto 0 0; padding-top: 18px; color: var(--muted-2); font-size: 9px; line-height: 1.45; }

.chart-card { min-height: 510px; padding: 20px; }
.chart-card.large { min-height: 610px; }
.chart-card select, .table-heading select { height: 34px; border: 1px solid var(--line-strong); border-radius: 9px; color: var(--ink); background: var(--surface-soft); padding: 0 10px; font-size: 10px; }
.canvas-wrap { position: relative; height: 380px; margin-top: 22px; }
.chart-card.large .canvas-wrap { height: 475px; }
.chart-hint { margin: 14px 0 0; text-align: center; color: var(--muted); font-size: 9px; }
.charts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.custom-legend { display: flex; flex-wrap: wrap; gap: 7px 13px; margin-top: 12px; color: var(--muted); font-size: 9px; }
.custom-legend span { display: inline-flex; align-items: center; }
.custom-legend i { width: 7px; height: 7px; margin-right: 5px; border-radius: 2px; }
.type-reference-card { margin-top: 13px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-sm); }
.type-reference-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 17px; }
.type-reference-item { min-width: 0; padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); }
.type-reference-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.type-code { display: inline-flex; min-height: 26px; align-items: center; padding: 0 8px; border-radius: 7px; color: var(--green-ink); background: var(--green-soft); font: 800 9px/1 ui-monospace, SFMono-Regular, Menlo, monospace; }
.type-count { color: var(--muted-2); font: 700 9px/1 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: nowrap; }
.type-reference-item h4 { margin: 11px 0 5px; color: var(--ink-strong); font-size: 12px; line-height: 1.35; letter-spacing: -.15px; }
.type-reference-item p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }

.table-card { padding: 18px; }
.table-heading { align-items: center; margin-bottom: 15px; }
.table-tools { display: flex; align-items: center; gap: 13px; color: var(--muted); font-size: 10px; }
.table-tools label { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.table-scroll { max-height: 680px; overflow: auto; border: 1px solid var(--line); border-radius: 11px; }
table { width: 100%; min-width: 1080px; border-collapse: separate; border-spacing: 0; }
thead { position: sticky; top: 0; z-index: 2; }
th { padding: 11px 13px; border-bottom: 1px solid var(--line); color: #6e7c75; background: #f2f5f2; text-align: left; font-size: 8px; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; white-space: nowrap; }
td { padding: 13px; border-bottom: 1px solid #e9edea; font-size: 11px; vertical-align: top; }
tbody tr { transition: background .12s; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover, tbody tr:focus-visible { background: #f5faf7; outline: none; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 7px; border-radius: 999px; color: #08634e; background: var(--green-soft); font-size: 8px; font-weight: 800; white-space: nowrap; }
.status-pill.partial { color: #9a4c0b; background: var(--amber-soft); }
.status-pill i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.record-name { display: block; max-width: 360px; color: var(--ink-strong); font-weight: 720; line-height: 1.38; }
.record-sub { display: block; margin-top: 4px; color: var(--muted); line-height: 1.4; }
.record-address { display: -webkit-box; max-width: 520px; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.type-badge { display: inline-block; padding: 4px 6px; border: 1px solid #cbd9d1; border-radius: 6px; color: var(--green-dark); font-size: 8px; font-weight: 800; }
.row-action-cell { text-align: right; }
.row-open { min-width: 76px; min-height: 34px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line); border-radius: 8px; color: var(--green-ink); background: var(--surface); font-size: 10px; font-weight: 760; }
.row-open:hover { border-color: #b9cdc4; background: var(--green-soft); }
.row-open b { font-size: 14px; }
.table-empty-row td { padding: 52px 20px; color: var(--muted); text-align: center; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 16px; margin-top: 15px; color: var(--muted); font-size: 10px; }
.pagination button { min-height: 34px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: var(--surface); font-size: 10px; }
.pagination button:hover:not(:disabled) { border-color: var(--line-strong); background: var(--surface-soft); }
.pagination button:disabled { opacity: .38; cursor: default; }

.footer { width: min(1540px, calc(100% - 48px)); min-height: 72px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 30px; border-top: 1px solid var(--line); color: var(--muted); font-size: 9px; }
.footer span { color: var(--ink); font-weight: 800; }
.footer p { margin: 0; text-align: right; }

.empty-state { position: fixed; inset: 68px 0 0; z-index: 850; display: grid; place-content: center; padding: 30px; text-align: center; background: var(--canvas); }
.empty-state[hidden] { display: none; }
.empty-state h2 { margin: 13px 0 7px; font-size: 26px; letter-spacing: -.8px; }
.empty-state p { max-width: 500px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.empty-state .primary-btn { margin: 17px auto 0; }
.empty-icon { width: 62px; height: 62px; margin: auto; display: grid; place-items: center; border-radius: 18px; color: var(--green); background: var(--green-soft); font-size: 30px; }

.update-drawer { position: fixed; right: 22px; bottom: 22px; z-index: 1100; width: min(440px, calc(100vw - 44px)); display: flex; gap: 13px; padding: 16px; border: 1px solid rgba(255,255,255,.08); border-radius: 14px; color: white; background: var(--ink-strong); box-shadow: 0 20px 55px rgba(4,25,19,.3); }
.update-drawer[hidden] { display: none; }
.update-drawer > div:last-child { flex: 1; }
.update-drawer strong, .update-drawer span { display: block; }
.update-drawer strong { font-size: 11px; }
.update-drawer span { margin-top: 4px; color: #b8c9c2; font-size: 9px; }
.update-copy { min-width: 0; }
.update-title { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.update-title strong { min-width: 0; line-height: 1.35; }
.update-title b { color: #9eebcf; font: 800 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace; }
.progress { position: relative; height: 9px; margin-top: 10px; overflow: hidden; border-radius: 99px; background: #36544e; box-shadow: inset 0 0 0 1px rgba(255,255,255,.04); }
.progress i { display: block; width: 1%; height: 100%; border-radius: inherit; background: #79ddb9; transition: width .35s ease; }
.progress.indeterminate::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 34%; background: linear-gradient(90deg, transparent, rgba(255,255,255,.72), transparent); animation: progress-shimmer 1.1s linear infinite; }
.update-drawer.done .progress i { background: #8ee6bd; }
.update-drawer.error { background: #381c1b; }
.update-drawer.error .progress { background: #673331; }
.update-drawer.error .progress i { background: #f08a82; }
.update-drawer.stalled { background: #302817; }
.update-drawer.stalled .progress { background: #65552d; }
.update-drawer.stalled .progress i { background: #f0c96d; }
.update-progress-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-top: 10px; }
.update-progress-stats[hidden] { display: none; }
.update-progress-stats > span { min-width: 0; margin: 0; padding: 6px 7px; border: 1px solid rgba(255,255,255,.09); border-radius: 8px; background: rgba(255,255,255,.04); }
.update-progress-stats small, .update-progress-stats b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.update-progress-stats small { color: #8fa69e; font-size: 7px; font-weight: 700; text-transform: uppercase; letter-spacing: .35px; }
.update-progress-stats b { margin-top: 3px; color: #effaf6; font: 760 10px/1.1 ui-monospace, SFMono-Regular, Menlo, monospace; }
.update-resume-note { margin-top: 8px !important; padding: 7px 9px; border-radius: 8px; color: #c9e9dd !important; background: rgba(121,221,185,.09); line-height: 1.4; }
.update-resume-note[hidden] { display: none; }
.update-dismiss { margin-top: 10px; padding: 6px 9px; border: 1px solid rgba(255,255,255,.2); border-radius: 7px; color: white; background: rgba(255,255,255,.08); font-size: 10px; font-weight: 750; }
#update-elapsed { color: #819991; }
@keyframes progress-shimmer { from { transform: translateX(-120%); } to { transform: translateX(220%); } }
.spinner { flex: 0 0 20px; width: 20px; height: 20px; border: 2px solid #46665f; border-top-color: #79ddb9; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

dialog { width: min(820px, calc(100vw - 30px)); max-height: calc(100vh - 34px); padding: 0; border: 0; border-radius: 20px; color: var(--ink); background: var(--surface); box-shadow: 0 28px 90px rgba(10,38,31,.35); }
dialog::backdrop { background: rgba(5,24,18,.58); backdrop-filter: blur(4px); }
.modal-close { position: sticky; float: right; top: 13px; right: 13px; z-index: 2; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 50%; color: var(--ink); background: rgba(255,255,255,.92); font-size: 21px; }
.modal-content { padding: 30px; }
.modal-content h2 { margin: 7px 43px 10px 0; color: var(--ink-strong); font-size: clamp(22px, 4vw, 32px); line-height: 1.1; letter-spacing: -1px; }
.modal-meta { color: var(--muted); line-height: 1.5; }
.contact-card { margin: 20px 0; padding: 17px; border: 1px solid #cfe2da; border-radius: 14px; background: var(--surface-green); }
.contact-person { display: flex; align-items: center; gap: 13px; }
.contact-avatar { flex: 0 0 44px; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 13px; color: #d8f6ea; background: var(--green-dark); font: 780 13px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: -.5px; }
.contact-person h3 { margin: 0; color: var(--ink-strong); font-size: 14px; line-height: 1.25; letter-spacing: -.3px; }
.contact-person p:not(.section-kicker) { margin: 3px 0 0; color: var(--muted); font-size: 10px; }
.contact-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin-top: 14px; }
.contact-link { min-width: 0; min-height: 48px; display: flex; align-items: center; gap: 9px; padding: 8px 10px; border: 1px solid rgba(8,120,93,.13); border-radius: 10px; color: inherit; background: rgba(255,255,255,.72); text-decoration: none; }
a.contact-link:hover { border-color: rgba(8,120,93,.32); background: white; }
.contact-link > span:last-child { min-width: 0; }
.contact-link small, .contact-link b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact-link small { margin-bottom: 2px; color: var(--muted); font-size: 8px; font-weight: 700; }
.contact-link b { color: var(--ink-strong); font-size: 10px; font-weight: 720; }
.contact-icon { flex: 0 0 28px; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; color: var(--green-dark); background: var(--green-soft); font-size: 12px; font-weight: 850; }
.contact-icon.email { color: #365db8; background: #e8eefc; }
.contact-icon.phone { color: var(--green-dark); background: #dcefe7; }
.contact-empty { grid-column: 1 / -1; margin: 0; padding: 10px 0 1px; color: var(--muted); font-size: 10px; }
.contact-pending, .contact-error { display: flex; align-items: center; gap: 13px; }
.contact-pending .spinner { border-color: #b8d5ca; border-top-color: var(--green); }
.contact-pending h3, .contact-error h3 { margin: 0; font-size: 14px; }
.contact-pending p:not(.section-kicker), .contact-error p:not(.section-kicker) { margin: 4px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.contact-error { justify-content: space-between; border-color: #ebc8c4; background: #fff5f4; }
.modal-error-actions { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 16px; }
.modal-error-actions .source-link { margin-top: 0; }
.official-card { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 20px 0; padding: 17px; border: 1px solid #cfe2da; border-radius: 14px; background: var(--surface-green); }
.official-card h3 { margin: 0; color: var(--ink-strong); font-size: 14px; }
.official-card p:not(.section-kicker) { max-width: 520px; margin: 4px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.official-card a { flex: 0 0 auto; padding: 10px 13px; border-radius: 9px; color: white; background: var(--green-dark); font-size: 10px; font-weight: 750; text-decoration: none; }
.modal-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; margin: 21px 0; }
.detail-box { padding: 13px; border: 1px solid #e7ece8; border-radius: 11px; background: var(--surface-soft); }
.detail-box.wide { grid-column: 1 / -1; }
.detail-box > span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 8px; font-weight: 750; text-transform: uppercase; letter-spacing: .55px; }
.detail-box strong, .detail-box p { margin: 0; font-size: 11px; line-height: 1.55; }
.structured-box { padding: 0; overflow: hidden; background: white; }
.structured-heading { min-height: 45px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 13px; border-bottom: 1px solid #e7ece8; background: var(--surface-soft); }
.structured-heading > span { margin: 0; color: var(--ink-strong); font-size: 9px; font-weight: 820; text-transform: uppercase; letter-spacing: .55px; }
.structured-heading small { color: var(--muted); font-size: 9px; }
.address-stack { display: grid; gap: 8px; padding: 11px; }
.address-item { min-width: 0; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); }
.address-pin { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; color: var(--green-dark); background: var(--green-soft); font-size: 15px; font-weight: 850; }
.address-item > div { min-width: 0; }
.address-item .address-label { display: block; margin: 0 0 3px; color: var(--green); font-size: 8px; font-weight: 800; text-transform: uppercase; letter-spacing: .55px; }
.address-item strong { display: block; color: var(--ink-strong); font-size: 10px; line-height: 1.4; }
.address-item p { margin: 3px 0 0; color: var(--muted); font-size: 9px; line-height: 1.5; }
.structured-more { border-top: 1px solid var(--line); }
.structured-more summary { padding: 11px 13px; color: var(--green-dark); background: #fbfdfb; font-size: 9px; font-weight: 780; cursor: pointer; }
.structured-more summary:focus-visible { outline: 3px solid rgba(8,120,93,.22); outline-offset: -3px; }
.structured-more[open] summary { border-bottom: 1px solid var(--line); }
.structured-more .address-stack { padding-top: 10px; }
.structured-empty { padding: 14px; color: var(--muted); }
.scope-summary { padding: 11px 13px 0; }
.scope-summary span { display: inline-flex; min-height: 25px; align-items: center; margin: 0; padding: 0 8px; border-radius: 7px; color: var(--green-ink); background: var(--green-soft); font-size: 8px; font-weight: 780; text-transform: none; letter-spacing: 0; }
.scope-list { display: grid; gap: 0; margin: 0; padding: 8px 13px 12px; list-style: none; counter-reset: scope; }
.scope-list li { position: relative; padding: 9px 8px 9px 32px; border-bottom: 1px solid #edf1ee; color: #334b44; font-size: 10px; line-height: 1.55; counter-increment: scope; }
.scope-list li:last-child { border-bottom: 0; }
.scope-list li::before { content: counter(scope); position: absolute; left: 3px; top: 8px; width: 20px; height: 20px; display: grid; place-items: center; border-radius: 6px; color: var(--green-dark); background: var(--green-soft); font: 750 8px/1 ui-monospace, SFMono-Regular, Menlo, monospace; }
.structured-more .scope-list { padding-top: 3px; }
.detail-section { margin-top: 22px; }
.detail-section h3 { font-size: 13px; }
.detail-list { margin: 0; padding-left: 17px; color: #405752; font-size: 11px; line-height: 1.65; }
.source-link { display: inline-flex; margin-top: 18px; color: var(--green); font-size: 11px; font-weight: 800; text-decoration: none; }
.modal-loading { min-height: 260px; display: grid; place-content: center; text-align: center; color: var(--muted); }
.change-modal { width: min(900px, calc(100vw - 30px)); }
.change-details { display: grid; gap: 12px; margin-top: 22px; }
.change-diff-row { overflow: hidden; border: 1px solid var(--line); border-radius: 12px; }
.change-diff-row h3 { margin: 0; padding: 11px 13px; border-bottom: 1px solid var(--line); color: var(--ink-strong); background: var(--surface-soft); font-size: 11px; }
.change-diff-values { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.change-diff-values > div { min-width: 0; padding: 12px 13px; }
.change-diff-values > div + div { border-left: 1px solid var(--line); background: #f6fcf9; }
.change-diff-values span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 8px; font-weight: 800; text-transform: uppercase; letter-spacing: .55px; }
.change-diff-values p { max-height: 240px; margin: 0; overflow: auto; color: var(--ink-strong); font-size: 11px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.change-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--line); }
.change-facts div { min-width: 0; padding: 12px 13px; background: white; }
.change-facts dt { margin-bottom: 4px; color: var(--muted); font-size: 8px; font-weight: 800; text-transform: uppercase; letter-spacing: .55px; }
.change-facts dd { margin: 0; color: var(--ink-strong); font-size: 11px; line-height: 1.5; overflow-wrap: anywhere; }
.change-source-note { margin: 0; color: var(--muted); font-size: 10px; }
.change-actions { display: flex; align-items: center; gap: 14px; margin-top: 20px; }
.change-actions .source-link { margin-top: 0; }
.toast { position: fixed; left: 50%; bottom: 22px; z-index: 1200; max-width: min(480px, calc(100vw - 32px)); padding: 10px 15px; transform: translateX(-50%); border-radius: 10px; color: white; background: #263d38; box-shadow: var(--shadow-md); font-size: 10px; }
.toast[hidden] { display: none; }

.leaflet-control-zoom a { color: var(--ink) !important; border-color: var(--line) !important; }
.leaflet-control-attribution { color: var(--muted); font-size: 8px !important; background: rgba(255,255,255,.9) !important; }
.ral-cluster-wrap { display: grid; place-items: center; border: 0; background: transparent; }
.cluster-bubble { width: 100%; height: 100%; display: grid; place-items: center; border: 3px solid rgba(255,255,255,.96); border-radius: 50%; color: white; box-shadow: 0 6px 18px rgba(10,50,40,.28); }
.cluster-bubble.active { background: var(--green); }
.cluster-bubble.partial { background: var(--amber); }
.cluster-bubble.mixed { background: var(--blue); }
.cluster-bubble b { font: 800 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace; }
.leaflet-popup-content-wrapper { border: 1px solid rgba(207,216,210,.9); border-radius: 15px; box-shadow: 0 18px 44px rgba(16,43,40,.2); }
.leaflet-popup-content { width: min(310px, calc(100vw - 76px)) !important; margin: 15px !important; }
.map-popup { min-width: 0; }
.popup-meta { display: flex; flex-wrap: wrap; gap: 5px; }
.popup-meta span { max-width: 100%; padding: 4px 6px; border-radius: 6px; color: #52665f; background: #edf3ef; font-size: 8px; font-weight: 730; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-popup h4 { display: -webkit-box; margin: 9px 0 11px; overflow: hidden; color: var(--ink-strong); font-size: 13px; line-height: 1.35; letter-spacing: -.2px; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.map-popup .address-item { padding: 9px; background: #fbfdfb; }
.map-popup .address-item p { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.popup-empty { padding: 10px; border-radius: 9px; color: var(--muted); background: var(--surface-soft); font-size: 9px; }
.more-badge { display: inline-flex; margin-top: 6px; padding: 4px 7px; border-radius: 6px; color: #4b6058; background: #edf2ef; font-size: 8px; font-weight: 720; }
.popup-actions { display: flex; align-items: center; gap: 7px; margin-top: 11px; padding-top: 10px; border-top: 1px solid var(--line); }
.popup-actions button, .popup-actions a { min-height: 34px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; margin: 0; padding: 0 10px; border: 0; border-radius: 8px; font-size: 9px; font-weight: 800; text-decoration: none; }
.popup-actions button { flex: 1; color: white; background: var(--green); }
.popup-actions button:hover { background: var(--green-dark); }
.popup-actions a { color: var(--green-ink); background: var(--green-soft); }
.popup-actions a:hover { background: #cae8dc; }
.popup-actions a span { font: 800 9px/1 ui-monospace, SFMono-Regular, Menlo, monospace; }

.pc-view { display: grid; gap: 14px; }
.pc-source-banner { display: flex; align-items: center; justify-content: space-between; gap: 28px; padding: 16px 18px; border: 1px solid #bcd8cd; border-radius: var(--radius-md); background: #f7fcf9; box-shadow: var(--shadow-sm); }
.pc-source-banner h3 { margin: 0; color: var(--ink-strong); font-size: 17px; letter-spacing: -.45px; }
.pc-source-banner p:last-child { max-width: 820px; margin: 7px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.pc-source-actions { flex: 0 0 auto; display: flex; align-items: flex-end; flex-direction: column; gap: 8px; }
.pc-source-actions > span { color: var(--muted); font-size: 10px; }
.pc-kpi-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-sm); }
.pc-kpi { min-height: 88px; padding: 13px 15px; border: 0; border-right: 1px solid var(--line); border-top: 3px solid transparent; border-radius: 0; text-align: left; background: transparent; box-shadow: none; transition: background .15s, box-shadow .15s; }
.pc-kpi:last-child { border-right: 0; }
button.pc-kpi:hover { background: var(--surface-soft); }
button.pc-kpi.active { position: relative; z-index: 1; background: #f2faf6; box-shadow: inset 0 0 0 2px rgba(8,120,93,.22); }
.pc-kpi span, .pc-kpi small { display: block; color: var(--muted); font-size: 10px; }
.pc-kpi strong { display: block; margin: 8px 0 5px; color: var(--ink-strong); font: 760 25px/1 ui-monospace, SFMono-Regular, Menlo, monospace; }
.pc-kpi.hot { border-top-color: #c84e48; }
.pc-kpi.warm { border-top-color: #dd812a; }
.pc-kpi.early { border-top-color: #3d70cc; }
.pc-kpi.review { border-top-color: #7b6b91; }
.pc-kpi.coverage { border-top-color: var(--green); }
.update-drawer.partial { border-color: #dd812a; }
.update-drawer.partial .progress { background: #59442d; }
.update-drawer.partial .progress i { background: #f2a956; }
.pc-table-card { padding: 18px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-sm); }
.pc-toolbar { display: grid; grid-template-columns: minmax(210px,1.35fr) repeat(3,minmax(145px,.75fr)) auto; gap: 10px; align-items: end; }
.pc-toolbar label > span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 10px; font-weight: 750; }
.pc-toolbar input, .pc-toolbar select { width: 100%; height: 42px; padding: 0 11px; border: 1px solid var(--line-strong); border-radius: 10px; color: var(--ink); background: var(--surface-soft); font-size: 12px; }
.pc-export { height: 42px; }
.pc-result-line { min-height: 45px; display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 13px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.pc-result-line span:first-child { color: var(--ink); font-weight: 700; }
.pc-table-scroll { max-height: 720px; }
.pc-table { min-width: 1160px; }
.pc-table td { vertical-align: top; }
.pc-company strong, .pc-company span { display: block; }
.pc-company strong { max-width: 390px; color: var(--ink-strong); font-size: 11px; line-height: 1.35; }
.pc-company span { margin-top: 4px; color: var(--muted); font-size: 9px; }
.pc-date strong, .pc-date span { display: block; }
.pc-date strong { font: 750 11px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; }
.pc-date span { margin-top: 4px; color: var(--muted); font-size: 9px; }
.pc-relation { display: grid; gap: 5px; min-width: 185px; }
.pc-relation small { max-width: 205px; color: var(--muted); font-size: 9px; line-height: 1.35; }
.lead-pill, .confidence-pill { display: inline-flex; align-items: center; min-height: 28px; padding: 0 9px; border-radius: 999px; font-size: 9px; font-weight: 820; white-space: nowrap; }
.procedure-pill { display: inline-flex; justify-self: start; align-items: center; min-height: 24px; max-width: 205px; padding: 0 8px; border-radius: 999px; color: #4f645c; background: #edf2ef; font-size: 9px; font-weight: 820; line-height: 1.15; }
.procedure-pill.combined_likely { color: #086148; background: #dff2e9; }
.procedure-pill.separate_likely { color: #2e579e; background: #e8effd; }
.procedure-pill.requires_check { color: #85500e; background: #fff0d9; }
.lead-pill.hot { color: #852d29; background: #ffe7e5; }
.lead-pill.warm { color: #8a4b0e; background: #ffefd9; }
.lead-pill.early { color: #2e579e; background: #e8effd; }
.lead-pill.future { color: #4f645c; background: #edf2ef; }
.lead-pill.review, .lead-pill.overdue_review, .lead-pill.unknown { color: #5c4c73; background: #eee9f4; }
.confidence-pill.high { color: #086148; background: #dff2e9; }
.confidence-pill.medium { color: #85500e; background: #fff0d9; }
.confidence-pill.low { color: #842f2b; background: #ffe7e5; }
.pc-days { font: 760 12px/1 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: nowrap; }
.pc-days small { display: block; margin-top: 5px; color: var(--muted); font: 9px/1.2 Inter, sans-serif; }
.pc-score { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: var(--green-ink); background: var(--green-soft); font: 800 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace; }
.pc-row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.pc-row-actions button, .pc-row-actions a { min-height: 34px; padding: 0 9px; border: 1px solid var(--line); border-radius: 8px; color: var(--green-ink); background: var(--surface-soft); font-size: 9px; font-weight: 780; text-decoration: none; white-space: nowrap; }
.pc-row-actions button:hover, .pc-row-actions a:hover { background: var(--green-soft); }
.pc-empty { padding: 52px 20px; text-align: center; border: 1px dashed var(--line-strong); border-radius: 13px; background: var(--surface-soft); }
.pc-empty > div { color: var(--green); font-size: 28px; }
.pc-empty h3 { margin: 10px 0 5px; }
.pc-empty p { margin: 0 auto 15px; max-width: 560px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.pc-methodology { border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.pc-methodology summary { min-height: 48px; display: flex; align-items: center; padding: 0 16px; color: var(--ink); font-size: 11px; font-weight: 760; cursor: pointer; }
.pc-methodology > div { padding: 0 16px 16px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.pc-methodology a { color: var(--green-dark); }

/* Dense professional views remain compact without sacrificing readability. */
.page-lead { font-size: 15px; }
.kpi-card span { font-size: 11px; }
.kpi-card small, .coverage-note span, .coverage-note small { font-size: 10px; }
.filter-grid label > span, .date-filter > span, .status-filter legend { font-size: 10px; }
.filter-grid input:not([type=checkbox]), .filter-grid select { font-size: 13px; }
.status-filter label, .reset-btn { font-size: 11px; }
.workspace-head > div > p:last-child, .panel-heading p:not(.section-kicker), .map-quality { font-size: 11px; }
.tab { min-height: 38px; font-size: 11px; }
.status-key, .panel-note, .custom-legend { font-size: 10px; }
.rank-row > div:first-child, .rank-row b { font-size: 11px; }
.type-reference-item h4 { font-size: 13px; }
.type-reference-item p, .type-count, .type-code { font-size: 10px; }
th { font-size: 10px; }
td, .pagination, .pagination button, .table-tools { font-size: 12px; }
.footer { font-size: 10px; }
.detail-box strong, .detail-box p, .detail-list, .source-link { font-size: 12px; }
.address-item strong { font-size: 11px; }
.address-item p, .scope-list li, .structured-heading small { font-size: 10px; }
.popup-meta span, .more-badge { font-size: 9px; }
.map-popup .address-item strong, .map-popup .address-item p { font-size: 10px; }
.popup-actions button, .popup-actions a { min-height: 38px; font-size: 10px; }
.pc-company strong, .pc-date strong { font-size: 12px; }
.pc-company span, .pc-date span, .pc-relation small, .lead-pill, .confidence-pill, .procedure-pill { font-size: 10px; }

@media (max-width: 1180px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-card:nth-child(2) { border-right: 0; }
  .kpi-card:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-footer { align-items: flex-start; flex-wrap: wrap; }
  .filter-chips { order: 3; flex-basis: 100%; }
  .map-layout { grid-template-columns: 1fr; }
  .ranking-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .panel-note { margin-top: 18px; }
  .pc-kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; overflow: visible; border: 0; background: transparent; box-shadow: none; }
  .pc-kpi { border: 1px solid var(--line); border-top-width: 3px; border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-sm); }
  .pc-toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pc-export { width: auto; }
}

@media (max-width: 840px) {
  .topbar-inner, main, .footer { width: min(100% - 28px, 1540px); }
  .source-note { display: none; }
  .product-mode { margin-left: auto; }
  main { padding-top: 24px; }
  .page-head { align-items: start; }
  .coverage-note { display: none; }
  .workspace-head { top: 64px; align-items: flex-start; flex-direction: column; gap: 9px; padding: 9px 0; }
  .tabs { width: 100%; overflow-x: auto; }
  .tab { flex: 1; }
  .charts-grid { grid-template-columns: 1fr; }
  .type-reference-grid { grid-template-columns: 1fr; }
  .footer { padding: 18px 0; align-items: flex-start; flex-direction: column; gap: 6px; }
  .footer p { text-align: left; }
  .data-state { align-items: flex-start; }
  .pc-source-banner { align-items: flex-start; flex-direction: column; }
  .pc-source-actions { width: 100%; align-items: stretch; }
  .pc-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .filter-toggle { display: inline-flex; align-items: center; }
  .filter-count { max-width: 180px; line-height: 1.35; text-align: right; }
  .filters-collapsed #filter-controls { display: none; }
  .filters-collapsed .filter-header { margin-bottom: 0; }

  .table-scroll, .pc-table-scroll { max-height: none; overflow: visible; border: 0; border-radius: 0; }
  .table-scroll table, .table-scroll tbody { display: block; min-width: 0; }
  .table-scroll thead { display: none; }
  .table-scroll tbody { display: grid; gap: 10px; }
  .table-scroll tbody tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; padding: 15px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); box-shadow: var(--shadow-sm); }
  .table-scroll tbody tr:hover { background: var(--surface); }
  .table-scroll td { min-width: 0; padding: 0; border: 0; font-size: 12px; }
  .table-scroll td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 5px; color: var(--muted-2); font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .55px; }
  #records-body td:nth-child(3), #records-body td:nth-child(6), .pc-table td:nth-child(2), .pc-table td:nth-child(4), .row-action-cell { grid-column: 1 / -1; }
  .record-name, .record-address, .pc-company strong, .pc-relation small { max-width: none; }
  .record-address { -webkit-line-clamp: 2; }
  .row-open, .pc-row-actions, .pc-row-actions button, .pc-row-actions a { width: 100%; min-height: 42px; }
  .pc-row-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .pc-score { width: 38px; height: 38px; }
  .table-empty-row { display: block !important; }
  .table-empty-row td { display: block; padding: 34px 16px; }
}

@media (max-width: 580px) {
  .topbar { height: 62px; }
  .topbar-inner, main, .footer { width: min(100% - 20px, 1540px); }
  .brand-copy small { display: none; }
  .topbar-actions .primary-btn { width: 40px; min-height: 40px; padding: 0; }
  .topbar-actions .primary-btn span:last-child { display: none; }
  .product-mode { display: none; }
  main { padding: 18px 0 45px; }
  .page-head { padding-bottom: 19px; }
  .changes-summary { align-items: flex-start; padding: 15px; }
  .changes-summary-icon { display: none; }
  .changes-summary-heading { display: block; }
  .changes-summary-period { display: block; margin-top: 4px; }
  .changes-feed { grid-template-columns: 1fr; }
  .change-event { min-height: 74px; }
  h1 { font-size: 31px; letter-spacing: -1.35px; }
  .page-lead { font-size: 13px; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; }
  .kpi-card { min-height: 94px; padding: 12px; gap: 10px; align-items: center; flex-direction: row; }
  .kpi-icon { width: 28px; height: 28px; flex-basis: 28px; border-radius: 8px; font-size: 14px; }
  .kpi-card strong { font-size: 24px; }
  .filter-panel { padding: 16px; border-radius: 17px; }
  .filter-header { align-items: flex-start; }
  .filter-actions { flex-wrap: wrap; justify-content: flex-end; }
  .reset-btn { padding: 0 9px; }
  .reset-btn span { display: none; }
  .filter-grid { grid-template-columns: 1fr; }
  .filter-footer { gap: 12px; }
  .status-filter { width: 100%; align-items: flex-start; flex-direction: column; }
  .status-filter legend { float: none; margin-bottom: 1px; }
  .status-filter label { width: 100%; }
  .secondary-btn { width: 100%; }
  .workspace-head { top: 62px; }
  .tabs { padding: 3px; scroll-snap-type: x proximity; }
  .tab { flex: 0 0 auto; min-height: 42px; padding: 0 11px; font-size: 10px; scroll-snap-align: start; }
  .tab span { display: inline; }
  .map-heading { align-items: flex-start; flex-direction: column; }
  .map-status { justify-content: flex-start; }
  #map { height: 500px; }
  .ranking-list { grid-template-columns: 1fr; }
  .chart-card { padding: 16px; }
  .chart-card.large { min-height: 540px; }
  .chart-card.large .canvas-wrap { height: 410px; }
  .table-card { padding: 13px; }
  .table-heading { align-items: flex-start; flex-direction: column; }
  .table-tools { width: 100%; justify-content: space-between; }
  .modal-content { padding: 24px 17px; }
  .contact-card { padding: 14px; }
  .contact-list { grid-template-columns: 1fr; }
  .official-card { align-items: flex-start; flex-direction: column; }
  .modal-grid { grid-template-columns: 1fr; }
  .change-diff-values, .change-facts { grid-template-columns: 1fr; }
  .change-diff-values > div + div { border-top: 1px solid var(--line); border-left: 0; }
  .change-actions { align-items: stretch; flex-direction: column; }
  .change-actions .secondary-btn { width: 100%; }
  .detail-box.wide { grid-column: auto; }
  .data-state { flex-direction: column; gap: 10px; }
  .data-state button { width: 100%; min-height: 44px; }
  .update-drawer { right: 10px; bottom: 10px; width: calc(100vw - 20px); }
  .update-progress-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .modal-close { width: 44px; height: 44px; top: 8px; right: 8px; }
  .modal-error-actions { align-items: stretch; flex-direction: column; }
  .modal-error-actions .secondary-btn { min-height: 44px; }
  .contact-error { align-items: stretch; flex-direction: column; }
  .pc-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pc-toolbar { grid-template-columns: 1fr; }
  .pc-source-banner, .pc-table-card { padding: 14px; }
  .pc-result-line { align-items: flex-start; flex-direction: column; gap: 5px; }
  .filter-grid input:not([type=checkbox]), .filter-grid select, .status-filter label { min-height: 44px; }
  .leaflet-popup-content { width: calc(100vw - 76px) !important; margin: 12px !important; }
}

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