* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
}

:root {
  --app-viewport-height: 100vh;
  --map-accent: #1e40af;
  --map-accent-hover: #1d4ed8;
  --map-surface: #ffffff;
  --map-border: #e2e8f0;
  --map-muted: #64748b;
  --map-radius: 10px;
  --map-touch: 44px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --public-content-max: 72rem;
  --public-space-xs: 0.5rem;
  --public-space-sm: 0.75rem;
  --public-space-md: 1rem;
  --public-space-lg: 1.35rem;
}

@supports (height: 100dvh) {
  :root {
    --app-viewport-height: 100dvh;
  }
}

/* iOS Safari/WebKit fallback for dynamic viewport sizing. */
@supports (-webkit-touch-callout: none) {
  :root {
    --app-viewport-height: -webkit-fill-available;
  }

  body {
    min-height: -webkit-fill-available;
  }
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  color: #14213d;
  background-color: #f6f8fb;
  min-height: var(--app-viewport-height);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: hidden;
}

.app-shell {
  width: 100%;
  max-width: 100vw;
  min-height: var(--app-viewport-height);
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 0;
  background: #f1f5f9;
}

.topbar {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
  padding: 0.75rem 1rem;
  border-radius: 0;
  box-shadow: none;
  text-align: center;
  flex-shrink: 0;
}

.topbar h1 {
  margin: 0;
  font-size: clamp(0.9rem, 2.8vw, 1.35rem);
  color: #ffffff;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.25;
  text-align: center;
}

.topbar p {
  margin: 0.2rem 0 0;
  color: #94a3b8;
  font-size: clamp(0.68rem, 1.8vw, 0.8rem);
  font-weight: 500;
  letter-spacing: 0.03em;
  text-align: center;
}

/* Public map — professional SaaS-style layout */
.public-page {
  margin: 0;
  background: #f6f4fb;
  height: var(--app-viewport-height);
  max-height: var(--app-viewport-height);
  overflow: hidden;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  z-index: 10000;
}

.skip-link:focus {
  left: var(--safe-left);
  top: var(--safe-top);
  width: auto;
  height: auto;
  padding: 0.65rem 1rem;
  background: #ffffff;
  color: #0f172a;
  border: 2px solid #6d28d9;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.15);
}

.app-shell--public {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100vw;
  height: var(--app-viewport-height);
  max-height: var(--app-viewport-height);
  min-height: var(--app-viewport-height);
  margin: 0;
  padding: 0;
  padding-left: var(--safe-left);
  padding-right: var(--safe-right);
  gap: 0;
  overflow: hidden;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(167, 139, 250, 0.14), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(191, 219, 254, 0.2), transparent 50%),
    linear-gradient(180deg, #faf9fc 0%, #f3f6fb 45%, #f8fafc 100%);
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  color: #0f172a;
}

