/* Shared glass treatment. Layout and touch-target sizes remain in site/map.css. */
:root {
  --glass: linear-gradient(135deg, #ffffffb8, #ffffff61);
  --glass-readable: linear-gradient(135deg, #fffffff0, #ffffffc7);
  --glass-edge: #ffffffc2;
  --glass-shadow: inset 0 1px 0 #ffffffed, inset 0 -1px 0 #ffffff40,
    0 6px 22px #263c4910;
  --glass-filter: blur(16px) saturate(1.2);
}
body {
  background-color: #edf2f2;
  background-image:
    radial-gradient(ellipse at 0% 0%, #f7dce4b3, transparent 48%),
    radial-gradient(ellipse at 100% 20%, #d9e9efb3, transparent 52%),
    linear-gradient(150deg, #f3f7f5, #e8f0ee);
  background-attachment: fixed;
}
.site-header {
  background: var(--glass);
  border-color: var(--glass-edge);
  box-shadow: inset 0 -1px 0 #ffffff80, 0 4px 20px #263c4908;
  -webkit-backdrop-filter: var(--glass-filter);
  backdrop-filter: var(--glass-filter);
}
.brand-icon {
  background: linear-gradient(145deg, #fff9, #f9d9e380);
  box-shadow: var(--glass-shadow);
  border: 1px solid var(--glass-edge);
}
.button,
.site-header nav > a,
.chip {
  border-radius: 999px;
}
.button,
.icon-button,
.site-header nav > a,
.guide-card {
  transition: background-color 160ms, box-shadow 160ms, border-color 160ms;
}
.secondary,
.icon-button {
  background: var(--glass);
  border-color: var(--glass-edge);
  box-shadow: var(--glass-shadow);
}
.secondary:hover,
.icon-button:hover,
.site-header nav > a:hover {
  background: #ffffffbd;
  box-shadow: var(--glass-shadow);
}
.site-header nav > a[aria-current],
.chip {
  background: linear-gradient(135deg, #fff7f9e6, #f7dbe480);
  box-shadow: inset 0 1px 0 white, 0 2px 8px #a62c4510;
}
.primary,
.search-box button {
  background: linear-gradient(160deg, #c63451, #ad2641);
  box-shadow: inset 0 1px 0 #ffffff5c, 0 3px 10px #a62c4526;
}
.primary:hover,
.search-box button:hover {
  background: linear-gradient(160deg, #b82d48, #9e1d37);
}
input:not([type="checkbox"]),
select {
  background: #ffffffa6;
  border-color: #aebbc6;
  border-radius: 14px;
  box-shadow: inset 0 1px 3px #263c4908, 0 1px 0 #ffffffc2;
}
dialog {
  background: var(--glass-readable);
  border-color: var(--glass-edge);
  border-radius: 24px;
  box-shadow: inset 0 1px 0 white, 0 24px 80px #263c4933;
  -webkit-backdrop-filter: var(--glass-filter);
  backdrop-filter: var(--glass-filter);
}
dialog::backdrop {
  background: #27384540;
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}
.dialog-heading {
  border-color: #c9d4d880;
}
#updates-dialog {
  width: min(464px, calc(100% - 32px));
  background: linear-gradient(140deg, #fffffff0, #f6f9fbe6);
}
.signup-content {
  position: relative;
  padding: 32px 30px 16px;
}
.signup-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin-bottom: 22px;
  color: var(--accent);
  border: 1px solid #ffffffd9;
  border-radius: 16px;
  background: linear-gradient(140deg, #fff, #f6dce594);
  box-shadow: var(--glass-shadow);
}
.signup-close {
  position: absolute;
  top: 16px;
  right: 16px;
}
#updates-title {
  font-size: 32px;
  line-height: 1.15;
  letter-spacing: -1px;
  margin: 0 0 12px;
}
.signup-lede {
  font-size: 14px;
  line-height: 1.65;
  color: var(--muted);
  max-width: 330px;
  margin: 0 0 24px;
}
#signup-container {
  width: 100%;
  max-width: 400px;
  margin-inline: auto;
}
.signup-note {
  margin: 12px 0 14px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--muted);
}
.signup-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid #d2dade80;
  padding-top: 6px;
}
.signup-footer .text-button {
  padding-inline: 0;
}
.signup-footer a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 11px;
  color: var(--muted);
}
#signup-feedback {
  margin: 12px 0 0;
  color: #23583e;
}
.guide-card,
.toc,
.district,
.table-wrap,
.article-cta,
.help-card,
.fine-result {
  background: var(--glass-readable);
  border: 1px solid var(--glass-edge);
  border-radius: 20px;
  box-shadow: var(--glass-shadow);
}
.guide-card {
  border-radius: 24px;
}
.guide-card:hover {
  box-shadow: inset 0 1px 0 white, 0 12px 30px #263c491c;
}
.guide-art {
  background: linear-gradient(135deg, #f7dbe4b3, #fff6);
}
.guide-art.map-art {
  background-color: #dcece580;
}
.callout {
  background: linear-gradient(120deg, #fff4f7db, #fff9);
  box-shadow: inset 0 1px 0 white;
  border-radius: 4px 16px 16px 4px;
}
th {
  background: #e7eeefb3;
}
/* Map surfaces use the same material without adding another overlay. */
.discovery {
  background: #ffffff38;
  border-color: #ffffffa6;
  box-shadow: inset -1px 0 0 #ffffff80;
}
.search-panel {
  background: var(--glass);
  box-shadow: inset 0 1px 0 #ffffffb3;
}
.search-box {
  background: var(--glass-readable);
  border: 1px solid #aebbc6;
  border-radius: 999px;
  box-shadow: inset 0 1px 0 white, 0 4px 14px #263c490a;
}
.search-box input {
  background: transparent;
  border: 0;
  box-shadow: none;
}
.search-box button {
  border-radius: 50%;
}
.results-heading,
.panel-footer,
.camera-list {
  background: #ffffff38;
  border-color: #d2dade80;
}
.camera-row {
  background: transparent;
  border-color: #cdd7dc80;
  border-radius: 14px;
}
.camera-row:hover {
  background: #ffffff80;
}
.camera-row[aria-pressed="true"] {
  background: linear-gradient(120deg, #fff4f7eb, #f5dce57a);
  box-shadow: inset 3px 0 var(--accent), inset 0 1px 0 white;
}
.camera-row .speed,
.speed-badge {
  background: #ffffff70;
  border-color: var(--glass-edge);
  border-radius: 12px;
  box-shadow: inset 0 1px 0 #fff9;
}
.map-notice {
  background: #ffffff80;
  border-color: var(--glass-edge);
}
.camera-details,
.map-status {
  background: var(--glass-readable);
  border-color: var(--glass-edge);
  box-shadow: inset 0 1px 0 white, 0 12px 32px #263c491c;
  -webkit-backdrop-filter: var(--glass-filter);
  backdrop-filter: var(--glass-filter);
}
.camera-details {
  border-radius: 24px;
}
.area-button,
.leaflet-control-zoom {
  background: var(--glass);
  border-color: var(--glass-edge) !important;
  box-shadow: var(--glass-shadow) !important;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.leaflet-control-zoom {
  border-radius: 22px !important;
}
.leaflet-control-zoom a {
  background: transparent;
  border-color: #ffffff80;
}
.leaflet-control-zoom a:hover {
  background: #ffffffa6;
}
/* The key stays clearer than other surfaces so roads show through it. */
.map-legend {
  background: rgb(255 255 255 / 40%);
  border-color: rgb(255 255 255 / 28%);
  box-shadow: inset 0 1px 0 #ffffff61;
  -webkit-backdrop-filter: blur(1px);
  backdrop-filter: blur(1px);
}
.map-legend .legend-title > span,
.map-legend .legend-note {
  color: #3c4a55;
}
.map-legend .legend-title,
.map-legend .legend-items {
  text-shadow: 0 1px 2px #ffffffb3;
}
.mobile-nav {
  display: none;
}
.updates-nav {
  color: var(--accent);
}
@media (max-width: 768px) {
  .signup-content {
    padding: 24px 20px 12px;
  }
  .site-header {
    height: 52px;
    flex-shrink: 0;
  }
  /* Reserve the dropdown's space so it cannot partially cover map controls. */
  .site-header:has(.mobile-nav[open]) {
    height: 260px;
    align-items: flex-start;
    padding-top: 4px;
  }
  .site-header nav {
    gap: 6px;
  }
  .site-header nav > a {
    display: none;
  }
  .updates-nav {
    display: inline-flex;
    margin-left: 0;
    padding: 10px 12px;
    font-size: 11px;
  }
  .updates-nav > span {
    display: none;
  }
  .mobile-nav {
    display: block;
    position: relative;
  }
  .mobile-nav > summary {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 1px solid var(--glass-edge);
    border-radius: 50%;
    background: var(--glass);
    box-shadow: var(--glass-shadow);
    font-size: 18px;
    list-style: none;
  }
  .mobile-nav > summary::-webkit-details-marker {
    display: none;
  }
  .mobile-nav > div {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 200px;
    padding: 8px;
    border: 1px solid var(--glass-edge);
    border-radius: 18px;
    background: var(--glass-readable);
    box-shadow: var(--glass-shadow);
    -webkit-backdrop-filter: var(--glass-filter);
    backdrop-filter: var(--glass-filter);
  }
  .mobile-nav a {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 8px 12px;
    border-radius: 12px;
    color: var(--ink);
    font-size: 13px;
    text-decoration: none;
  }
  .mobile-nav a:hover {
    background: #ffffffa6;
  }
  .search-panel {
    padding: 6px 12px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 4px 8px;
  }
  #search-form {
    grid-column: 1 / -1;
    min-width: 0;
  }
  .search-panel label[for="search"] {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .filter-toolbar {
    display: contents;
  }
  #filter-toggle {
    grid-column: 1;
    grid-row: 2;
    align-self: center;
  }
  #filter-chips {
    grid-column: 2;
    grid-row: 2;
    padding: 0;
    min-width: 0;
    flex-wrap: nowrap;
    align-items: center;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
  }
  .chip {
    flex-shrink: 0;
    white-space: nowrap;
    min-height: 44px;
  }
  #filters {
    grid-column: 1 / -1;
    grid-row: 3;
  }
  .results-heading {
    min-height: 28px;
    padding: 4px 12px;
  }
  .results-heading > div {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 2px 8px;
  }
  .results-heading h2 {
    margin: 0;
    font-size: 11px;
  }
  .explorer[data-view="map"].details-open .results-heading {
    display: none;
  }
  .map-notice {
    padding: 4px 12px;
  }
  .map-notice summary {
    min-height: 24px;
    display: flex;
    align-items: center;
  }
  .view-switch {
    grid-column: 3;
    grid-row: 2;
    background: #d9e3e666;
    border-color: #ffffffb3;
    border-radius: 999px;
    box-shadow: inset 0 1px 3px #263c490a;
    padding: 2px;
  }
  .view-switch button {
    border-radius: 999px;
    min-height: 44px;
  }
  .view-switch button[aria-pressed="true"] {
    background: var(--glass-readable);
    box-shadow: var(--glass-shadow);
  }
  .camera-details {
    border-radius: 22px 22px 0 0;
    padding-block: 8px max(4px, env(safe-area-inset-bottom));
  }
}
/* Solid fallbacks preserve legibility without transparency support/preferences. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root {
    --glass: #f7f9fa;
    --glass-readable: #fff;
  }
}
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  :root {
    --glass: #f7f9fa;
    --glass-readable: #fff;
    --glass-edge: #aebbc6;
    --glass-filter: none;
  }
  .map-legend,
  .map-notice,
  .discovery,
  .camera-list,
  .results-heading,
  .panel-footer {
    background: #fff;
  }
  .map-legend,
  .area-button,
  .leaflet-control-zoom,
  dialog::backdrop {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .button,
  .icon-button,
  .site-header nav > a,
  .guide-card {
    transition: none;
  }
}

@media (max-width: 768px) {
  #status-panel { grid-column: 1 / -1; grid-row: 2; background: transparent; }
  #filter-toggle, #filter-chips, .view-switch { grid-row: 3; }
  #filters { grid-row: 4; }
}
/* Mobile: reveal secondary information only when requested. */
#status-toggle { display: none; }
#status-panel[hidden] { display: none; }
@media (max-width: 768px) {
  .map-page .updates-nav { display: none; }
  .mobile-nav button {
    display: flex; align-items: center; width: 100%; min-height: 44px;
    padding: 8px 12px; border: 0; border-radius: 12px;
    background: transparent; color: var(--ink); font: inherit; font-size: 13px; text-align: left;
  }
  .search-panel { grid-template-columns: auto auto minmax(0, 1fr) auto; }
  #filter-toggle { grid-column: 1; grid-row: 2; }
  #status-toggle { display: inline-flex; grid-column: 2; grid-row: 2; align-self: center; min-height: 44px; padding: 8px 12px; }
  #filter-chips { grid-column: 3; grid-row: 2; }
  .view-switch { grid-column: 4; grid-row: 2; }
  #status-panel { grid-column: 1 / -1; grid-row: 3; display: flex; flex-direction: column; align-items: stretch; gap: 4px; }
  #status-panel[hidden] { display: none; }
  #status-panel .status-heading { position: static; width: auto; height: auto; overflow: visible; clip-path: none; justify-content: space-between; }
  #status-panel .status-freshness { display: block; padding: 6px 0; background: transparent; }
  #status-panel .map-notice { display: flex; padding: 6px 0; border: 0; background: transparent; }
  #filters { grid-row: 4; }
  .results-heading { min-height: 28px; }
}

/* Keep the subject visible on phones while preserving compact map controls. */
@media (max-width: 768px) {
  .search-panel { padding-block: 0; row-gap: 2px; }
  .search-panel .eyebrow { display: block; grid-column: 1 / -1; grid-row: 1; margin: 0; font-size: 10px; line-height: 12px; }
  #search-form { grid-row: 2; }
  #filter-toggle, #status-toggle, #filter-chips, .view-switch { grid-row: 3; }
  #status-panel { grid-row: 4; }
  #filters { grid-row: 5; }
}

/* Social landing: one status line above the search box and a signup button
   directly under it. On phones both take their own grid row in the compact
   search panel, and step aside while a selected location is open. */
.live-line { margin: -14px 0 14px; font-size: 13px; font-weight: 600; color: var(--ink); }
.alerts-cta { width: 100%; min-height: 44px; margin-top: 10px; justify-content: center; text-align: center; }
@media (max-width: 768px) {
  .live-line { grid-column: 1 / -1; grid-row: 2; margin: 0; font-size: 12px; line-height: 16px; }
  #search-form { grid-row: 3; }
  .alerts-cta { grid-column: 1 / -1; grid-row: 4; margin: 2px 0; }
  #filter-toggle, #status-toggle, #filter-chips, .view-switch { grid-row: 5; }
  #status-panel { grid-row: 6; }
  #filters { grid-row: 7; }
}
