/* Keep search controls and filters inside the map sidebar at every width. */
.map-layout,
.map-sidebar,
.sidebar-top,
.station-results {
  min-width: 0;
}

.filter-row {
  min-width: 0;
  max-width: 100%;
  flex-wrap: wrap;
  overflow: visible;
}

.filter-row > * {
  max-width: 100%;
}

.filter-row select.filter-chip {
  min-width: 0;
}

.search-wrap {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
  height: 48px;
}

.search-wrap input[type="search"] {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 48px;
  padding: 0 46px 0 43px;
  line-height: normal;
  appearance: none;
  -webkit-appearance: none;
}

.search-wrap input[type="search"]::-webkit-search-cancel-button,
.search-wrap input[type="search"]::-webkit-search-decoration,
.search-wrap input[type="search"]::-webkit-search-results-button,
.search-wrap input[type="search"]::-webkit-search-results-decoration,
.search-wrap input[type="search"]::-ms-clear {
  display: none;
  width: 0;
  height: 0;
  appearance: none;
  -webkit-appearance: none;
}

.search-icon {
  top: 50%;
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  transform: translateY(-50%);
  line-height: 0;
  pointer-events: none;
}

.search-icon svg {
  display: block;
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.search-wrap [data-clear-search] {
  top: 50%;
  right: 6px;
  display: grid;
  width: 34px;
  height: 34px;
  padding: 0;
  place-items: center;
  transform: translateY(-50%);
  line-height: 0;
}

.search-wrap [data-clear-search] svg {
  display: block;
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.search-wrap [data-clear-search]:hover {
  color: var(--brand);
}

.search-wrap [data-clear-search]:focus-visible {
  outline: 3px solid #c98219;
  outline-offset: 1px;
}

/* Switch to the compact menu before desktop links become crowded. */
@media (max-width: 1120px) {
  .site-header {
    gap: 10px;
  }

  .brand {
    min-width: 0;
    flex: 1;
  }

  .main-nav,
  .header-actions .header-manage {
    display: none;
  }

  .header-actions {
    gap: 8px;
  }

  .header-actions .button {
    min-height: 38px;
    padding: 7px 10px;
    font-size: 11px;
  }

  .theme-toggle {
    width: 38px;
    height: 38px;
  }

  .mobile-menu-button {
    display: flex;
    width: 38px;
    height: 38px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: #fff;
  }

  .mobile-menu-button span {
    width: 16px;
    height: 2px;
    border-radius: 3px;
    background: #425951;
  }

  .mobile-nav {
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    z-index: 55;
    display: flex;
    flex-direction: column;
    padding: 10px 14px 14px;
    border-bottom: 1px solid var(--line);
    background: #fff;
    box-shadow: 0 15px 24px rgba(32, 62, 44, .1);
  }

  .mobile-nav[hidden] {
    display: none;
  }

  .mobile-nav a {
    padding: 11px 7px;
    border-bottom: 1px solid #edf1ee;
    color: #4b5c53;
    font-weight: 650;
  }
}

@media (max-width: 760px) {
  .search-wrap {
    height: 43px;
  }

  .search-wrap input[type="search"] {
    height: 43px;
    font-size: 14px;
  }
}

/* PMR Radio equipment-inspired visual system. */
:root {
  --ink: #192a2b;
  --muted: #596862;
  --line: #ccd6e4;
  --panel: #fff;
  --canvas: #f1f4f1;
  --brand: #315744;
  --brand-soft: #e6eee9;
}

.site-header,
html[data-theme="dark"] .site-header {
  background: #192a2b;
  border-bottom: 3px solid #315744;
}

.site-header .brand-copy strong {
  letter-spacing: .08em;
  text-transform: uppercase;
}

.brand-mark,
.admin-brand-mark {
  border-radius: 6px;
}

.site-header .main-nav a {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.site-header .icon-button,
.site-header .mobile-menu-button,
.site-header .button,
.mobile-menu-button {
  border-radius: 5px;
}

.site-header .button-primary {
  border: 1px solid #91ad9c;
  border-radius: 5px;
  background: #315744;
  color: #fff;
  box-shadow: none;
}

.site-header .button-primary:hover {
  border-color: #fff;
  background: #264a39;
  color: #fff;
}

.mobile-nav,
html[data-theme="dark"] .mobile-nav {
  border-top: 1px solid rgba(255,255,255,.14);
  border-bottom-color: rgba(255,255,255,.2);
  background: #192a2b;
}

.map-sidebar .sidebar-top {
  border-bottom: 3px solid #c98219;
  background: #192a2b;
}

.map-sidebar .search-wrap input[type="search"] {
  border-radius: 5px;
}

.page-hero,
.panel,
.content-page .content-panel,
.content-card,
.station-card,
.group-card,
.net-card,
.stat-card,
.results-empty {
  border-radius: 7px;
}

.page-hero {
  padding: clamp(20px, 3.5vw, 34px);
  border: 1px solid var(--line);
  border-left: 5px solid #315744;
  background: var(--panel);
  box-shadow: 0 8px 22px rgba(25,42,43,.06);
}

.page-hero .eyebrow {
  color: #98600a;
}

.button,
.filter-chip,
.icon-button,
.channel-option,
.area-link,
.avatar-choice label,
.station-modal-close {
  border-radius: 5px;
}

.form-field input,
.form-field select,
.form-field textarea,
.search-wrap input[type="search"] {
  border-radius: 5px;
}

.channel-chip {
  border: 1px solid #d2ddd6;
  border-left: 3px solid #315744;
  border-radius: 3px;
  background: #f1f4f1;
  color: #365747;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  letter-spacing: .025em;
}

.channel-chip.channel-highlight {
  border-color: #e2c27e;
  border-left-color: #c98219;
  background: #fff5df;
  color: #67420a;
}

.filter-chip[aria-pressed="true"] {
  border-color: #315744;
  background: #e6eee9;
  color: #264a39;
}

.map-marker,
.community-map-marker,
.map-cluster,
.map-control,
.metric-pill {
  border-radius: 5px;
}

.map-cluster {
  border: 2px solid #fff;
  background: #315744;
}

.station-avatar {
  border: 1px solid #ccd8ea;
  border-radius: 7px;
  background: #e7efe9;
}

.site-header :focus-visible,
.mobile-nav a:focus-visible,
.button:focus-visible,
.area-link:focus-visible {
  outline: 3px solid #c98219;
  outline-offset: 2px;
}

.station-modal,
.station-modal-card {
  border-radius: 8px;
}

html[data-theme="dark"] .page-hero,
html[data-theme="dark"] .panel,
html[data-theme="dark"] .content-page .content-panel,
html[data-theme="dark"] .content-card,
html[data-theme="dark"] .stat-card {
  border-color: #43564d;
  background: #1c2a29;
}

html[data-theme="dark"] .page-hero .eyebrow {
  color: #ffc45f;
}

/* PMR Radio brand treatment from the main site. */
.site-header,
html[data-theme="dark"] .site-header {
  background: #315744;
  border-bottom-color: rgba(255, 255, 255, .22);
}

.site-header .brand,
.site-header .brand-copy strong,
.site-header .main-nav a,
.site-header .header-manage {
  color: #fff;
}

.site-header .brand-copy small {
  color: rgba(255, 255, 255, .78);
}

.site-header .main-nav a:hover,
.site-header .header-manage:hover {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 5px;
}

.site-header .icon-button,
.site-header .mobile-menu-button {
  border-color: rgba(255, 255, 255, .75);
  background: transparent;
  color: #fff;
}

.site-header .mobile-menu-button span {
  background: #fff;
}

.site-header .button-primary {
  border-color: #fff;
  background: transparent;
  color: #fff;
  box-shadow: none;
}

.site-header .button-primary:hover {
  background: #fff;
  color: #315744;
}

.mobile-nav,
html[data-theme="dark"] .mobile-nav {
  border-bottom-color: rgba(255, 255, 255, .25);
  background: #315744;
}

.mobile-nav a,
html[data-theme="dark"] .mobile-nav a {
  border-bottom-color: rgba(255, 255, 255, .18);
  color: #fff;
}

.map-sidebar .sidebar-top {
  background: #315744;
  color: #fff;
}

.map-sidebar .sidebar-top .eyebrow,
.map-sidebar .sidebar-heading h1 {
  color: #fff;
}

.map-sidebar .search-wrap input[type="search"] {
  border-color: rgba(255, 255, 255, .82);
  background: #fff;
  color: #1c2928;
}

.map-sidebar .search-icon {
  color: #315744;
}

/* Accessible station preview opened from a map marker. */
.station-modal {
  width: 92vw;
  width: min(92vw, 560px);
  max-width: 560px;
  max-height: 88vh;
  max-height: min(88vh, 760px);
  margin: auto;
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 22px;
  background: transparent;
  color: var(--ink);
}

/* Keep the empty fallback dialog hidden in browsers without native <dialog>. */
.station-modal:not([open]) {
  display: none;
}

.station-modal::backdrop {
  background: rgba(10, 23, 52, .62);
  backdrop-filter: blur(3px);
}

.station-modal-card {
  position: relative;
  max-height: 88vh;
  max-height: min(88vh, 760px);
  overflow: auto;
  padding: clamp(22px, 5vw, 34px);
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: 0 24px 70px rgba(7, 22, 54, .28);
}

.station-modal-close {
  position: absolute;
  top: 13px;
  right: 13px;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--panel);
  color: var(--ink);
  font-size: 22px;
  cursor: pointer;
}

.station-modal-heading {
  display: flex;
  align-items: center;
  gap: 15px;
  padding-right: 40px;
}

.station-modal-heading .station-avatar {
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
  font-size: 34px;
}

.station-modal-heading h2 {
  margin: 2px 0 3px;
  font-size: clamp(21px, 5vw, 28px);
  line-height: 1.15;
}

.station-modal-meta,
.station-modal-detail {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.station-modal-intro {
  margin: 22px 0;
  color: var(--ink);
  white-space: pre-line;
}

.station-modal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 22px;
}

.station-modal-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 11px;
}

/* Visible hierarchy for area and station pages. */
.breadcrumbs {
  width: min(1100px, calc(100% - 36px));
  margin: 0 auto;
  padding: 16px 0 0;
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0;
  padding: 0;
  color: var(--muted);
  font-size: 12px;
  list-style: none;
}

.breadcrumbs li + li::before {
  content: "›";
  margin-right: 7px;
  color: #77877e;
}

.breadcrumbs a {
  color: #315744;
}

.area-section {
  margin: 28px 0 0;
}

.area-section h2 {
  margin: 0 0 12px;
  color: var(--ink);
  font-size: 21px;
}

.area-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.area-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  color: var(--ink);
  font-size: 13px;
}