.public-header {
  flex-shrink: 0;
  padding: calc(0.85rem + var(--safe-top)) max(1.25rem, var(--safe-right)) 0.85rem max(1.25rem, var(--safe-left));
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.public-header__inner {
  max-width: var(--public-content-max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.public-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

.public-brand__logo {
  width: 2.5rem;
  height: 2.5rem;
  object-fit: contain;
  flex-shrink: 0;
}

.public-brand__text {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  min-width: 0;
}

.public-brand__title {
  font-size: clamp(0.9rem, 2.5vw, 1.05rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: #0f172a;
}

.public-brand__title--short {
  display: none;
}

.public-header__cta-label--long {
  display: inline;
}

.public-header__cta-label:not(.public-header__cta-label--long) {
  display: none;
}

.public-map-card--immersive .map-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.public-map-chrome {
  position: relative;
  z-index: 500;
  flex-shrink: 0;
}

.map-controls-toggle {
  display: none;
}

/* Collapsible map controls (public + admin) */
@media (max-width: 700px) {
  .map-toolbar--collapsible.is-collapsed {
    opacity: 0;
    transform: translateY(-10px);
    max-height: 0;
    overflow: hidden;
    pointer-events: none;
    margin: 0;
    transition: opacity 0.18s ease, transform 0.2s ease, max-height 0.22s ease;
  }

  .map-toolbar--collapsible.is-expanded {
    opacity: 1;
    transform: translateY(0);
    max-height: none;
    pointer-events: auto;
    transition: opacity 0.18s ease, transform 0.2s ease, max-height 0.22s ease;
  }
}

.public-toolbar--dock .public-toolbar__dock {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.65rem 0.75rem;
  width: 100%;
}

.map-filter-input-wrap {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
}

.map-search-clear-btn {
  display: none;
}

.map-filter-input-wrap .map-search-clear-btn {
  position: absolute;
  top: 50%;
  right: 0.45rem;
  transform: translateY(-50%);
  z-index: 2;
  display: none;
  align-items: center;
  justify-content: center;
  width: 1.65rem;
  height: 1.65rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #64748b;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.map-filter-input-wrap .map-search-clear-btn:hover {
  background: rgba(148, 163, 184, 0.2);
  color: #334155;
}

.map-filter-input-wrap .map-search-clear-btn:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

@media (min-width: 701px) {
  .public-toolbar--dock .public-toolbar__actions {
    padding: 0.22rem;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  }
}

@media (min-width: 701px) and (max-width: 1300px) and (orientation: portrait) {
  body.public-map-fullscreen-active .public-map-chrome,
  html:fullscreen body.public-page .public-map-chrome,
  html:-webkit-full-screen body.public-page .public-map-chrome,
  body.is-fallback-fullscreen.public-page .public-map-chrome {
    top: auto;
    bottom: 0;
    flex-direction: row;
    align-items: flex-end;
    justify-content: flex-start;
    padding: 0 max(0.6rem, var(--safe-right)) calc(0.45rem + var(--safe-bottom))
      max(0.6rem, var(--safe-left));
    --public-dock-offset: 2.85rem;
  }

  body.public-map-fullscreen-active .public-map-chrome:not(.is-controls-collapsed),
  html:fullscreen body.public-page .public-map-chrome:not(.is-controls-collapsed),
  html:-webkit-full-screen body.public-page .public-map-chrome:not(.is-controls-collapsed),
  body.is-fallback-fullscreen.public-page .public-map-chrome:not(.is-controls-collapsed) {
    --public-dock-offset: 9.25rem;
  }

  body.public-map-fullscreen-active .public-map-chrome.is-controls-collapsed,
  html:fullscreen body.public-page .public-map-chrome.is-controls-collapsed,
  html:-webkit-full-screen body.public-page .public-map-chrome.is-controls-collapsed,
  body.is-fallback-fullscreen.public-page .public-map-chrome.is-controls-collapsed {
    --public-dock-offset: 2.85rem;
  }

  body.public-map-fullscreen-active .public-toolbar--dock.controls,
  html:fullscreen body.public-page .public-toolbar--dock.controls,
  html:-webkit-full-screen body.public-page .public-toolbar--dock.controls,
  body.is-fallback-fullscreen.public-page .public-toolbar--dock.controls {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
    margin: 0;
  }

  body.public-map-fullscreen-active .map-controls-toggle,
  html:fullscreen body.public-page .map-controls-toggle,
  html:-webkit-full-screen body.public-page .map-controls-toggle,
  body.is-fallback-fullscreen.public-page .map-controls-toggle {
    align-self: flex-end;
    order: -1;
    flex-shrink: 0;
  }
}

.map-filter-icon {
  display: none;
}

.map-action-btn--dock {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.public-brand__sub {
  font-size: 0.75rem;
  font-weight: 500;
  color: #64748b;
  line-height: 1.25;
}

.public-header__cta {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.15rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #6d28d9 0%, #5b21b6 100%);
  color: #ffffff;
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(91, 33, 182, 0.28);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.public-header__cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(91, 33, 182, 0.34);
}

.public-main {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  overflow: hidden;
}

.public-map-card {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  background: #ffffff;
  border-radius: 0;
  border: none;
  box-shadow: none;
  overflow: hidden;
}

.public-toolbar.controls {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--public-space-sm) var(--public-space-md);
  padding: var(--public-space-md) 1.15rem;
  margin: 0;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border: none;
  border-bottom: 1px solid #e2e8f0;
  border-radius: 0;
  box-shadow: inset 0 -1px 0 rgba(15, 23, 42, 0.02);
}


.public-toolbar__status.search-status {
  flex: 1 1 100%;
  width: 100%;
  margin: 0.25rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: #475569;
}

.public-toolbar__filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.65rem 1rem;
  flex: 1 1 12rem;
  min-width: 0;
}

.app-shell--public .public-toolbar .map-filter-field {
  gap: 0.35rem;
  flex: 1 1 10rem;
  min-width: 0;
}

.app-shell--public .public-toolbar .map-filter-field--search {
  flex: 2 1 14rem;
  max-width: 22rem;
}

.app-shell--public .public-toolbar .map-filter-field--type {
  flex: 0 1 10rem;
  min-width: 7.5rem;
}

.app-shell--public .public-toolbar .map-filter-field label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #334155;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.app-shell--public .public-toolbar .controls input,
.app-shell--public .public-toolbar .controls select {
  min-height: 2.5rem;
  font-size: 0.875rem;
  border-radius: 0.6rem;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #0f172a;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
}

.app-shell--public .public-toolbar .controls input:focus,
.app-shell--public .public-toolbar .controls select:focus {
  background: #ffffff;
  border-color: #1d4ed8;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
}

.public-toolbar__actions.map-action-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0;
  margin: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

.app-shell--public .public-toolbar .map-action-btn {
  min-height: 2.5rem;
  padding: 0 1rem;
  font-size: 0.84rem;
  font-weight: 700;
  border-radius: 0.65rem;
}

.app-shell--public .public-toolbar .map-action-btn--primary {
  background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
  border: 1px solid #1e3a8a;
  color: #ffffff;
  box-shadow: 0 8px 16px rgba(30, 64, 175, 0.2);
}

.app-shell--public .public-toolbar .map-action-btn--primary:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e3a8a 100%);
}

.app-shell--public .public-toolbar .map-action-btn--ghost {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #1e293b;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.app-shell--public .public-toolbar .map-action-btn--ghost:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

.app-shell--public .public-toolbar .map-action-label {
  position: static;
  width: auto;
  height: auto;
  clip: auto;
  overflow: visible;
}

.app-shell--public .public-map-card__map {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
}

.app-shell--public .public-map-card__map .map {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  height: 100%;
  border-radius: 0;
  box-shadow: none;
}

.app-shell--public .public-map-card__map .map.leaflet-container {
  min-height: 0;
  height: 100% !important;
}

@media (min-width: 701px) {
  .app-shell--public {
    background:
      radial-gradient(ellipse 80% 50% at 50% -10%, rgba(167, 139, 250, 0.14), transparent 55%),
      radial-gradient(ellipse 60% 40% at 100% 0%, rgba(191, 219, 254, 0.2), transparent 50%),
      linear-gradient(180deg, #faf9fc 0%, #f3f6fb 45%, #f8fafc 100%);
    padding-left: var(--safe-left);
    padding-right: var(--safe-right);
    height: var(--app-viewport-height);
    max-height: var(--app-viewport-height);
    overflow: hidden;
  }

  .public-page {
    background: #f6f4fb;
  }

  .public-header {
    background: rgba(255, 255, 255, 0.88);
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
    box-shadow: none;
  }

  .public-brand__title--full {
    display: block;
    color: #0f172a;
  }

  .public-brand__title--short {
    display: none;
  }

  .public-brand__sub {
    color: #64748b;
  }

  .public-header__cta {
    background: linear-gradient(135deg, #6d28d9 0%, #5b21b6 100%);
    border: none;
    box-shadow: 0 4px 16px rgba(91, 33, 182, 0.28);
  }

  .public-header__cta-label--long {
    display: inline;
    color: #ffffff;
  }

  .public-header__cta-label:not(.public-header__cta-label--long) {
    display: none;
  }

  .public-main {
    padding: 0;
  }

  .public-map-card--immersive {
    background: #ffffff;
    border: none;
    border-radius: 0;
    box-shadow: none;
  }

  .public-map-card--immersive .map-stage {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
  }

  .public-map-card--immersive .map {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    flex: none;
    z-index: 1;
  }

  .public-map-chrome {
    position: relative;
    order: -1;
    padding: 0;
    pointer-events: auto;
  }

  .public-toolbar--dock.controls {
    border-bottom: 1px solid #f1f5f9;
    padding: 1rem 1.15rem;
    margin: 0;
    background: #ffffff;
  }

  .public-toolbar--dock .public-toolbar__dock {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.65rem 0.75rem;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
    grid-template-columns: unset;
    grid-template-rows: unset;
  }

  .public-toolbar--dock .public-toolbar__filters {
    display: flex;
    flex-wrap: wrap;
    flex: 1 1 auto;
  }

  .public-toolbar--dock .public-toolbar__actions {
    display: flex;
  }

  .public-toolbar--dock .map-filter-field--search,
  .public-toolbar--dock .map-filter-field--type,
  .public-toolbar--dock .map-action-btn--primary,
  .public-toolbar--dock .map-action-btn--ghost {
    grid-column: auto;
    grid-row: auto;
    width: auto;
    max-width: none;
    flex: unset;
  }

  .public-toolbar--dock .map-action-btn--dock .map-action-label,
  .public-toolbar--dock .map-action-btn--dock .map-action-label[hidden] {
    position: static !important;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    overflow: visible !important;
    clip: auto !important;
    white-space: nowrap !important;
  }

  .public-toolbar--dock .map-action-btn--dock .map-action-label[hidden] {
    display: none !important;
  }

  .public-map-card--immersive .public-map-toast {
    position: static;
    margin-top: 0.35rem;
    background: transparent;
    color: #475569;
    box-shadow: none;
    padding: 0;
  }

  .app-shell--public .map .leaflet-top.leaflet-left {
    top: max(0.5rem, var(--safe-top));
  }
}

@media (min-width: 900px) {
  .public-toolbar--dock .public-toolbar__dock {
    flex-wrap: nowrap;
    align-items: flex-end;
  }

  .public-toolbar--dock .public-toolbar__filters {
    flex: 1 1 auto;
    display: flex;
    flex-wrap: nowrap;
    grid-template-columns: unset;
  }

  .public-toolbar--dock .map-filter-field--search {
    grid-column: auto;
    flex: 2 1 14rem;
  }

  .public-toolbar--dock .public-toolbar__actions {
    margin-left: auto;
    width: auto;
  }
}

.map-toolbar.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.5rem 0.65rem;
  background: var(--map-surface);
  padding: 0.6rem 0.85rem;
  border-radius: 0;
  border-bottom: 1px solid var(--map-border);
  box-shadow: none;
  flex-shrink: 0;
}

.map-filter-field {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  flex: 1 1 9rem;
  min-width: 0;
}

.map-filter-field--search {
  flex: 2 1 12rem;
}

.map-filter-field label {
  font-weight: 600;
  font-size: 0.72rem;
  line-height: 1.2;
  color: var(--map-muted);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.map-filter-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 0;
  flex: 0 0 auto;
}

/* Professional map toolbar action cluster */
.map-action-group {
  padding: 0.22rem;
  gap: 0.28rem;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid var(--map-border);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.map-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-width: var(--map-touch);
  min-height: var(--map-touch);
  padding: 0 0.72rem;
  border: 1px solid transparent;
  border-radius: 9px;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  white-space: nowrap;
  transition:
    background-color 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    color 0.16s ease,
    transform 0.12s ease;
}

.map-action-icon-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.125rem;
  height: 1.125rem;
  flex-shrink: 0;
}

.map-action-icon {
  width: 1.125rem;
  height: 1.125rem;
  flex-shrink: 0;
  display: block;
}

.map-action-icon--compress {
  display: none;
}

.map-action-btn[data-fs-state="exit"] .map-action-icon--expand {
  display: none;
}

.map-action-btn[data-fs-state="exit"] .map-action-icon--compress {
  display: block;
}

.map-action-btn--primary {
  background: linear-gradient(180deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  border-color: #1e40af;
  box-shadow:
    0 1px 2px rgba(30, 64, 175, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.map-action-btn--primary:hover {
  background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
}

.map-action-btn--ghost {
  background: #ffffff;
  color: #334155;
  border-color: #cbd5e1;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.map-action-btn--ghost:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  color: #0f172a;
}

.map-action-btn--admin {
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  color: #ffffff;
  border-color: #0f172a;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.2);
}

.map-action-btn--admin:hover {
  background: linear-gradient(180deg, #334155 0%, #1e293b 100%);
}

.map-action-btn:active:not(:disabled) {
  transform: translateY(1px);
}

.map-action-btn:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

.map-action-btn:disabled {
  opacity: 0.65;
  cursor: wait;
}

.map-action-btn.is-resetting .map-action-icon {
  animation: map-reset-spin 0.85s linear infinite;
}

@keyframes map-reset-spin {
  to {
    transform: rotate(-360deg);
  }
}

.map-stage--resetting .leaflet-container {
  transition: filter 0.5s ease;
  filter: saturate(0.9) brightness(0.97);
}

.map-stage .leaflet-container {
  transition: filter 0.55s ease;
}

.map-action-label {
  max-width: 5.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.controls input {
  width: 100%;
  min-width: 0;
  min-height: var(--map-touch);
  border: 1px solid var(--map-border);
  border-radius: var(--map-radius);
  padding: 0 0.65rem;
  font-size: 0.9rem;
  background: #ffffff;
  color: #0f172a;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.controls select {
  width: 100%;
  min-width: 0;
  min-height: var(--map-touch);
  border: 1px solid var(--map-border);
  border-radius: var(--map-radius);
  padding: 0 0.55rem;
  font-size: 0.9rem;
  background-color: #ffffff;
  color: #0f172a;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.map-toolbar.controls input:focus,
.map-toolbar.controls select:focus {
  outline: none;
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.14);
}

/* Legacy controls (non-toolbar pages) */
.controls button:not(.map-action-btn):not(.map-search-clear-btn) {
  min-height: var(--map-touch);
  border: 0;
  border-radius: var(--map-radius);
  padding: 0 0.75rem;
  font-weight: 600;
  font-size: 0.84rem;
  cursor: pointer;
  background: var(--map-accent);
  color: #ffffff;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  white-space: nowrap;
}

.controls button:not(.map-action-btn):not(.map-search-clear-btn):disabled {
  opacity: 0.8;
  cursor: wait;
}

.controls .link-btn:not(.map-action-btn) {
  min-height: var(--map-touch);
  border-radius: var(--map-radius);
  padding: 0 0.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  text-decoration: none;
  background: #0f172a;
  color: #ffffff;
  border: 1px solid #0f172a;
}

.controls .search-status {
  flex: 1 1 100%;
  width: 100%;
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.35;
  color: #92400e;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: 8px;
  padding: 0.45rem 0.65rem;
}

.controls .search-status[hidden] {
  display: none !important;
}

.admin-icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: #ffffff;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.controls button:not(.map-action-btn):not(.map-search-clear-btn):hover {
  background: #1e40af;
}

.controls .link-btn:not(.map-action-btn):hover {
  background: #000000;
}

.controls .link-btn:not(.map-action-btn):focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.provider-badge {
  margin-left: auto;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 0 0.7rem;
  border-radius: 999px;
  background: #e0e7ff;
  color: #1e3a8a;
  font-size: 0.85rem;
  font-weight: 700;
}

.map {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

/* Prevent hairline seams between Leaflet raster tiles on some GPUs/browsers. */
.leaflet-container .leaflet-tile {
  outline: 1px solid transparent;
}

.popup-content {
  min-width: 200px;
  max-width: 300px;
  display: flex;
  flex-direction: column;
  max-height: min(72vh, 28rem);
  overflow: hidden;
}

.popup-content--with-personnel {
  max-width: 328px;
}

.popup-header {
  display: grid;
  gap: 0.18rem;
  margin-bottom: 0.2rem;
  justify-items: center;
  flex-shrink: 0;
}

.popup-title {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1.15;
  text-align: center;
}

.popup-body {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  padding-bottom: 0.15rem;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

.popup-section--leadership {
  display: grid;
  gap: 0.28rem;
}

.popup-image-card {
  display: grid;
  place-items: center;
  text-decoration: none;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 0.25rem;
  background: #f8fafc;
  border: 1px solid #dbe3f0;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.12);
  min-height: 140px;
}

.popup-branch-image {
  width: 100%;
  height: 140px;
  object-fit: contain;
  object-position: center;
  display: block;
}

.popup-image-card--partner {
  min-height: 120px;
}

.popup-partner-image {
  padding: 0.35rem;
  box-sizing: border-box;
}

.popup-image-label {
  display: block;
  padding: 0.35rem 0.6rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: #1e3a8a;
  background: #eef2ff;
}

.popup-content p {
  margin: 0.2rem 0;
  font-size: 0.875rem;
}

.popup-meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  width: fit-content;
  border-radius: 999px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  padding: 0.18rem 0.55rem;
}

.popup-meta-label {
  color: #991b1b;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.popup-meta-value {
  color: #7f1d1d;
  font-size: 0.8rem;
  font-weight: 700;
}

.popup-row {
  display: grid;
  gap: 0.12rem;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 0.2rem 0.36rem;
  background: #ffffff;
}

.popup-key {
  font-size: 0.64rem;
  color: #475569;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.popup-value {
  font-size: 0.76rem;
  color: #0f172a;
  line-height: 1.15;
}

.popup-personnel-wrap {
  margin-top: 0.1rem;
  padding-top: 0.45rem;
  border-top: 1px solid #e2e8f0;
  pointer-events: auto;
  flex-shrink: 0;
  border: 1px solid #dbe3f0;
  border-radius: 10px;
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
  overflow: hidden;
}

.leaflet-popup-content .popup-personnel-wrap,
.leaflet-popup-content .popup-staff-summary,
.leaflet-popup-content [data-popup-interactive-root] {
  pointer-events: auto;
}

.popup-staff-summary {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  width: 100%;
  margin: 0;
  padding: 0.5rem 0.65rem;
  box-sizing: border-box;
  cursor: pointer;
  border: none;
  border-bottom: 1px solid transparent;
  border-radius: 0;
  background: transparent;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #1e3a8a;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease;
}

.popup-personnel-wrap.is-open .popup-staff-summary {
  border-bottom-color: #e2e8f0;
  background: rgba(255, 255, 255, 0.72);
}

.popup-staff-summary:hover {
  background: rgba(255, 255, 255, 0.9);
}

.popup-staff-summary:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: -2px;
}

.popup-staff-summary__text {
  flex: 1 1 auto;
  min-width: 0;
  text-align: left;
}

.popup-staff-summary__meta {
  flex: 0 0 auto;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
  color: #64748b;
  padding: 0.12rem 0.42rem;
  border-radius: 999px;
  background: #eef2f7;
  border: 1px solid #e2e8f0;
  white-space: nowrap;
}

.popup-staff-summary__chevron {
  flex: 0 0 auto;
  width: 0.5rem;
  height: 0.5rem;
  border-right: 2px solid #475569;
  border-bottom: 2px solid #475569;
  transform: rotate(45deg);
  margin-top: -0.12rem;
  transition: transform 0.18s ease;
}

.popup-personnel-wrap.is-open .popup-staff-summary__chevron {
  transform: rotate(225deg);
  margin-top: 0.08rem;
}

.popup-personnel-wrap .popup-staff-panel {
  display: none;
  padding: 0.45rem 0.5rem 0.55rem;
  gap: 0.4rem;
}

.popup-personnel-wrap.is-open .popup-staff-panel {
  display: grid;
  max-height: min(34vh, 13rem);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

.popup-staff-card {
  margin: 0;
  padding: 0.42rem 0.48rem;
  border: 1px solid #e8edf4;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.popup-staff-card__title {
  margin: 0 0 0.28rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #475569;
  line-height: 1.2;
}

.popup-staff-names {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.2rem;
}

.popup-staff-name {
  font-size: 0.78rem;
  font-weight: 500;
  color: #0f172a;
  line-height: 1.35;
  padding-left: 0.55rem;
  position: relative;
  word-break: break-word;
}

.popup-staff-name::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #1e3a8a;
  transform: translateY(-50%);
}

.leaflet-popup-content-wrapper {
  border-radius: 12px;
  overflow: hidden;
  max-height: min(84vh, 30rem);
  display: flex;
  flex-direction: column;
}

.leaflet-popup-content {
  margin: 10px 12px;
  line-height: 1.35;
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

@media (max-width: 480px) {
  .popup-content,
  .popup-content--with-personnel {
    max-width: min(92vw, 328px);
  }

  .popup-staff-summary {
    flex-wrap: wrap;
    row-gap: 0.25rem;
    padding: 0.45rem 0.55rem;
  }

  .popup-staff-summary__meta {
    margin-left: 0;
  }
}

.leaflet-branch-pin-wrap {
  background: transparent;
  border: 0;
}

.leaflet-branch-pin {
  display: block;
  width: 38px;
  height: 38px;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  filter: drop-shadow(0 4px 8px rgba(15, 23, 42, 0.24));
  position: relative;
  transition: transform 180ms ease, filter 180ms ease;
}

.leaflet-branch-pin.is-active {
  transform: scale(1.12);
  filter: drop-shadow(0 6px 12px rgba(185, 28, 28, 0.35));
}

.leaflet-branch-pin.is-overview-logo {
  transform: scale(0.94);
  filter: drop-shadow(0 5px 10px rgba(15, 23, 42, 0.18));
}

.modern-red-cluster-wrapper {
  background: transparent;
  border: 0;
}

.map-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.map-stage .map {
  flex: 1 1 auto;
  min-height: 0;
}

.map-cluster-hint,
.map-legend {
  display: none !important;
}

.map-legend {
  position: absolute;
  left: 0.5rem;
  bottom: 0.5rem;
  z-index: 800;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 0.55rem;
  max-width: min(22rem, calc(100% - 1rem));
  padding: 0.38rem 0.55rem;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(148, 163, 184, 0.4);
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.12);
  font-size: 0.7rem;
  font-weight: 600;
  color: #334155;
  pointer-events: none;
  backdrop-filter: blur(6px);
}

.map-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  white-space: nowrap;
}

.map-legend__hint {
  flex: 1 1 100%;
  font-size: 0.64rem;
  font-weight: 500;
  color: #64748b;
  line-height: 1.25;
}

.map-legend--public .map-legend__hint {
  flex: 0 1 auto;
}

.map-legend__swatch {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  flex-shrink: 0;
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.95);
}

.map-legend__swatch--branch {
  background: linear-gradient(145deg, #ef4444 0%, #b91c1c 100%);
}

.map-legend__swatch--partnership {
  background: radial-gradient(circle at 32% 28%, #6b9bd1 0%, #1e3a8a 48%, #0f172a 100%);
}

.map-cluster-hint {
  position: absolute;
  left: 50%;
  bottom: 3.1rem;
  z-index: 850;
  transform: translateX(-50%);
  max-width: min(18rem, calc(100% - 2rem));
  margin: 0;
  padding: 0.42rem 0.7rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.88);
  color: #f8fafc;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.28);
  pointer-events: none;
  backdrop-filter: blur(4px);
}

.map-cluster-hint[hidden] {
  display: none !important;
}

.modern-red-cluster {
  width: 56px;
  height: 52px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  position: relative;
  overflow: visible;
}

.modern-red-cluster img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  filter: drop-shadow(0 6px 10px rgba(15, 23, 42, 0.2));
  pointer-events: none;
}

.modern-red-cluster span {
  position: absolute;
  top: -2px;
  right: -4px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: linear-gradient(145deg, #ef4444 0%, #b91c1c 100%);
  border: 2px solid rgba(255, 255, 255, 0.95);
  color: rgba(255, 255, 255, 0.98);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 9px rgba(127, 29, 29, 0.28);
}

.modern-red-cluster.is-count-md span,
.partnership-navy-cluster.is-count-md .partnership-navy-cluster__count {
  min-width: 17px;
  height: 17px;
  font-size: 0.65rem;
}

.modern-red-cluster.is-count-lg span,
.partnership-navy-cluster.is-count-lg .partnership-navy-cluster__count {
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  font-size: 0.6rem;
}

.partnership-sphere-pin {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 28px;
  height: 42px;
  filter: drop-shadow(0 4px 9px rgba(15, 23, 42, 0.3));
  pointer-events: auto;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.partnership-sphere-pin--cluster {
  transform: scale(1.12);
  transform-origin: center bottom;
}

.partnership-sphere-pin.is-active {
  transform: scale(1.1);
  transform-origin: center bottom;
  filter: drop-shadow(0 6px 12px rgba(30, 58, 138, 0.45));
}

.partnership-sphere-pin__orb {
  position: relative;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #7ba7e8 0%, #3b5fbf 22%, #1e3a8a 52%, #0f172a 100%);
  box-shadow:
    inset -3px -4px 8px rgba(15, 23, 42, 0.4),
    0 2px 4px rgba(30, 58, 138, 0.35);
}

.partnership-sphere-pin__orb::after {
  content: "";
  position: absolute;
  top: 16%;
  left: 20%;
  width: 38%;
  height: 30%;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.2) 70%, transparent 100%);
}

.partnership-sphere-pin__stem {
  width: 3px;
  height: 17px;
  margin-top: -2px;
  border-radius: 2px;
  background: linear-gradient(180deg, #f1f5f9 0%, #cbd5e1 38%, #94a3b8 72%, #64748b 100%);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.2);
}

.leaflet-partnership-pin-wrap,
.leaflet-partnership-pin-wrap--photo {
  background: transparent !important;
  border: none !important;
}

.leaflet-partnership-pin-wrap.leaflet-marker-icon,
.leaflet-partnership-pin-wrap--photo.leaflet-marker-icon {
  pointer-events: auto !important;
  cursor: pointer;
  touch-action: manipulation;
}

.leaflet-pane.partnershipPane {
  z-index: 650 !important;
  pointer-events: none;
}

.leaflet-pane.partnershipPane .leaflet-marker-icon {
  pointer-events: auto;
}

.leaflet-partnership-photo-pin {
  position: relative;
  width: 40px;
  height: 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  filter: drop-shadow(0 4px 10px rgba(15, 23, 42, 0.28));
  transition: transform 180ms ease, filter 180ms ease;
  pointer-events: auto;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.leaflet-partnership-photo-pin.is-active {
  transform: scale(1.1);
  filter: drop-shadow(0 6px 14px rgba(30, 58, 138, 0.45));
}

.leaflet-partnership-photo-pin__head {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid #1e3a8a;
  background: #fff;
  box-sizing: border-box;
  flex-shrink: 0;
  box-shadow:
    inset -2px -3px 6px rgba(15, 23, 42, 0.2),
    0 2px 4px rgba(30, 58, 138, 0.3);
}

.leaflet-partnership-photo-pin.is-active .leaflet-partnership-photo-pin__head {
  border-color: #0f172a;
  box-shadow: 0 0 0 2px rgba(30, 58, 138, 0.4);
}

.leaflet-partnership-photo-pin__head img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.leaflet-partnership-photo-pin::after {
  content: "";
  width: 3px;
  height: 14px;
  margin-top: -1px;
  border-radius: 2px;
  background: linear-gradient(180deg, #f1f5f9 0%, #cbd5e1 38%, #94a3b8 72%, #64748b 100%);
}

.partnership-navy-cluster-wrapper {
  background: transparent;
  border: 0;
}

.partnership-navy-cluster-wrapper.leaflet-marker-icon {
  pointer-events: auto !important;
  cursor: pointer;
  touch-action: manipulation;
}

.partnership-navy-cluster {
  position: relative;
  width: 44px;
  height: 52px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: auto;
  cursor: pointer;
}

.partnership-navy-cluster__count {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  border-radius: 999px;
  background: linear-gradient(145deg, #1e40af 0%, #0f172a 100%);
  border: 2px solid rgba(255, 255, 255, 0.95);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 8px rgba(15, 23, 42, 0.35);
  z-index: 2;
}

.map-layer-toggles {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  padding: 0.22rem 0.35rem;
  background: #f8fafc;
  border: 1px solid var(--map-border);
  border-radius: 10px;
}

.map-layer-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: #334155;
  cursor: default;
  user-select: none;
  white-space: nowrap;
}

.map-layer-toggle input,
.map-layer-toggle__checkbox {
  width: 1.05rem;
  height: 1.05rem;
  margin: 0;
  padding: 0;
  accent-color: #1e3a8a;
  cursor: pointer;
  flex-shrink: 0;
  pointer-events: auto;
  position: relative;
  z-index: 2;
}

.map-layer-toggle__text {
  line-height: 1.1;
  pointer-events: none;
}

.map-layer-toggle__swatch {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  flex-shrink: 0;
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.95);
  pointer-events: none;
}

.map-layer-toggle__swatch--branch {
  background: linear-gradient(145deg, #ef4444 0%, #b91c1c 100%);
}

.map-layer-toggle__swatch--partnership {
  background: radial-gradient(circle at 32% 28%, #6b9bd1 0%, #1e3a8a 48%, #0f172a 100%);
}

:fullscreen .app-shell:not(.app-shell--public) {
  width: 100vw;
  height: var(--app-viewport-height);
  margin: 0;
  padding: 0.5rem;
  background-color: #f6f8fb;
}

:fullscreen .app-shell:not(.app-shell--public) .topbar,
:fullscreen .app-shell:not(.app-shell--public) .controls {
  border-radius: 8px;
}

:fullscreen .app-shell:not(.app-shell--public) .map {
  height: calc(var(--app-viewport-height) - 175px);
  min-height: unset;
  border-radius: 8px;
}

/* Public map — true edge-to-edge fullscreen (toolbar + map fill the display). */
html:fullscreen,
html:-webkit-full-screen {
  width: 100%;
  height: 100%;
  background: #ffffff;
}

html:fullscreen body.public-page,
html:-webkit-full-screen body.public-page {
  overflow: hidden;
  background: #ffffff;
}

html:fullscreen body.public-page .app-shell--public,
html:-webkit-full-screen body.public-page .app-shell--public {
  width: 100vw;
  height: var(--app-viewport-height);
  min-height: var(--app-viewport-height);
  max-width: none;
  margin: 0;
  padding: 0;
  background: #ffffff;
  display: flex;
  flex-direction: column;
}

html:fullscreen body.public-page .public-header,
html:-webkit-full-screen body.public-page .public-header {
  display: none;
}

html:fullscreen body.public-page .public-main,
html:-webkit-full-screen body.public-page .public-main {
  flex: 1 1 auto;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

html:fullscreen body.public-page .public-map-card,
html:-webkit-full-screen body.public-page .public-map-card {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  border-radius: 0;
  border: none;
  box-shadow: none;
}

html:fullscreen body.public-page .public-map-card__map,
html:fullscreen body.public-page .map-stage,
html:-webkit-full-screen body.public-page .public-map-card__map,
html:-webkit-full-screen body.public-page .map-stage {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

html:fullscreen body.public-page .map,
html:-webkit-full-screen body.public-page .map {
  flex: 1 1 auto;
  width: 100%;
  height: 100% !important;
  min-height: 0 !important;
  border-radius: 0;
}

html:fullscreen body.public-page .public-map-chrome,
html:-webkit-full-screen body.public-page .public-map-chrome {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 600;
  padding: calc(0.35rem + var(--safe-top)) max(0.55rem, var(--safe-right)) 0.35rem max(0.55rem, var(--safe-left));
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.98) 0%,
    rgba(255, 255, 255, 0.96) 78%,
    rgba(255, 255, 255, 0) 100%
  );
  gap: 0.2rem;
}

html:fullscreen body.public-page .public-toolbar--dock .public-toolbar__dock,
html:-webkit-full-screen body.public-page .public-toolbar--dock .public-toolbar__dock {
  padding: 0.4rem 0.45rem;
  border-radius: 0.8rem;
}

html:fullscreen body.public-page .public-map-card--immersive .map,
html:-webkit-full-screen body.public-page .public-map-card--immersive .map {
  position: absolute;
  inset: 0;
  height: 100% !important;
}


/* Mobile fallback when native Fullscreen API is blocked. */
body.is-fallback-fullscreen {
  overflow: hidden;
}

body.is-fallback-fullscreen .app-shell {
  position: fixed;
  inset: 0;
  width: 100%;
  height: var(--app-viewport-height);
  min-height: 100%;
  margin: 0;
  padding: max(0.35rem, env(safe-area-inset-top)) max(0.35rem, env(safe-area-inset-right))
    max(0.35rem, env(safe-area-inset-bottom)) max(0.35rem, env(safe-area-inset-left));
  background-color: #f6f8fb;
  z-index: 9999;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 0.4rem;
  overflow: hidden;
}

body.is-fallback-fullscreen.public-page {
  overflow: hidden;
  background: #ffffff;
}

body.is-fallback-fullscreen.public-page .app-shell--public {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: var(--app-viewport-height);
  min-height: var(--app-viewport-height);
  max-width: none;
  margin: 0;
  padding: 0;
  background: #ffffff;
  overflow: hidden;
}

body.is-fallback-fullscreen.public-page .public-header {
  display: none;
}

body.is-fallback-fullscreen.public-page .public-main {
  flex: 1 1 auto;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

body.is-fallback-fullscreen.public-page .public-map-card {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  border-radius: 0;
  border: none;
  box-shadow: none;
}

body.is-fallback-fullscreen.public-page .public-map-card__map,
body.is-fallback-fullscreen.public-page .map-stage {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
  display: flex;
  flex-direction: column;
}

body.is-fallback-fullscreen.public-page .public-map-chrome {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 600;
  padding: calc(0.5rem + var(--safe-top)) max(0.55rem, var(--safe-right)) 0 max(0.55rem, var(--safe-left));
  pointer-events: none;
}

body.is-fallback-fullscreen.public-page .public-map-chrome > * {
  pointer-events: auto;
}

body.is-fallback-fullscreen.public-page .public-map-card--immersive .map {
  position: absolute;
  inset: 0;
  height: 100% !important;
  min-height: 0 !important;
}

body.is-fallback-fullscreen .map {
  height: auto;
  min-height: 0;
  border-radius: 8px;
}

body.is-fallback-fullscreen.public-page .map {
  flex: 1 1 auto;
  width: 100%;
  height: 100% !important;
  min-height: 0 !important;
  border-radius: 0;
}

/* Safari fullscreen fallback selector */
:-webkit-full-screen .app-shell:not(.app-shell--public) {
  width: 100vw;
  height: var(--app-viewport-height);
  margin: 0;
  padding: 0.5rem;
  background-color: #f6f8fb;
}

:-webkit-full-screen .app-shell:not(.app-shell--public) .map {
  height: calc(var(--app-viewport-height) - 175px);
  min-height: unset;
  border-radius: 8px;
}

@media (max-width: 700px) {
  .app-shell {
    width: 100%;
    margin: 0;
    padding: 0;
    gap: 0;
    min-height: var(--app-viewport-height);
    height: var(--app-viewport-height);
    max-height: var(--app-viewport-height);
  }

  .topbar {
    padding: 0.5rem 0.7rem;
    text-align: center;
  }

  .topbar h1 {
    font-size: clamp(0.82rem, 3.8vw, 0.98rem);
    line-height: 1.25;
  }

  .topbar p {
    display: block;
    font-size: 0.62rem;
    margin-top: 0.15rem;
    line-height: 1.2;
  }

  /* —— Mobile: immersive map-first layout —— */
  .app-shell--public {
    min-height: var(--app-viewport-height);
    height: var(--app-viewport-height);
    max-height: var(--app-viewport-height);
    overflow: hidden;
    padding-left: 0;
    padding-right: 0;
    background: #0f172a;
  }

  body.public-page {
    height: var(--app-viewport-height);
    max-height: var(--app-viewport-height);
    overflow: hidden;
    background: #0f172a;
  }

  .public-page {
    background: #0f172a;
  }

  .public-header {
    padding: calc(0.45rem + var(--safe-top)) max(0.75rem, var(--safe-right)) 0.45rem max(0.75rem, var(--safe-left));
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 48%, #312e81 100%);
    border-bottom: none;
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.35);
  }

  .public-header__inner {
    max-width: none;
    gap: 0.5rem;
  }

  .public-brand__logo {
    width: 2rem;
    height: 2rem;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.25));
  }

  .public-brand__title--full {
    display: block;
    font-size: clamp(0.68rem, 2.8vw, 0.88rem);
    font-weight: 700;
    color: #f8fafc;
    letter-spacing: 0.01em;
    line-height: 1.2;
    white-space: normal;
  }

  .public-brand__title--short {
    display: none;
  }

  .public-brand__sub {
    display: block;
    font-size: 0.65rem;
    color: rgba(226, 232, 240, 0.75);
    font-weight: 500;
  }

  .public-header__cta {
    padding: 0.42rem 0.85rem;
    font-size: 0.72rem;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.22);
    box-shadow: none;
    backdrop-filter: blur(8px);
  }

  .public-header__cta-label--long {
    display: none;
  }

  .public-header__cta-label:not(.public-header__cta-label--long) {
    display: inline;
    color: #f8fafc;
  }

  .public-header__cta:hover {
    background: rgba(255, 255, 255, 0.22);
    transform: none;
  }

  .public-main {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    overflow: hidden;
  }

  .public-map-card--immersive {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    border: none;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
  }

  .public-map-card--immersive .map-stage,
  .app-shell--public .public-map-card__map {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    width: 100%;
    position: relative;
  }

  .public-map-card--immersive .map,
  .app-shell--public .public-map-card__map .map {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: none;
    flex: none;
    z-index: 1;
  }

  .app-shell--public .public-map-card__map .map.leaflet-container {
    min-height: 0 !important;
    height: 100% !important;
  }

  .public-map-chrome {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.3rem;
    padding: 0.45rem max(0.5rem, var(--safe-left)) 0 max(0.5rem, var(--safe-right));
    pointer-events: none;
  }

  .map-controls-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: flex-end;
    gap: 0.3rem;
    min-height: 1.95rem;
    padding: 0 0.72rem;
    border-radius: 0.58rem;
    border: 1px solid #1e3a8a;
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    box-shadow: 0 6px 14px rgba(30, 64, 175, 0.22);
    pointer-events: auto;
    flex-shrink: 0;
  }

  .public-map-chrome > * {
    pointer-events: auto;
  }

  .public-toolbar--dock.controls {
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
  }

  .public-map-chrome {
    --public-dock-offset: 2.65rem;
  }

  .public-map-chrome:not(.is-controls-collapsed) {
    --public-dock-offset: 8.95rem;
  }

  .public-map-chrome.is-controls-collapsed {
    --public-dock-offset: 2.65rem;
  }

  .public-toolbar--dock.is-collapsed {
    opacity: 0;
    transform: translateY(-10px);
    max-height: 0;
    overflow: hidden;
    pointer-events: none;
    margin: 0;
    transition: opacity 0.18s ease, transform 0.2s ease, max-height 0.22s ease;
  }

  .public-toolbar--dock.is-expanded {
    opacity: 1;
    transform: translateY(0);
    max-height: none;
    pointer-events: auto;
    transition: opacity 0.18s ease, transform 0.2s ease, max-height 0.22s ease;
  }

  .public-toolbar--dock .public-toolbar__dock {
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    flex-wrap: nowrap !important;
    gap: 0.42rem;
    padding: 0.5rem;
    border-radius: 0.75rem;
    background: #ffffff;
    border: 1px solid #dbe4ef;
    box-shadow:
      0 6px 16px rgba(15, 23, 42, 0.1),
      0 1px 6px rgba(15, 23, 42, 0.05);
  }

  .public-toolbar--dock .public-toolbar__filters {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.4rem;
    width: 100%;
    min-width: 0;
    flex: 0 0 auto;
  }

  .public-toolbar--dock .map-filter-field {
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    min-width: 0;
    max-width: none !important;
    align-self: stretch;
    gap: 0.26rem;
  }

  .public-toolbar--dock .public-toolbar__actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0.35rem;
    width: 100%;
    min-width: 0;
  }

  .public-toolbar--dock .map-filter-field {
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    gap: 0.28rem;
    position: relative;
    width: 100%;
    min-width: 0;
    flex: 0 0 auto !important;
    max-width: none !important;
  }

  .app-shell--public .public-toolbar--dock .map-filter-field--search,
  .app-shell--public .public-toolbar--dock .map-filter-field--type {
    flex: 0 0 auto !important;
    max-width: none !important;
  }

  .public-toolbar--dock .map-filter-input-wrap {
    position: relative;
    width: 100%;
    min-width: 0;
  }

  .public-toolbar--dock .map-filter-label {
    position: static;
    width: auto;
    height: auto;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    clip: auto;
    white-space: nowrap;
    border: 0;
    color: #334155;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    line-height: 1.2;
  }

  .public-toolbar--dock .map-filter-field--search,
  .public-toolbar--dock .map-filter-field--type {
    width: 100%;
    min-width: 0;
  }

  .public-toolbar--dock .map-filter-icon {
    display: flex;
    position: absolute;
    left: 0.62rem;
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
    color: #1e3a8a;
    pointer-events: none;
    z-index: 1;
  }

  .public-toolbar--dock .map-filter-field--search input,
  .public-toolbar--dock .map-filter-field--type select {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    min-height: 2.35rem;
    font-size: 15px;
    border-radius: 0.62rem;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #0f172a;
  }

  .public-toolbar--dock .map-filter-field--search input {
    padding: 0 0.72rem 0 2.2rem;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
    font-weight: 500;
  }

  .public-toolbar--dock .map-filter-field--type select {
    padding-right: 1.8rem;
    text-overflow: ellipsis;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
    font-weight: 600;
  }

  .public-toolbar--dock .map-action-btn--primary,
  .public-toolbar--dock .map-action-btn--ghost {
    width: 100%;
    min-width: 0;
    min-height: 2.3rem;
    padding: 0 0.65rem;
    margin: 0;
    justify-content: center;
    align-items: center;
    border-radius: 0.62rem;
    gap: 0.35rem;
    flex: 1 1 auto;
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0.01em;
  }

  .public-toolbar--dock .map-action-btn--primary {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
    border: 1px solid #1e3a8a;
    box-shadow: 0 6px 14px rgba(30, 64, 175, 0.22);
  }

  .public-toolbar--dock .map-action-btn--ghost {
    border: 1px solid #cbd5e1;
    color: #1e293b;
    background: #ffffff;
  }

  .public-toolbar--dock .map-action-btn--dock .map-action-label {
    position: static !important;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    overflow: visible !important;
    clip: auto !important;
    white-space: nowrap !important;
    border: 0 !important;
    font-size: 0.72rem;
    line-height: 1;
  }

  .public-toolbar--dock .map-filter-field--search input:focus,
  .public-toolbar--dock .map-filter-field--type select:focus {
    border-color: #1d4ed8;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
    outline: none;
  }

  .public-toolbar--dock .map-action-btn--dock .map-action-label[hidden] {
    display: none !important;
  }

  .public-toolbar--dock .map-action-btn--dock .map-action-icon-wrap,
  .public-toolbar--dock .map-action-btn--dock .map-action-icon {
    width: 0.94rem;
    height: 0.94rem;
  }


  .public-map-card--immersive .public-map-toast.search-status {
    position: absolute;
    left: max(0.55rem, var(--safe-left));
    right: max(0.55rem, var(--safe-right));
    bottom: max(0.65rem, var(--safe-bottom));
    margin: 0;
    padding: 0.5rem 0.7rem;
    border-radius: 0.6rem;
    background: rgba(15, 23, 42, 0.92);
    color: #f8fafc;
    font-size: 0.75rem;
    line-height: 1.4;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.28);
    z-index: 650;
    pointer-events: none;
  }

  .public-map-card--immersive .public-map-toast.search-status:not([hidden]) {
    display: block;
  }

  .app-shell--public .map .leaflet-top.leaflet-left {
    top: calc(var(--public-dock-offset, 6.8rem) + 0.45rem + var(--safe-top));
    left: max(0.45rem, var(--safe-left));
  }

  .app-shell--public .map .leaflet-control-zoom {
    border: none;
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.12);
    border-radius: 0.65rem;
    overflow: hidden;
  }

  .app-shell--public .map .leaflet-control-zoom a {
    width: 2.35rem;
    height: 2.35rem;
    line-height: 2.35rem;
    font-size: 1.05rem;
    color: #334155;
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(226, 232, 240, 0.9);
  }

  .app-shell--public .map .leaflet-control-zoom a:hover {
    background: #f8fafc;
    color: #6d28d9;
  }

  .app-shell--public .map .leaflet-bottom.leaflet-right {
    bottom: max(0.65rem, var(--safe-bottom));
  }

  /* Toolbar: filters + compact action cluster (admin / legacy) */
  .map-toolbar.controls:not(.public-toolbar) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(4.25rem, 0.4fr) auto;
    grid-template-rows: auto auto;
    gap: 0.2rem 0.45rem;
    padding: 0.5rem 0.55rem;
    align-items: end;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
  }

  .map-toolbar.controls:not(.public-toolbar) .map-filter-field {
    display: contents;
  }

  .map-toolbar.controls:not(.public-toolbar) .map-filter-label {
    display: block;
    font-size: 0.6rem;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
    padding: 0;
  }

  .map-toolbar.controls:not(.public-toolbar) .map-filter-field--search label {
    grid-column: 1;
    grid-row: 1;
  }

  .map-toolbar.controls:not(.public-toolbar) .map-filter-field--search input {
    grid-column: 1;
    grid-row: 2;
    min-width: 0;
    width: 100%;
    min-height: 2.5rem;
    font-size: 16px;
    padding: 0 0.5rem;
    border-radius: 8px;
  }

  .map-toolbar.controls:not(.public-toolbar) .map-filter-field--type label {
    grid-column: 2;
    grid-row: 1;
  }

  .map-toolbar.controls:not(.public-toolbar) .map-filter-field--type select {
    grid-column: 2;
    grid-row: 2;
    min-width: 0;
    width: 100%;
    min-height: 2.5rem;
    font-size: 0.8125rem;
    padding: 0 0.35rem;
    border-radius: 8px;
  }

  .map-toolbar.controls:not(.public-toolbar) .map-filter-actions.map-action-group {
    display: flex;
    grid-column: 3;
    grid-row: 1 / 3;
    align-self: end;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 0.22rem;
    padding: 0.18rem;
    max-width: 100%;
  }

  .map-toolbar.controls:not(.public-toolbar) .map-action-btn {
    min-width: 2.5rem;
    min-height: 2.5rem;
    padding: 0 0.45rem;
    border-radius: 8px;
    flex: 0 0 auto;
  }

  .map-toolbar.controls:not(.public-toolbar):not(.map-toolbar--formal) .map-action-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .map-toolbar.controls:not(.public-toolbar) .map-action-btn--admin .map-action-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }

  .controls .search-status {
    grid-column: 1 / -1;
    grid-row: 3;
    margin-top: 0.15rem;
  }

  .map-legend {
    left: 0.35rem;
    bottom: 0.35rem;
    max-width: calc(100% - 0.7rem);
    padding: 0.3rem 0.42rem;
    font-size: 0.62rem;
  }

  .map-legend__hint {
    display: none;
  }

  .map-cluster-hint {
    bottom: 2.35rem;
    font-size: 0.65rem;
    padding: 0.34rem 0.55rem;
  }

  .map {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    border-radius: 0;
  }

  body.is-fallback-fullscreen .map {
    height: auto;
    min-height: 0;
    border-radius: 0;
  }

  body.is-fallback-fullscreen .controls {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.5rem;
    padding: 0.65rem 0.7rem;
  }

  body.is-fallback-fullscreen .map-filter-field {
    flex: 1 1 9rem;
    min-width: 8rem;
  }

  body.is-fallback-fullscreen .map-filter-actions {
    flex: 0 0 auto;
    display: flex;
    flex-wrap: nowrap;
    width: auto;
  }

  .provider-badge {
    margin-left: 0;
    width: fit-content;
    min-height: 34px;
    font-size: 0.78rem;
  }

}

