/* --- Tokens and base --- */
:root {
  color-scheme: light;
  --ink: #171918;
  --muted: #68706b;
  --line: #cbd2cd;
  --line-strong: var(--line);
  --surface: #fff;
  --surface-2: #f5f7f5;
  --surface-3: #ecefeb;
  --green: #198754;
  --green-dark: #116b41;
  --map-control-border: var(--line-strong);
  --completion-recent: #7c3aed;
  --completion-earlier: #2563eb;
  --completion-not-verified: #d97706;
  --control-height: 34px;
  --control-radius: 8px;
  --control-surface: rgb(255 255 255 / 96%);
  --control-shadow: 0 2px 10px rgb(20 30 24 / 12%);
  --control-focus: 0 0 0 3px rgb(57 116 214 / 20%);
  --chevron-size: 8px;
  --chevron-right: 10px;
  --chevron-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10' fill='none'%3E%3Cpath d='M2 3.5 5 6.5 8 3.5' stroke='%2368706b' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --filter-label-weight: 600;
  --filter-control-weight: 450;
  --shadow: 0 14px 40px rgb(24 32 27 / 15%);
  --wash: #fafcfb;
  --radius: 12px;
  --sidebar-width: 374px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; overflow: hidden; }
body { color: var(--ink); background: var(--surface-2); font-size: 14px; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
a { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 0; box-shadow: var(--control-focus); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
/* --- Header and view navigation --- */
.topbar {
  height: 58px;
  padding: 0 18px;
  display: grid;
  grid-template-columns: minmax(310px, 1fr) minmax(300px, 600px) minmax(150px, 1fr);
  align-items: center;
  gap: 20px;
  background: #111312;
  color: #fff;
  border-bottom: 1px solid var(--line-strong);
}
.brand-block { display: flex; align-items: center; gap: 11px; min-width: 0; color: inherit; text-decoration: none; }
.brand-block > div { min-width: 0; }
.brand-logo {
  width: 42px; height: 42px; display: grid; place-items: center; flex: 0 0 auto;
  border: 1px solid var(--line-strong); border-radius: 10px; background: var(--green); color: white; font-weight: 750; font-size: 19px; object-fit: cover;
}
.brand-block h1 { margin: 0; font-size: 16px; line-height: 1.2; letter-spacing: -.01em; }
.brand-block p { margin: 3px 0 0; color: #9fa7a2; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-subtitle { display: block; margin-top: 2px; color: #7f8983; font-size: 9px; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.global-search { height: 38px; display: flex; align-items: center; gap: 9px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 9px; background: #202320; }
.global-search:focus-within { border-color: var(--line-strong); box-shadow: 0 0 0 3px rgb(104 112 107 / 18%); }
.global-search svg { width: 17px; fill: none; stroke: #9fa7a2; stroke-width: 1.8; }
.global-search input { width: 100%; min-width: 0; border: 0; outline: 0; color: #fff; background: transparent; }
.global-search input::placeholder { color: #929994; }
.topbar-actions { display: flex; align-items: center; justify-self: end; gap: 8px; }
.theme-toggle { width: var(--control-height); min-width: var(--control-height); padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.theme-toggle-icon { font-size: 15px; line-height: 1; }
.ghost-button { min-height: var(--control-height); justify-self: end; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line-strong); border-radius: var(--control-radius); background: var(--control-surface); color: var(--ink); padding: 0 11px; text-decoration: none; box-shadow: var(--control-shadow); font-size: 11px; font-weight: 700; }
.ghost-button:hover { border-color: var(--line-strong); background: #f4f8f4; color: var(--green-dark); }
.topbar .ghost-button, .viewer .ghost-button { border-color: var(--line-strong); background: transparent; color: inherit; box-shadow: none; }
.topbar .ghost-button:hover, .viewer .ghost-button:hover { border-color: var(--line-strong); background: rgb(255 255 255 / 7%); color: inherit; }
.topbar .topbar-dashboard-button.is-active { border-color: var(--green); background: var(--green); color: #fff; }
.topbar .topbar-dashboard-button.is-active:hover { border-color: var(--green-dark); background: var(--green-dark); color: #fff; }
.topbar .topbar-weekly-recap-button { white-space: nowrap; }
.topbar .topbar-weekly-recap-button.is-active { border-color: var(--green); background: var(--green); color: #fff; }
.topbar .topbar-weekly-recap-button.is-active:hover { border-color: var(--green-dark); background: var(--green-dark); color: #fff; }
html[data-theme="dark"] .topbar .topbar-dashboard-button.is-active,
html[data-theme="dark"] .topbar .topbar-weekly-recap-button.is-active { color: #172027; }
.leaflet-container { font-family: inherit; }
.mobile-menu-toggle, .mobile-panel-header, .mobile-panel-actions, .mobile-view-tabs, .mobile-scrim, .mobile-map-menu { display: none; }
.mobile-brand { display: none; color: inherit; text-decoration: none; }
.mobile-scrim[hidden] { display: none !important; }
.leaflet-tooltip.census-tract-tooltip { text-align: left; }

.workspace { height: calc(100% - 58px); display: block; position: relative; }
.map-workspace { position: absolute; inset: 0; display: flex; }
.map-workspace[hidden] { display: none !important; }
.view-tabs { position: absolute; z-index: 760; top: 12px; left: calc(var(--sidebar-width, 374px) + (100% - var(--sidebar-width, 374px)) / 2); display: inline-flex; transform: translateX(-50%); padding: 3px; border: 1px solid var(--map-control-border); border-radius: var(--control-radius); background: var(--control-surface); box-shadow: var(--control-shadow); transition: left .2s ease; }
body[data-view="table"] .view-tabs,
.workspace:has(#tablePanel:not([hidden])) .view-tabs { left: 50%; }
body.detail-open .view-tabs { left: calc(var(--sidebar-width, 374px) + (100% - var(--sidebar-width, 374px) - 470px) / 2); }
body.detail-open .workspace:has(.map-workspace.sidebar-collapsed) .view-tabs { left: calc((100% - 470px) / 2); }
@media (min-width: 721px) and (max-width: 1048px) {
  body.detail-open .workspace:has(.map-workspace:not(.sidebar-collapsed)) .view-tabs { display: none; }
}
.view-tab { min-height: 30px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); padding: 0 14px; font-size: 11px; font-weight: 750; }
.view-tab:hover { color: var(--ink); }
.view-tab.is-active { background: var(--green); color: #fff; }
/* --- Dashboard --- */
.dashboard-panel { position: absolute; inset: 0; z-index: 700; overflow-y: auto; background: var(--surface-2); }
.dashboard-panel[hidden] { display: none !important; }
.dashboard-content { width: min(1240px, 100%); margin: 0 auto; padding: 32px 30px 56px; }
.dashboard-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 0 22px; }
.dashboard-header-main { display: flex; min-width: 0; align-items: center; gap: 14px; }
.dashboard-back-button { flex: 0 0 auto; min-height: 32px; padding-inline: 9px; font-size: 11px; }
.dashboard-back-button span { margin-right: 2px; font-size: 16px; line-height: 1; }
.dashboard-header h2 { margin: 0; font-size: clamp(28px, 3vw, 38px); letter-spacing: -.04em; }
.dashboard-snapshot { flex: 0 0 auto; padding: 8px 11px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: var(--surface); font-size: 12px; white-space: nowrap; }
.dashboard-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.dashboard-metric { display: flex; min-width: 0; min-height: 86px; flex-direction: column; justify-content: space-between; padding: 14px 15px 13px; border: 1px solid var(--line); border-top: 3px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); box-shadow: var(--control-shadow); }
.dashboard-metric-benchmark { border-top-color: var(--green); background: color-mix(in srgb, var(--green) 8%, var(--surface)); }
.dashboard-metric span { display: block; color: var(--muted); font-size: 13px; font-weight: 700; line-height: 1.2; }
.dashboard-metric strong { display: block; margin-top: 12px; color: var(--ink); font-size: 29px; line-height: 1; letter-spacing: -.045em; }
.dashboard-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.dashboard-card { min-width: 0; padding: 20px 20px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--control-shadow); }
.dashboard-card-wide { grid-column: 1 / -1; }
.dashboard-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.dashboard-card h3 { margin: 0; font-size: 19px; letter-spacing: -.025em; }
.dashboard-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 15px 0 3px; color: var(--muted); font-size: 10px; font-weight: 650; }
.dashboard-legend span { display: inline-flex; align-items: center; gap: 5px; }
.dashboard-legend i { width: 9px; height: 9px; display: inline-block; border-radius: 999px; background: var(--legend-color); }
.dashboard-chart-svg { width: 100%; height: auto; display: block; overflow: visible; }
.dashboard-trend-svg { margin-top: 10px; }
.dashboard-bar-chart { display: grid; gap: 14px; margin-top: 13px; }
.dashboard-bar-row { display: grid; gap: 6px; min-width: 0; }
.dashboard-bar-row-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; min-width: 0; }
.dashboard-bar-label { min-width: 0; color: var(--ink); font-size: 12px; font-weight: 650; line-height: 1.25; }
.dashboard-bar-value { flex: 0 0 auto; color: var(--ink); font-size: 12px; font-weight: 750; line-height: 1.25; white-space: nowrap; }
.dashboard-bar-track { height: 12px; overflow: hidden; border-radius: 999px; background: var(--surface-3); }
.dashboard-bar-fill { display: block; height: 100%; min-width: 0; border-radius: inherit; }
.dashboard-census-tract-chart { max-height: 540px; margin-top: 13px; overflow-y: auto; border-top: 1px solid var(--line); }
.dashboard-census-tract-scale { display: flex; justify-content: space-between; gap: 12px; padding: 8px 10px; color: var(--muted); font-size: 10px; font-weight: 650; }
.dashboard-census-tract-row { width: 100%; display: grid; grid-template-columns: minmax(112px, .8fr) minmax(110px, 2fr) max-content; align-items: center; gap: 12px; padding: 7px 10px; border: 0; border-top: 1px solid var(--line); background: transparent; color: var(--ink); text-align: left; }
.dashboard-census-tract-row:hover, .dashboard-census-tract-row.selected { background: var(--surface-2); }
.dashboard-census-tract-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 650; }
.dashboard-census-tract-bars, .dashboard-center-bars { display: grid; align-content: center; gap: 2px; height: 12px; overflow: hidden; border-radius: 999px; background: var(--surface-3); }
.dashboard-census-tract-bars { display: flex; gap: 0; }
.dashboard-census-tract-bars i, .dashboard-center-bars i { display: block; height: 4px; min-width: 0; border-radius: 999px; }
.dashboard-census-tract-bars i { height: 100%; border-radius: 0; }
.dashboard-census-tract-bars i:first-child { border-radius: 999px 0 0 999px; }
.dashboard-census-tract-bars i:last-child { border-radius: 0 999px 999px 0; }
.dashboard-census-tract-bars i.completed-recent { background: var(--completion-recent); }
.dashboard-census-tract-bars i.completed-earlier { background: var(--completion-earlier); }
.dashboard-census-tract-bars i.not-completed { background: var(--completion-not-verified); }
.dashboard-center-bars i.proposed { background: var(--green); }
.dashboard-center-bars i.completed { background: var(--completion-earlier); }
.dashboard-census-tract-values { color: var(--muted); font-size: 10px; font-weight: 750; white-space: nowrap; }
.dashboard-tract-projects { margin-top: 18px; padding-top: 15px; border-top: 1px solid var(--line); }
.dashboard-tract-projects h4 { margin: 0; color: var(--ink); font-size: 14px; letter-spacing: -.01em; }
.dashboard-tract-project-section + .dashboard-tract-project-section { margin-top: 18px; padding-top: 15px; border-top: 1px solid var(--line); }
.dashboard-project-table-wrap { margin-top: 10px; overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
.dashboard-project-table { width: 100%; min-width: 1020px; border-collapse: collapse; font-size: 11px; }
.dashboard-project-table th, .dashboard-project-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; white-space: nowrap; }
.dashboard-project-table th { position: sticky; top: 0; z-index: 1; background: var(--surface-3); color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .045em; }
.dashboard-project-table th.numeric, .dashboard-project-table td.numeric { text-align: right; }
.dashboard-project-table td:first-child { min-width: 190px; white-space: normal; }
.dashboard-project-table .table-row { cursor: default; }
.dashboard-project-table .table-project-link { display: inline; max-width: none; cursor: default; color: var(--ink); }
.dashboard-project-table .table-map-button { cursor: pointer; }
.dashboard-center-chart { display: grid; gap: 14px; max-height: 540px; margin-top: 13px; overflow-y: auto; }
.dashboard-center-bar-row { display: grid; gap: 6px; min-width: 0; }
.dashboard-svg-grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 4; }
.dashboard-svg-axis { fill: var(--muted); font-size: 10px; }
.dashboard-empty { margin: 28px 0 8px; color: var(--muted); font-size: 13px; }
.dashboard-loading { padding: 36px; color: var(--muted); text-align: center; }
/* --- Table and filters --- */
.table-panel { position: absolute; inset: 0; z-index: 700; display: flex; flex-direction: column; min-width: 0; overflow: hidden; background: var(--surface); }
.table-panel[hidden] { display: none !important; }
.table-panel-header { display: flex; align-items: end; justify-content: space-between; gap: 18px; padding: 20px 24px 15px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.mobile-table-map { display: none; }
.table-panel-header .eyebrow { margin-bottom: 4px; }
.table-panel-header h2 { margin: 0; font-size: 20px; letter-spacing: -.025em; }
.table-panel-count { color: var(--muted); font-size: 12px; }
.table-panel-count strong { color: var(--ink); }
.table-toolbar { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; padding: 10px 24px; border-bottom: 1px solid var(--line); background: var(--surface); }
.table-search-field { flex: 1 1 auto; max-width: 640px; }
.table-search-field input { width: 100%; min-height: 38px; border: 1px solid var(--line-strong); border-radius: var(--control-radius); background: var(--control-surface); color: var(--ink); padding: 0 11px; box-shadow: var(--control-shadow); }
.table-toolbar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.mobile-table-sort { display: none; }
.table-filters-toggle { min-height: 38px; position: relative; display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line-strong); border-radius: var(--control-radius); background: var(--control-surface); color: var(--ink); padding: 0 32px 0 11px; box-shadow: var(--control-shadow); font-size: 12px; font-weight: 700; }
.table-filters-toggle[aria-expanded="true"] .filter-chevron { transform: translateY(-50%) rotate(180deg); }
.table-filter-count { min-width: 20px; height: 20px; display: inline-grid; place-items: center; border-radius: 999px; background: var(--green); color: #fff; padding-inline: 5px; font-size: 10px; line-height: 1; }
.table-filter-count[hidden] { display: none; }
.table-filters.filters { flex: 0 0 auto; max-height: none; overflow: visible; padding: 13px 24px 14px; border-bottom: 1px solid var(--line); }
.table-filters .filter-grid { grid-template-columns: repeat(5, minmax(120px, 1fr)); margin-top: 9px; }
.table-wrap { flex: 1 1 auto; min-height: 0; overflow: auto; background: #fff; }
#projectTable { width: 100%; border-collapse: collapse; font-size: 12px; }
#projectTable th, #projectTable td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; white-space: nowrap; }
#projectTable th { position: sticky; top: 0; z-index: 2; background: #f2f5f2; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .045em; }
#projectTable th.numeric, #projectTable td.numeric { text-align: right; }
#projectTable th button { border: 0; background: none; color: inherit; padding: 0; font: inherit; text-align: inherit; text-transform: inherit; letter-spacing: inherit; cursor: pointer; }
#projectTable th button::after { content: "↕"; margin-left: 4px; color: #a0aaa3; font-size: 10px; }
#projectTable th button[aria-sort="ascending"]::after { content: "↑"; color: var(--green-dark); }
#projectTable th button[aria-sort="descending"]::after { content: "↓"; color: var(--green-dark); }
#projectTable td:first-child { min-width: 220px; white-space: normal; }
#projectTable td small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }
.table-row { cursor: pointer; }
.table-row:hover { background: #fafcfb; }
.table-row.expanded { background: var(--surface-2); }
.table-row.selected { background: #eef7f1; }
.table-row td:first-child { box-shadow: inset 3px 0 var(--completion-color, transparent); }
.table-address-actions { display: inline-flex; align-items: center; gap: 7px; min-width: 0; max-width: 100%; vertical-align: middle; }
.table-project-link { flex: 1 1 auto; min-width: 0; max-width: 310px; overflow-wrap: anywhere; border: 0; background: none; padding: 0; color: var(--green-dark); font: inherit; font-weight: 700; text-align: left; }
.table-project-link:hover { text-decoration: underline; }
.table-map-button { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 3px; min-height: 24px; padding: 2px 6px; border: 1px solid var(--line-strong); border-radius: var(--control-radius); background: var(--control-surface); color: var(--muted); font-size: 10px; font-weight: 700; line-height: 1; box-shadow: var(--control-shadow); }
.table-map-button:hover { background: var(--surface-3); color: var(--green-dark); }
.table-map-button > span:first-child { font-size: 14px; line-height: .8; }
.table-document.ready { color: var(--green-dark); font-weight: 700; }
.table-expanded-row { background: var(--surface-2); }
.table-expanded-row > td { padding: 0 !important; white-space: normal !important; }
.table-expanded-content { border-bottom: 1px solid var(--line); overflow: hidden; }
.table-expanded-content .address-record { border: 0; }
.table-expanded-content .detail-header { padding-right: 22px; }
.table-expanded-content .address-maps-button { position: static; margin-top: 0; }
@media (min-width: 721px) {
  .table-expanded-content .image-set-section { padding: 18px 24px; }
  .table-expanded-content .image-set-section .document-card { max-width: 720px; margin-inline: auto; }
}
.table-expanded-message { padding: 24px 22px; color: var(--muted); }
.table-empty { padding: 40px 18px !important; color: var(--muted); text-align: center !important; white-space: normal !important; }
.table-load-more { align-self: center; flex: 0 0 auto; width: min(260px, calc(100% - 32px)); margin: 10px 16px 14px; }
/* --- Sidebar filters --- */
.sidebar { width: var(--sidebar-width, 374px); flex: 0 0 var(--sidebar-width, 374px); display: flex; flex-direction: column; background: var(--surface); border-right: 1px solid var(--line); z-index: 500; }
.sidebar-collapse-toggle { position: absolute; z-index: 710; top: 50%; left: calc(var(--sidebar-width, 374px) - 13px); width: 27px; height: 52px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 0 9px 9px 0; background: var(--control-surface); color: var(--green-dark); padding: 0; box-shadow: var(--control-shadow); font-family: Arial, sans-serif; font-size: 27px; line-height: 1; transform: translateY(-50%); transition: left .22s ease, background-color .18s ease; }
.sidebar-collapse-toggle:hover { background: var(--surface-3); }
.sidebar-collapse-toggle > span { display: grid; width: 1em; height: 1em; place-items: center; line-height: .85; }
.map-workspace.sidebar-collapsed { --sidebar-width: 0px; }
.map-workspace.sidebar-collapsed .sidebar { overflow: hidden; width: 0; flex-basis: 0; border-right-color: transparent; }
.map-workspace.sidebar-collapsed .sidebar-collapse-toggle { left: 0; border-left: 0; }
.workspace:has(.map-workspace.sidebar-collapsed) .view-tabs { left: 50%; }
body[data-view="dashboard"] .view-tabs { display: none; }
.filters { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 14px 16px 15px; border-bottom: 1px solid var(--line); }
.section-heading { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-bottom: 2px; }
.section-heading h2 { margin: 0; font-size: 14px; }
.text-button { min-height: 30px; padding: 0 8px; border: 0; border-radius: 6px; background: transparent; color: var(--green-dark); font-size: 14px; font-weight: 700; }
.text-button:hover { background: var(--surface-3); }
.filter-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 11px; }
.filter-grid-normal { margin-top: 8px; }
.filter-grid label { display: grid; min-width: 0; gap: 4px; color: var(--muted); font-size: 10px; font-weight: var(--filter-label-weight); text-transform: uppercase; letter-spacing: .04em; text-align: left; }
.filter-help { color: var(--muted); font-size: 9px; font-weight: 500; text-transform: none; letter-spacing: 0; }
.advanced-filter-toggle { width: 100%; min-height: var(--control-height); position: relative; display: flex; align-items: center; justify-content: flex-start; gap: 10px; margin-top: 12px; padding: 0 28px 0 8px; border: 1px solid var(--line-strong); border-radius: var(--control-radius); background-color: var(--surface-2); color: var(--green-dark); font-size: 11px; font-weight: var(--filter-label-weight); text-align: left; }
.advanced-filter-toggle:hover { border-color: var(--line-strong); background-color: #f4f8f4; }
.filter-chevron { width: var(--chevron-size); height: var(--chevron-size); position: absolute; top: 50%; right: var(--chevron-right); border: 0; background: var(--chevron-icon) center / contain no-repeat; transform: translateY(-50%); transform-origin: center; transition: transform .22s ease; }
.advanced-filter-toggle[aria-expanded="true"] .filter-chevron { transform: translateY(-50%) rotate(180deg); }
.advanced-filters { margin-top: 11px; padding-top: 1px; border-top: 1px solid var(--line); }
.advanced-filters .filter-grid { margin-top: 8px; }
.overlay-heading { margin-top: 12px; color: var(--muted); font-size: 9px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; text-align: left; }
.overlay-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin-top: 8px; }
.overlay-toggle { width: 100%; min-height: var(--control-height); padding-inline: 7px; text-align: left; white-space: normal; line-height: 1.15; }
.center-boundary-legend { display: flex; flex-wrap: wrap; gap: 6px 10px; margin-top: 6px; color: var(--muted); font-size: 9px; }
.center-boundary-legend span { display: inline-flex; align-items: center; gap: 4px; }
.center-boundary-swatch { width: 16px; height: 3px; flex: 0 0 16px; border-radius: 999px; }
.center-boundary-swatch.regional { background: #7b5aa6; }
.center-boundary-swatch.urban { background: #c8783d; }
.center-boundary-swatch.neighborhood { background: #3d8b75; }
.density-legend { margin-top: 8px; color: var(--muted); font-size: 9px; line-height: 1.2; }
.density-legend-title { font-weight: 700; }
.density-gradient { height: 9px; margin-top: 5px; border: 1px solid var(--line-strong); border-radius: 3px; background: linear-gradient(to right, #f7fcf0 0%, #e0f3db 4%, #ccebc5 8%, #a8ddb5 17%, #7bccc4 25%, #4eb3d3 33%, #2b8cbe 50%, #084081 100%); }
.density-legend-labels { display: flex; justify-content: space-between; margin-top: 2px; color: var(--muted); font-size: 8px; }
select { width: 100%; min-height: var(--control-height); appearance: none; -webkit-appearance: none; border: 1px solid var(--line-strong); border-radius: 7px; background-color: #fff; background-image: var(--chevron-icon); background-repeat: no-repeat; background-position: right var(--chevron-right) center; background-size: var(--chevron-size) var(--chevron-size); color: var(--ink); padding: 0 28px 0 8px; font-size: 12px; text-transform: none; letter-spacing: 0; font-weight: var(--filter-control-weight); text-align: left; text-align-last: left; }
.homes-filter, .homes-data-filter, .lot-size-filter { min-width: 0; display: flex !important; flex-direction: column; }
.homes-filter > .range-boxes, .homes-data-filter > select, .lot-size-filter > .range-boxes { margin-top: auto; }
.range-text { width: 100%; border: 1px solid var(--line-strong); border-radius: 6px; background: #fff; color: var(--ink); padding: 5px 7px; font-size: 11px; font-weight: var(--filter-control-weight); text-transform: none; letter-spacing: 0; text-align: left; }
.range-boxes { display: flex; min-width: 0; align-items: center; gap: 5px; }
.range-boxes > .range-text { min-width: 0; flex: 1 1 0; }
.range-boxes > span { color: var(--muted); font-size: 10px; text-align: left; }
.zone-filter { min-width: 0; }
.zone-picker { position: relative; display: block; }
.zone-filter-button { width: 100%; min-height: var(--control-height); position: relative; border: 1px solid var(--line-strong); border-radius: var(--control-radius); background-color: var(--control-surface); color: var(--ink); padding: 0 28px 0 8px; text-align: left; font-size: 12px; font-weight: var(--filter-control-weight); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: var(--control-shadow); }
.zone-filter-button::after { content: ""; width: var(--chevron-size); height: var(--chevron-size); position: absolute; top: 50%; right: var(--chevron-right); border: 0; background: var(--chevron-icon) center / contain no-repeat; transform: translateY(-50%); }
.zone-filter-menu { position: absolute; z-index: 900; top: calc(100% + 4px); right: 0; min-width: 190px; max-height: 280px; overflow: auto; padding: 6px; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; box-shadow: 0 8px 22px rgb(20 30 24 / 16%); }
.activity-picker { position: relative; display: block; min-width: 0; }
.activity-filter-button { width: 100%; min-width: 0; min-height: var(--control-height); position: relative; border: 1px solid var(--line-strong); border-radius: var(--control-radius); background-color: var(--control-surface); color: var(--ink); padding: 0 28px 0 8px; text-align: left; font-size: 12px; font-weight: var(--filter-control-weight); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: var(--control-shadow); }
.activity-filter-button::after { content: ""; width: var(--chevron-size); height: var(--chevron-size); position: absolute; top: 50%; right: var(--chevron-right); border: 0; background: var(--chevron-icon) center / contain no-repeat; transform: translateY(-50%); }
.activity-filter-menu { position: absolute; z-index: 900; top: calc(100% + 4px); right: 0; min-width: 180px; overflow: auto; padding: 6px; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; box-shadow: 0 8px 22px rgb(20 30 24 / 16%); }
.last-activity-filter-menu { max-height: min(280px, 50vh); }
.activity-filter-item { width: 100%; display: flex; align-items: center; gap: 7px; padding: 6px 5px; border: 0; border-radius: 5px; background: transparent; color: var(--ink); font-size: 11px; font-weight: 500; line-height: 1.2; text-align: left; }
.activity-filter-item:hover { background: var(--wash); }
.activity-filter-item .completion-check { flex: 0 0 18px; }
.activity-filter-item[aria-pressed="true"] .completion-check { border-color: var(--green); background: var(--green); color: #fff; }
.activity-filter-item[aria-pressed="false"] .completion-check { background: transparent; }
.activity-dot { width: 9px; height: 9px; display: inline-block; flex: 0 0 9px; border-radius: 50%; }
.activity-dot.completed { background: var(--completion-earlier); }
.activity-dot.active { background: var(--green); }
.activity-dot.inactive { background: #929b95; }
.zone-check { display: flex !important; grid-template-columns: none !important; align-items: center; gap: 7px !important; padding: 5px 4px; color: var(--ink) !important; font-size: 11px !important; font-weight: 500 !important; text-transform: none !important; letter-spacing: 0 !important; white-space: nowrap; }
.zone-check:hover { background: var(--wash); }
.zone-check input { margin: 0; accent-color: var(--green); }
.zone-check small { color: var(--muted); font-size: 10px; }
.zone-all { margin-bottom: 4px; padding-bottom: 7px; border-bottom: 1px solid var(--line); font-weight: 450 !important; }
.table-row.completed-recent { --completion-color: var(--completion-recent); }
.table-row.completed-earlier { --completion-color: var(--completion-earlier); }
.table-row.not-completed { --completion-color: var(--completion-not-verified); }
.completion-dot { width: 8px; height: 8px; display: inline-block; flex: 0 0 8px; margin: 0 7px 1px 0; border-radius: 50%; background: var(--completion-not-verified); box-shadow: 0 0 0 1px rgb(255 255 255 / 80%); }
.completion-dot.completed-recent { background: var(--completion-recent); }
.completion-dot.completed-earlier { background: var(--completion-earlier); }
.completion-dot.not-completed { background: var(--completion-not-verified); }
.load-more { min-height: var(--control-height); margin: 10px 16px 14px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--control-radius); background: var(--control-surface); color: var(--muted); box-shadow: var(--control-shadow); font-size: 11px; font-weight: 700; }
.load-more:hover { border-color: var(--line-strong); background: #f4f8f4; color: var(--green-dark); }
.empty { padding: 30px 18px; color: var(--muted); text-align: center; line-height: 1.5; }
/* --- Map, controls, and pins --- */
.map-region { flex: 1; min-width: 0; position: relative; }
#map { position: absolute; inset: 0; z-index: 1; background: transparent; }
.map-basemap-status { position: absolute; z-index: 675; top: 50%; left: 50%; max-width: min(260px, calc(100% - 28px)); padding: 9px 12px; transform: translate(-50%, -50%); border: 1px solid var(--line-strong); border-radius: 999px; background: color-mix(in srgb, var(--control-surface) 94%, transparent); box-shadow: var(--control-shadow); color: var(--muted); font-size: 12px; font-weight: 700; text-align: center; pointer-events: none; }
.map-basemap-status[hidden] { display: none; }
.leaflet-gl-layer, .leaflet-gl-layer canvas { pointer-events: none; }
#map3d { position: absolute; inset: 0; z-index: 2; opacity: 0; background: #f8f4f0; pointer-events: none; }
.map-region.is-3d #map { visibility: hidden; pointer-events: none; }
.map-region.is-3d #map3d { opacity: 1; pointer-events: auto; }
.map-basemap-control-host { position: absolute; z-index: 5; right: 10px; bottom: 42px; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; pointer-events: none; }
.map-basemap-control-host > * { pointer-events: auto; }
.map-basemap-control-host > .leaflet-control { float: none; margin: 0; }
.map-basemap-control-host .leaflet-control-layers { order: 2; }
.mobile-map-action-controls { display: none; align-items: center; gap: 6px; }
.mobile-map-action { white-space: nowrap; }
#map3d .maplibregl-canvas { outline: none; }
#map3d .maplibregl-ctrl-group { overflow: hidden; border: 1px solid var(--map-control-border); border-radius: var(--control-radius); background: var(--control-surface); box-shadow: var(--control-shadow); }
#map3d .maplibregl-ctrl-group button { width: 32px; height: 32px; background-color: var(--control-surface); }
#map3d .maplibregl-ctrl-group button:hover { background-color: var(--wash); }
#map3d .maplibregl-ctrl-attrib { margin: 0 5px 5px 0; border: 1px solid var(--line-strong); border-radius: 999px; background: color-mix(in srgb, var(--control-surface) 92%, transparent); box-shadow: var(--control-shadow); color: var(--muted); font-size: 9px; }
#map3d .maplibregl-ctrl-attrib a { color: var(--green-dark); }
#map3d .maplibregl-ctrl-bottom-right { right: 10px; bottom: 150px; }
.visible-area-summary { position: absolute; z-index: 680; top: 12px; left: 12px; width: min(300px, calc(100% - 86px)); padding: 10px 11px; border: 1px solid var(--line-strong); border-radius: 11px; background: color-mix(in srgb, var(--control-surface) 94%, transparent); box-shadow: var(--control-shadow); color: var(--ink); pointer-events: none; backdrop-filter: blur(10px); }
.sidebar-visible-area-summary { position: static; display: block; width: auto; margin: 10px 14px 0; padding: 9px 10px; background: var(--surface-2); box-shadow: none; pointer-events: none; backdrop-filter: none; }
.visible-area-summary[hidden], .detail-open .visible-area-summary { display: none; }
.visible-area-title { display: block; margin-bottom: 7px; font-size: 11px; letter-spacing: .01em; }
.visible-area-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; }
.visible-area-grid span { min-width: 0; color: var(--muted); font-size: 9px; line-height: 1.2; text-transform: uppercase; letter-spacing: .045em; }
.visible-area-grid b { display: block; margin-bottom: 2px; color: var(--ink); font-size: 13px; line-height: 1.15; letter-spacing: 0; text-transform: none; }
.map-fallback { position: absolute; inset: 0; display: grid; place-content: center; gap: 8px; padding: 32px; background: linear-gradient(145deg, #eef2ed, #dfe7df); color: var(--ink); text-align: center; }
.map-fallback strong { font-size: 15px; }
.map-fallback span { max-width: 310px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.map-control-stack { position: absolute; z-index: 450; left: 12px; bottom: 10px; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; max-width: calc(100% - 24px); pointer-events: none; }
.map-control-stack > * { pointer-events: auto; }
.map-tools { display: flex; align-items: center; gap: 6px; }
.map-control-stack .map-tools { order: -1; }
.map-tool { min-height: var(--control-height); border: 1px solid var(--map-control-border); border-radius: var(--control-radius); background: var(--control-surface); color: var(--ink); padding: 0 10px; box-shadow: var(--control-shadow); font-size: 11px; font-weight: 700; }
.map-tool:hover { border-color: var(--map-control-border); background: #f4f8f4; color: var(--green-dark); }
.map-tool.weekly-recap-button.is-active { border-color: var(--green); background: var(--green); color: #fff; }
.map-tool.weekly-recap-button.is-active:hover { border-color: var(--green-dark); background: var(--green-dark); color: #fff; }
.map-tool:disabled { opacity: .6; cursor: wait; }
.completion-filter-control { position: relative; }
.completion-filter-button { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; }
.completion-filter-dot { width: 10px; height: 10px; flex: 0 0 10px; border: 1px solid rgb(255 255 255 / 72%); border-radius: 50%; background: conic-gradient(var(--completion-recent) 0 33%, var(--completion-earlier) 33% 66%, var(--completion-not-verified) 66% 100%); }
.completion-filter-summary { color: var(--muted); font-size: 10px; font-weight: 750; }
.completion-filter-chevron { width: 7px; height: 7px; margin-left: 1px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform .16s ease; }
.completion-filter-button[aria-expanded="true"] .completion-filter-chevron { transform: translateY(2px) rotate(225deg); }
.completion-filter-menu { position: absolute; z-index: 2; left: 0; bottom: calc(100% + 8px); width: max-content; min-width: 238px; max-width: min(360px, calc(100vw - 20px)); }
.completion-filter-menu[hidden] { display: none; }
.completion-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 7px 11px; color: var(--muted); font-size: 10px; line-height: 1.2; }
.completion-legend-item { display: inline-flex; align-items: center; gap: 8px; min-height: 28px; padding: 2px 6px; border: 0; border-radius: 6px; background: transparent; color: inherit; font: inherit; line-height: inherit; text-align: left; white-space: nowrap; }
.completion-legend-item:hover { background: var(--surface-3); color: var(--ink); }
.completion-check { width: 18px; height: 18px; display: inline-grid; flex: 0 0 18px; place-items: center; border: 2px solid color-mix(in srgb, var(--muted) 72%, transparent); border-radius: 4px; color: transparent; font-size: 12px; font-weight: 800; line-height: 1; }
.completion-legend-item[aria-pressed="true"] .completion-check { border-color: var(--green); background: var(--green); color: #fff; }
.legend-swatch { width: 9px; height: 9px; display: inline-block; border-radius: 50%; background: var(--completion-not-verified); }
.legend-swatch.completed-recent { background: var(--completion-recent); }
.legend-swatch.completed-earlier { background: var(--completion-earlier); }
.legend-swatch.not-completed { background: var(--completion-not-verified); }
.map-legend { max-width: min(420px, 100%); padding: 5px 7px; border: 1px solid var(--map-control-border); border-radius: var(--control-radius); background: var(--control-surface); box-shadow: var(--control-shadow); }
.map-legend.completion-legend { flex-direction: column; align-items: flex-start; gap: 0; }
.map-control-stack .completion-legend-item { width: 100%; min-height: 24px; margin: 3px 0; padding: 0; gap: 5px; font-size: 11px; }
.leaflet-control-zoom, .leaflet-control-layers { border: 1px solid var(--map-control-border); border-color: var(--map-control-border) !important; border-radius: var(--control-radius); box-shadow: var(--control-shadow); overflow: hidden; }
.leaflet-control-zoom a { width: 32px; height: 32px; border: 0; background: var(--control-surface); color: var(--ink); font-size: 18px; line-height: 32px; }
.leaflet-control-zoom.leaflet-bar a { width: 32px; height: 32px; border-radius: 0; line-height: 32px; }
.leaflet-control-zoom a + a { border-top: 1px solid var(--map-control-border); }
.leaflet-control-zoom a:hover { background: #f4f8f4; color: var(--green-dark); }
.map-attribution-control { position: relative; display: inline-flex; align-items: center; gap: 4px; max-width: min(190px, calc(100vw - 24px)); padding: 3px 5px 3px 3px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--control-surface); box-shadow: var(--control-shadow); color: var(--muted); font-size: 9px; line-height: 1.2; }
.map-attribution-button { width: 18px; height: 18px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 50%; background: var(--green); color: #fff; padding: 0; font-family: Georgia, serif; font-size: 12px; font-weight: 700; line-height: 1; }
.map-attribution-button:hover { background: var(--green-dark); }
.map-attribution-compact { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-region > .map-attribution-control { position: absolute; z-index: 5; right: 10px; bottom: 10px; }
.map-attribution-details { position: absolute; right: 0; bottom: calc(100% + 6px); width: min(300px, calc(100vw - 28px)); padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: var(--control-radius); background: var(--control-surface); box-shadow: var(--control-shadow); color: var(--ink); font-size: 11px; line-height: 1.35; }
.map-attribution-details[hidden] { display: none; }
.leaflet-control-layers-expanded { padding: 5px 7px; background: var(--control-surface); }
.map-basemap-control-host .leaflet-control-layers:not(.leaflet-control-layers-expanded) { width: 64px; height: 64px; border-radius: 10px; }
.leaflet-control-layers-toggle { position: relative; width: 64px; height: 64px; padding: 0; overflow: hidden; background-color: var(--control-surface) !important; background-image: none !important; }
.map-layer-thumbnail { position: absolute; inset: 0; display: block; overflow: hidden; border-radius: 9px; background: #dfe8df; box-shadow: inset 0 0 0 1px rgb(0 0 0 / 14%); }
.map-layer-thumbnail > svg { width: 100%; height: 100%; display: block; }
.map-thumb-satellite, .map-thumb-3d { display: none; }
.leaflet-control-layers-toggle[data-map-basemap="satellite"] .map-thumb-street,
.leaflet-control-layers-toggle[data-map-basemap="3d"] .map-thumb-street { display: none; }
.leaflet-control-layers-toggle[data-map-basemap="satellite"] .map-thumb-satellite,
.leaflet-control-layers-toggle[data-map-basemap="3d"] .map-thumb-3d { display: block; }
.map-layers-glyph { position: absolute; z-index: 2; top: 6px; right: 6px; width: 23px; height: 23px; display: grid; place-items: center; border: 1px solid rgb(255 255 255 / 92%); border-radius: 7px; background: rgb(255 255 255 / 94%); box-shadow: 0 1px 3px rgb(0 0 0 / 28%); color: #4f5b55; pointer-events: none; }
.map-layers-glyph svg { width: 16px; height: 16px; display: block; fill: currentColor; }
.map-layers-label { position: absolute; z-index: 2; right: 0; bottom: 4px; left: 0; height: 17px; display: grid; place-items: center; background: transparent; color: #fff; font-size: 10px; font-weight: 800; line-height: 1; letter-spacing: .01em; text-shadow: 0 1px 3px rgb(0 0 0 / 84%); }
.map-layers-collapse-button { display: none; }
.leaflet-control-layers-toggle:focus-visible { outline: 0; box-shadow: var(--control-focus); }
.leaflet-control-layers-overlays { display: none; }
.leaflet-control-layers-base label, .leaflet-control-layers-overlays label { display: flex; align-items: center; gap: 0; min-height: 28px; margin: 1px 0; padding: 2px 6px; border-radius: 6px; color: var(--ink); font-size: 11px; cursor: pointer; }
.leaflet-control-layers-base label:hover { background: var(--surface-3); }
.leaflet-control-layers-base label > span { display: inline-flex; align-items: center; gap: 8px; min-height: 18px; }
.leaflet-control-layers-base label > span > span { line-height: 1.2; }
.leaflet-control-layers-base input.leaflet-control-layers-selector { width: 18px; height: 18px; flex: 0 0 18px; appearance: none; -webkit-appearance: none; margin: 0; position: static; border: 2px solid color-mix(in srgb, var(--muted) 72%, transparent); border-radius: 50%; background: var(--control-surface); }
.leaflet-control-layers-base input.leaflet-control-layers-selector:checked { border-color: var(--green); background: radial-gradient(circle, var(--green) 0 4px, var(--control-surface) 4.5px); }
.leaflet-control-layers-base input.leaflet-control-layers-selector:focus-visible, .completion-legend-item:focus-visible { outline: 0; box-shadow: var(--control-focus); }
.map-zoning-option { gap: 8px !important; }
.map-layer-checkbox { position: relative; width: 18px; height: 18px; display: block !important; flex: 0 0 18px; min-height: 18px !important; }
.map-layer-checkbox input { position: absolute; inset: 0; z-index: 1; width: 18px; height: 18px; margin: 0; opacity: 0; cursor: pointer; }
.map-layer-checkbox-mark { width: 18px; height: 18px; display: grid !important; place-items: center; border: 2px solid color-mix(in srgb, var(--muted) 72%, transparent); border-radius: 4px; color: transparent; font-size: 12px; font-weight: 800; line-height: 1; }
.map-layer-checkbox input:checked + .map-layer-checkbox-mark { border-color: var(--green); background: var(--green); color: #fff; }
.map-layer-checkbox input:focus-visible + .map-layer-checkbox-mark { outline: 0; box-shadow: var(--control-focus); }
.map-mode-label { white-space: nowrap; }
.detail-open .leaflet-control-zoom { display: none; }
.project-pin { width: var(--pin-size, 20px); height: var(--pin-size, 20px); border-radius: 50% 50% 50% 0; transform: translate(var(--pin-offset-x, 0px), var(--pin-offset-y, 0px)) rotate(-45deg); border: 2.5px solid #fff; background: var(--completion-not-verified); box-shadow: 0 2px 6px rgb(0 0 0 / 35%); transition: transform 140ms ease, box-shadow 140ms ease; }
.project-pin.is-selected { transform: translate(var(--pin-offset-x, 0px), var(--pin-offset-y, 0px)) rotate(-45deg) scale(1.08); border: 3px solid #172019; box-shadow: 0 0 0 2px #fff, 0 0 0 4px #172019, 0 3px 12px rgb(0 0 0 / 58%); filter: saturate(1.08) brightness(1.05); }
.project-pin.completed-recent { background: var(--completion-recent); }
.project-pin.completed-earlier { background: var(--completion-earlier); }
.project-pin.not-completed { background: var(--completion-not-verified); }
.single-cluster-icon { background: transparent; }
.single-cluster-bubble { width: 42px; height: 42px; display: grid; place-items: center; border: 3px solid #fff; border-radius: 50%; background: #23332a; box-shadow: 0 2px 8px rgb(0 0 0 / 28%); color: #fff; font-size: 12px; font-weight: 800; }
.single-cluster-icon.is-selected { z-index: 900 !important; }
.single-cluster-bubble.is-selected { width: 56px; height: 56px; border-width: 4px; background: var(--green); box-shadow: 0 3px 14px rgb(0 0 0 / 42%); font-size: 14px; }
/* --- Detail panel and document viewer --- */
.detail-panel { width: 470px; flex: 0 0 470px; position: relative; overflow-y: auto; background: #fff; border-left: 1px solid var(--line); box-shadow: -10px 0 30px rgb(21 29 24 / 9%); z-index: 600; }
@media (min-width: 721px) { .detail-panel { overflow-y: scroll; scrollbar-gutter: stable; } }
.detail-scrim { display: none; }
.detail-sheet-handle { display: none; }
.detail-close { position: absolute; right: 14px; top: 12px; z-index: 2; }
.icon-button { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: var(--control-radius); background: var(--control-surface); color: var(--muted); padding: 0; box-shadow: var(--control-shadow); font-family: Arial, sans-serif; font-size: 27px; font-weight: 500; line-height: .9; }
.icon-button:hover { border-color: var(--line-strong); color: var(--green-dark); }
.detail-header { padding: 24px 52px 18px 22px; border-bottom: 1px solid var(--line); }
.detail-panel > #detailContent .detail-header { position: relative; padding-right: 116px; }
.detail-address-heading { display: flex; align-items: flex-start; gap: 8px; min-width: 0; }
.eyebrow { margin: 0 0 8px; color: var(--green-dark); font-size: 10px; font-weight: 750; text-transform: uppercase; letter-spacing: .09em; }
.detail-header h2 { flex: 1 1 auto; min-width: 0; margin: 0; font-size: 22px; line-height: 1.2; letter-spacing: -.025em; overflow-wrap: anywhere; }
.address-maps-button { flex: 0 0 auto; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 3px; margin-top: -2px; border: 1px solid var(--line-strong); border-radius: var(--control-radius); background: var(--control-surface); color: var(--green-dark); text-decoration: none; box-shadow: var(--control-shadow); }
.detail-panel > #detailContent .address-maps-button { position: absolute; top: 12px; right: 66px; margin-top: 0; }
.address-maps-button .google-maps-mark { width: 18px; height: 18px; flex: 0 0 18px; }
.address-maps-button .address-maps-arrow { width: 14px; height: 14px; flex: 0 0 14px; }
.address-maps-button:hover { background: var(--surface-3); color: var(--green); }
.detail-header .project-name { margin: 6px 0 0; color: var(--muted); }
.detail-primary-row { display: flex; align-items: end; justify-content: flex-start; flex-wrap: wrap; gap: 12px 18px; margin-top: 11px; }
.detail-unit-count span { display: block; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .055em; text-transform: uppercase; }
.detail-unit-count strong { display: block; margin-top: 2px; font-size: 17px; line-height: 1.1; }
.detail-record-count span { display: block; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .055em; text-transform: uppercase; }
.detail-record-count strong { display: block; margin-top: 2px; font-size: 17px; line-height: 1.1; }
.detail-record-family-note { display: block; max-width: 190px; margin-top: 4px; color: var(--muted); font-size: 9px; font-weight: 650; line-height: 1.25; letter-spacing: 0; text-transform: none; }
.detail-completion-status { margin: 0 0 0 auto; }
.detail-completion-status > span { display: block; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .055em; text-transform: uppercase; }
.detail-completion-status > strong { display: block; margin-top: 2px; font-size: 17px; line-height: 1.1; }
.detail-completion-status.completed-recent > strong { color: #5b21b6; }
.detail-completion-status.completed-earlier > strong { color: #1d4ed8; }
.detail-completion-status.not-completed > strong { color: #9a3412; }
.detail-section { padding: 18px 22px; border-bottom: 1px solid var(--line); }
.address-record-list { background: var(--surface); }
.address-record + .address-record { border-top: 1px solid var(--line-strong); }
.image-set-section { padding-inline: 0; }
.image-set-section .document-card { border-inline: 0; border-radius: 0; }
.detail-section h3 { margin: 0 0 10px; font-size: 12px; }
.detail-section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.detail-section-heading h3 { margin: 0; }
.detail-assessor-link, .detail-activity-link { flex: 0 0 auto; color: var(--green-dark); font-size: 10px; font-weight: 700; line-height: 1.3; text-decoration: underline; text-underline-offset: 2px; white-space: nowrap; }
.detail-assessor-link:hover, .detail-activity-link:hover { color: var(--green); }
.detail-description { margin: 0; line-height: 1.55; color: #434945; }
.fact-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 13px; }
.fact-grid div { min-width: 0; }
.fact-grid span, .document-meta span { display: block; color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .055em; font-weight: 700; }
.fact-grid strong { display: block; margin-top: 3px; font-size: 13px; overflow-wrap: anywhere; }
.fact-source { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; line-height: 1.3; }
.fact-source a { color: var(--green-dark); }
.document-card { overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-2); }
.document-preview { position: relative; width: 100%; aspect-ratio: 16 / 10; display: grid; place-items: center; overflow: hidden; cursor: pointer; background: #dfe3df; border: 0; padding: 0; color: inherit; }
.document-preview img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.document-preview-image { transition: opacity .18s ease, transform .2s ease; }
.document-preview:hover .document-preview-image { transform: scale(1.015); }
.document-preview-placeholder { position: absolute; inset: 0; z-index: 0; filter: blur(8px) saturate(.9); transform: scale(1.08); transition: opacity .2s ease; }
.document-preview.has-preview-placeholder .document-preview-image { position: relative; z-index: 0; opacity: 0; }
.document-preview.has-preview-placeholder.is-preview-loaded .document-preview-image { opacity: 1; }
.document-preview.has-preview-placeholder.is-preview-loaded .document-preview-placeholder { opacity: 0; }
.document-preview::after { content: ""; position: absolute; inset: auto 0 0; height: 46%; background: linear-gradient(transparent, rgb(12 20 15 / 72%)); pointer-events: none; }
.document-preview-hint { position: absolute; right: 10px; bottom: 9px; z-index: 1; display: inline-flex; align-items: center; gap: 5px; padding: 6px 8px; border: 1px solid var(--line-strong); border-radius: 999px; background: rgb(14 25 18 / 78%); color: #fff; font-size: 10px; font-weight: 750; letter-spacing: .01em; text-shadow: 0 1px 2px rgb(0 0 0 / 30%); }
.document-preview:hover .document-preview-hint, .document-preview:focus-visible .document-preview-hint { background: var(--green); border-color: var(--line-strong); }
.document-preview:focus-visible { outline: 3px solid var(--green); outline-offset: -3px; }
.mobile-inline-gallery { cursor: default; touch-action: pan-y; }
.mobile-inline-gallery.is-gallery-zoomed { touch-action: none; }
.mobile-inline-gallery .document-preview-image { pointer-events: none; transform-origin: center center; user-select: none; -webkit-user-drag: none; }
.mobile-inline-gallery.is-gallery-dragging .document-preview-image { transition: none; }
.mobile-gallery-expand { position: absolute; z-index: 4; top: 10px; right: 10px; width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid rgb(255 255 255 / 60%); border-radius: 999px; background: rgb(17 19 18 / 76%); color: #fff; padding: 0; box-shadow: 0 2px 10px rgb(0 0 0 / 28%); font-family: Arial, sans-serif; font-size: 18px; line-height: 1; }
.mobile-gallery-expand > span { width: 1em; height: 1em; display: grid; place-items: center; line-height: 1; }
.mobile-gallery-expand:active { background: rgb(17 19 18 / 94%); transform: scale(.96); }
.mobile-gallery-arrow { position: absolute; z-index: 3; top: 50%; width: 38px; height: 48px; display: grid; place-items: center; border: 1px solid rgb(255 255 255 / 60%); border-radius: 999px; background: rgb(17 19 18 / 76%); color: #fff; padding: 0 0 3px; box-shadow: 0 2px 10px rgb(0 0 0 / 28%); font-family: Arial, sans-serif; font-size: 30px; line-height: 1; transform: translateY(-50%); }
.mobile-gallery-arrow.prev { left: 10px; }
.mobile-gallery-arrow.next { right: 10px; }
.mobile-gallery-arrow:disabled { opacity: .28; pointer-events: none; }
.mobile-gallery-arrow:not(:disabled):active { background: rgb(17 19 18 / 94%); transform: translateY(-50%) scale(.96); }
.mobile-gallery-counter { position: absolute; z-index: 3; right: 50%; bottom: 10px; display: inline-flex; min-width: 42px; justify-content: center; padding: 4px 7px; border: 1px solid rgb(255 255 255 / 50%); border-radius: 999px; background: rgb(17 19 18 / 74%); color: #fff; font-size: 10px; font-weight: 750; line-height: 1.1; transform: translateX(50%); }
.document-preview-fallback { color: var(--green-dark); font-size: 12px; font-weight: 700; }
.document-placeholder { padding: 28px; text-align: center; color: var(--muted); line-height: 1.45; }
.document-placeholder strong { display: block; color: var(--ink); margin-bottom: 4px; }
.document-meta { padding: 12px 13px; }
.document-meta strong { display: block; margin-top: 3px; }
.document-actions { display: flex; gap: 8px; margin-top: 11px; }
.document-file-list { display: grid; gap: 5px; margin-top: 10px; }
.file-open { min-height: 32px; padding: 0 8px; border: 1px solid var(--line-strong); border-radius: var(--control-radius); background: var(--control-surface); color: var(--muted); text-align: left; font-size: 10px; box-shadow: var(--control-shadow); }
.file-open:hover { border-color: var(--line-strong); background: #f4f8f4; color: var(--green-dark); }
.primary-button, .secondary-button { min-height: var(--control-height); display: inline-flex; align-items: center; justify-content: center; padding: 0 10px; border-radius: var(--control-radius); text-decoration: none; font-size: 11px; font-weight: 700; box-shadow: var(--control-shadow); }
.primary-button { border: 1px solid var(--line-strong); background: var(--green); color: white; }
.secondary-button { border: 1px solid var(--line-strong); background: #fff; color: var(--ink); }
.primary-button:hover, .secondary-button:hover { border-color: var(--line-strong); background: #f4f8f4; color: var(--green-dark); }
.primary-button:hover { background: var(--green-dark); color: white; }
.viewer { position: fixed; inset: 0; z-index: 2000; background: #000; color: #fff; }
.viewer-bar { height: 62px; display: grid; grid-template-columns: 1fr minmax(240px, auto) 1fr; align-items: center; gap: 18px; padding: 0 16px; border-bottom: 1px solid var(--line-strong); background: #111312; }
.viewer-back { width: auto; min-width: 72px; height: 36px; justify-self: start; display: inline-flex; align-items: center; justify-content: center; gap: 4px; border-color: rgb(255 255 255 / 42%); border-radius: 7px; background: transparent; color: #d6dad7; padding: 0 9px; box-shadow: none; font-size: 11px; font-weight: 700; }
.viewer-back:hover { border-color: #fff; background: rgb(255 255 255 / 9%); color: #fff; }
.viewer-back-arrow { margin-top: -1px; font-family: Arial, sans-serif; font-size: 24px; font-weight: 400; line-height: 1; }
.viewer-back-label { line-height: 1; }
.viewer-title { min-width: 0; text-align: center; }
.viewer-title strong, .viewer-title span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.viewer-title span { margin-top: 2px; color: #939a95; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.viewer-actions { justify-self: end; display: flex; align-items: center; gap: 12px; color: #b4bbb6; font-size: 11px; }
.viewer-zoom-controls { display: inline-flex; align-items: stretch; border: 1px solid rgb(255 255 255 / 42%); border-radius: 7px; overflow: hidden; }
.viewer-zoom-button { min-width: 30px; height: 29px; border: 0; border-right: 1px solid rgb(255 255 255 / 24%); background: transparent; color: #fff; padding: 0 7px; font-size: 14px; font-weight: 700; line-height: 1; }
.viewer-zoom-button:last-child { border-right: 0; }
.viewer-zoom-button:hover { background: rgb(255 255 255 / 12%); }
.viewer-zoom-button:disabled { opacity: .35; cursor: default; }
.viewer-zoom-reset { min-width: 48px; color: #c8cfca; font-size: 10px; }
.viewer-stage { position: absolute; inset: 62px 0 0; overflow: hidden; display: flex; align-items: center; justify-content: center; padding: 20px 70px 30px; background: #000; }
.viewer-stage img { display: block; width: auto; max-width: min(1400px, 100%); max-height: calc(100vh - 104px); height: auto; object-fit: contain; background: white; box-shadow: 0 12px 40px rgb(0 0 0 / 35%); transform-origin: center center; transition: transform .16s ease; user-select: none; -webkit-user-drag: none; }
.viewer-stage.is-viewer-zoomed img { cursor: grab; }
.viewer-stage.is-viewer-dragging img { cursor: grabbing; transition: none; }
.viewer-actions .viewer-close { position: static; flex: 0 0 44px; border-color: rgb(255 255 255 / 48%); background: rgb(17 19 18 / 90%); color: #fff; }
.viewer-close:hover { border-color: #fff; background: rgb(17 19 18 / 98%); color: #fff; }
.center-boundary { vector-effect: non-scaling-stroke; }
.center-boundary-satellite { filter: drop-shadow(0 0 1px rgb(0 0 0 / 90%)) drop-shadow(0 0 1px rgb(255 255 255 / 80%)); }
.page-arrow { position: fixed; z-index: 2; top: 50%; width: 40px; height: 52px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: var(--control-radius); background: rgb(17 19 18 / 84%); color: white; padding: 0; box-shadow: 0 2px 10px rgb(0 0 0 / 22%); font-family: Arial, sans-serif; font-size: 30px; line-height: 1; }
.page-arrow > span { width: 1em; height: 1em; display: grid; place-items: center; line-height: 1; }
.page-arrow:disabled { opacity: .25; cursor: default; }
.page-arrow.prev { left: 14px; }
.page-arrow.next { right: 14px; }
/* --- About page --- */
html.about-document { min-height: 100%; height: auto; overflow-x: hidden; overflow-y: auto; }
.about-page { min-height: 100vh; height: auto; overflow: visible; background: var(--surface-2); }
.about-topbar { display: flex; height: auto; min-height: 58px; justify-content: space-between; }
.about-topbar .brand-block { min-width: 0; }
.about-topbar .brand-block p { margin: 3px 0 0; color: #9fa7a2; font-size: 11px; }
.about-main { width: min(760px, 100%); margin: 0 auto; padding: clamp(28px, 7vw, 64px) 18px 64px; }
.about-card { padding: clamp(22px, 5vw, 40px); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.about-card h2 { margin: 0 0 18px; font-size: clamp(25px, 5vw, 34px); letter-spacing: -.03em; }
.about-card h3 { margin: 22px 0 6px; color: var(--ink); font-size: 13px; letter-spacing: .01em; }
.about-card p { color: #4f5652; line-height: 1.6; }
.about-card .eyebrow { margin: 0 0 8px; color: var(--green-dark); font-size: 10px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.about-card .about-project-links-unavailable { margin-top: 0; padding: 11px 12px; border-left: 3px solid var(--line-strong); background: var(--surface-2); color: var(--ink); font-size: 12px; font-weight: 600; }
.about-card a { color: var(--green-dark); }
.about-project-links { margin-top: 22px; }
.about-project-link-list { display: grid; gap: 8px; margin: 10px 0 0; padding: 0; list-style: none; }
.about-project-link-list li { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.about-project-link-list li:last-child { border-bottom: 0; }
.about-project-link-list a { min-width: 0; color: var(--green-dark); font-size: 13px; font-weight: 700; overflow-wrap: anywhere; }
.about-project-link-list span { flex: 0 1 auto; color: var(--muted); font-size: 10px; line-height: 1.35; text-align: right; }
.project-route-fallback { background: var(--surface); }
.project-route-history ol { display: grid; gap: 12px; margin: 0; padding-left: 22px; }
.project-route-history li { padding-left: 3px; }
.project-route-history li > strong, .project-route-history li > span { display: block; }
.project-route-history li > strong { color: var(--ink); font-size: 12px; }
.project-route-history li > span { margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.project-route-record-links { display: flex !important; flex-wrap: wrap; gap: 8px; }
.project-route-record-links a { color: var(--green-dark); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
/* --- Responsive layout --- */
@media (max-width: 1000px) {
  :root { --sidebar-width: 335px; }
  .topbar { grid-template-columns: minmax(160px, 1fr) minmax(200px, 1.2fr) auto; gap: 8px; padding-inline: 10px; }
  .topbar .brand-block h1 { font-size: 15px; }
  .topbar-actions { display: flex; }
  .sidebar { width: var(--sidebar-width, 335px); flex-basis: var(--sidebar-width, 335px); }
  .detail-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(470px, calc(100% - 80px)); }
  .dashboard-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1001px) and (max-width: 1279px) {
  .topbar { grid-template-columns: minmax(250px, 1fr) minmax(240px, 1fr) auto; gap: 12px; padding-inline: 12px; }
  .topbar-actions { gap: 6px; }
  .topbar-actions .ghost-button { padding-inline: 8px; font-size: 10px; }
}

@media (max-width: 720px) {
  html, body { overflow: hidden; }
  .about-page { overflow: auto; }
  .about-page .topbar { position: static; height: auto; min-height: 58px; display: flex; padding: 9px 14px; border-bottom: 1px solid var(--line-strong); background: #111312; pointer-events: auto; }
  .about-page .brand-block, .about-page .topbar-actions { display: flex; }
  .about-page .brand-block { gap: 8px; }
  .about-page .brand-logo { width: 36px; height: 36px; }
  .about-page .brand-block h1 { font-size: 13px; }
  .about-page .brand-block p { font-size: 10px; }
  .about-page .topbar-actions .ghost-button { min-height: 32px; padding-inline: 8px; font-size: 10px; }
  .topbar { position: fixed; inset: 0; z-index: 710; height: 0; min-height: 0; display: block; padding: 0; border: 0; background: transparent; pointer-events: none; }
  .brand-block, .topbar-actions { display: none; }
  .mobile-brand { position: fixed; top: 10px; left: 10px; z-index: 702; width: 40px; height: 40px; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 9px; background: rgb(17 19 18 / 88%); box-shadow: var(--control-shadow); pointer-events: auto; }
  .mobile-brand img { width: 100%; height: 100%; object-fit: cover; }
  .mobile-menu-toggle { position: fixed; top: 10px; right: 10px; width: 88px; min-width: 88px; height: 40px; display: flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line-strong); border-radius: var(--control-radius); background: rgb(17 19 18 / 88%); box-shadow: var(--control-shadow); color: #fff; padding: 0 8px; font-size: 12px; font-weight: 750; line-height: 1; text-align: center; pointer-events: auto; }
  .mobile-menu-toggle span[aria-hidden="true"] { position: relative; width: 18px; height: 18px; display: block; flex: 0 0 18px; color: currentColor; }
  .mobile-menu-toggle span[aria-hidden="true"]::before { content: ""; position: absolute; top: 50%; left: 1px; width: 16px; height: 2px; border-radius: 999px; background: currentColor; transform: translateY(-50%); box-shadow: 0 -5px 0 currentColor, 0 5px 0 currentColor; }
  .mobile-menu-open .mobile-menu-toggle { opacity: 0; pointer-events: none; }
  .global-search { position: fixed; z-index: 701; top: 10px; left: 58px; right: 106px; height: 40px; background: rgb(32 35 32 / 92%); box-shadow: 0 2px 10px rgb(0 0 0 / 22%); opacity: .96; pointer-events: auto; }
  .mobile-menu-open .global-search { opacity: 0; pointer-events: none; }
  .leaflet-tooltip.census-tract-tooltip {
    width: min(350px, calc(100vw - 20px));
    max-width: calc(100vw - 20px);
    padding: 7px 8px;
    font-size: 11px;
    line-height: 1.35;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .leaflet-control-zoom { display: none !important; }
  /*
   * 100vh can describe Safari's larger layout viewport, not the visible
   * viewport between its address and bottom browser bars. Prefer the small
   * and dynamic viewport units; app.js measures any remaining occlusion for
   * browsers that do not fully apply those units.
   */
  .workspace { height: 100vh; height: 100svh; height: 100dvh; display: block; }
  .view-tabs { display: none; }
  body[data-view="table"] .mobile-brand,
  body[data-view="table"] .mobile-menu-toggle,
  body[data-view="table"] .global-search,
  body[data-view="dashboard"] .mobile-brand,
  body[data-view="dashboard"] .global-search { display: none; }
  .dashboard-content { padding: 20px 14px 38px; }
  .dashboard-header { display: block; padding: 0 0 15px; }
  .dashboard-header-main { display: block; }
  .dashboard-header h2 { margin-top: 12px; }
  .dashboard-header h2 { font-size: 27px; }
  .dashboard-snapshot { display: inline-flex; margin-top: 12px; font-size: 10px; }
  .dashboard-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
  .dashboard-metric { min-height: 75px; padding: 12px 12px 11px; }
  .dashboard-metric span { font-size: 12px; }
  .dashboard-metric strong { margin-top: 10px; font-size: 25px; }
  .dashboard-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .dashboard-card-wide { grid-column: auto; }
  .dashboard-card { padding: 15px 13px 14px; }
  .dashboard-card h3 { font-size: 17px; }
  .dashboard-bar-chart { gap: 12px; }
  .dashboard-bar-label, .dashboard-bar-value { font-size: 12px; }
  .dashboard-census-tract-row { grid-template-columns: minmax(92px, .9fr) minmax(70px, 1.4fr) max-content; gap: 8px; padding-inline: 7px; }
  .dashboard-census-tract-scale { padding-inline: 7px; font-size: 9px; }
  .dashboard-census-tract-label, .dashboard-census-tract-values { font-size: 9px; }
  .dashboard-project-table-wrap { margin-inline: -2px; }
  .table-panel { overflow: hidden; }
  .table-panel-header { min-height: 66px; align-items: center; justify-content: flex-start; gap: 10px; padding: calc(8px + env(safe-area-inset-top, 0px)) 14px 8px; }
  .mobile-table-map { min-height: 38px; display: inline-flex; align-items: center; gap: 5px; flex: 0 0 auto; border: 1px solid var(--line-strong); border-radius: var(--control-radius); background: var(--control-surface); color: var(--green-dark); padding: 0 10px; box-shadow: var(--control-shadow); font-size: 12px; font-weight: 750; }
  .mobile-table-map span { font-size: 17px; line-height: 1; }
  .table-heading-copy { min-width: 0; }
  .table-panel-header .eyebrow { display: none; }
  .table-panel-header h2 { font-size: 17px; white-space: nowrap; }
  .table-panel-count { margin-left: auto; font-size: 10px; white-space: nowrap; }
  .table-panel-header > .completion-legend { display: none; }
  .table-toolbar { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 10px 14px; }
  .table-search-field { max-width: none; }
  .table-search-field input { min-height: 42px; font-size: 16px; }
  .table-toolbar-actions { width: 100%; margin-left: 0; justify-content: space-between; }
  .mobile-table-sort { min-width: 0; display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 10px; font-weight: var(--filter-label-weight); text-transform: uppercase; letter-spacing: .04em; }
  .mobile-table-sort select { width: auto; min-width: 132px; height: 38px; min-height: 38px; font-size: 14px; text-transform: none; letter-spacing: 0; }
  .table-filters-toggle { min-height: 38px; }
  .table-filters.filters { flex: 1 1 auto; max-height: none; overflow-y: auto; padding: 10px 14px 18px; }
  .table-filters .filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  #tableFilters:not([hidden]) ~ .table-wrap,
  #tableFilters:not([hidden]) ~ .table-load-more { display: none; }
  .table-wrap { flex: 1 1 auto; min-height: 0; overflow-x: hidden; overflow-y: auto; background: var(--surface-2); }
  #projectTable, #projectTable tbody { width: 100%; display: block; }
  #projectTable { font-size: 11px; }
  #projectTable thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
  #projectTable .table-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px 16px; padding: 13px 14px 14px; border-bottom: 1px solid var(--line); background: var(--surface); box-shadow: inset 4px 0 var(--completion-color, transparent); }
  #projectTable .table-row:hover { background: var(--surface-2); }
  #projectTable .table-row.selected { background: #eef7f1; }
  #projectTable .table-expanded-row { display: block; background: var(--surface-2); }
  #projectTable .table-expanded-row > td { display: block; width: 100%; padding: 0 !important; border: 0; }
  #projectTable .table-expanded-content .detail-header { padding: 18px 14px 16px; }
  #projectTable .table-expanded-content .detail-section { padding: 15px 14px; }
  #projectTable .table-expanded-message { padding: 22px 14px; }
  #projectTable .table-row td { display: none; min-width: 0; padding: 0; border: 0; text-align: left; white-space: normal; box-shadow: none; }
  #projectTable .table-row td:nth-child(1),
  #projectTable .table-row td:nth-child(2),
  #projectTable .table-row td:nth-child(3),
  #projectTable .table-row td:nth-child(4),
  #projectTable .table-row td:nth-child(10),
  #projectTable .table-row td:nth-child(12) { display: block; }
  #projectTable .table-row td:first-child { grid-column: 1 / -1; min-width: 0; }
  #projectTable .table-address-actions { max-width: calc(100% - 22px); }
  #projectTable .table-project-link { max-width: none; min-width: 0; }
  #projectTable .table-row td:nth-child(2)::before,
  #projectTable .table-row td:nth-child(3)::before,
  #projectTable .table-row td:nth-child(4)::before,
  #projectTable .table-row td:nth-child(10)::before,
  #projectTable .table-row td:nth-child(12)::before { display: block; margin-bottom: 3px; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
  #projectTable .table-row td:nth-child(2)::before { content: "Applied"; }
  #projectTable .table-row td:nth-child(3)::before { content: "Unit count"; }
  #projectTable .table-row td:nth-child(4)::before { content: "Last activity"; }
  #projectTable .table-row td:nth-child(10)::before { content: "Record type"; }
  #projectTable .table-row td:nth-child(12)::before { content: "Document"; }
  #projectTable .table-project-link { max-width: calc(100% - 22px); font-size: 14px; line-height: 1.25; }
  #projectTable td small { margin: 3px 0 0 19px; }
  .table-load-more { margin: 8px 14px 10px; }
  .map-region { position: absolute; inset: 0; z-index: 0; height: auto; min-height: 0; }
  .sidebar { position: fixed; inset: 0 auto 0 0; z-index: 1100; width: min(92vw, 390px); transform: translate3d(-102%, 0, 0); transition: transform .22s ease; border-right: 1px solid var(--line); border-top: 0; box-shadow: 12px 0 28px rgb(16 24 18 / 18%); overflow-y: auto; }
  /* A desktop sidebar-collapse preference must not zero out the mobile drawer. */
  .map-workspace.sidebar-collapsed .sidebar { width: min(92vw, 390px); flex-basis: auto; overflow-y: auto; border-right-color: var(--line); }
  .mobile-menu-open .sidebar, .sidebar.is-mobile-open { transform: translate3d(0, 0, 0); }
  .mobile-panel-header { position: static; min-height: 54px; display: flex; align-items: center; justify-content: space-between; padding: 8px 12px 8px 16px; border-bottom: 1px solid var(--line); background: rgb(255 255 255 / 96%); }
  .mobile-view-tabs { display: flex; margin: 10px 14px 0; padding: 3px; border: 1px solid var(--line-strong); border-radius: var(--control-radius); background: var(--surface-3); }
  .advanced-filters .mobile-advanced-view-tabs { margin: 0 0 10px; }
  .mobile-view-tabs .view-tab { flex: 1; min-height: 36px; font-size: 13px; }
  .mobile-panel-actions { display: flex; gap: 7px; padding: 10px 14px 0; }
  .mobile-panel-actions .map-tool { flex: 1; min-width: 0; }
  .mobile-chevron { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: var(--control-radius); background: var(--control-surface); color: var(--ink); padding: 0; box-shadow: var(--control-shadow); font-family: Arial, sans-serif; font-size: 28px; font-weight: 500; line-height: .9; }
  .mobile-panel-title { display: flex; align-items: flex-start; gap: 9px; min-width: 0; }
  .mobile-panel-heading { display: grid; gap: 2px; min-width: 0; padding-top: 1px; }
  .mobile-panel-heading small { color: var(--muted); font-size: 13px; font-weight: 650; line-height: 1.25; overflow-wrap: anywhere; }
  .mobile-panel-heading .mobile-panel-subtitle { color: var(--green-dark); font-size: 11px; }
  .mobile-panel-theme-toggle { width: 40px; height: 40px; min-width: 40px; flex: 0 0 40px; padding: 0; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--control-surface); color: var(--ink); box-shadow: var(--control-shadow); display: inline-flex; align-items: center; justify-content: center; }
  .mobile-panel-theme-toggle .theme-toggle-icon { font-size: 16px; line-height: 1; }
  .mobile-scrim { position: fixed; inset: 0; z-index: 1000; display: block; border: 0; background: rgb(7 12 9 / 38%); }
  .filters { flex: none; overflow: visible; padding: 12px 14px 15px; }
  .filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; overflow: visible; padding-right: 2px; }
  .filter-grid label { display: grid; }
  /* Keep iOS Safari from zooming the page when a form control receives focus. */
  input:not([type="range"]), select, textarea { font-size: 16px; }
  select, .zone-filter-button, .activity-filter-button, .advanced-filter-toggle { height: var(--control-height); min-height: var(--control-height); box-sizing: border-box; padding-top: 0; padding-bottom: 0; font-size: 16px; font-weight: var(--filter-control-weight); }
  select, .zone-filter-button, .activity-filter-button { background-position: right var(--chevron-right) center; background-size: var(--chevron-size) var(--chevron-size); }
  .filter-chevron, .zone-filter-button::after, .activity-filter-button::after { width: var(--chevron-size); height: var(--chevron-size); top: 50%; right: var(--chevron-right); }
  .filter-chevron { transform: translateY(-50%); }
  .advanced-filter-toggle[aria-expanded="true"] .filter-chevron { transform: translateY(-50%) rotate(180deg); }
  .range-text { font-size: 16px; font-weight: var(--filter-control-weight); }
  .zone-filter { position: relative; z-index: 10; }
  .zone-filter-menu { z-index: 1000; }
  .activity-picker { position: relative; z-index: 10; }
  .activity-filter-menu { z-index: 1000; }
  .last-activity-filter-menu { left: 0; right: auto; width: min(260px, calc(100vw - 28px)); min-width: 0; box-sizing: border-box; }
  .sidebar-collapse-toggle { display: none; }
  .load-more { margin-inline: 14px; }
  .sidebar-visible-area-summary[hidden] { display: none; }
  .visible-area-grid { gap: 5px 10px; }
  .detail-panel { --sheet-offset: 100%; position: fixed; top: max(58px, env(safe-area-inset-top, 0px)); right: 0; bottom: 0; left: 0; width: auto; max-height: none; z-index: 1200; overflow-y: hidden; transform: translate3d(0, var(--sheet-offset), 0); transition: transform .24s cubic-bezier(.22, .76, .24, 1); border: 1px solid var(--line); border-bottom: 0; border-radius: 18px 18px 0 0; box-shadow: 0 -8px 28px rgb(21 29 24 / 20%); overscroll-behavior: contain; will-change: transform; }
  .detail-panel:not(.is-sheet-expanded) { touch-action: none; }
  .detail-panel.is-sheet-expanded { overflow-y: auto; touch-action: pan-y; -webkit-overflow-scrolling: touch; }
  .detail-panel.is-sheet-dragging, .detail-panel.is-sheet-no-transition { transition: none; }
  .detail-panel.is-sheet-dragging { cursor: grabbing; user-select: none; }
  .detail-sheet-handle { position: sticky; top: 0; z-index: 4; width: 100%; height: 30px; display: grid; place-items: center; border: 0; background: var(--surface); padding: 0; cursor: grab; touch-action: none; }
  .detail-sheet-handle:active { cursor: grabbing; }
  .detail-sheet-handle:focus-visible { outline: 3px solid var(--green); outline-offset: -3px; }
  .detail-sheet-grabber { width: 42px; height: 5px; border-radius: 999px; background: var(--line-strong); }
  .detail-panel .detail-close { position: fixed; top: 8px; right: 10px; z-index: 5; }
  .detail-panel .detail-header { padding: 8px 58px 14px 16px; }
  .detail-panel > #detailContent .detail-header { padding: 8px 112px 14px 16px; }
  .detail-panel .detail-header h2 { font-size: 20px; }
  /* Keep Google Maps on the same sheet-header baseline as the close control.
     The header starts below the 30px drag handle, so absolute positioning
     there put this control visibly lower than the fixed close button. */
  .detail-panel > #detailContent .address-maps-button { position: fixed; top: 8px; right: 62px; z-index: 5; }
  /* Keep the three header facts on one aligned baseline on narrow sheets.
     The desktop auto margin previously pushed status onto a second row. */
  .detail-panel .detail-primary-row { display: grid; grid-template-columns: max-content max-content minmax(0, 1fr); align-items: end; gap: 12px; margin-top: 9px; }
  .detail-panel .detail-record-family-note { max-width: 130px; }
  .detail-panel .detail-completion-status { min-width: 0; margin: 0; }
  .detail-panel .detail-completion-status > strong { overflow-wrap: anywhere; }
  .detail-panel #detailContent .address-record:last-child > .detail-section:last-child { padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px)); }
  .detail-scrim { display: none !important; }
  .image-set-section { padding-block: 0; }
  /*
   * Mobile browser navigation can overlay the layout viewport without
   * contributing to safe-area-inset-bottom. app.js raises this shared
   * 16px baseline only when VisualViewport reports additional occlusion.
   * Keep the value shared by the custom legend and Leaflet's layer picker;
   * do not replace the measured inset with a larger fixed guess.
   */
  .workspace { --mobile-bottom-control-clearance: 16px; }
  .map-control-stack { top: auto; right: auto; bottom: calc(env(safe-area-inset-bottom, 0px) + var(--mobile-bottom-control-clearance)); left: 10px; width: max-content; max-width: calc(100% - 20px); align-items: flex-start; }
  .map-tools { display: none; }
  .map-legend { width: max-content; max-width: calc(100vw - 20px); padding: 7px 8px; }
  /* Keep the shared basemap controls clear of mobile browser chrome. */
  .map-basemap-control-host { top: calc(env(safe-area-inset-top, 0px) + 58px); right: 10px; bottom: auto; flex-direction: row; align-items: center; }
  .mobile-map-action-controls { display: flex; }
  .map-basemap-control-host .leaflet-control-layers { order: 1; }
  #map3d .maplibregl-ctrl-bottom-right { right: 10px; bottom: calc(env(safe-area-inset-bottom, 0px) + var(--mobile-bottom-control-clearance) + 140px); }
  .map-basemap-control-host > * { margin: 0 !important; }
  .map-basemap-control-host .leaflet-control-layers:not(.leaflet-control-layers-expanded) { width: 38px; height: 38px; border-radius: 50%; }
  .map-basemap-control-host .leaflet-control-layers-toggle { width: 38px; height: 38px; border-radius: 50%; background: #fff !important; box-shadow: 0 1px 4px rgb(60 64 67 / 30%); }
  .map-layer-thumbnail { display: none; }
  .map-layers-glyph { inset: auto; top: 50%; left: 50%; width: 21px; height: 21px; transform: translate(-50%, -50%); border: 0; border-radius: 0; background: transparent; box-shadow: none; color: #5f6368; }
  /* Center the stacked mark's rendered ink, not just its SVG box. */
  .map-layers-glyph svg { width: 21px; height: 21px; transform: translate(-1px, -.1px); }
  .map-layers-label { display: none; }
  html[data-theme="dark"] .map-basemap-control-host .leaflet-control-layers-toggle { background: var(--control-surface) !important; box-shadow: 0 1px 4px rgb(0 0 0 / 48%); }
  html[data-theme="dark"] .map-basemap-control-host .map-layers-glyph { color: #d8e0e5; }
  .map-region > .map-attribution-control { right: 10px; bottom: calc(env(safe-area-inset-bottom, 0px) + var(--mobile-bottom-control-clearance)); max-width: min(190px, calc(100vw - 20px)); }
  .leaflet-control-layers-expanded { padding: 5px 7px; }
  .map-layers-collapse-button { width: calc(100% + 14px); height: 28px; display: none; align-items: center; justify-content: flex-end; margin: -5px -7px 5px; padding: 0 7px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; }
  .leaflet-control-layers-expanded .map-layers-collapse-button { display: flex; }
  .map-layers-collapse-button:hover { background: var(--surface-3); color: var(--ink); }
  .map-layers-collapse-button:focus-visible { outline: 0; box-shadow: var(--control-focus); }
  .map-layers-collapse-button svg { width: 18px; height: 18px; display: block; fill: currentColor; }
  .leaflet-control-layers-base label { font-size: 11px; }
  .mobile-menu-open .map-region { pointer-events: none; }
  .viewer-bar { height: 64px; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; padding: 6px 8px; }
  .viewer-back { display: none; }
  .viewer-title { grid-row: auto; grid-column: auto; min-width: 0; text-align: center; padding: 0 3px; }
  .viewer-title strong { font-size: 12px; }
  .viewer-title span { font-size: 9px; }
  .viewer-actions { min-width: 0; gap: 4px; font-size: 9px; }
  .viewer-stage { inset-block-start: 64px; overflow: hidden; padding: 8px 0 24px; background: #000; }
  .viewer-stage img { width: auto; max-width: 100vw; max-height: calc(100vh - 88px); height: auto; object-fit: contain; box-shadow: none; }
  .viewer-actions .viewer-close { flex: 0 0 44px; }
  .viewer-actions .ghost-button { display: none; }
  .viewer-zoom-controls { display: none; }
  .page-arrow { width: 36px; height: 50px; }
  .page-arrow.prev { left: 4px; }
  .page-arrow.next { right: 4px; }
}
/* --- Dark theme --- */
html[data-theme="dark"] {
  color-scheme: dark;
  --ink: #edf1f4;
  --muted: #a5afb8;
  --line: #424943;
  --surface: #111312;
  --surface-2: #111312;
  --surface-3: #1b201d;
  --green: #8fa7b7;
  --green-dark: #c0ced7;
  --control-surface: #111312;
  --control-shadow: 0 2px 10px rgb(0 0 0 / 27%);
  --control-focus: 0 0 0 3px rgb(143 167 183 / 30%);
  --shadow: 0 14px 40px rgb(0 0 0 / 38%);
  --wash: #1c211e;
}

html[data-theme="dark"] .view-tab.is-active { color: #172027; }

html[data-theme="dark"] .global-search { border-color: var(--line-strong); background: #111312; }
html[data-theme="dark"] .global-search:focus-within { border-color: var(--line-strong); box-shadow: 0 0 0 3px rgb(66 73 67 / 28%); }
html[data-theme="dark"] .global-search svg { stroke: #adb7c0; }
html[data-theme="dark"] .global-search input::placeholder { color: #a5afb8; }

html[data-theme="dark"] body,
html[data-theme="dark"] .table-panel,
html[data-theme="dark"] .table-wrap,
html[data-theme="dark"] #projectTable,
html[data-theme="dark"] .dashboard-panel,
html[data-theme="dark"] .dashboard-project-table,
html[data-theme="dark"] .dashboard-card,
html[data-theme="dark"] .dashboard-metric,
html[data-theme="dark"] .sidebar,
html[data-theme="dark"] .detail-panel { background: var(--surface); color: var(--ink); }
html[data-theme="dark"] .table-panel-header { background: var(--surface-2); }
html[data-theme="dark"] #projectTable th,
html[data-theme="dark"] .dashboard-project-table th { background: var(--surface-3); }
html[data-theme="dark"] #projectTable th button::after { color: #87968c; }
html[data-theme="dark"] .table-row:hover { background: #2c3339; }
html[data-theme="dark"] .table-row.selected { background: #303b44; }
html[data-theme="dark"] .table-expanded-row { background: var(--surface-2); }
html[data-theme="dark"] .dashboard-panel { background: var(--surface-2); }
html[data-theme="dark"] .dashboard-svg-track { fill: #27302e; }
html[data-theme="dark"] .dashboard-svg-grid { stroke: #424943; }
html[data-theme="dark"] .table-project-link,
html[data-theme="dark"] .table-document.ready,
html[data-theme="dark"] .fact-source a { color: var(--green-dark); }
html[data-theme="dark"] .table-map-button { color: var(--muted); }
html[data-theme="dark"] .detail-description { color: var(--muted); }
html[data-theme="dark"] select,
html[data-theme="dark"] .range-text,
html[data-theme="dark"] .table-search-field input,
html[data-theme="dark"] .zone-filter-menu,
html[data-theme="dark"] .activity-filter-menu,
html[data-theme="dark"] .secondary-button { background-color: var(--control-surface); color: var(--ink); }
@media (max-width: 720px) {
  html[data-theme="dark"] #projectTable .table-row.selected { background: #303b44; }
}
html[data-theme="dark"] .zone-check:hover,
html[data-theme="dark"] .activity-filter-item:hover,
html[data-theme="dark"] .advanced-filter-toggle:hover,
html[data-theme="dark"] .map-tool:hover,
html[data-theme="dark"] .completion-legend-item:hover,
html[data-theme="dark"] .load-more:hover,
html[data-theme="dark"] .file-open:hover,
html[data-theme="dark"] .ghost-button:hover,
html[data-theme="dark"] .leaflet-control-zoom a:hover { background-color: #1c211e; color: var(--ink); }
html[data-theme="dark"] .completion-legend-item[aria-pressed="true"] .completion-check { border-color: var(--green); background: var(--green); color: #fff; }
html[data-theme="dark"] .completion-legend-item[aria-pressed="false"] .completion-check { border-color: var(--line-strong); background: transparent; }
html[data-theme="dark"] .activity-filter-item[aria-pressed="true"] .completion-check { border-color: var(--green); background: var(--green); color: #fff; }
html[data-theme="dark"] .activity-filter-item[aria-pressed="false"] .completion-check { border-color: var(--line-strong); background: transparent; }
html[data-theme="dark"] .map-attribution-control { border-color: var(--line-strong); background: #111312; color: #c4cdc7; }
html[data-theme="dark"] .map-attribution-button { background: #111312; border-color: var(--line-strong); }
html[data-theme="dark"] .map-attribution-button:hover { background: #1c211e; color: #fff; }
html[data-theme="dark"] .map-attribution-details { border-color: var(--line-strong); background: #111312; color: #d8e0db; }
html[data-theme="dark"] #map { background: #171b20; }
html[data-theme="dark"] .map-fallback { background: linear-gradient(145deg, #252c33, #171b20); }
html[data-theme="dark"] .detail-panel { box-shadow: 0 10px 30px rgb(0 0 0 / 40%); }
html[data-theme="dark"] .document-preview { background: #30363d; }
html[data-theme="dark"] .document-placeholder strong { color: var(--ink); }
html[data-theme="dark"] .mobile-panel-header { background: #111312; }
html[data-theme="dark"] .mobile-menu-toggle { background: #111312; }
html[data-theme="dark"] .about-card p { color: var(--muted); }
html[data-theme="dark"] .about-card .about-project-links-unavailable { background: var(--surface-2); color: var(--ink); }
/* Mobile glass sheets: one backdrop per drawer, never per field or record.
   Opaque defaults also cover browsers without backdrop-filter support. */
@media (max-width: 720px) {
  :root {
    --control-height: 44px;
    --control-radius: 15px;
    --radius: 22px;
    --mobile-glass: rgb(250 253 255 / 88%);
    --mobile-field: rgb(255 255 255 / 70%);
    --mobile-canvas: #e9eff5;
    --mobile-shadow: inset 0 1px 0 rgb(255 255 255 / 65%), 0 4px 16px rgb(25 42 62 / 14%);
    --drawer-glass: rgb(249 252 250 / 87%);
    --drawer-edge: rgb(255 255 255 / 78%);
    --drawer-highlight: rgb(255 255 255 / 42%);
  }
  html[data-theme="dark"] {
    --mobile-glass: rgb(28 34 42 / 91%);
    --mobile-field: rgb(255 255 255 / 7%);
    --mobile-canvas: #121923;
    --mobile-shadow: inset 0 1px 0 rgb(255 255 255 / 13%), 0 4px 16px rgb(0 0 0 / 24%);
    --drawer-glass: rgb(20 25 23 / 89%);
    --drawer-edge: rgb(222 239 229 / 22%);
    --drawer-highlight: rgb(255 255 255 / 9%);
  }
  html:root .sidebar, html:root .detail-panel {
    background: var(--surface);
    border-color: var(--drawer-edge);
    box-shadow: inset 0 1px 0 var(--drawer-highlight), 0 12px 36px rgb(0 0 0 / 23%);
  }
  html:root .sidebar { border-radius: 0 24px 24px 0; }
  html:root .detail-panel { border-radius: 24px 24px 0 0; }
  .detail-panel .address-record-list { background: transparent; }
  html:root .mobile-panel-header, html:root .detail-sheet-handle { background: transparent; }
  html[data-theme="dark"] .mobile-panel-header { background: transparent; }
  /* The map remains the canvas. Glass belongs to floating chrome, not tiles,
     markers, chart contents, or hundreds of individually blurred rows. */
  html:root :is(.global-search, .mobile-menu-toggle, .completion-filter-button,
    .completion-filter-menu, .leaflet-control-layers, .map-attribution-control,
    .viewer-bar) {
    background: var(--mobile-glass);
    color: var(--ink);
    border: 1px solid var(--drawer-edge);
    box-shadow: var(--mobile-shadow);
    border-radius: 22px;
  }
  html:root .global-search { height: 44px; right: 110px; opacity: 1; padding-inline: 13px; }
  html:root .global-search input { color: var(--ink); }
  html:root .global-search input::placeholder { color: var(--muted); }
  html:root .global-search svg { stroke: var(--muted); }
  html:root .mobile-menu-toggle { min-height: 44px; padding-inline: 13px; }
  html:root .mobile-menu-open .global-search { opacity: 0; }
  html:root .completion-filter-button { min-height: 44px; padding-inline: 13px; font-size: 13px; }
  .completion-filter-summary { font-size: 12px; }
  .completion-filter-menu { padding: 8px; }
  .completion-filter-menu .completion-legend-item { min-height: 44px; font-size: 13px; border-radius: 13px; }
  html:root .map-attribution-button { background: transparent; color: var(--ink); }
  html:root .map-basemap-control-host .leaflet-control-layers-toggle {
    width: 44px; height: 44px; background: transparent !important; box-shadow: none;
  }
  html:root .map-basemap-control-host .leaflet-control-layers:not(.leaflet-control-layers-expanded) {
    width: 44px; height: 44px;
  }
  .map-basemap-control-host { top: calc(env(safe-area-inset-top, 0px) + 64px); }
  .leaflet-control-layers-expanded { padding: 9px 12px; }
  .leaflet-control-layers-base label, .leaflet-control-layers-overlays label { min-height: 44px; font-size: 14px; }
  .map-layers-collapse-button { min-height: 40px; width: 100%; margin: -5px 0 4px; padding: 0; }
  html:root .map-layers-collapse-button:hover { border-radius: 14px; background: var(--mobile-field); }
  html:root :is(.sidebar, .table-panel, .map-basemap-control-host) :is(select, .range-text, .zone-filter-button,
    .activity-filter-button, .advanced-filter-toggle, .map-tool, .theme-toggle) {
    background-color: var(--mobile-field); border-color: var(--line); box-shadow: none;
  }
  /* These actions sit directly over the basemap. Keep their surface opaque
     enough for dark-theme text to remain readable over light map tiles. */
  html:root .map-basemap-control-host .mobile-map-action {
    background: var(--mobile-glass);
    border-color: var(--drawer-edge);
    box-shadow: var(--mobile-shadow);
  }
  html:root :is(.sidebar, .map-basemap-control-host) .weekly-recap-button.is-active { background: var(--green); color: var(--surface); }
  .filter-grid { gap: 12px 9px; }
  .mobile-view-tabs { border-radius: 18px; padding: 4px; }
  .mobile-view-tabs .view-tab { min-height: 44px; border-radius: 14px; }
  html:root .mobile-view-tabs .view-tab.is-active { background: var(--control-surface); color: var(--ink); box-shadow: var(--mobile-shadow); }
  .mobile-chevron, .icon-button { border-radius: 50%; }
  .mobile-chevron { width: 44px; height: 44px; }
  .detail-panel .detail-header { padding-bottom: 18px; }
  .detail-panel .detail-section { padding-block: 20px; }
  .detail-panel .image-set-section { padding-block: 0; }
  .detail-description { font-size: 16px; }
  .fact-grid { gap: 18px 14px; }
  .fact-grid span, .document-meta span { font-size: 11px; }
  .fact-grid strong { font-size: 14px; }
  html[data-theme="dark"] .detail-completion-status.not-completed > strong { color: #ffb76b; }
  html[data-theme="dark"] .detail-completion-status.completed-earlier > strong { color: #91b8ff; }
  html[data-theme="dark"] .detail-completion-status.completed-recent > strong { color: #c6abff; }
  html:root :is(.table-panel, .dashboard-panel, .about-page) {
    background: linear-gradient(155deg, var(--mobile-canvas), var(--surface-2));
  }
  html:root :is(.table-panel-header, .table-toolbar, .table-wrap) { background: transparent; }
  html:root :is(.dashboard-card, .dashboard-metric, .about-card) {
    background: var(--mobile-glass); border-color: var(--drawer-edge);
    border-radius: 22px; box-shadow: var(--mobile-shadow);
  }
  .table-wrap { padding: 0 10px 10px; }
  html:root #projectTable .table-row { margin-top: 10px; border: 1px solid var(--drawer-edge); border-radius: 20px; background: var(--mobile-glass); padding: 17px; }
  html:root #projectTable .table-row.selected { border-color: var(--green); background: var(--surface); border-radius: 20px 20px 0 0; }
  html:root #projectTable .table-expanded-row { border-radius: 0 0 20px 20px; overflow: hidden; background: var(--mobile-glass); }
  #projectTable .table-project-link { font-size: 16px; }
  #projectTable .table-row { font-size: 13px; }
  #projectTable .table-row td::before { font-size: 11px; }
  .dashboard-grid { gap: 16px; }
  .dashboard-card { padding: 20px 16px; }
  .dashboard-legend { font-size: 12px; }
  .about-main { padding: 20px 12px 40px; }
  .about-card { padding: 24px 20px; }
  .about-card p { font-size: 16px; }
  html:root .about-topbar { border-radius: 0 0 22px 22px; background: var(--mobile-glass); color: var(--ink); border-color: var(--drawer-edge); box-shadow: var(--mobile-shadow); }
  .about-topbar .ghost-button { color: var(--ink); border-radius: 22px; min-height: 44px; display: inline-flex; align-items: center; }
  html:root .viewer-bar { border-radius: 0 0 22px 22px; }
  .viewer-title strong { font-size: 14px; }
  .viewer-title span, .viewer-actions { font-size: 12px; }
  .viewer-title span, .viewer-actions { color: var(--ink); }
  .page-arrow { width: 44px; height: 54px; border-radius: 22px; }
  :is(button, a, input, select) { -webkit-tap-highlight-color: transparent; }
  :is(button, a):focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
  .mobile-scrim { background: rgb(7 12 9 / 24%); }
  @supports ((backdrop-filter: blur(12px)) or (-webkit-backdrop-filter: blur(12px))) {
    html:root :is(.global-search, .mobile-menu-toggle, .completion-filter-button,
      .completion-filter-menu, .leaflet-control-layers, .viewer-bar) {
      -webkit-backdrop-filter: blur(12px) saturate(125%);
      backdrop-filter: blur(12px) saturate(125%);
    }
    html:root .sidebar, html:root .detail-panel,
    html[data-theme="dark"] .sidebar, html[data-theme="dark"] .detail-panel {
      background: linear-gradient(135deg, var(--drawer-highlight), transparent 38%), var(--drawer-glass);
      -webkit-backdrop-filter: blur(12px) saturate(125%);
      backdrop-filter: blur(12px) saturate(125%);
    }
  }
  @media (prefers-reduced-transparency: reduce), (forced-colors: active) {
    :root, html[data-theme="dark"] { --mobile-glass: var(--surface); --mobile-field: var(--surface); }
    html:root :is(.global-search, .mobile-menu-toggle, .completion-filter-button,
      .completion-filter-menu, .leaflet-control-layers, .viewer-bar) {
      -webkit-backdrop-filter: none; backdrop-filter: none;
    }
    html:root .sidebar, html:root .detail-panel,
    html[data-theme="dark"] .sidebar, html[data-theme="dark"] .detail-panel {
      background: var(--surface);
      -webkit-backdrop-filter: none;
      backdrop-filter: none;
    }
  }
  @media (prefers-reduced-motion: reduce) {
    .sidebar, .detail-panel { transition: none; }
  }
}