.area-link:hover {
  border-color: #a6b8ae;
  text-decoration: none;
}

@media (max-width: 760px) {
  .station-modal {
    width: calc(100vw - 24px);
    max-width: none;
  }

  .station-modal-card {
    padding: 22px 18px;
  }

  .breadcrumbs {
    width: calc(100% - 28px);
  }
}

/* Final PMRMap radio-console finish: clear controls, square panels, strong signal accents. */
:root {
  --ink: #192a2b;
  --muted: #596862;
  --line: #d2ddd6;
  --panel: #fff;
  --canvas: #f1f4f1;
  --brand: #315744;
  --brand-soft: #e6eee9;
  --brand-highlight: #c8d7cd;
  --radius: 5px;
}

.site-header,
html[data-theme="dark"] .site-header {
  background: #315744;
  border-bottom: 3px solid #c98219;
  box-shadow: none;
}

.map-sidebar .sidebar-top {
  background: #192a2b;
  border-bottom: 3px solid #c98219;
  color: #fff;
}

.map-sidebar .sidebar-top .eyebrow,
.map-sidebar .sidebar-heading h1 {
  color: #fff;
}

.map-sidebar .sidebar-top .eyebrow {
  color: #ffc45f;
}

.page-hero,
.panel,
.content-page .content-panel,
.content-card,
.content-tile,
.station-card,
.group-card,
.net-card,
.stat-card,
.results-empty,
.profile-stat,
.wizard-preview,
.map-fallback-inner,
.map-popup,
.station-modal,
.station-modal-card,
.station-modal-close,
.button,
.filter-chip,
.icon-button,
.map-control,
.metric-pill,
.form-field input,
.form-field select,
.form-field textarea,
.avatar-choice label,
.channel-option,
.area-link {
  border-radius: 5px;
}

.page-hero,
.content-page .content-panel {
  border-top: 3px solid var(--brand);
  box-shadow: 0 8px 22px rgba(16, 32, 58, .06);
}

.button-primary,
.filter-chip[aria-pressed="true"],
.map-marker,
.map-cluster {
  border-radius: 4px;
}

.map-marker {
  box-shadow: 0 3px 9px rgba(16, 32, 58, .22);
}

.channel-chip,
.channel-option strong,
.key-display {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  letter-spacing: .025em;
}

.channel-chip.channel-highlight {
  border-color: #e2c27e;
  border-left-color: #c98219;
  background: #fff5df;
  color: #67420a;
}

.site-footer {
  border-top: 3px solid #315744;
}

html[data-theme="dark"] .page-hero,
html[data-theme="dark"] .panel,
html[data-theme="dark"] .content-page .content-panel,
html[data-theme="dark"] .content-card,
html[data-theme="dark"] .content-tile,
html[data-theme="dark"] .station-card,
html[data-theme="dark"] .group-card,
html[data-theme="dark"] .net-card,
html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .station-modal-card {
  border-color: #43564d;
  background: #1c2a29;
}

@media (max-width: 760px) {
  .site-header {
    border-bottom-width: 2px;
  }

  .map-layout {
    border-top: 2px solid #c98219;
  }
}

/* Mobile map stays full-screen behind a compact, scrollable filter drawer. */
.station-results.is-hidden {
  display: none;
}