@media (max-width: 390px) {
  .topbar h1 {
    font-size: 0.88rem;
  }

  .controls {
    padding: 0.6rem 0.65rem;
  }

  body.is-fallback-fullscreen .map {
    height: auto;
    min-height: 0;
    border-radius: 0;
  }

  body.is-fallback-fullscreen .controls {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.45rem;
    padding: 0.55rem 0.6rem;
  }

  body.is-fallback-fullscreen .map-filter-field {
    flex: 1 1 8rem;
    min-width: 7rem;
  }

  body.is-fallback-fullscreen .map-filter-actions {
    flex: 0 0 auto;
    display: flex;
    flex-wrap: nowrap;
    width: auto;
  }

  body.is-fallback-fullscreen .controls .admin-icon-btn {
    width: 44px;
    min-width: 44px;
  }
}

@media (orientation: portrait) and (min-width: 700px) {
  .app-shell {
    grid-template-rows: auto auto 1fr;
    padding: 0.65rem;
    gap: 0.65rem;
  }

  .topbar {
    padding: 1.35rem 1.1rem;
  }

  .topbar h1 {
    font-size: clamp(1.15rem, 2.7vw, 2rem);
  }

  .topbar p {
    font-size: clamp(0.82rem, 1.35vw, 1.05rem);
  }

  .controls {
    gap: 0.85rem;
    padding: 0.9rem 1rem;
  }

  .controls input,
  .controls select,
  .controls button,
  .controls .link-btn,
  .provider-badge {
    min-height: 50px;
    font-size: 1rem;
  }

  .map {
    height: calc(var(--app-viewport-height) - 250px);
    min-height: 500px;
  }
}

