.potholes-page {
  --panel-width: 340px;
  --pothole-toolbar-height: 180px;
  --panel: #fff;
  --line: #dce4df;
  --muted: #52645b;
  --pothole-report: #ff1744;
  --pothole-repair: #13766a;
  --pothole-presumed: #7a8b80;
  --pothole-unknown: #161b18;
  background: #f4f7f5;
}

.potholes-page [hidden] { display: none !important; }
.potholes-page .app-shell { display: grid; grid-template-columns: var(--panel-width) minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
.pothole-toolbar { grid-column: 1 / -1; grid-row: 1; min-width: 0; padding: 12px 18px; display: grid; gap: 10px; background: #fff; border-bottom: 1px solid var(--line); z-index: 1400; }
.pothole-toolbar-heading { display: grid; grid-template-columns: minmax(0, 1fr) minmax(440px, 520px); gap: 24px; align-items: center; }
.pothole-toolbar .brand-block { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "region links" "title links"; gap: 3px 18px; padding: 0; min-width: 0; }
.pothole-toolbar .eyebrow { grid-area: region; font-size: 0.68rem; }
.pothole-toolbar h1 { grid-area: title; font-size: 1.4rem; line-height: 1.2; letter-spacing: 0; }
.pothole-toolbar .site-nav { grid-area: links; position: static; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; }
.pothole-toolbar .site-nav > a, .pothole-toolbar .site-nav > button { min-width: 40px; min-height: 36px; }
.pothole-toolbar .pothole-road-link { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.pothole-toolbar .map-mode-nav { margin: 0; }
.pothole-map-filters { min-width: 0; }
.pothole-map-filters > summary { display: none; }
.pothole-toolbar .pothole-layer { padding: 0; border: 0; }
.pothole-toolbar .pothole-layer legend { margin-bottom: 6px; }
.pothole-toolbar .pothole-layer-heading { justify-content: flex-start; gap: 10px; font-size: 0.8rem; }
.pothole-toolbar .pothole-layer-heading .pothole-icon-button { width: 36px; height: 36px; flex-basis: 36px; }
.pothole-toolbar .pothole-filter-grid { grid-template-columns: minmax(110px, 0.55fr) minmax(160px, 0.8fr) minmax(220px, 1.05fr) minmax(180px, 1fr) minmax(200px, 1.1fr); align-items: end; gap: 12px; }
.pothole-toolbar .pothole-full-width { grid-column: auto; }
.pothole-toolbar #repairsControls { grid-template-columns: repeat(3, minmax(140px, 1fr)); }
.pothole-toolbar-repair-summary { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 4px 20px; margin-top: 8px; }
.pothole-toolbar .pothole-toolbar-repair-summary .pothole-coverage { margin: 0; }
.pothole-toolbar-repair-summary #repairsCountsHelpArea { grid-column: 2; grid-row: 1 / span 2; }
.pothole-toolbar-repair-summary #repairsWarning { grid-column: 1 / -1; }
.pothole-toolbar .pothole-year-picker { position: relative; }
.pothole-toolbar .pothole-year-options { position: absolute; top: calc(100% + 5px); left: 0; width: max(100%, 260px); max-width: calc(100vw - 32px); max-height: min(320px, calc(100dvh - var(--pothole-toolbar-height) - 18px)); overflow-y: auto; padding: 10px 12px; border: 1px solid #b7c7be; border-radius: 4px; background: #fff; box-shadow: 0 5px 18px #17201c25; z-index: 20; }
.pothole-toolbar .pothole-counts-help { max-height: min(340px, calc(100dvh - var(--pothole-toolbar-height) - 16px)); }
.potholes-page .potholes-panel { grid-column: 1; grid-row: 2; padding: 0; gap: 0; overflow: hidden; }
.potholes-page .pothole-results-resize { top: calc(50% + var(--pothole-toolbar-height) / 2); display: grid; place-items: center; touch-action: none; color: var(--accent-dark); }
.potholes-page .pothole-results-resize::before { content: none; }
.pothole-results-resize svg { width: 18px; height: 18px; pointer-events: none; }
.potholes-page .map-zone { grid-column: 2; grid-row: 2; height: 100%; }
.potholes-page .menu-toggle { display: none; }
.potholes-page button, .potholes-page select { font: inherit; }
.potholes-page :focus-visible { outline: 3px solid #1976d2; outline-offset: 3px; }
.potholes-panel { padding: 18px; gap: 16px; background: var(--panel); box-shadow: none; }
.potholes-panel .brand-block { padding-right: 0; min-height: 0; flex-shrink: 0; }
.potholes-panel .site-nav { position: static; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; grid-row: auto; justify-content: flex-start; }
.potholes-panel .site-nav > a, .potholes-panel .site-nav > button { min-width: 40px; min-height: 36px; }
.potholes-panel .site-nav .pothole-road-link { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.pothole-road-link svg { width: 17px; height: 17px; flex: 0 0 17px; }
.potholes-panel h1 { font-size: 1.7rem; line-height: 1.14; letter-spacing: 0; }
.potholes-page .map-mode-nav { grid-template-columns: 1fr 1fr 1.7fr 1fr; flex-shrink: 0; }
.potholes-page .map-mode-nav a { font-size: 0.8rem; min-height: 44px; overflow-wrap: anywhere; text-align: center; }
.pothole-layer { margin: 0; padding: 0 0 16px; border: 0; border-bottom: 1px solid var(--line); min-width: 0; }
.pothole-layer legend { padding: 0; margin-bottom: 12px; width: 100%; }
.pothole-layer-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-weight: 750; font-size: 0.98rem; }
.pothole-layer-toggle { display: flex; align-items: center; gap: 9px; font-size: 0.98rem; font-weight: 750; cursor: pointer; min-height: 28px; }
.pothole-layer-toggle input { width: 18px; height: 18px; flex: 0 0 18px; accent-color: var(--accent); margin: 0; }
.pothole-swatch { display: inline-block; width: 10px; height: 10px; flex: 0 0 10px; background: var(--pothole-report); border-radius: 50%; }
.pothole-swatch.repairs { background: var(--pothole-repair); border-radius: 2px; }
.pothole-swatch.closed { background: #677078; }
.pothole-swatch.presumed-repaired { background: var(--pothole-presumed); }
.pothole-swatch.unknown { background: #fff; border: 2px solid var(--pothole-unknown); }
.pothole-swatch.mixed { background: #e7ece9; border: 1px solid #5a7364; }
.pothole-year-picker { border: 1px solid #b7c7be; border-radius: 4px; background: #fff; min-width: 0; }
.pothole-year-picker summary { padding: 10px; cursor: pointer; min-height: 40px; font-size: 0.85rem; line-height: 1.45; overflow-wrap: anywhere; }
.pothole-year-options { padding: 0 12px 10px; }
.pothole-year-options label { display: flex; align-items: center; gap: 8px; min-height: 36px; cursor: pointer; font-size: 0.85rem; }
.pothole-year-options #yearOptions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px 10px; }
.pothole-year-options .pothole-year-all { border-bottom: 1px solid var(--line); padding-bottom: 8px; margin-bottom: 6px; font-weight: 700; }
.pothole-filter-grid .pothole-year-options input { width: 18px; height: 18px; min-height: 0; flex: 0 0 18px; padding: 0; margin: 0; accent-color: var(--accent); }
.pothole-filter-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.pothole-full-width { grid-column: 1 / -1; }
.pothole-filter-grid .field { min-width: 0; gap: 5px; font-size: 0.78rem; }
.pothole-filter-grid select, .pothole-filter-grid input {
  width: 100%; min-width: 0; min-height: 40px; padding: 8px; border: 1px solid #b7c7be;
  border-radius: 4px; background: #fff; color: var(--ink); font-size: 0.85rem; text-overflow: ellipsis;
}
.pothole-filter-grid select:disabled, .pothole-filter-grid input:disabled { background: #f1f4f2; color: #69786f; }
.pothole-count-range { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) 40px; align-items: center; gap: 6px; }
.pothole-count-range > span { color: var(--muted); }
.pothole-count-range .pothole-icon-button { width: 40px; height: 40px; flex-basis: 40px; }
.pothole-count-range input[aria-invalid="true"] { border-color: #a32940; }
.pothole-count-filter .pothole-error { margin: 0; }
.pothole-coverage, .pothole-counts, .pothole-warning, .pothole-error { font-size: 0.77rem; line-height: 1.5; overflow-wrap: anywhere; }
.pothole-coverage { color: var(--muted); }
.pothole-layer .pothole-coverage { margin-top: 10px; }
.pothole-counts { margin-top: 4px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pothole-counts-area { position: relative; }
.pothole-counts-row { display: flex; align-items: center; gap: 8px; }
.pothole-counts-row .pothole-counts { flex: 1; min-width: 0; }
.pothole-info-button { border: 0; border-radius: 50%; }
.pothole-counts-help { position: absolute; top: 100%; left: 0; width: 100%; max-height: min(360px, 65dvh); overflow-y: auto; padding: 14px; z-index: 10; border: 1px solid #b7c7be; border-radius: 6px; background: #fff; box-shadow: 0 5px 18px #17201c25; font-size: 0.8rem; line-height: 1.5; overflow-wrap: anywhere; }
.pothole-counts-help p { margin: 4px 0 12px; }
.pothole-counts-help p:last-child { margin-bottom: 0; }
.pothole-warning { color: #7a4421; border-left: 2px solid #b78537; padding-left: 8px; margin-top: 7px; }
.pothole-error { color: #a32940; margin-top: 6px; }
.pothole-text-button { min-height: 40px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 4px; background: #fff; color: var(--accent-dark); cursor: pointer; font-weight: 700; }
.pothole-text-button:hover { background: #eef6f2; }
.pothole-result-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pothole-result-heading h2 { margin: 0; font-size: 0.95rem; line-height: 1.3; }
.pothole-results-dock { flex-shrink: 0; display: grid; gap: 10px; padding: 18px; background: var(--panel); border-bottom: 1px solid var(--line); }
.pothole-viewport-counts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.pothole-viewport-metric { min-width: 0; padding: 32px 10px 10px; border: 1px solid var(--line); border-radius: 6px; background: #f1f6f3; container-type: inline-size; }
.pothole-viewport-metric strong { display: block; font-size: clamp(1rem, 21cqi, 1.65rem); line-height: 1.2; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pothole-viewport-metric span { display: block; margin-top: 6px; min-height: 2.6em; color: var(--muted); font-size: 0.74rem; line-height: 1.3; overflow-wrap: anywhere; }
.pothole-viewport-metric > .pothole-info-button { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; padding: 0; color: var(--accent-dark); background: transparent; }
.pothole-viewport-metric > .pothole-info-button:hover { background: #dcece3; }
.pothole-viewport-metric .pothole-counts-help { left: auto; right: 0; width: min(280px, calc(var(--panel-width) - 38px), calc(100vw - 92px)); max-height: min(300px, calc(100dvh - var(--pothole-toolbar-height) - 180px)); }
.pothole-history-filter { display: flex; align-items: center; gap: 9px; min-height: 44px; padding: 9px 10px; border: 1px solid #b7c7be; border-radius: 4px; background: #fff; font-size: 0.8rem; line-height: 1.4; cursor: pointer; }
.pothole-history-filter:has(input:checked) { background: #e8f5ef; border-color: var(--accent); }
.pothole-history-filter input { width: 18px; height: 18px; flex: 0 0 18px; margin: 0; accent-color: var(--accent); }
.pothole-history-filter span { min-width: 0; overflow-wrap: anywhere; }
.pothole-results-scroll { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 10px 18px 18px; overscroll-behavior: contain; }
.pothole-results-scroll > * + * { margin-top: 16px; }
.pothole-results-scroll .pothole-results { margin: 0; }
.pothole-results-scroll > button { width: 100%; }
.pothole-icon-button { display: inline-grid; place-items: center; width: 44px; height: 44px; flex: 0 0 44px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink); cursor: pointer; }
.pothole-icon-button svg { width: 21px; height: 21px; pointer-events: none; }
.pothole-icon-button:hover { background: #edf5f1; }
.pothole-icon-button:disabled { cursor: default; color: #88938e; background: #f3f5f4; }
.pothole-results { list-style: none; padding: 0; margin: -6px 0 0; }
.pothole-results li + li { border-top: 1px solid var(--line); }
.pothole-result { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 10px; width: 100%; padding: 12px 0; border: 0; background: transparent; color: var(--ink); cursor: pointer; text-align: left; }
.pothole-result:hover { background: #f2f6f3; }
.pothole-result .pothole-swatch { margin-top: 5px; }
.pothole-result strong { display: block; font-size: 0.84rem; line-height: 1.35; overflow-wrap: anywhere; }
.pothole-result small { display: block; color: var(--muted); font-size: 0.75rem; margin-top: 4px; line-height: 1.4; }
.pothole-result-count { font-size: 0.9rem; font-weight: 800; font-variant-numeric: tabular-nums; align-self: center; }
.pothole-sources { border-top: 1px solid var(--line); padding-top: 14px; font-size: 0.78rem; line-height: 1.55; color: var(--muted); }
.pothole-sources summary { font-weight: 750; color: var(--ink); cursor: pointer; min-height: 32px; }
.pothole-sources p { margin: 10px 0; }
.pothole-sources a { display: block; margin-top: 8px; color: var(--accent-dark); text-decoration: underline; }
.pothole-map-caption { position: absolute; top: 18px; left: 18px; z-index: 500; padding: 10px 13px; background: rgba(255, 255, 255, 0.94); border-left: 3px solid var(--pothole-report); max-width: calc(100% - 100px); pointer-events: none; }
.pothole-map-caption strong { display: block; font-size: 1.05rem; line-height: 1.25; }
.pothole-map-caption span { display: block; font-size: 0.74rem; color: var(--muted); margin-top: 3px; }
.potholes-page[data-pothole-view="repairs"] .pothole-map-caption { border-left-color: var(--pothole-repair); }
.pothole-map-tools { position: absolute; right: 14px; top: 14px; display: grid; gap: 8px; z-index: 700; }
.pothole-map-tools .pothole-icon-button { box-shadow: 0 2px 7px #17201c20; }
.pothole-map-legend { position: absolute; bottom: 30px; left: 14px; display: flex; flex-wrap: wrap; gap: 8px 16px; max-width: calc(100% - 28px); padding: 10px 12px; border-radius: 4px; background: rgba(255, 255, 255, 0.96); z-index: 500; font-size: 0.78rem; line-height: 1.5; }
.pothole-map-legend > span { display: inline-flex; align-items: center; gap: 7px; }
.potholes-page #mapStatus { max-width: min(320px, calc(100% - 100px)); font-size: 0.82rem; }
.potholes-page #mapStatus[data-mode="error"] { top: 50%; left: 50%; transform: translate(-50%, -50%); }
.pothole-page-retry { position: absolute; top: calc(50% + 65px); left: 50%; transform: translateX(-50%); z-index: 700; }
.pothole-map-notice { position: absolute; top: 110px; left: 18px; z-index: 500; max-width: min(290px, calc(100% - 100px)); padding: 12px; border-radius: 4px; background: #fff; color: #7a4421; font-size: 0.8rem; line-height: 1.5; }
.pothole-marker { background: none; border: 0; }
.pothole-marker > span { display: grid; place-items: center; width: 38px; height: 38px; border: 2px solid #fff; border-radius: 50%; background: var(--pothole-report); color: #fff; box-shadow: 0 1px 4px #17201c50; font-size: 0.78rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.pothole-marker.active > span { color: #101b14; }
.pothole-marker.presumed-repaired > span { background: var(--pothole-presumed); color: #101b14; }
.pothole-marker.unknown > span { background: #fff; border-color: var(--pothole-unknown); color: var(--pothole-unknown); }
.pothole-marker.mixed > span { background: #e7ece9; color: #263e30; border-color: #5a7364; }
.potholes-page .leaflet-tooltip { width: max-content; white-space: normal; max-width: min(280px, calc(100vw - 32px)); overflow-wrap: anywhere; }
.potholes-page .leaflet-tooltip.pothole-point-label { max-width: min(380px, calc(100vw - 32px)); }
.pothole-point-tooltip { white-space: pre-line; }
.pothole-marker.repairs > span { background: var(--pothole-repair); border-radius: 6px; }
.pothole-marker.closed > span { background: #677078; }
.pothole-marker.position > span { width: 28px; height: 28px; font-size: 0.7rem; border-width: 1px; }
.pothole-dialog { width: min(540px, calc(100% - 24px)); max-height: calc(100dvh - 32px); padding: 0; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); box-shadow: 0 12px 60px #17201c30; }
.pothole-dialog::backdrop { background: #17201c70; }
.pothole-dialog-header { position: sticky; top: 0; z-index: 1; background: #fff; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.pothole-dialog-header h2 { font-size: 1.15rem; line-height: 1.35; overflow-wrap: anywhere; }
.pothole-detail-content { padding: 18px 20px; font-size: 0.88rem; line-height: 1.5; }
.pothole-detail-content > * + * { margin-top: 16px; }
.pothole-detail-meta { color: var(--muted); font-size: 0.8rem; }
.pothole-detail-status { display: inline-block; padding: 4px 8px; color: #822339; background: #faedf0; border-left: 3px solid var(--pothole-report); font-weight: 750; }
.pothole-detail-status.closed { color: #45524a; background: #edf1ee; border-color: #677078; }
.pothole-detail-status.presumed-repaired { color: #45524a; background: #edf1ee; border-color: var(--pothole-presumed); }
.pothole-detail-status.unknown { background: #fff; color: var(--muted); border-color: var(--pothole-unknown); }
.pothole-timeline { list-style: none; margin: 16px 0; padding: 0 0 0 14px; border-left: 2px solid var(--line); }
.pothole-timeline li { position: relative; display: grid; gap: 3px; padding: 0 0 18px; overflow-wrap: anywhere; }
.pothole-timeline li::before { position: absolute; top: 5px; left: -19px; content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--pothole-report); }
.pothole-timeline li.repair::before { background: var(--pothole-presumed); }
.pothole-timeline time, .pothole-timeline span { color: var(--muted); font-size: 0.77rem; }
.pothole-timeline strong { font-size: 0.84rem; }
.pothole-detail-fields { display: grid; grid-template-columns: minmax(120px, 0.8fr) minmax(0, 1.2fr); gap: 7px 14px; margin: 0; }
.pothole-detail-fields dt { color: var(--muted); font-size: 0.8rem; }
.pothole-detail-fields dd { margin: 0; overflow-wrap: anywhere; }
.pothole-detail-section { padding-top: 14px; border-top: 1px solid var(--line); }
.pothole-detail-section summary { font-weight: 750; cursor: pointer; min-height: 30px; }
.pothole-detail-section .pothole-detail-fields { margin-top: 10px; }
.pothole-detail-section h3 { margin: 0 0 10px; font-size: 0.95rem; }
.pothole-detail-note { border-left: 2px solid var(--line); padding-left: 10px; color: var(--muted); font-size: 0.78rem; }
.pothole-history { width: 100%; border-collapse: collapse; margin-top: 10px; font-variant-numeric: tabular-nums; }
.pothole-history th, .pothole-history td { border: 0; padding: 4px 0; text-align: left; font-size: 0.8rem; }
.pothole-history th { width: 55px; background: transparent; font-weight: 500; }
.pothole-history td:last-child { width: 45px; text-align: right; }
.pothole-history-bar { display: block; height: 7px; background: #c57b8b; min-width: 2px; max-width: 100%; }
.pothole-pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--line); font-size: 0.85rem; }
.pothole-detail-content a { color: var(--accent-dark); text-decoration: underline; }

@media (min-width: 881px) and (max-width: 1100px) {
  .pothole-toolbar #reportsControls { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pothole-toolbar .pothole-search-field { grid-column: span 2; }
}

@media (max-width: 880px) {
  .potholes-page .app-shell { grid-template-columns: minmax(0, 1fr); }
  .pothole-toolbar { padding: 10px 14px; gap: 8px; }
  .pothole-toolbar-heading { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .potholes-page #potholeModeNav { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
  .potholes-page #potholeModeNav a { min-width: 0; min-height: 36px; padding: 4px 3px; font-size: 0.72rem; line-height: 1.25; }
  .pothole-map-filters > summary { display: flex; align-items: center; justify-content: space-between; min-height: 36px; padding: 4px 0; cursor: pointer; list-style: none; font-size: 0.82rem; font-weight: 700; }
  .pothole-map-filters > summary::-webkit-details-marker { display: none; }
  .pothole-map-filters > summary > span { display: inline-flex; align-items: center; gap: 7px; }
  .pothole-map-filters > summary svg { width: 17px; height: 17px; }
  .pothole-map-filters[open] > summary { margin-bottom: 8px; }
  .pothole-map-filters[open] > summary > svg { transform: rotate(180deg); }
  .pothole-toolbar .pothole-filter-grid, .pothole-toolbar #repairsControls { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .pothole-toolbar .pothole-count-filter { grid-column: 1 / -1; }
  .pothole-toolbar #repairsControls .pothole-full-width { grid-column: 1 / -1; }
  .pothole-toolbar-repair-summary { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .pothole-toolbar-repair-summary #repairsCountsHelpArea { grid-column: 1; grid-row: auto; }
  .potholes-page .menu-toggle { display: grid; top: calc(var(--pothole-toolbar-height) + 12px); }
  .potholes-page .map-zone { grid-column: 1; grid-row: 2; height: 100%; }
  .potholes-page .potholes-panel { top: var(--pothole-toolbar-height); bottom: 0; width: min(340px, calc(100vw - 54px)); }
  .pothole-results-dock .pothole-result-heading { min-height: 40px; padding-left: 52px; }
  .potholes-page .pothole-results-resize { display: none; }
  .potholes-panel .brand-block { padding-top: 0; padding-right: 0; }
  .potholes-panel .site-nav { position: static; margin: 0; display: flex; }
  .potholes-page .menu-backdrop:not([hidden]) { display: block; position: fixed; inset: var(--pothole-toolbar-height) 0 0; background: #17201c70; z-index: 1100; }
  .potholes-page .menu-toggle.is-open { color: #fff; }
  .pothole-map-caption { top: 14px; left: 70px; max-width: calc(100% - 140px); padding: 8px 10px; }
  .pothole-map-caption strong { font-size: 0.95rem; overflow-wrap: anywhere; }
  .pothole-map-caption span { font-size: 0.7rem; }
  .pothole-map-notice { left: 14px; }
  .pothole-map-legend { max-width: calc(100% - 84px); font-size: 0.73rem; gap: 5px 12px; }
}

@media (max-width: 880px) and (max-height: 650px) {
  .pothole-toolbar { max-height: 55dvh; overflow-y: auto; }
  .pothole-toolbar .pothole-year-options { position: static; width: 100%; max-width: 100%; max-height: 190px; border: 0; box-shadow: none; }
  .pothole-toolbar .pothole-counts-help { position: static; max-height: 180px; }
}

@media (max-width: 880px) and (max-height: 450px) {
  .pothole-map-caption { display: none; }
  .pothole-map-tools { display: flex; top: 12px; right: 12px; gap: 6px; }
  .pothole-map-tools .pothole-icon-button { width: 36px; height: 36px; flex-basis: 36px; }
  .pothole-map-legend { max-width: calc(100% - 28px); bottom: 24px; }
}

@media (max-width: 400px) {
  .pothole-toolbar { padding-inline: 10px; }
  .pothole-toolbar h1 { font-size: 1.1rem; }
  .pothole-toolbar .brand-block { column-gap: 8px; }
  .pothole-toolbar .pothole-road-link span { display: none; }
  .potholes-panel { padding-inline: 14px; }
  .potholes-panel h1 { font-size: 1.4rem; }
  .pothole-filter-grid { grid-template-columns: minmax(0, 1fr); }
  .pothole-detail-fields { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .pothole-detail-fields dd + dt { margin-top: 8px; }
  .pothole-dialog-header, .pothole-detail-content, .pothole-pagination { padding-inline: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .potholes-page *, .potholes-page *::before { animation: none !important; transition: none !important; }
}

.potholes-page.pothole-reading .app-shell { grid-template-columns: minmax(0, 1fr); }
.potholes-page.pothole-reading .pothole-toolbar { max-height: none; overflow: visible; }
.pothole-content { grid-column: 1 / -1; grid-row: 2; min-height: 0; overflow-y: auto; background: #fff; padding: 30px 24px 64px; scroll-padding-top: var(--statistics-dock-height, 20px); }
.potholes-page[data-pothole-view="statistics"] .pothole-content { padding-top: 0; }
.pothole-document { max-width: 1000px; margin: 0 auto; line-height: 1.65; }
#statisticsView { width: 100%; max-width: none; }
.pothole-statistics-dock { position: sticky; top: 0; z-index: 8; display: grid; justify-items: center; gap: 6px; background: #fff; padding: 8px 0; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
.potholes-page .pothole-statistics-nav { display: flex; flex-wrap: wrap; justify-content: center; width: fit-content; max-width: 100%; gap: 6px; margin: 0; }
.pothole-document .pothole-statistics-nav a { flex: 0 1 auto; min-width: 112px; min-height: 32px; padding: 6px 12px; text-decoration: none; }
.pothole-document .pothole-statistics-nav a[aria-current="page"] { color: #fff; }
.pothole-chart-controls { width: min(100%, 600px); display: grid; justify-items: center; gap: 3px; }
.pothole-chart-controls .field { width: min(100%, 350px); display: grid; grid-template-columns: max-content minmax(0, 1fr); align-items: center; gap: 8px; text-align: left; margin: 0; }
.pothole-chart-controls .field > span:first-child { font-size: 0.75rem; font-weight: 650; color: var(--muted); }
.pothole-period-select { position: relative; display: flex; align-items: center; min-width: 0; min-height: 36px; border: 1px solid #bccdc3; border-radius: 6px; background: #f3f7f4; box-shadow: 0 1px 2px #203c2b0a; }
.pothole-period-select:focus-within { outline: 2px solid var(--accent-dark); outline-offset: 2px; }
.pothole-period-select select { appearance: none; width: 100%; min-width: 0; min-height: 36px; padding: 6px 32px; border: 0; outline: 0; border-radius: 6px; background: transparent; color: #243a31; font-size: 0.82rem; font-weight: 650; cursor: pointer; }
.pothole-period-select > svg { position: absolute; width: 17px; height: 17px; color: var(--accent-dark); pointer-events: none; }
.pothole-period-select > svg:first-child { left: 11px; }
.pothole-period-select > svg:last-child { right: 11px; }
.pothole-data-updates { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 14px; margin: 0; color: var(--muted); font-size: 0.7rem; line-height: 1.4; text-align: center; }
.pothole-data-updates > span { white-space: nowrap; }
.pothole-chart-controls.pothole-borough-controls { width: min(100%, 850px); grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 5px 20px; }
.pothole-borough-controls .field { width: 100%; }
.pothole-borough-controls .pothole-data-updates { grid-column: 1 / -1; }
.pothole-borough-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; padding: 22px 0; margin: 0; border-bottom: 1px solid var(--line); }
.pothole-borough-metrics dt { font-size: 0.8rem; line-height: 1.4; color: var(--muted); }
.pothole-borough-metrics dd { margin: 6px 0 0; font-size: 1.7rem; line-height: 1.25; font-weight: 750; font-variant-numeric: tabular-nums; }
#boroughCharts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 32px; }
.pothole-borough-chart { min-width: 0; display: grid; grid-row: span 3; grid-template-rows: subgrid; align-items: start; gap: 14px; padding: 26px 0; border-bottom: 1px solid var(--line); }
.pothole-borough-chart h3, #statisticsBoroughs .pothole-document-section h3 { margin: 0; font-size: 1.12rem; line-height: 1.35; }
.pothole-borough-chart .pothole-analysis-note { margin-top: 10px; }
.pothole-borough-chart-details summary { cursor: pointer; font-size: 0.84rem; font-weight: 650; }
.pothole-borough-chart-details { min-width: 0; }
.pothole-borough-search { padding: 22px 0 0; }
.pothole-borough-search .field { max-width: 440px; }
.pothole-borough-table-wrap { max-width: 100%; overflow: auto; margin-top: 14px; }
.pothole-borough-table-wrap table { min-width: 650px; }
#boroughLocationsTable { min-width: 1050px; }
.pothole-borough-table-wrap tbody th { min-width: 190px; max-width: 270px; overflow-wrap: anywhere; }
.pothole-borough-table-wrap td { vertical-align: top; }
.pothole-borough-table-wrap a { text-decoration: none; }
.pothole-borough-table-wrap .pothole-icon-button { color: var(--accent-dark); }
.pothole-borough-sort { display: inline-flex; gap: 5px; align-items: center; padding: 0; border: 0; background: none; color: inherit; font: inherit; font-weight: 700; text-align: left; cursor: pointer; }
.pothole-borough-sort svg { width: 13px; height: 13px; flex: 0 0 13px; }
.pothole-borough-section-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.pothole-borough-section-heading .field { max-width: 100%; }
@media (max-width: 1000px) {
  #boroughCharts { grid-template-columns: minmax(0, 1fr); }
  .pothole-borough-chart { grid-row: auto; grid-template-rows: none; }
}
@media (max-width: 600px) {
  .pothole-chart-controls.pothole-borough-controls { grid-template-columns: minmax(0, 1fr); max-width: 350px; }
  .pothole-borough-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  #statisticsBoroughs .pothole-pagination { padding-inline: 0; }
}
#statisticsChartsContent { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); column-gap: 32px; }
.pothole-analysis { position: relative; min-width: 0; display: grid; grid-column: span 3; grid-row: span 3; grid-template-columns: minmax(0, 1fr); grid-template-rows: subgrid; align-items: start; gap: 16px; padding: 28px 0; border-bottom: 1px solid var(--line); }
.pothole-analysis[data-analysis="concentration"] { grid-column: span 2; }
.pothole-analysis[data-analysis="districts"] { grid-column: span 4; }
.pothole-analysis-copy, .pothole-analysis-plot { min-width: 0; }
.pothole-analysis h3 { margin: 0 0 18px; font-size: 1.2rem; line-height: 1.35; }
.pothole-analysis-metric { margin: 0 0 8px; font-size: 2rem; font-weight: 750; line-height: 1.2; font-variant-numeric: tabular-nums; color: #963e51; }
.pothole-analysis-statement { font-size: 0.95rem; line-height: 1.55; }
.pothole-analysis-note { margin-top: 16px; font-size: 0.8rem; color: var(--muted); }
.pothole-analysis-plot { position: relative; height: var(--analysis-height, 300px); }
.pothole-analysis-viewport { min-width: 0; width: 100%; overflow: hidden; }
.pothole-analysis[data-analysis="unpatched"] .pothole-analysis-viewport { overflow: visible; }
.pothole-polar-outer-label { position: absolute; transform: translate(-50%, -50%); color: #506256; font-size: 10px; line-height: 1; white-space: nowrap; pointer-events: none; }
.pothole-analysis[data-analysis="districts"] .pothole-analysis-viewport { overflow-x: auto; }
.pothole-analysis[data-analysis="districts"] .pothole-analysis-plot { min-width: 960px; }
.pothole-analysis-plot canvas { width: 100%; height: 100%; }
.pothole-analysis-empty { padding: 24px 0; color: var(--muted); }
.pothole-analysis-values { grid-column: 1 / -1; min-width: 0; }
.pothole-analysis-values summary { cursor: pointer; width: fit-content; font-weight: 650; font-size: 0.84rem; }
.pothole-analysis-values.is-accessible-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.pothole-analysis-table-wrap { max-width: 100%; overflow: auto; margin-top: 12px; }
.pothole-analysis-values .pothole-statistics-table { min-width: 360px; }
@media (max-width: 1000px) {
  #statisticsChartsContent { grid-template-columns: minmax(0, 1fr); }
  .pothole-analysis, .pothole-analysis[data-analysis="concentration"], .pothole-analysis[data-analysis="districts"] { grid-column: auto; grid-row: auto; grid-template-rows: none; gap: 18px; }
  .pothole-analysis h3 { margin-bottom: 12px; }
}
.pothole-document-intro { padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.pothole-document-intro h2 { font-size: 1.6rem; line-height: 1.25; margin-bottom: 10px; }
.pothole-document-lead { max-width: 800px; font-size: 1rem; }
#statisticsView .pothole-document-lead { max-width: none; }
.pothole-document-meta { color: var(--muted); font-size: 0.8rem; margin-top: 12px; }
.pothole-reading-facts, .pothole-statistics-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin: 0; padding: 24px 0; border-bottom: 1px solid var(--line); }
.pothole-reading-facts dt { font-weight: 750; font-size: 0.88rem; }
.pothole-reading-facts dd { margin: 4px 0 0; color: var(--muted); font-size: 0.86rem; }
.pothole-document-nav { display: flex; flex-wrap: wrap; gap: 8px 22px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.pothole-document a { color: var(--accent-dark); text-decoration: underline; text-underline-offset: 3px; }
.pothole-document-nav a { font-weight: 650; font-size: 0.86rem; }
.pothole-document-section { padding: 28px 0; border-bottom: 1px solid var(--line); scroll-margin-top: 16px; }
.pothole-document-section > h2 { font-size: 1.25rem; line-height: 1.3; margin-bottom: 16px; }
#howView .pothole-document-section > h2 { text-align: center; font-size: 1.4rem; margin-bottom: 20px; }
.pothole-document-section details { border-top: 1px solid var(--line); }
.pothole-document-section details:last-child { border-bottom: 1px solid var(--line); }
.pothole-document-section summary { cursor: pointer; padding: 15px 4px; font-size: 0.98rem; font-weight: 650; line-height: 1.45; }
.pothole-answer { padding: 0 4px 18px; max-width: 850px; color: #34453c; font-size: 0.94rem; overflow-wrap: anywhere; }
.pothole-answer p + p { margin-top: 12px; }
.pothole-document-links { padding-left: 22px; margin-bottom: 0; }
.pothole-document-links li + li { margin-top: 5px; }
.pothole-status-definitions { margin: 8px 0 18px; display: grid; gap: 18px; }
.pothole-status-definitions dt { display: flex; align-items: center; gap: 9px; font-weight: 750; }
.pothole-status-definitions dd { margin: 5px 0 0 19px; }
.pothole-example-label { margin-top: 20px; font-weight: 650; font-size: 0.78rem; color: var(--muted); }
.pothole-example-timeline { list-style: none; padding: 0; margin: 14px 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.pothole-example-timeline li { display: grid; align-content: start; gap: 6px; padding-top: 10px; border-top: 3px solid var(--pothole-report); }
.pothole-example-timeline li.presumed-repaired { border-color: var(--pothole-presumed); }
.pothole-example-timeline time { color: var(--muted); font-size: 0.78rem; }
.pothole-example-timeline strong { font-size: 0.92rem; }
.pothole-example-timeline span { font-size: 0.82rem; }
.pothole-document-highlight { padding: 12px 14px; border-left: 3px solid var(--accent); background: #f0f6f2; font-size: 0.9rem; margin: 16px 0; }
.pothole-statistics-metrics dt { color: var(--muted); font-size: 0.84rem; }
.pothole-statistics-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
#statisticsData { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 32px; border-bottom: 1px solid var(--line); }
#statisticsMetrics { grid-column: 1 / -1; }
#statisticsData > .pothole-document-section { min-width: 0; display: grid; grid-row: span 4; grid-template-rows: subgrid; align-items: start; border-bottom: 0; }
.pothole-statistics-metrics dd { margin: 6px 0 0; font-size: 2rem; line-height: 1.2; font-weight: 750; font-variant-numeric: tabular-nums; }
.pothole-table-scroll { overflow: auto; margin-top: 16px; scrollbar-gutter: stable; scrollbar-width: auto; scrollbar-color: #587966 #edf2ef; }
.pothole-table-scroll.has-year-overflow { overflow-y: scroll; }
.pothole-table-scroll::-webkit-scrollbar { width: 12px; height: 12px; }
.pothole-table-scroll::-webkit-scrollbar-track { background: #edf2ef; }
.pothole-table-scroll::-webkit-scrollbar-thumb { background: #587966; border: 2px solid #edf2ef; border-radius: 6px; }
.pothole-table-scroll::-webkit-scrollbar-corner { background: #edf2ef; }
.pothole-statistics-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; font-variant-numeric: tabular-nums; }
.pothole-statistics-table th, .pothole-statistics-table td { padding: 11px 12px; border: 0; border-bottom: 1px solid var(--line); text-align: left; }
.pothole-statistics-table thead th { position: sticky; top: 0; z-index: 3; color: var(--muted); background: #f3f6f4; font-size: 0.78rem; box-shadow: 0 1px 0 var(--line); }
.pothole-statistics-table tbody th { background: none; font-weight: 650; }
.pothole-table-sort { display: flex; align-items: center; justify-content: space-between; gap: 5px; width: 100%; min-height: 32px; padding: 0; border: 0; background: transparent; color: var(--accent-dark); font-weight: 700; text-align: left; cursor: pointer; }
.pothole-table-sort span { min-width: 0; overflow-wrap: anywhere; }
.pothole-table-sort svg { width: 15px; height: 15px; flex: 0 0 15px; }
.pothole-column-filter { display: block; width: 100%; min-width: 0; max-width: 180px; min-height: 32px; margin-top: 5px; padding: 3px 5px; border: 1px solid #b7c7be; border-radius: 4px; background: #fff; color: var(--ink); font-size: 0.75rem; text-overflow: ellipsis; }
.pothole-statistics-table td.pothole-stat-volume { position: relative; width: 27%; }
.pothole-stat-volume > span:last-child { position: relative; z-index: 1; }
.pothole-stat-track { position: absolute; inset: 7px 12px; pointer-events: none; }
.pothole-stat-bar { display: block; height: 100%; background: #efc8cf; max-width: 100%; }
.pothole-stat-information .pothole-stat-bar { background: #d9ebe2; }

.pothole-ranking-intro { padding: 28px 0 8px; }
.pothole-ranking-intro h2 { font-size: 1.35rem; line-height: 1.3; margin-bottom: 12px; }
.pothole-ranking-method { margin-top: 14px; color: var(--muted); font-size: 0.82rem; }
.pothole-ranking-method summary { cursor: pointer; font-weight: 650; }
.pothole-ranking-method p { margin-top: 10px; }
.pothole-ranking-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 32px; padding: 28px 0; border-bottom: 1px solid var(--line); }
.pothole-ranking-panel { min-width: 0; display: grid; grid-row: span 3; grid-template-rows: subgrid; align-items: start; }
.pothole-ranking-panel h3 { font-size: 1.1rem; line-height: 1.35; margin: 0 0 12px; }
.pothole-ranking-note { font-size: 0.84rem; color: var(--muted); }
.pothole-ranking-table thead tr { height: var(--ranking-header-height, auto); }
.pothole-ranking-table tbody tr { height: var(--ranking-row-height, auto); }
.pothole-ranking-table th:first-child { width: 45%; }
.pothole-ranking-table tbody th { min-width: 140px; overflow-wrap: anywhere; }
.pothole-ranking-table tbody th, .pothole-ranking-table tbody td { vertical-align: top; }
.pothole-ranking-place { display: block; }
.pothole-ranking-meta { display: block; color: var(--muted); font-size: 0.72rem; line-height: 1.45; font-weight: 400; margin-top: 4px; }

@media (max-width: 1100px) {
  .pothole-toolbar-heading { grid-template-columns: minmax(0, 1fr); gap: 10px; }
}

@media (min-width: 1001px) {
  .pothole-statistics-table thead th { height: 4rem; }
}

@media (max-width: 1000px) {
  #statisticsData { grid-template-columns: minmax(0, 1fr); }
  #statisticsData > .pothole-document-section { display: block; grid-row: auto; }
  .pothole-ranking-pair { grid-template-columns: minmax(0, 1fr); row-gap: 28px; }
  .pothole-ranking-panel { display: block; grid-row: auto; }
}

@media (max-width: 600px) {
  .potholes-page .pothole-statistics-nav { gap: 4px; }
  .pothole-document .pothole-statistics-nav a { min-width: 0; padding: 6px 4px; font-size: 0.8rem; }
  .pothole-content { padding: 22px 16px 40px; }
  .pothole-document-intro h2 { font-size: 1.25rem; }
  .pothole-reading-facts, .pothole-statistics-metrics, .pothole-example-timeline { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .pothole-document-section { padding: 22px 0; }
  .pothole-document-section summary { font-size: 0.92rem; }
  .pothole-statistics-metrics dd { font-size: 1.6rem; }
  .pothole-statistics-table th, .pothole-statistics-table td { padding: 9px 7px; }
  .pothole-stat-track { inset: 7px; }
  .pothole-ranking-table { min-width: 360px; }
}