@media (max-width: 760px) {
  .map-page {
    overflow: visible;
  }

  .map-layout {
    position: relative;
    display: block;
    height: calc(100vh - var(--header-h));
    height: calc(100dvh - var(--header-h));
    overflow: hidden;
    isolation: isolate;
  }

  .map-stage {
    position: absolute;
    z-index: 0;
    inset: 0;
    width: 100%;
    height: 100%;
    min-height: 0;
  }

  .map-sidebar {
    position: absolute;
    z-index: 15;
    top: 60px;
    right: 12px;
    left: 12px;
    display: flex;
    max-height: min(58vh, calc(100% - 74px));
    max-height: min(58dvh, calc(100% - 74px));
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    border: 1px solid #d2ddd6;
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 12px 34px rgba(16, 32, 58, .2);
    transition: transform .24s ease, opacity .2s ease;
    -webkit-overflow-scrolling: touch;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    filter: none;
  }

  .map-sidebar.collapsed {
    transform: translateY(calc(-100% - 64px));
    opacity: 0;
    pointer-events: none;
  }

  .map-sidebar .sidebar-top {
    padding: 14px 14px 12px;
  }

  .map-sidebar .sidebar-heading h1 {
    font-size: clamp(18px, 5vw, 21px);
  }

  .map-sidebar .search-wrap {
    margin-top: 13px;
    height: 46px;
  }

  .map-sidebar .search-wrap input[type="search"] {
    height: 46px;
    padding-right: 44px;
    padding-left: 42px;
  }

  .map-sidebar > .filter-row {
    gap: 8px;
    row-gap: 8px;
    padding: 8px 14px 5px;
  }

  .map-sidebar > .sidebar-top + .filter-row {
    padding-top: 12px;
  }

  .map-sidebar > .filter-row + .filter-row {
    padding-top: 7px;
    padding-bottom: 9px;
  }

  .map-sidebar .filter-chip {
    min-height: 40px;
    padding: 8px 11px;
    font-size: 12px;
  }

  .map-sidebar select[data-channel-select] {
    flex: 1 1 150px;
    min-width: 150px;
    max-width: 100%;
  }

  .map-sidebar .filter-toolbar {
    flex: 0 0 auto;
    padding: 3px 14px 9px;
  }

  .map-sidebar .station-results {
    flex: 0 1 auto;
    max-height: min(18vh, 150px);
    max-height: min(18dvh, 150px);
    padding: 0 10px 10px;
    overflow: auto;
  }

  .map-sidebar .results-empty {
    padding: 16px 12px;
  }

  .map-filter-toggle {
    position: absolute;
    z-index: 18;
    top: 10px;
    right: 12px;
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    gap: 7px;
    border: 1px solid #d2ddd6;
    border-radius: 5px;
    padding: 8px 12px;
    background: #fff;
    color: #192a2b;
    box-shadow: 0 5px 16px rgba(16, 32, 58, .16);
    font-size: 12px;
    font-weight: 800;
  }

  .map-filter-toggle span {
    display: inline-block;
    transition: transform .2s ease;
  }

  .map-filter-toggle[aria-expanded="true"] span {
    transform: rotate(180deg);
  }

  .map-filter-toggle:focus-visible,
  .map-sidebar :focus-visible {
    outline: 3px solid #c98219;
    outline-offset: 2px;
  }

  .map-controls {
    bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
  }

  .map-metrics {
    bottom: calc(env(safe-area-inset-bottom, 0px) + 17px);
  }

  .avatar-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 7px;
  }

  .avatar-choice label {
    min-height: 64px;
    padding: 5px 3px;
  }

  .avatar-choice label small {
    text-align: center;
    font-size: 9px;
    line-height: 1.15;
  }
}

@media (max-width: 400px) {
  .map-sidebar {
    right: 8px;
    left: 8px;
  }

  .map-sidebar > .filter-row {
    gap: 6px;
    row-gap: 7px;
    padding-right: 10px;
    padding-left: 10px;
  }

  .map-sidebar .sidebar-top {
    padding-right: 12px;
    padding-left: 12px;
  }

  .map-sidebar select[data-channel-select] {
    flex-basis: 132px;
    min-width: 132px;
  }

  .avatar-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  .map-sidebar,
  .map-filter-toggle span {
    transition: none;
  }
}

/* Earlier layout adjustments; the neutral palette below is the final theme. */
:root {
  color-scheme: light;
  --ink: #1c2928;
  --muted: #596862;
  --line: #d2ddd6;
  --panel: #ffffff;
  --canvas: #f1f4f1;
  --brand: #315744;
  --brand-soft: #e7efe9;
  --brand-highlight: #c9d9ce;
  
  --amber: #9a5f0a;
  --amber-bg: #fff3d9;
  --signal: #c98219;
  --signal-soft: #fff3d9;
  --shadow: 0 12px 32px rgba(25, 42, 43, .12);
  --radius: 5px;
  --header-h: 100px;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --ink: #e5eee8;
  --muted: #b0beb6;
  --line: #405249;
  --panel: #1c2a29;
  --canvas: #111b1d;
  --brand: #91ad9c;
  --brand-soft: #293b32;
  --brand-highlight: #506c59;
  
  --amber: #ffd078;
  --amber-bg: #392b15;
  --signal: #e4ad47;
  --signal-soft: #392b15;
  --shadow: 0 14px 36px rgba(0, 0, 0, .32);
  background: #111b1d;
}

html,
body {
  color: var(--ink);
}

body {
  background: var(--canvas);
}

.site-header,
html[data-theme="dark"] .site-header {
  position: relative;
  display: grid;
  grid-template-columns: minmax(180px, 235px) minmax(180px, 1fr) max-content;
  grid-template-rows: 58px 39px;
  column-gap: clamp(16px, 3vw, 44px);
  row-gap: 0;
  height: var(--header-h);
  min-height: var(--header-h);
  padding: 0 clamp(16px, 4vw, 60px);
  background: #315744;
  border-bottom: 3px solid #c98219;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.site-header > .brand {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
}

.site-header > .main-nav {
  grid-column: 1 / -1;
  grid-row: 2;
  display: flex;
  justify-content: center;
  gap: clamp(16px, 2.8vw, 34px);
  height: 39px;
  border-top: 1px solid rgba(255, 255, 255, .18);
}

.site-header .main-nav a {
  display: inline-flex;
  align-items: center;
  height: 100%;
  border-bottom: 2px solid transparent;
  color: #f2f6f3;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .045em;
  text-transform: uppercase;
  white-space: nowrap;
}

.site-header .main-nav a:hover {
  border-bottom-color: #ffd078;
  color: #fff;
  text-decoration: none;
}

.site-header > .header-search {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  align-items: stretch;
  justify-self: center;
  width: 100%;
  max-width: 650px;
  height: 42px;
  min-width: 0;
  overflow: hidden;
  border: 1px solid #d2ddd6;
  border-radius: 5px;
  background: #fff;
}

.header-search input[type="search"] {
  flex: 1 1 auto;
  width: 0;
  min-width: 0;
  height: 100%;
  padding: 0 13px;
  border: 0;
  border-radius: 0;
  outline: none;
  background: #fff;
  color: #1c2928;
  font-size: 14px;
}

.header-search input[type="search"]:focus-visible {
  outline: 3px solid #c98219;
  outline-offset: -3px;
}

.header-search button {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 86px;
  padding: 0 13px;
  border: 0;
  border-left: 1px solid #d2ddd6;
  border-radius: 0;
  background: #e7efe9;
  color: #264a39;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.header-search button:hover {
  background: #d9e6dd;
}

.header-search button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.site-header > .header-actions {
  grid-column: 3;
  grid-row: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}

.site-header .header-actions .mobile-menu-button {
  display: none;
}

.site-header .header-actions .button-primary {
  min-height: 42px;
  padding: 8px 12px;
  font-size: 12px;
  white-space: nowrap;
}

.site-header .header-actions .theme-toggle {
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
}

.site-header .brand,
.site-header .brand-copy strong,
.site-header .main-nav a,
.site-header .header-manage {
  color: #fff;
}

.site-header .brand-copy small {
  color: #e3ece6;
}

.site-header .brand-mark {
  background: #e7efe9;
  color: #315744;
}

.site-header .icon-button,
.site-header .mobile-menu-button {
  border-color: rgba(255, 255, 255, .72);
  background: transparent;
  color: #fff;
}

.site-header .mobile-menu-button span {
  background: #fff;
}

.site-header .button-primary {
  border-color: #fff;
  background: transparent;
  color: #fff;
  box-shadow: none;
}

.site-header .button-primary:hover {
  background: #fff;
  color: #264a39;
}