@media (orientation: landscape) and (min-width: 1024px) {
  .app-shell {
    padding: 0.65rem;
    gap: 0.6rem;
  }

  .topbar {
    padding: 1rem 1rem;
  }

  .controls {
    padding: 0.8rem 1rem;
    gap: 0.7rem;
  }

  .controls input,
  .controls select,
  .controls button,
  .controls .link-btn,
  .provider-badge {
    min-height: 46px;
    font-size: 0.97rem;
  }

  .map {
    height: calc(var(--app-viewport-height) - 205px);
    min-height: 420px;
  }
}

@media (orientation: landscape) and (max-height: 820px) {
  .app-shell {
    grid-template-rows: auto auto 1fr;
    padding: 0.45rem;
    gap: 0.45rem;
  }

  .topbar {
    padding: 0.72rem 0.85rem;
  }

  .topbar h1 {
    font-size: clamp(0.95rem, 1.7vw, 1.3rem);
  }

  .topbar p {
    margin-top: 0.25rem;
    font-size: clamp(0.72rem, 1vw, 0.86rem);
  }

  .controls {
    gap: 0.5rem;
    padding: 0.58rem 0.72rem;
  }

  .controls label {
    font-size: 0.82rem;
  }

  .controls input,
  .controls select,
  .controls button,
  .controls .link-btn,
  .provider-badge {
    min-height: 34px;
    font-size: 0.86rem;
  }

  .map {
    height: calc(var(--app-viewport-height) - 150px);
    min-height: 340px;
  }
}

@media (min-width: 1920px) {
  .app-shell {
    padding: 0.85rem;
    gap: 0.8rem;
  }

  .topbar h1 {
    font-size: clamp(1.3rem, 1.9vw, 2.2rem);
  }

  .topbar p {
    font-size: clamp(0.9rem, 1vw, 1.12rem);
  }

  .controls {
    padding: 1rem 1.2rem;
    gap: 0.9rem;
  }

  .controls input,
  .controls select,
  .controls button,
  .controls .link-btn,
  .provider-badge {
    min-height: 54px;
    font-size: 1.06rem;
  }

  .map {
    height: calc(var(--app-viewport-height) - 235px);
    min-height: 560px;
  }
}

/* Professional non-fullscreen refinement (mobile-first, keeps fullscreen behavior) */
.app-shell {
  height: var(--app-viewport-height);
  grid-template-rows: auto auto minmax(0, 1fr);
  padding: 0.55rem;
  gap: 0.55rem;
}

.topbar {
  border: 1px solid rgba(148, 163, 184, 0.28);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.24);
}

.controls {
  border: 1px solid #d9e2ef;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.controls input,
.controls select {
  background: #f8fafc;
  color: #1f2937;
}

.controls button,
.controls .link-btn {
  border-radius: 10px;
  letter-spacing: 0.01em;
  white-space: nowrap;
  transition: background-color 160ms ease, box-shadow 160ms ease, transform 120ms ease;
}

.controls input::placeholder {
  color: #94a3b8;
}

.controls input:focus-visible,
.controls select:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.28);
  outline-offset: 1px;
  border-color: #93c5fd;
}