.mobile-nav,
html[data-theme="dark"] .mobile-nav {
  border-color: rgba(255, 255, 255, .2);
  background: #192a2b;
}

.mobile-nav a,
html[data-theme="dark"] .mobile-nav a {
  border-color: rgba(255, 255, 255, .14);
  color: #f4f7f5;
}

.map-sidebar .sidebar-top {
  background: #192a2b;
  border-bottom: 3px solid #c98219;
  color: #fff;
}

.map-sidebar .sidebar-top .eyebrow {
  color: #ffd078;
}

.map-sidebar .sidebar-heading h1 {
  color: #fff;
}

.map-sidebar .search-wrap input[type="search"] {
  border-color: #c9d5cd;
  background: #fff;
  color: #1c2928;
}

.map-sidebar .search-icon {
  color: #315744;
}

.map-sidebar .filter-chip[aria-pressed="true"],
.filter-chip[aria-pressed="true"] {
  border-color: #315744;
  background: #e7efe9;
  color: #264a39;
}

.map-sidebar .filter-chip.channel-highlight,
.channel-chip.channel-highlight {
  border-color: #e2c27e;
  background: #fff3d9;
  color: #67420a;
}

.map-marker,
.community-map-marker,
.map-cluster {
  background: #315744;
  box-shadow: 0 4px 13px rgba(25, 42, 43, .22);
}

.community-map-marker.is-net {
  background: #192a2b;
  border-bottom: 3px solid #c98219;
}

.map-controls .map-control:focus-visible,
.map-controls .map-control:hover,
.map-sidebar :focus-visible,
.map-filter-toggle:focus-visible,
.button:focus-visible,
.form-field :focus-visible {
  outline: 3px solid #c98219;
  outline-offset: 2px;
}

.page-hero,
.content-page .content-panel {
  border-top: 3px solid #315744;
}

.site-footer {
  border-top: 3px solid #315744;
}

html[data-theme="dark"] .page-hero,
html[data-theme="dark"] .panel,
html[data-theme="dark"] .content-page .content-panel,
html[data-theme="dark"] .content-card,
html[data-theme="dark"] .content-tile,
html[data-theme="dark"] .station-card,
html[data-theme="dark"] .group-card,
html[data-theme="dark"] .net-card,
html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .station-modal-card,
html[data-theme="dark"] .map-sidebar {
  border-color: #405249;
  background: #1c2a29;
}

html[data-theme="dark"] .map-sidebar .sidebar-top {
  background: #192a2b;
}

html[data-theme="dark"] .map-sidebar .search-wrap input[type="search"] {
  background: #f8faf8;
  color: #1c2928;
}

html[data-theme="dark"] .results-empty,
html[data-theme="dark"] .filter-chip,
html[data-theme="dark"] .map-filter-toggle {
  border-color: #405249;
  background: #293a34;
  color: #e5eee8;
}