.controls button:not(.map-action-btn):not(.map-search-clear-btn) {
  background: #1e3a8a;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
  white-space: normal;
  line-height: 1.1;
  text-align: center;
}

.controls button:not(.map-action-btn):not(.map-search-clear-btn):hover {
  background: #1d4ed8;
}

.controls button:not(.map-action-btn):not(.map-search-clear-btn):active,
.controls .link-btn:not(.map-action-btn):active {
  transform: translateY(1px);
}

.map {
  height: auto;
  min-height: 0;
  border-radius: 0;
  box-shadow: none;
  flex: 1 1 auto;
}

@media (min-width: 701px) {
  .map-action-group {
    gap: 0.32rem;
    padding: 0.28rem;
  }

  .map-action-btn {
    min-height: var(--map-touch);
    padding: 0 0.85rem;
  }

  .map-action-label {
    max-width: none;
  }
}

@media (min-width: 701px) and (max-width: 1024px) {
  .map-toolbar.controls {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-end;
    gap: 0.45rem 0.55rem;
  }

  .map-filter-field--search {
    flex: 1 1 12rem;
  }

  .map-filter-field--type {
    flex: 0 1 8.5rem;
  }

  .map-filter-actions.map-action-group {
    flex: 0 0 auto;
    margin-left: auto;
  }
}

@media (min-width: 1025px) {
  .app-shell {
    max-width: 1600px;
    margin-inline: auto;
    padding: 0.5rem;
    gap: 0.5rem;
    border-radius: 0;
  }

  .topbar {
    border-radius: var(--map-radius);
  }

  .map-toolbar.controls {
    border-radius: var(--map-radius);
    border: 1px solid var(--map-border);
  }

  .map {
    min-height: 420px;
    height: calc(var(--app-viewport-height) - 12rem);
    border-radius: var(--map-radius);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
  }
}

@media (max-width: 380px) {
  .map-toolbar.controls {
    grid-template-columns: minmax(0, 1fr) minmax(3.75rem, 0.38fr) auto;
    gap: 0.15rem 0.32rem;
    padding: 0.42rem 0.45rem;
  }

  .map-action-btn {
    min-width: 2.35rem;
    min-height: 2.35rem;
    padding: 0;
  }

  .map-action-icon,
  .map-action-icon-wrap {
    width: 1rem;
    height: 1rem;
  }
}

@media (min-width: 480px) and (max-width: 700px) {
  .map-toolbar.controls:not(.public-toolbar) .map-action-label {
    position: static;
    width: auto;
    height: auto;
    margin: 0;
    clip: auto;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 2.75rem;
    font-size: 0.72rem;
  }

  .map-toolbar.controls:not(.public-toolbar) .map-action-btn {
    min-width: auto;
    padding: 0 0.5rem;
  }
}

/* Preserve fullscreen sizing after non-fullscreen overrides (legacy/admin shells). */
:fullscreen.app-shell .map,
:fullscreen .app-shell:not(.app-shell--public) .map {
  height: calc(var(--app-viewport-height) - 175px);
  min-height: unset;
}

:-webkit-full-screen.app-shell .map,
:-webkit-full-screen .app-shell:not(.app-shell--public) .map {
  height: calc(var(--app-viewport-height) - 175px);
  min-height: unset;
}

@media (max-width: 1023px) {
  body {
    padding-left: env(safe-area-inset-left, 0);
    padding-right: env(safe-area-inset-right, 0);
    padding-bottom: env(safe-area-inset-bottom, 0);
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .app-shell {
    padding: 0.55rem;
    max-width: 100%;
  }

  .map {
    min-height: calc(var(--app-viewport-height) - 240px);
  }
}

@media (hover: none) and (pointer: coarse) {
  .controls input,
  .controls select,
  .controls button,
  .controls .link-btn {
    min-height: 44px;
  }
}

@media (min-width: 1920px) {
  .app-shell:not(.app-shell--public) {
    width: min(100%, 2400px);
    margin-inline: auto;
  }

  .topbar h1 {
    font-size: clamp(1.35rem, 1.5vw, 2.1rem);
  }

  .map {
    min-height: calc(var(--app-viewport-height) - 220px);
  }
}

@media (min-width: 2560px) {
  .app-shell:not(.app-shell--public) {
    width: min(100%, 2800px);
  }
}

/* —— Public map: phones (compact) —— */
@media (max-width: 479px) {
  .public-brand__title--full {
    font-size: clamp(0.62rem, 2.5vw, 0.78rem);
    line-height: 1.15;
  }

  .public-header__cta {
    padding: 0.4rem 0.7rem;
  }

  .public-toolbar--dock .public-toolbar__dock {
    padding: 0.5rem;
    border-radius: 0.85rem;
  }

  .public-toolbar--dock .map-action-btn--primary .map-action-label {
    font-size: 0.75rem;
  }
}

/* Fullscreen / fallback: same dock grid; tighter offset (no site header) */
body.public-map-fullscreen-active .public-map-chrome,
html:fullscreen body.public-page .public-map-chrome,
html:-webkit-full-screen body.public-page .public-map-chrome,
body.is-fallback-fullscreen.public-page .public-map-chrome {
  padding-top: calc(0.35rem + var(--safe-top));
  --public-dock-offset: 5.15rem;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.98) 0%,
    rgba(255, 255, 255, 0.96) 72%,
    rgba(255, 255, 255, 0) 100%
  );
  gap: 0.2rem;
}

body.public-map-fullscreen-active .public-map-card--immersive .map-stage,
html:fullscreen body.public-page .public-map-card--immersive .map-stage,
html:-webkit-full-screen body.public-page .public-map-card--immersive .map-stage,
body.is-fallback-fullscreen.public-page .public-map-card--immersive .map-stage {
  --public-dock-offset: 5.15rem;
}

body.public-map-fullscreen-active .app-shell--public .map .leaflet-top.leaflet-left,
html:fullscreen body.public-page .map .leaflet-top.leaflet-left,
html:-webkit-full-screen body.public-page .map .leaflet-top.leaflet-left,
body.is-fallback-fullscreen.public-page .map .leaflet-top.leaflet-left {
  top: calc(var(--public-dock-offset, 5.15rem) + 0.25rem + var(--safe-top));
}

body.public-map-fullscreen-active .public-map-card--immersive .public-map-toast,
html:fullscreen body.public-page .public-map-toast,
html:-webkit-full-screen body.public-page .public-map-toast,
body.is-fallback-fullscreen.public-page .public-map-toast {
  bottom: max(0.75rem, var(--safe-bottom));
}

@media (min-width: 701px) {
  body.public-map-fullscreen-active .public-map-chrome,
  html:fullscreen body.public-page .public-map-chrome,
  html:-webkit-full-screen body.public-page .public-map-chrome,
  body.is-fallback-fullscreen.public-page .public-map-chrome {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 600;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.2rem;
    padding: calc(0.35rem + var(--safe-top)) max(0.6rem, var(--safe-right)) 0.35rem max(0.6rem, var(--safe-left));
    pointer-events: none;
    background: linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.98) 0%,
      rgba(255, 255, 255, 0.96) 78%,
      rgba(255, 255, 255, 0) 100%
    );
  }

  body.public-map-fullscreen-active .public-map-chrome > *,
  html:fullscreen body.public-page .public-map-chrome > *,
  html:-webkit-full-screen body.public-page .public-map-chrome > *,
  body.is-fallback-fullscreen.public-page .public-map-chrome > * {
    pointer-events: auto;
  }

  body.public-map-fullscreen-active .map-controls-toggle,
  html:fullscreen body.public-page .map-controls-toggle,
  html:-webkit-full-screen body.public-page .map-controls-toggle,
  body.is-fallback-fullscreen.public-page .map-controls-toggle {
    display: inline-flex !important;
    align-self: flex-end;
    flex-shrink: 0;
    margin: 0;
  }

  body.public-map-fullscreen-active .public-toolbar--dock.map-toolbar--collapsible.is-collapsed,
  html:fullscreen body.public-page .public-toolbar--dock.map-toolbar--collapsible.is-collapsed,
  html:-webkit-full-screen body.public-page .public-toolbar--dock.map-toolbar--collapsible.is-collapsed,
  body.is-fallback-fullscreen.public-page .public-toolbar--dock.map-toolbar--collapsible.is-collapsed {
    opacity: 0;
    transform: translateY(-10px);
    max-height: 0;
    overflow: hidden;
    pointer-events: none;
    margin: 0;
    transition: opacity 0.18s ease, transform 0.2s ease, max-height 0.22s ease;
  }

  body.public-map-fullscreen-active .public-toolbar--dock.map-toolbar--collapsible.is-expanded,
  html:fullscreen body.public-page .public-toolbar--dock.map-toolbar--collapsible.is-expanded,
  html:-webkit-full-screen body.public-page .public-toolbar--dock.map-toolbar--collapsible.is-expanded,
  body.is-fallback-fullscreen.public-page .public-toolbar--dock.map-toolbar--collapsible.is-expanded {
    opacity: 1;
    transform: translateY(0);
    max-height: none;
    pointer-events: auto;
    transition: opacity 0.18s ease, transform 0.2s ease, max-height 0.22s ease;
  }

}

/* Public fullscreen desktop (landscape): compact professional toolbar row */
@media (min-width: 1025px) and (orientation: landscape) {
  body.public-map-fullscreen-active .public-map-chrome,
  html:fullscreen body.public-page .public-map-chrome,
  html:-webkit-full-screen body.public-page .public-map-chrome,
  body.is-fallback-fullscreen.public-page .public-map-chrome {
    padding: calc(0.35rem + var(--safe-top)) max(0.8rem, var(--safe-right)) 0 max(0.8rem, var(--safe-left));
    --public-dock-offset: 4.95rem;
    align-items: center;
  }

  body.public-map-fullscreen-active .public-map-chrome:not(.is-controls-collapsed),
  html:fullscreen body.public-page .public-map-chrome:not(.is-controls-collapsed),
  html:-webkit-full-screen body.public-page .public-map-chrome:not(.is-controls-collapsed),
  body.is-fallback-fullscreen.public-page .public-map-chrome:not(.is-controls-collapsed) {
    --public-dock-offset: 4.95rem;
  }

  body.public-map-fullscreen-active .public-map-chrome.is-controls-collapsed,
  html:fullscreen body.public-page .public-map-chrome.is-controls-collapsed,
  html:-webkit-full-screen body.public-page .public-map-chrome.is-controls-collapsed,
  body.is-fallback-fullscreen.public-page .public-map-chrome.is-controls-collapsed {
    --public-dock-offset: 2.8rem;
  }

  body.public-map-fullscreen-active .public-toolbar--dock.controls,
  html:fullscreen body.public-page .public-toolbar--dock.controls,
  html:-webkit-full-screen body.public-page .public-toolbar--dock.controls,
  body.is-fallback-fullscreen.public-page .public-toolbar--dock.controls {
    width: min(100%, 1180px);
    margin: 0 auto;
    background: transparent;
    border: none;
    padding: 0;
  }

  body.public-map-fullscreen-active .map-controls-toggle,
  html:fullscreen body.public-page .map-controls-toggle,
  html:-webkit-full-screen body.public-page .map-controls-toggle,
  body.is-fallback-fullscreen.public-page .map-controls-toggle {
    min-height: 1.85rem;
    padding: 0 0.58rem;
    border-radius: 0.52rem;
    border: 1px solid #1e3a8a;
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
    color: #ffffff;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1;
    box-shadow: 0 5px 10px rgba(30, 64, 175, 0.22);
  }

  body.public-map-fullscreen-active .public-toolbar--dock .public-toolbar__dock,
  html:fullscreen body.public-page .public-toolbar--dock .public-toolbar__dock,
  html:-webkit-full-screen body.public-page .public-toolbar--dock .public-toolbar__dock,
  body.is-fallback-fullscreen.public-page .public-toolbar--dock .public-toolbar__dock {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-end;
    gap: 0.58rem 0.75rem;
    padding: 0.55rem 0.7rem;
    border-radius: 0.82rem;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.96) 100%);
    border: 1px solid rgba(203, 213, 225, 0.95);
    box-shadow:
      0 14px 30px rgba(15, 23, 42, 0.14),
      0 3px 10px rgba(15, 23, 42, 0.06);
    backdrop-filter: saturate(1.05) blur(2px);
  }

  body.public-map-fullscreen-active .public-toolbar--dock .public-toolbar__filters,
  html:fullscreen body.public-page .public-toolbar--dock .public-toolbar__filters,
  html:-webkit-full-screen body.public-page .public-toolbar--dock .public-toolbar__filters,
  body.is-fallback-fullscreen.public-page .public-toolbar--dock .public-toolbar__filters {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-end;
    flex: 1 1 auto;
    gap: 0.5rem;
    min-width: 0;
  }

  body.public-map-fullscreen-active .public-toolbar--dock .map-filter-field--search,
  html:fullscreen body.public-page .public-toolbar--dock .map-filter-field--search,
  html:-webkit-full-screen body.public-page .public-toolbar--dock .map-filter-field--search,
  body.is-fallback-fullscreen.public-page .public-toolbar--dock .map-filter-field--search {
    flex: 2 1 17rem;
    max-width: 26rem;
  }

  body.public-map-fullscreen-active .public-toolbar--dock .map-filter-field--type,
  html:fullscreen body.public-page .public-toolbar--dock .map-filter-field--type,
  html:-webkit-full-screen body.public-page .public-toolbar--dock .map-filter-field--type,
  body.is-fallback-fullscreen.public-page .public-toolbar--dock .map-filter-field--type {
    flex: 0 1 11rem;
    min-width: 9.25rem;
  }

  body.public-map-fullscreen-active .public-toolbar--dock .public-toolbar__actions,
  html:fullscreen body.public-page .public-toolbar--dock .public-toolbar__actions,
  html:-webkit-full-screen body.public-page .public-toolbar--dock .public-toolbar__actions,
  body.is-fallback-fullscreen.public-page .public-toolbar--dock .public-toolbar__actions {
    display: flex;
    flex-wrap: nowrap;
    width: auto;
    margin-left: auto;
    gap: 0.35rem;
  }

  body.public-map-fullscreen-active .public-toolbar--dock .map-action-btn--primary,
  body.public-map-fullscreen-active .public-toolbar--dock .map-action-btn--ghost,
  html:fullscreen body.public-page .public-toolbar--dock .map-action-btn--primary,
  html:fullscreen body.public-page .public-toolbar--dock .map-action-btn--ghost,
  html:-webkit-full-screen body.public-page .public-toolbar--dock .map-action-btn--primary,
  html:-webkit-full-screen body.public-page .public-toolbar--dock .map-action-btn--ghost,
  body.is-fallback-fullscreen.public-page .public-toolbar--dock .map-action-btn--primary,
  body.is-fallback-fullscreen.public-page .public-toolbar--dock .map-action-btn--ghost {
    min-height: 2.3rem;
    padding: 0 0.85rem;
    min-width: 5.5rem;
    width: auto;
    flex: 0 0 auto;
  }
}

/* —— Public map: tablet portrait / small landscape —— */
@media (min-width: 700px) and (max-width: 1024px) and (orientation: landscape) {
  .app-shell--public {
    min-height: var(--app-viewport-height);
  }

  .public-main {
    padding: var(--public-space-md) 1.5rem calc(var(--public-space-lg) + var(--safe-bottom));
  }

  .public-toolbar--dock .public-toolbar__dock {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(9rem, 0.72fr) auto;
    grid-template-rows: auto auto;
    align-items: end;
    gap: 0.55rem 0.75rem;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
  }

  .public-toolbar--dock .public-toolbar__filters {
    display: contents;
  }

  .public-toolbar--dock .map-filter-field--search {
    grid-column: 1;
    grid-row: 1 / span 2;
    max-width: none;
  }

  .public-toolbar--dock .map-filter-field--type {
    grid-column: 2;
    grid-row: 1 / span 2;
    min-width: 0;
  }

  .public-toolbar--dock .public-toolbar__actions {
    grid-column: 3;
    grid-row: 1 / span 2;
    align-self: end;
    flex-wrap: nowrap;
    width: auto;
    display: flex;
  }

  .public-toolbar--dock .public-toolbar__status {
    grid-column: 1 / -1;
  }

  .app-shell--public .public-map-card__map .map {
    min-height: calc(var(--app-viewport-height) - 11.5rem);
  }
}

/* TV portrait / tall portrait displays: use phone-style map controls layout */
@media (min-width: 701px) and (max-width: 1300px) and (orientation: portrait) {
  .public-map-card--immersive .map-stage,
  .app-shell--public .public-map-card__map {
    position: relative;
  }

  .public-map-card--immersive .map,
  .app-shell--public .public-map-card__map .map {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    flex: none !important;
    border-radius: 0 !important;
    z-index: 1;
  }

  .app-shell--public .public-map-card__map .map.leaflet-container {
    height: 100% !important;
    min-height: 0 !important;
  }

  .public-map-chrome {
    position: absolute;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 20;
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    gap: 0.3rem;
    padding: 0 max(0.5rem, var(--safe-left)) calc(0.45rem + env(safe-area-inset-bottom, 0))
      max(0.5rem, var(--safe-right));
    pointer-events: none;
    --public-dock-offset: 2.85rem;
  }

  .public-map-chrome:not(.is-controls-collapsed) {
    --public-dock-offset: 9.25rem;
  }

  .public-map-chrome.is-controls-collapsed {
    --public-dock-offset: 2.65rem;
  }

  .public-map-chrome > * {
    pointer-events: auto;
  }

  .map-controls-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: flex-end;
    gap: 0.3rem;
    min-height: 1.95rem;
    padding: 0 0.72rem;
    border-radius: 0.58rem;
    border: 1px solid #1e3a8a;
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    box-shadow: 0 6px 14px rgba(30, 64, 175, 0.22);
    pointer-events: auto;
    flex-shrink: 0;
  }

  .public-toolbar--dock.controls {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
  }

  .public-toolbar--dock.is-collapsed {
    opacity: 0;
    transform: translateY(-10px);
    max-height: 0;
    overflow: hidden;
    pointer-events: none;
    margin: 0;
    transition: opacity 0.18s ease, transform 0.2s ease, max-height 0.22s ease;
  }

  .public-toolbar--dock.is-expanded {
    opacity: 1;
    transform: translateY(0);
    max-height: none;
    pointer-events: auto;
    transition: opacity 0.18s ease, transform 0.2s ease, max-height 0.22s ease;
  }

  .public-toolbar--dock .public-toolbar__dock {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.32rem;
    padding: 0.4rem;
    border-radius: 0.7rem;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(219, 228, 239, 0.95);
    box-shadow:
      0 10px 22px rgba(15, 23, 42, 0.12),
      0 2px 8px rgba(15, 23, 42, 0.06);
    backdrop-filter: saturate(1.05) blur(6px);
  }

  .public-toolbar--dock .public-toolbar__filters {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: flex-end !important;
    gap: 0.28rem 0.35rem;
    width: 100%;
    min-width: 0;
    flex: 0 0 auto !important;
  }

  .public-toolbar--dock .public-toolbar__actions {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    justify-content: flex-end !important;
    gap: 0.28rem;
    width: 100%;
    min-width: 0;
  }

  .public-toolbar--dock .map-filter-field {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    flex: 1 1 12rem !important;
    gap: 0.26rem;
    align-self: stretch;
  }

  .public-toolbar--dock .map-filter-field--search,
  .public-toolbar--dock .map-filter-field--type {
    flex: 1 1 12rem !important;
    max-width: none !important;
    width: auto !important;
  }

  .public-toolbar--dock .map-filter-field--search input,
  .public-toolbar--dock .map-filter-field--type select {
    min-height: 34px;
    font-size: 14px;
    width: 100%;
  }

  .public-toolbar--dock .map-filter-field--search input[type="search"] {
    padding-right: 1.9rem;
  }

  .public-toolbar--dock .map-filter-field--search input[type="search"]::-webkit-search-cancel-button {
    display: none;
    -webkit-appearance: none;
  }

  .public-toolbar--dock .map-filter-input-wrap.has-search-value .map-search-clear-btn {
    display: inline-flex;
    width: 1.2rem;
    height: 1.2rem;
    min-width: 1.2rem;
    min-height: 1.2rem;
    right: 0.32rem;
    padding: 0;
    border: 1px solid #000000;
    border-radius: 0.28rem;
    background: transparent;
    color: #0f172a;
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1;
    box-shadow: none;
  }

  .public-toolbar--dock .map-filter-input-wrap .map-search-clear-btn:hover {
    background: rgba(15, 23, 42, 0.06);
    color: #000000;
    border-color: #000000;
  }

  .public-toolbar--dock .map-filter-input-wrap .map-search-clear-btn:focus-visible {
    outline: 2px solid #000000;
    outline-offset: 1px;
  }

  .public-toolbar--dock .map-filter-field--search {
    flex: 1 1 100% !important;
    order: 10;
  }

  .public-map-chrome:not(.is-tv-filters-expanded) .public-toolbar--dock .map-filter-field--search {
    display: none !important;
  }

  .public-toolbar--dock .map-action-btn--tv-filters {
    display: inline-flex !important;
  }

  .public-toolbar--dock .map-action-btn--tv-filters[hidden] {
    display: none !important;
  }
}