/* Keep text at native scale with solid surfaces so browser rasterization stays crisp. */
.site-header,
.map-sidebar,
.mobile-nav {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

@media (max-width: 760px) {
  body {
    font-size: 16px;
    line-height: 1.55;
  }

  .site-footer,
  .site-footer nav a,
  .page-wrap .content-page p,
  .page-wrap .content-page li {
    font-size: 14px;
  }

  .site-header .brand-copy strong {
    font-size: 14px;
  }

  .site-header .brand-copy small {
    font-size: 11px;
  }

  .map-sidebar .eyebrow {
    font-size: 10px;
  }

  .map-sidebar .sidebar-heading h1 {
    font-size: clamp(20px, 5.2vw, 23px);
    line-height: 1.2;
  }

  .map-sidebar .search-wrap input[type="search"] {
    font-size: 16px;
  }

  .map-sidebar .filter-chip {
    min-height: 42px;
    font-size: 13px;
  }

  .map-sidebar .filter-toolbar,
  .map-filter-toggle {
    font-size: 13px;
  }

  .map-filter-toggle {
    min-height: 44px;
    border-color: #cbd6ce;
    box-shadow: 0 5px 16px rgba(25, 42, 43, .16);
  }

  .map-sidebar .results-empty,
  .map-sidebar .results-empty strong {
    font-size: 14px;
    line-height: 1.5;
  }

  .map-sidebar .station-location,
  .map-sidebar .station-schedule,
  .map-sidebar .station-trust {
    font-size: 12px;
  }

  .metric-pill {
    font-size: 12px;
  }

  .metric-pill strong {
    font-size: 14px;
  }

  .form-field input,
  .form-field select,
  .form-field textarea {
    font-size: 16px;
  }
}

@media (max-width: 400px) {
  .map-sidebar .filter-chip {
    min-height: 42px;
    padding-right: 10px;
    padding-left: 10px;
  }

  .map-sidebar .search-wrap input[type="search"] {
    padding-left: 40px;
  }
}

@media (max-width: 1120px) {
  :root { --header-h: 64px; }
  .site-header,
  html[data-theme="dark"] .site-header {
    grid-template-columns: minmax(130px, 205px) minmax(120px, 1fr) max-content;
    grid-template-rows: 64px;
    column-gap: clamp(10px, 2vw, 22px);
    height: 64px;
    min-height: 64px;
    padding: 0 16px;
  }
  .site-header > .main-nav { display: none; }
  .site-header > .header-search { grid-column: 2; grid-row: 1; height: 40px; }
  .site-header > .header-actions { grid-column: 3; grid-row: 1; gap: 8px; }
  .site-header .header-actions .mobile-menu-button {
    display: flex;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
  }
  .site-header .header-actions .theme-toggle { flex-basis: 38px; width: 38px; height: 38px; }
  .site-header .header-actions .button-primary { min-height: 38px; padding: 7px 9px; font-size: 12px; }
}

@media (max-width: 760px) {
  .site-header,
  html[data-theme="dark"] .site-header {
    grid-template-columns: minmax(0, 1fr) max-content;
    grid-template-rows: 64px;
    column-gap: 8px;
    padding: 0 12px;
  }
  .site-header > .header-search { display: none; }
  .site-header > .header-actions { gap: 7px; }
  .site-header .header-actions .button-primary { min-height: 38px; padding: 7px 8px; font-size: 12px; }
  .map-layout { height: calc(100vh - var(--header-h)); height: calc(100dvh - var(--header-h)); }
  .form-field label,
  .field-label { font-size: 14px; }
  .form-field small,
  .field-help,
  .field-error,
  .recaptcha-note { font-size: 13px; line-height: 1.45; }
  .notice { font-size: 14px; line-height: 1.5; }
  .page-wrap .content-page p,
  .page-wrap .content-page li,
  .content-card p,
  .net-card p,
  .group-card p { font-size: 15px; line-height: 1.65; }
  .channel-chip,
  .station-modal-note { font-size: 12px; }
  .avatar-choice label small { font-size: 11px; }
}

@media (max-width: 400px) {
  .site-header { padding-right: 9px; padding-left: 9px; }
  .site-header .brand-mark { width: 34px; height: 34px; }
  .site-header .brand-copy strong { font-size: 13px; }
  .site-header .brand-copy small { font-size: 10px; }
  .site-header .header-actions { gap: 5px; }
  .site-header .header-actions .button-primary { padding-right: 7px; padding-left: 7px; font-size: 11px; }
}

/* Clear, understated controls and system typography. */
:root {
  color-scheme: light;
  --ink: #252b30;
  --muted: #59636a;
  --line: #d3d9dd;
  --panel: #ffffff;
  --canvas: #f3f5f6;
  --brand: #343b40;
  --brand-soft: #e9edef;
  --brand-highlight: #dce2e5;
  --amber: #4f5960;
  --amber-bg: #edf0f2;
  --signal: #59636a;
  --signal-soft: #e9edef;
  --shadow: 0 4px 14px rgba(29, 38, 43, .10);
  --radius: 6px;
  --header-h: 64px;
  font-family: Arial, Helvetica, sans-serif;
}

html, body, button, input, select, textarea {
  font-family: Arial, Helvetica, sans-serif;
  font-synthesis: none;
}

body { color: var(--ink); background: var(--canvas); font-size: 16px; }
a { color: #394249; }
.eyebrow { color: var(--muted); font-size: 13px; font-weight: 600; letter-spacing: 0; text-transform: none; }
h1, h2, h3 { letter-spacing: 0; }
button, input, select, textarea { font-size: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
.button, .icon-button, .mobile-menu-button, .filter-chip, .map-control,
.map-filter-toggle, .mobile-nav a, .form-field input, .form-field select,
.form-field textarea, .admin-row-form input, .admin-row-form select {
  border-radius: 4px;
}
.button { box-shadow: none; transition: background-color .15s ease, border-color .15s ease, color .15s ease; }
.button:hover { transform: none; }
.button-primary { background: #343b40; color: #fff; box-shadow: none; }
.button-primary:hover { background: #252b30; color: #fff; }
.button-light { background: #fff; color: #252b30; border-color: #aeb7bc; }
.icon-button, .mobile-menu-button { background: #fff; border-color: #aeb7bc; color: #343b40; }
.site-footer { border-top: 1px solid var(--line); }

/* A plain single-row header, without the duplicate global search bar. */
.site-header, html[data-theme="dark"] .site-header {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr) max-content;
  grid-template-rows: var(--header-h);
  column-gap: clamp(18px, 3vw, 42px);
  height: var(--header-h);
  min-height: var(--header-h);
  padding: 0 clamp(16px, 3vw, 42px);
  background: #fff;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.site-header > .brand { grid-column: 1; grid-row: 1; gap: 9px; min-width: 0; }
.site-header .brand-mark { width: 38px; height: 38px; border: 1px solid #59636a; border-radius: 4px; background: #59636a; color: #fff; }
.site-header .brand-copy strong { color: #343b40; font-size: 16px; font-weight: 700; letter-spacing: 0; text-transform: none; }
.site-header .brand-copy small { font-size: 12px; color: var(--muted); }
.site-header > .main-nav {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(12px, 1.55vw, 22px);
  height: 100%;
  border: 0;
}
.site-header .main-nav a {
  height: auto;
  padding: 8px 0;
  border: 0;
  color: #343b40;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.2;
  text-transform: none;
}
.site-header .main-nav a:hover { color: #111619; text-decoration: underline; }
.site-header > .header-search { display: none; }
.site-header > .header-actions { grid-column: 3; grid-row: 1; gap: 8px; }
.site-header .header-actions .theme-toggle { width: 38px; height: 38px; flex-basis: 38px; }
.site-header .header-actions .button-primary {
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid #343b40;
  background: #343b40;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}
.site-header .header-actions .button-primary:hover { background: #252b30; }
.site-header .icon-button, .site-header .mobile-menu-button { color: #343b40; }
.site-header .mobile-menu-button span { background: #343b40; }
.mobile-nav, html[data-theme="dark"] .mobile-nav { border-color: var(--line); background: #fff; box-shadow: 0 8px 16px rgba(29,38,43,.1); }
.mobile-nav a, html[data-theme="dark"] .mobile-nav a { border-color: var(--line); color: #343b40; font-size: 15px; }

/* Map filters sit behind one quiet drawer on mobile. */
.map-sidebar .sidebar-top { background: #fff; color: var(--ink); border-bottom: 1px solid var(--line); }
.map-filter-toggle { display: none; }
.mobile-filter-panel { display: flex; flex: 1 1 auto; flex-direction: column; min-height: 0; }
.map-sidebar .sidebar-top .eyebrow { color: var(--muted); }
.map-sidebar .sidebar-heading h1 { color: var(--ink); }
.map-sidebar .search-wrap input[type="search"] { border-color: var(--line); background: #fff; color: var(--ink); }
.map-sidebar .search-icon { color: #59636a; }
.station-card, .results-empty, .content-card, .content-tile, .stat-card,
.net-card, .group-card, .profile-stat, .wizard-preview, .channel-option,
.avatar-choice label, .day-option label, .metric-pill, .filter-chip {
  border-radius: 4px;
  box-shadow: none;
}
.station-card { border-color: var(--line); }
.station-avatar, .net-icon, .group-icon, .admin-avatar, .wizard-preview,
.profile-stat, .channel-option, .avatar-choice label, .key-display,
.key-actions .button-primary { border-color: var(--line); background: #edf0f2; color: #343b40; }
.key-display { font: 700 18px/1.4 Arial, Helvetica, sans-serif; letter-spacing: .05em; }
.avatar-choice input:checked + label, .channel-option.featured,
.day-option input:checked + label { border-color: #59636a; background: #dce2e5; color: #252b30; }
.station-card-title > a { font-size: 15px; }
.station-location, .station-schedule, .station-trust { font-size: 13px; line-height: 1.4; }
.channel-chip { border-radius: 3px; font-size: 12px; }
.results-empty { font-size: 14px; line-height: 1.5; }
.notice-info, .notice-success, .notice-warn, .notice-error {
  border-color: #c3cbd0;
  background: #edf0f2;
  color: #343b40;
}
.notice-error { border-left: 3px solid #59636a; }
.map-sidebar .filter-row { gap: 8px; padding-top: 10px; padding-bottom: 12px; }
.map-sidebar .filter-chip {
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 4px;
  border-color: #aeb7bc;
  background: #fff;
  color: #343b40;
  font-size: 14px;
  font-weight: 600;
}
.map-sidebar .filter-chip[aria-pressed="true"],
.filter-chip[aria-pressed="true"] { border-color: #59636a; background: #e9edef; color: #252b30; }
.map-sidebar .filter-chip.channel-highlight,
.channel-chip.channel-highlight { border-color: #aeb7bc; background: #edf0f2; color: #343b40; }
.map-sidebar .filter-toolbar { padding-bottom: 11px; font-size: 13px; }
.map-sidebar .filter-toolbar button { color: #343b40; font-size: 14px; }
.map-marker, .community-map-marker, .map-cluster { background: #3d454b; box-shadow: 0 2px 8px rgba(29,38,43,.22); }
.community-map-marker.is-net { background: #58636a; border-bottom: 2px solid #dce2e5; }
.map-controls .map-control:focus-visible, .map-sidebar :focus-visible,
.map-filter-toggle:focus-visible, .button:focus-visible, .form-field :focus-visible {
  outline: 2px solid #59636a;
  outline-offset: 2px;
}
.map-stage { background: #e3e7e9; }
.map-fallback-inner { border: 1px solid var(--line); border-radius: 6px; box-shadow: none; }

/* Searchable locality picker for the station form. */
.locality-picker { position: relative; }
.locality-picker [data-locality-search] { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid #aeb7bc; border-radius: 4px; background: #fff; color: var(--ink); }
.locality-picker [data-locality-search]:focus { border-color: #59636a; outline: 2px solid rgba(89,99,106,.18); }
.locality-suggestions[hidden] { display: none; }
.locality-suggestions {
  position: absolute;
  z-index: 30;
  top: calc(100% + 4px);
  right: 0;
  left: 0;
  max-height: min(280px, 42vh);
  overflow-y: auto;
  border: 1px solid #aeb7bc;
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 5px 14px rgba(29,38,43,.12);
}
.locality-suggestion, .locality-suggestion-message { padding: 11px 12px; color: var(--ink); font-size: 15px; line-height: 1.4; }
.locality-suggestion { cursor: pointer; border-bottom: 1px solid #e1e5e7; }
.locality-suggestion:last-child { border-bottom: 0; }
.locality-suggestion:hover, .locality-suggestion[aria-selected="true"] { background: #edf0f2; }
.locality-suggestion-message { color: var(--muted); }
.visually-hidden { position: absolute!important; width: 1px!important; height: 1px!important; padding: 0!important; margin: -1px!important; overflow: hidden!important; clip: rect(0,0,0,0)!important; white-space: nowrap!important; border: 0!important; }

/* Keep the Add Station wizard and other forms square, legible and calm. */
.page-wrap { width: min(100% - 32px, 1040px); padding: 32px 0 44px; }
.page-hero { margin-bottom: 20px; padding: 24px; border: 1px solid var(--line); border-top: 2px solid #59636a; border-radius: 6px; background: #fff; box-shadow: none; }
.page-hero h1, .content-page h1 { font-size: clamp(26px, 3vw, 34px); line-height: 1.2; letter-spacing: 0; }
.page-hero p, .content-page p { font-size: 16px; line-height: 1.6; }
.page-grid { gap: 18px; }
.panel, .content-page .content-panel, .content-card, .content-tile, .stat-card,
.station-modal-card, .net-card, .group-card, .admin-review-card {
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: none;
}
.panel { padding: 22px; }
.wizard-panel h2 { margin-top: 0; font-size: 20px; line-height: 1.35; letter-spacing: 0; }
.stepper { gap: 9px; }
.stepper-item { font-size: 13px; }
.stepper-item span { border-radius: 3px; }
.form-field { margin: 0 0 17px; }
.form-field label, .field-label { margin-bottom: 7px; font-size: 15px; font-weight: 600; }
.form-field small, .field-help, .field-error, .recaptcha-note { font-size: 13px; line-height: 1.5; }
.form-field input, .form-field select, .form-field textarea,
.admin-row-form input, .admin-row-form select { min-height: 44px; border: 1px solid #aeb7bc; border-radius: 4px; padding: 9px 11px; background: #fff; color: var(--ink); font-size: 15px; }
.form-field textarea { min-height: 112px; }
.avatar-choice label, .channel-option, .day-option label { border-radius: 4px; }
.avatar-choice label { min-height: 62px; }
.channel-option { padding: 10px; font-size: 14px; }
.schedule-grid { gap: 6px; }
.day-option label { min-height: 42px; font-size: 13px; }
.form-actions { gap: 8px; }
.form-actions .button { min-height: 42px; padding: 9px 14px; font-size: 14px; }
.notice { border-radius: 4px; box-shadow: none; }
dialog.home-welcome-dialog {
  width: min(440px, calc(100% - 28px));
  max-width: 100%;
  max-height: min(80dvh, 620px);
  margin: auto;
  padding: 0;
  overflow: auto;
  border: 1px solid #aeb7bc;
  border-radius: 5px;
  background: #fff;
  color: #252b30;
  box-shadow: 0 12px 32px rgba(20,27,31,.2);
}
.home-welcome-dialog::backdrop { background: rgba(20,27,31,.48); }
.home-welcome-card { position: relative; padding: 24px; }
.home-welcome-card .eyebrow { color: #59636a; font-size: 13px; letter-spacing: 0; text-transform: none; }
.home-welcome-card h2 { margin: 9px 32px 10px 0; font-size: 23px; line-height: 1.3; letter-spacing: 0; }
.home-welcome-card p { margin: 0 0 18px; color: #4d575d; font-size: 16px; line-height: 1.6; white-space: normal; }
.home-welcome-close { position: absolute; top: 12px; right: 12px; display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid #aeb7bc; border-radius: 4px; background: #fff; color: #343b40; font-size: 22px; line-height: 1; cursor: pointer; }
.home-welcome-actions { display: flex; flex-wrap: wrap; gap: 9px; }
html[data-theme="dark"] dialog.home-welcome-dialog { border-color: #59636a; background: #292f34; color: #e8ecee; }
html[data-theme="dark"] .home-welcome-card p { color: #c4cbcf; }
html[data-theme="dark"] .home-welcome-close { border-color: #59636a; background: #343c42; color: #e8ecee; }

/* Compact map controls and preserve a full-height map on phones. */
@media (max-width: 1120px) {
  .site-header, html[data-theme="dark"] .site-header {
    grid-template-columns: minmax(0,1fr) max-content;
    grid-template-rows: var(--header-h);
    column-gap: 12px;
    height: var(--header-h);
    min-height: var(--header-h);
    padding: 0 18px;
  }
  .site-header > .brand { grid-column: 1; grid-row: 1; }
  .site-header > .main-nav { display: none; }
  .site-header > .header-actions { grid-column: 2; grid-row: 1; }
  .site-header .header-actions .mobile-menu-button { display: flex; flex: 0 0 40px; width: 40px; height: 40px; }
}

@media (max-width: 760px) {
  :root { --header-h: 60px; }
  .site-header, html[data-theme="dark"] .site-header { padding: 0 12px; }
  .site-header .brand-mark { width: 36px; height: 36px; }
  .site-header .brand-copy strong { font-size: 15px; }
  .site-header .brand-copy small { font-size: 11px; }
  .site-header .header-actions { gap: 7px; }
  .site-header .header-actions .theme-toggle { width: 36px; height: 36px; flex-basis: 36px; }
  .site-header .header-actions .button-primary { min-height: 38px; padding: 7px 9px; font-size: 13px; }
  .site-header .header-actions .mobile-menu-button { flex-basis: 36px; width: 36px; height: 36px; }
  .map-page { min-height: calc(100vh - var(--header-h)); min-height: calc(100dvh - var(--header-h)); overflow: hidden; }
  .map-layout { position: relative; display: block; height: calc(100vh - var(--header-h)); height: calc(100dvh - var(--header-h)); min-height: 0; overflow: hidden; isolation: isolate; }
  .map-stage { position: absolute; z-index: 0; inset: 0; width: 100%; height: 100%; min-height: 0; }
  .map-sidebar {
    position: absolute;
    z-index: 15;
    top: 12px;
    right: 12px;
    left: 12px;
    display: block;
    max-height: none;
    overflow: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
    pointer-events: none;
  }
  .map-sidebar .sidebar-top { display: flex; align-items: center; gap: 8px; padding: 0; border: 0; background: transparent; pointer-events: none; }
  .map-sidebar .eyebrow, .map-sidebar .sidebar-heading { display: none; }
  .map-sidebar .search-wrap { flex: 1 1 auto; min-width: 0; height: 46px; margin: 0; border: 1px solid #aeb7bc; border-radius: 4px; background: #fff; box-shadow: 0 2px 8px rgba(29,38,43,.12); pointer-events: auto; }
  .map-sidebar .search-wrap input[type="search"] { height: 44px; padding: 0 42px 0 40px; border: 0; border-radius: 4px; background: #fff; font-size: 16px; }
  .map-sidebar .search-icon { top: 11px; left: 11px; color: #59636a; }
  .map-sidebar .search-wrap button { top: 5px; right: 4px; width: 34px; height: 34px; }
  .map-filter-toggle {
    position: static;
    z-index: 1;
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 46px;
    padding: 0 12px;
    border: 1px solid #aeb7bc;
    border-radius: 4px;
    background: #fff;
    color: #252b30;
    box-shadow: 0 2px 8px rgba(29,38,43,.12);
    font-size: 14px;
    font-weight: 600;
    pointer-events: auto;
  }
  .map-filter-toggle span { display: inline-block; transition: transform .18s ease; }
  .map-filter-toggle[aria-expanded="true"] .filter-toggle-icon { transform: rotate(180deg); }
  .filter-toggle-icon svg { display: block; width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
  .mobile-filter-panel {
    position: absolute;
    top: 54px;
    right: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    max-height: 0;
    overflow: hidden;
    padding: 0;
    border: 0 solid var(--line);
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 4px 12px rgba(29,38,43,.12);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-4px);
    visibility: hidden;
    transition: max-height .2s ease, opacity .16s ease, transform .16s ease, visibility .16s ease, padding .2s ease;
  }
  .map-sidebar.filters-open .mobile-filter-panel {
    max-height: min(66vh, calc(100vh - var(--header-h) - 84px));
    max-height: min(66dvh, calc(100dvh - var(--header-h) - 84px));
    overflow-x: hidden;
    overflow-y: auto;
    padding: 4px 0 8px;
    border-width: 1px;
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
    visibility: visible;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }
  .map-sidebar .mobile-filter-panel > .filter-row { flex-wrap: wrap; gap: 7px; padding: 8px 10px; overflow: visible; }
  .map-sidebar .mobile-filter-panel .filter-chip { min-height: 40px; padding: 8px 10px; font-size: 14px; }
  .map-sidebar .mobile-filter-panel select[data-channel-select] { flex: 1 1 145px; min-width: 145px; }
  .map-sidebar .filter-toolbar { flex: 0 0 auto; padding: 4px 10px 9px; font-size: 13px; }
  .map-sidebar .filter-toolbar button { min-height: 36px; padding: 4px 8px; font-size: 14px; }
  .map-sidebar .station-results { flex: 0 1 auto; max-height: min(26vh, 200px); padding: 0 8px 8px; overflow-y: auto; }
  .map-sidebar .station-results.is-hidden { display: none; }
  .map-sidebar .map-sidebar-footer { display: none; }
  .map-controls { top: auto; right: 12px; bottom: calc(env(safe-area-inset-bottom, 0px) + 58px); gap: 5px; }
  .map-control { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 4px; box-shadow: 0 2px 8px rgba(29,38,43,.12); }
  .map-metrics { top: auto; left: 12px; bottom: calc(env(safe-area-inset-bottom, 0px) + 60px); max-width: calc(100% - 110px); gap: 6px; }
  .metric-pill { padding: 6px 8px; border-radius: 4px; font-size: 12px; }
  .metric-pill strong { font-size: 14px; }
  .map-attribution { right: 8px; bottom: 7px; max-width: 68%; padding: 3px 5px; border-radius: 3px; font-size: 10px; }
  .map-lower-links { display: none; }
  .map-home .site-footer { display: flex; align-items: flex-start; gap: 6px; padding: 10px 12px; font-size: 12px; line-height: 1.4; }
  .map-home .site-footer nav { gap: 6px 12px; margin: 0; }
  .map-home .site-footer nav a { font-size: 12px; }
  dialog.home-welcome-dialog { max-height: min(82dvh, 620px); }
  .home-welcome-card { padding: 20px; }
  .home-welcome-card h2 { font-size: 21px; }
  .page-wrap { width: min(100% - 24px, 720px); padding: 18px 0 28px; }
  .page-hero { margin-bottom: 14px; padding: 17px; }
  .page-hero h1, .content-page h1 { font-size: 27px; }
  .page-hero p, .content-page p { font-size: 15px; }
  .panel { padding: 16px; }
  .page-grid, .two-col { grid-template-columns: 1fr; gap: 12px; }
  .wizard-panel h2 { font-size: 18px; }
  .stepper { flex-wrap: wrap; }
  .stepper-item { font-size: 12px; }
  .form-field label, .field-label { font-size: 15px; }
  .form-field input, .form-field select, .form-field textarea { font-size: 16px; }
  .form-actions { flex-wrap: wrap; }
  .form-actions .button { min-height: 44px; }
  .site-footer { display: block; padding: 13px 14px; font-size: 13px; }
  .site-footer nav { margin-top: 8px; gap: 7px 13px; }
  .site-footer nav a { font-size: 13px; }
}

@media (max-width: 400px) {
  .site-header, html[data-theme="dark"] .site-header { padding-right: 8px; padding-left: 8px; }
  .site-header .brand { gap: 6px; }
  .site-header .brand-mark { width: 33px; height: 33px; }
  .site-header .brand-copy strong { font-size: 14px; }
  .site-header .brand-copy small { font-size: 10px; }
  .site-header .header-actions { gap: 5px; }
  .site-header .header-actions .button-primary { padding-right: 7px; padding-left: 7px; font-size: 12px; }
  .map-sidebar, .map-filter-toggle { font-size: 13px; }
  .map-sidebar .mobile-filter-panel select[data-channel-select] { flex-basis: 126px; min-width: 126px; }
}

@media (max-width: 360px) {
  .site-header .header-actions .theme-toggle { display: none; }
  .site-header .header-actions .button-primary { padding-right: 6px; padding-left: 6px; }
}

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

html[data-theme="dark"] {
  color-scheme: dark;
  --ink: #e8ecee;
  --muted: #bac2c6;
  --line: #4a5359;
  --panel: #292f34;
  --canvas: #20262a;
  --brand: #c5cdd1;
  --brand-soft: #343c42;
  --brand-highlight: #4b555b;
  --amber: #c5cdd1;
  --amber-bg: #343c42;
  --signal: #bac2c6;
  --signal-soft: #343c42;
  background: #20262a;
}
html[data-theme="dark"] body { color: var(--ink); background: var(--canvas); }
html[data-theme="dark"] a { color: #c5cdd1; }
html[data-theme="dark"] .site-header, html[data-theme="dark"] .mobile-nav,
html[data-theme="dark"] .map-sidebar, html[data-theme="dark"] .map-sidebar .sidebar-top, html[data-theme="dark"] .mobile-filter-panel,
html[data-theme="dark"] .map-home .site-footer { background: #292f34; color: var(--ink); }
html[data-theme="dark"] .site-header .brand, html[data-theme="dark"] .site-header .brand-copy strong,
html[data-theme="dark"] .site-header .main-nav a, html[data-theme="dark"] .mobile-nav a { color: var(--ink); }
html[data-theme="dark"] .site-header .brand-copy small { color: var(--muted); }
html[data-theme="dark"] .site-header .brand-mark { background: #59636a; border-color: #7b858b; color: #fff; }
html[data-theme="dark"] .site-header .icon-button, html[data-theme="dark"] .site-header .mobile-menu-button { background: #343c42; border-color: #59636a; color: var(--ink); }
html[data-theme="dark"] .site-header .mobile-menu-button span { background: var(--ink); }
html[data-theme="dark"] .site-header .button-primary { border-color: #bac2c6; background: #343c42; color: #fff; }
html[data-theme="dark"] .map-sidebar .search-wrap, html[data-theme="dark"] .map-sidebar .search-wrap input[type="search"],
html[data-theme="dark"] .map-filter-toggle, html[data-theme="dark"] .map-sidebar .filter-chip,
html[data-theme="dark"] .map-sidebar .station-card, html[data-theme="dark"] .map-sidebar .results-empty {
  background: #343c42; border-color: #59636a; color: var(--ink);
}
html[data-theme="dark"] .page-hero, html[data-theme="dark"] .panel, html[data-theme="dark"] .content-card,
html[data-theme="dark"] .content-tile, html[data-theme="dark"] .stat-card, html[data-theme="dark"] .station-modal-card,
html[data-theme="dark"] .net-card, html[data-theme="dark"] .group-card, html[data-theme="dark"] .site-footer { background: #292f34; color: var(--ink); }
html[data-theme="dark"] .form-field input, html[data-theme="dark"] .form-field select,
html[data-theme="dark"] .form-field textarea, html[data-theme="dark"] .locality-picker [data-locality-search] {
  background: #343c42; border-color: #59636a; color: var(--ink);
}
html[data-theme="dark"] .station-avatar, html[data-theme="dark"] .net-icon,
html[data-theme="dark"] .group-icon, html[data-theme="dark"] .admin-avatar,
html[data-theme="dark"] .wizard-preview, html[data-theme="dark"] .profile-stat,
html[data-theme="dark"] .channel-option, html[data-theme="dark"] .avatar-choice label,
html[data-theme="dark"] .key-display { border-color: #59636a; background: #343c42; color: #e8ecee; }
html[data-theme="dark"] .avatar-choice input:checked + label,
html[data-theme="dark"] .channel-option.featured,
html[data-theme="dark"] .day-option input:checked + label { border-color: #7b858b; background: #4b555b; color: #fff; }
html[data-theme="dark"] .locality-suggestions { background: #292f34; border-color: #59636a; }
html[data-theme="dark"] .locality-suggestion { border-color: #4a5359; color: var(--ink); }
html[data-theme="dark"] .locality-suggestion:hover, html[data-theme="dark"] .locality-suggestion[aria-selected="true"] { background: #3a4349; }
html[data-theme="dark"] .map-stage { background: #2b3237; }
html[data-theme="dark"] .map-sidebar .filter-chip[aria-pressed="true"] { background: #4b555b; border-color: #7b858b; color: #fff; }

.not-found-page { min-height: min(70vh, 720px); display: grid; align-items: center; }
.not-found-card { width: min(100%, 940px); margin: 0 auto; padding: clamp(22px, 5vw, 48px); display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); align-items: center; gap: clamp(22px, 5vw, 54px); background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 12px 34px rgba(25, 43, 52, .08); }
.not-found-art { min-width: 0; padding: 10px; background: #f3f6f7; border: 1px solid #e1e7ea; border-radius: 6px; }
.not-found-art svg { display: block; width: 100%; height: auto; }
.not-found-copy .eyebrow { color: #536c7b; }
.not-found-copy h1 { max-width: 450px; margin: 10px 0 12px; color: var(--ink); font-size: clamp(30px, 4vw, 44px); line-height: 1.12; letter-spacing: -.8px; }
.not-found-copy p { max-width: 420px; margin: 0; color: var(--muted); font-size: 16px; line-height: 1.65; }
.not-found-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
html[data-theme="dark"] .not-found-card { background: #292f34; border-color: #59636a; }
html[data-theme="dark"] .not-found-art { background: #343c42; border-color: #59636a; }
html[data-theme="dark"] .not-found-copy h1 { color: var(--ink); }
html[data-theme="dark"] .not-found-copy p { color: var(--muted); }
@media (max-width: 680px) {
  .not-found-page { min-height: 0; padding-top: 24px; }
  .not-found-card { grid-template-columns: 1fr; gap: 20px; padding: 18px; }
  .not-found-art { width: min(100%, 320px); margin: 0 auto; }
  .not-found-copy h1 { font-size: 30px; }
  .not-found-actions { display: grid; grid-template-columns: 1fr; }
  .not-found-actions .button { justify-content: center; }
}

/* Keep map navigation in view while the map fills the space between the bars. */
.map-home { --map-footer-h: 58px; overflow: hidden; }
.map-home .site-header {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 100;
}
.map-home #main {
  padding: 0;
}
.map-home .map-page {
  position: fixed;
  top: var(--header-h);
  right: 0;
  bottom: var(--map-footer-h);
  left: 0;
  height: auto;
  min-height: 0;
}
.map-home .map-layout { height: 100%; }
.map-home .site-footer {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 90;
  flex-wrap: nowrap;
  height: var(--map-footer-h);
  min-height: var(--map-footer-h);
  padding: 0 clamp(16px, 3vw, 40px);
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  white-space: nowrap;
}
.map-home .site-footer > span { flex: 0 0 auto; white-space: nowrap; }
.map-home .site-footer nav {
  flex: 0 0 auto;
  flex-wrap: nowrap;
  gap: 0 clamp(12px, 1.5vw, 22px);
  min-width: max-content;
  margin: 0;
  white-space: nowrap;
}
.map-home .site-footer nav a { display: flex; align-items: center; min-height: 44px; white-space: nowrap; }
@media (max-width: 1120px) {
  .map-home .site-footer { justify-content: flex-start; padding-right: 16px; padding-left: 16px; }
  .map-home .site-footer > span { display: none; }
}

/* Keep map navigation reachable while the map takes touch gestures on phones. */
@media (max-width: 760px) {
  .map-home { --map-footer-h: 48px; }
  .map-home .site-header {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 100;
    height: calc(var(--header-h) + env(safe-area-inset-top, 0px));
    min-height: calc(var(--header-h) + env(safe-area-inset-top, 0px));
    padding-top: env(safe-area-inset-top, 0px);
  }
  .map-home #main {
    padding: 0;
  }
  .map-home .map-page {
    top: calc(var(--header-h) + env(safe-area-inset-top, 0px));
    bottom: calc(var(--map-footer-h) + env(safe-area-inset-bottom, 0px));
    height: auto;
    min-height: 0;
  }
  .map-home .map-layout { height: 100%; }
  .map-home .mobile-nav {
    position: fixed;
    top: calc(var(--header-h) + env(safe-area-inset-top, 0px));
    z-index: 99;
  }
  .map-home .site-footer {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 90;
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
    align-items: center;
    gap: 0;
    height: calc(var(--map-footer-h) + env(safe-area-inset-bottom, 0px));
    min-height: calc(var(--map-footer-h) + env(safe-area-inset-bottom, 0px));
    padding: 0 12px env(safe-area-inset-bottom, 0px);
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }
  .map-home .site-footer > span { display: none; }
  .map-home .site-footer nav {
    display: flex;
    flex: 0 0 auto;
    flex-wrap: nowrap;
    gap: 0 14px;
    min-width: max-content;
    margin: 0;
    white-space: nowrap;
  }
  .map-home .site-footer nav a {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 0 2px;
    font-size: 12px;
    white-space: nowrap;
  }
  .map-sidebar .search-icon { top: 50%; transform: translateY(-50%); }
  .map-sidebar .search-wrap [data-clear-search] { top: 50%; transform: translateY(-50%); }
}

/* Public content headings and form labels need explicit foregrounds in dark mode. */
html[data-theme="dark"] .page-wrap h1,
html[data-theme="dark"] .page-wrap h2,
html[data-theme="dark"] .page-wrap h3,
html[data-theme="dark"] .page-wrap h4,
html[data-theme="dark"] .page-wrap .form-field label,
html[data-theme="dark"] .page-wrap .field-label {
  color: var(--ink);
}
html[data-theme="dark"] .page-wrap .results-empty {
  border-color: var(--line);
  background: #292f34;
  color: var(--ink);
}

/* Align directory search and filter actions with their input controls. */
.directory-filter-row {
  align-items: flex-end;
}