/* —— Public map: desktop —— */
@media (min-width: 1025px) {
  .app-shell--public {
    height: var(--app-viewport-height);
    max-height: var(--app-viewport-height);
    overflow: hidden;
  }

  .public-main {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
  }

  .public-map-card {
    border-radius: 0;
    border: none;
    box-shadow: none;
    min-height: 0;
    height: 100%;
    flex: 1 1 auto;
  }

  .app-shell--public .public-map-card__map .map {
    min-height: 0;
    height: 100%;
  }

  .app-shell--public .public-toolbar #fullScreenBtn,
  .app-shell--public .public-toolbar #resetViewBtn {
    background: linear-gradient(135deg, #6d28d9 0%, #5b21b6 100%);
    border-color: #5b21b6;
    color: #ffffff;
    box-shadow: 0 4px 16px rgba(91, 33, 182, 0.28);
  }

  .app-shell--public .public-toolbar #fullScreenBtn:hover,
  .app-shell--public .public-toolbar #resetViewBtn:hover {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    border-color: #6d28d9;
    color: #ffffff;
  }
}

/* Desktop landscape only: remove TV "More" action button. */
@media (min-width: 1025px) and (orientation: landscape) {
  #publicTvFiltersToggle {
    display: none !important;
  }
}

/* Mobile only: remove TV "More" action button. */
@media (max-width: 700px) {
  #publicTvFiltersToggle {
    display: none !important;
  }
}

/* —— Public map: landscape phones / short viewports —— */
@media (max-height: 520px) and (orientation: landscape) and (max-width: 900px) {
  .public-header {
    padding-top: calc(0.35rem + var(--safe-top));
    padding-bottom: 0.35rem;
  }

  .public-brand__sub {
    display: none;
  }

  .public-map-chrome {
    --public-dock-offset: 3.6rem;
  }

  .public-toolbar--dock .public-toolbar__dock {
    gap: 0.45rem;
    padding: 0.55rem;
  }

  .public-toolbar--dock .public-toolbar__filters {
    gap: 0.45rem;
  }

  .public-toolbar--dock .map-filter-field--search input,
  .public-toolbar--dock .map-filter-field--type select,
  .public-toolbar--dock .map-action-btn--primary,
  .public-toolbar--dock .map-action-btn--ghost {
    min-height: 2.35rem;
  }

  .public-map-chrome:not(.is-controls-collapsed) {
    --public-dock-offset: 9.5rem;
  }

  .app-shell--public .map .leaflet-top.leaflet-left {
    top: calc(var(--public-dock-offset, 3rem) + 0.2rem + var(--safe-top));
  }
}

/* —— Public map: large TV / 4K —— */
@media (min-width: 1920px) {
  :root {
    --public-content-max: 88rem;
  }

  .public-header__inner {
    max-width: var(--public-content-max);
  }

  .public-brand__title {
    font-size: 1.15rem;
  }

  .public-brand__sub {
    font-size: 0.875rem;
  }

  .public-header__cta {
    padding: 0.65rem 1.35rem;
    font-size: 0.9375rem;
  }

  .app-shell--public .public-toolbar .map-filter-label {
    font-size: 0.8125rem;
  }

  .app-shell--public .public-toolbar .controls input,
  .app-shell--public .public-toolbar .controls select,
  .app-shell--public .public-toolbar .map-action-btn {
    min-height: 2.75rem;
    font-size: 0.9375rem;
  }

  .public-map-card {
    min-height: 0;
  }
}

/* Final mobile safeguard: public dock uses stacked flex (never display:contents) */
@media (max-width: 700px) {
  .public-toolbar--dock .map-filter-field {
    display: flex !important;
    flex-direction: column !important;
    flex: 0 0 auto !important;
  }

  .app-shell--public .public-toolbar--dock .map-filter-field--search,
  .app-shell--public .public-toolbar--dock .map-filter-field--type {
    flex: 0 0 auto !important;
    max-width: none !important;
  }

  .public-toolbar--dock .public-toolbar__filters {
    display: flex !important;
    flex-direction: column !important;
    flex: 0 0 auto !important;
  }

  .public-toolbar--dock .public-toolbar__actions {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    flex: 0 0 auto !important;
  }

  .public-toolbar--dock .public-toolbar__dock {
    flex: 0 0 auto !important;
    flex-wrap: nowrap !important;
  }
}

@media (min-width: 2560px) {
  :root {
    --public-content-max: 96rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .public-header__cta,
  .app-shell--public .public-toolbar .map-action-btn {
    transition: none;
  }
}

/* Controls/Hide toggle visual refresh (no layout changes). */
.map-controls-toggle {
  border: 1px solid #4b5563 !important;
  border-radius: 999px !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0) 38%),
    linear-gradient(180deg, #2a2e34 0%, #171a1f 100%) !important;
  color: #f9fafb !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 10px 22px rgba(15, 23, 42, 0.34) !important;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.45);
  letter-spacing: 0.01em;
}

.map-controls-toggle:hover {
  border-color: #6b7280 !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 38%),
    linear-gradient(180deg, #343a42 0%, #1f242b 100%) !important;
}

.map-controls-toggle[aria-expanded="true"] {
  border-color: #64748b !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0) 42%),
    linear-gradient(180deg, #2f3640 0%, #1b2028 100%) !important;
  color: #ffffff !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 10px 22px rgba(15, 23, 42, 0.38) !important;
}

@media (min-width: 1025px) {
  .map-controls-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding-top: 0;
    padding-bottom: 0;
  }

  body.public-page:not(.public-map-fullscreen-active) #mapControlsToggle {
    display: none !important;
  }
}

/* Leaflet controls: safe areas on notched / home-indicator devices */
.app-shell--public .map .leaflet-top.leaflet-left {
  top: max(0.5rem, var(--safe-top));
  left: max(0.5rem, var(--safe-left));
}

.app-shell--public .map .leaflet-bottom.leaflet-right {
  right: max(0.5rem, var(--safe-right));
  bottom: max(0.5rem, var(--safe-bottom));
}

.app-shell--public .map .leaflet-control-zoom a {
  width: var(--map-touch);
  height: var(--map-touch);
  line-height: calc(var(--map-touch) - 4px);
  font-size: 1.125rem;
}

/* Final override: portrait TV fullscreen toggle stays lower-left */
@media (min-width: 701px) and (max-width: 1300px) and (orientation: portrait) {
  body.public-map-fullscreen-active .public-map-chrome,
  html:fullscreen body.public-page .public-map-chrome,
  html:-webkit-full-screen body.public-page .public-map-chrome,
  body.is-fallback-fullscreen.public-page .public-map-chrome {
    top: auto !important;
    bottom: 0 !important;
    flex-direction: row !important;
    align-items: flex-end !important;
    justify-content: flex-start !important;
    padding: 0 max(0.6rem, var(--safe-right)) calc(0.45rem + var(--safe-bottom))
      max(0.6rem, var(--safe-left)) !important;
  }

  body.public-map-fullscreen-active .map-controls-toggle,
  html:fullscreen body.public-page .map-controls-toggle,
  html:-webkit-full-screen body.public-page .map-controls-toggle,
  body.is-fallback-fullscreen.public-page .map-controls-toggle {
    order: -1 !important;
    align-self: flex-end !important;
    margin-right: 0 !important;
  }

  body.public-map-fullscreen-active .public-toolbar--dock.controls,
  html:fullscreen body.public-page .public-toolbar--dock.controls,
  html:-webkit-full-screen body.public-page .public-toolbar--dock.controls,
  body.is-fallback-fullscreen.public-page .public-toolbar--dock.controls {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    width: auto !important;
    margin: 0 !important;
  }
}

/* Public map fullscreen: beat desktop card rules that load later in the cascade. */
body.public-map-fullscreen-active.public-page .app-shell--public,
html:fullscreen body.public-page .app-shell--public,
html:-webkit-full-screen body.public-page .app-shell--public,
body.is-fallback-fullscreen.public-page .app-shell--public {
  width: 100vw !important;
  max-width: none !important;
  height: var(--app-viewport-height) !important;
  max-height: var(--app-viewport-height) !important;
  min-height: var(--app-viewport-height) !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}

body.public-map-fullscreen-active.public-page .public-header,
html:fullscreen body.public-page .public-header,
html:-webkit-full-screen body.public-page .public-header,
body.is-fallback-fullscreen.public-page .public-header {
  display: none !important;
}

body.public-map-fullscreen-active.public-page .public-main,
html:fullscreen body.public-page .public-main,
html:-webkit-full-screen body.public-page .public-main,
body.is-fallback-fullscreen.public-page .public-main {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

body.public-map-fullscreen-active.public-page .public-map-card,
html:fullscreen body.public-page .public-map-card,
html:-webkit-full-screen body.public-page .public-map-card,
body.is-fallback-fullscreen.public-page .public-map-card {
  width: 100% !important;
  min-height: 0 !important;
  height: 100% !important;
  border-radius: 0 !important;
  border: none !important;
  box-shadow: none !important;
}

body.public-map-fullscreen-active.public-page .public-map-card__map,
body.public-map-fullscreen-active.public-page .map-stage,
html:fullscreen body.public-page .public-map-card__map,
html:fullscreen body.public-page .map-stage,
html:-webkit-full-screen body.public-page .public-map-card__map,
html:-webkit-full-screen body.public-page .map-stage,
body.is-fallback-fullscreen.public-page .public-map-card__map,
body.is-fallback-fullscreen.public-page .map-stage {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  height: 100% !important;
}

body.public-map-fullscreen-active.public-page .map,
html:fullscreen body.public-page .map,
html:-webkit-full-screen body.public-page .map,
body.is-fallback-fullscreen.public-page .map {
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  max-height: none !important;
  border-radius: 0 !important;
}

