* {
  box-sizing: border-box;
}

/* Leaflet layout fallback. Keeps tiles positioned even if CDN CSS is blocked. */
.leaflet-pane,
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow,
.leaflet-tile-container,
.leaflet-pane > svg,
.leaflet-pane > canvas,
.leaflet-zoom-box,
.leaflet-image-layer,
.leaflet-layer {
  position: absolute;
  left: 0;
  top: 0;
}

.leaflet-container {
  overflow: hidden;
  touch-action: pan-x pan-y;
}

.leaflet-map-pane {
  z-index: 400;
}

.leaflet-tile-pane {
  z-index: 200;
}

.leaflet-overlay-pane {
  z-index: 400;
}

.leaflet-shadow-pane {
  z-index: 500;
}

.leaflet-marker-pane {
  z-index: 600;
}

.leaflet-tooltip-pane {
  z-index: 650;
}

.leaflet-popup-pane {
  z-index: 700;
}

.leaflet-zoom-animated {
  transform-origin: 0 0;
}

.leaflet-interactive {
  cursor: pointer;
}

.leaflet-pane > svg path.leaflet-interactive {
  pointer-events: auto;
}

.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow {
  user-select: none;
  -webkit-user-drag: none;
}

.leaflet-tile {
  width: 256px;
  height: 256px;
  border: 0;
}

.leaflet-control {
  position: relative;
  z-index: 800;
  pointer-events: auto;
}

.leaflet-top,
.leaflet-bottom {
  position: absolute;
  z-index: 1000;
  pointer-events: none;
}

.leaflet-top {
  top: 0;
}

.leaflet-right {
  right: 0;
}

.leaflet-bottom {
  bottom: 0;
}

.leaflet-left {
  left: 0;
}

.leaflet-control-zoom {
  display: none;
}

.leaflet-control-zoom a {
  display: block;
  width: 30px;
  height: 30px;
  border-bottom: 1px solid #d0d7de;
  background: #ffffff;
  color: #1f2933;
  font: 700 18px/30px Arial, Helvetica, sans-serif;
  text-align: center;
  text-decoration: none;
}

.leaflet-container.leaflet-touch .leaflet-control-zoom a {
  width: 44px;
  height: 44px;
  font: 700 22px/44px Arial, Helvetica, sans-serif;
}

.leaflet-control-zoom a:first-child {
  border-radius: 4px 4px 0 0;
}

.leaflet-control-zoom a:last-child {
  border-bottom: 0;
  border-radius: 0 0 4px 4px;
}

.leaflet-control-attribution {
  margin: 0;
  padding: 4px 6px;
  background: rgba(255, 255, 255, 0.85);
  font-size: 11px;
  max-width: 52vw;
}

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
}

html,
body,
.app-shell,
.map-stage,
#map {
  width: 100%;
  height: 100%;
  margin: 0;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  color: #18202a;
}

.app-shell {
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
}

.map-stage {
  position: relative;
  background: #eef2f5;
}

#map .leaflet-tile-container {
  will-change: transform;
}

.map-title,
.map-mode-controls,
.mode-guide,
.layer-control,
.sector-info,
.tap-hint,
.floating-legend,
.map-context-toggle,
.app-footer,
.map-status {
  position: absolute;
  z-index: 900;
}

.map-title {
  top: 16px;
  left: 16px;
  display: grid;
  gap: 2px;
  max-width: min(360px, calc(100vw - 32px));
  padding: 10px 12px;
  border: 1px solid rgba(216, 221, 229, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 24px rgba(24, 32, 42, 0.12);
}

.map-title strong {
  font-size: 17px;
}

.map-title span {
  color: #53606f;
  font-size: 13px;
}

.map-mode-controls {
  display: none;
  top: 16px;
  left: 50%;
  gap: 8px;
  transform: translateX(-50%);
  padding: 6px;
  border: 1px solid rgba(216, 221, 229, 0.9);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 24px rgba(24, 32, 42, 0.12);
}

.map-mode-button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #374151;
  font: 700 14px Arial, Helvetica, sans-serif;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.map-mode-button.active {
  border-color: #1f6feb;
  background: #eff6ff;
  color: #174ea6;
}

.mode-guide {
  top: 78px;
  left: 50%;
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 10px;
  width: min(430px, calc(100vw - 32px));
  padding: 12px 40px 12px 12px;
  border: 1px solid rgba(216, 221, 229, 0.9);
  border-left: 4px solid #1f6feb;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 10px 30px rgba(24, 32, 42, 0.18);
  transform: translateX(-50%);
}

.guide-avatar {
  display: grid;
  align-items: center;
  justify-items: center;
  width: 46px;
  height: 46px;
  border-radius: 999px;
  background: #eff6ff;
  font-size: 26px;
}

.mode-guide strong {
  display: block;
  margin: 2px 0 4px;
  font-size: 15px;
}

.mode-guide p {
  margin: 0;
  color: #53606f;
  font-size: 13px;
  line-height: 1.35;
  text-align: justify;
}

.guide-action {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 8px;
  align-items: center;
  margin-top: 10px !important;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f6f8fa;
  color: #374151 !important;
  font-weight: 700;
  text-align: left !important;
}

.guide-action span {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: #eff6ff;
  font-size: 16px;
}

.guide-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 999px;
  background: #f3f4f6;
  color: #53606f;
  font: 700 13px Arial, Helvetica, sans-serif;
  cursor: pointer;
  display: grid;
  place-items: center;
  -webkit-tap-highlight-color: transparent;
}

.map-status {
  right: 16px;
  bottom: 18px;
  max-width: min(320px, calc(100vw - 32px));
  margin: 0;
  padding: 9px 11px;
  border: 1px solid rgba(216, 221, 229, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  color: #53606f;
  box-shadow: 0 8px 24px rgba(24, 32, 42, 0.12);
  font-size: 13px;
}

.map-status.error {
  border-color: #f0b8a8;
  background: #fff4f1;
  color: #9f2d16;
}

.legend-swatch {
  width: 16px;
  height: 12px;
  border-radius: 3px;
  border: 1px solid rgba(0, 0, 0, 0.16);
}

.legend-swatch.low {
  background: #2b8cbe;
}

.legend-swatch.moderate {
  background: #7bccc4;
}

.legend-swatch.high {
  background: #fdae61;
}

.legend-swatch.very-high {
  background: #f46d43;
}

.legend-swatch.critical {
  background: #a50026;
}

.hidden {
  display: none !important;
}

.layer-control {
  top: 94px;
  left: 16px;
  width: min(310px, calc(100vw - 32px));
  border: 1px solid rgba(216, 221, 229, 0.92);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 12px 32px rgba(24, 32, 42, 0.16);
  overflow: hidden;
}

.layer-panel-toggle {
  display: block;
  width: 100%;
  min-height: 36px;
  padding: 0 12px;
  border: 0;
  border-bottom: 1px solid #eef2f5;
  background: #ffffff;
  color: #18202a;
  font: 700 13px Arial, Helvetica, sans-serif;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.layer-panel-body {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.layer-panel-heading {
  display: grid;
  gap: 2px;
  padding-bottom: 8px;
  border-bottom: 1px solid #eef2f5;
}

.layer-panel-heading strong {
  font-size: 14px;
}

.layer-panel-heading span {
  color: #53606f;
  font-size: 12px;
}

.layer-group {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
}

.layer-group-header {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  width: 100%;
  min-height: 34px;
  padding: 0 9px;
  border: 0;
  background: #f6f8fa;
  color: #18202a;
  font: 700 13px Arial, Helvetica, sans-serif;
  text-align: left;
  cursor: pointer;
}

.layer-group-header b {
  color: #53606f;
  font-size: 13px;
}

.layer-group-body {
  display: grid;
  gap: 7px;
  padding: 9px;
}

.layer-group.collapsed .layer-group-body {
  display: none;
}

.layer-option {
  display: grid;
  grid-template-columns: 16px 1fr;
  gap: 8px;
  align-items: start;
  color: #374151;
  font-size: 13px;
  line-height: 1.25;
  cursor: pointer;
}

.layer-option input {
  width: 14px;
  height: 14px;
  margin: 2px 0 0;
}

.layer-option span {
  display: grid;
  gap: 2px;
}

.layer-option strong {
  font-size: 13px;
  line-height: 1.2;
}

.layer-option small {
  display: none;
  color: #6b7280;
  font-size: 11px;
  line-height: 1.25;
}

.layer-option.selected {
  padding: 7px;
  border-radius: 6px;
  background: #f8fafc;
}

.layer-option.selected small {
  display: block;
}

.layer-inline-legend {
  display: grid;
  gap: 6px;
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px solid #e5e7eb;
}

.layer-inline-legend strong {
  color: #18202a;
  font-size: 12px;
}

.layer-inline-legend em {
  color: #6b7280;
  font-size: 11px;
  font-style: normal;
  line-height: 1.25;
}

.layer-inline-legend ol {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.layer-inline-legend li {
  display: grid;
  grid-template-columns: 16px 1fr;
  gap: 7px;
  align-items: center;
  color: #374151;
  font-size: 12px;
}

.layer-control.collapsed {
  width: auto;
  border-radius: 8px;
}

.layer-control.collapsed .layer-panel-body {
  display: none;
}

.selected-sector {
  filter: drop-shadow(0 8px 7px rgba(17, 24, 39, 0.45))
    drop-shadow(0 0 5px rgba(255, 255, 255, 0.95));
  transform: translateY(-1px);
}

.sector-info {
  top: 94px;
  right: 16px;
  width: min(360px, calc(100vw - 32px));
  max-height: calc(100vh - 128px);
  max-height: calc(100dvh - 128px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  padding: 14px 42px 14px 14px;
  border: 1px solid rgba(216, 221, 229, 0.92);
  border-left: 4px solid #111827;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 16px 42px rgba(24, 32, 42, 0.22);
}

.tap-hint {
  left: 16px;
  bottom: 18px;
  z-index: 910;
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 10px;
  align-items: center;
  max-width: 340px;
  padding: 10px 12px;
  border: 1px solid rgba(216, 221, 229, 0.9);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 30px rgba(24, 32, 42, 0.18);
  pointer-events: none;
}

.tap-hint span {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: #f6f8fa;
  font-size: 21px;
}

.tap-hint p {
  margin: 0;
  color: #374151;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
}

.floating-legend {
  display: none;
}

.map-context-toggle {
  left: 50%;
  top: 16px;
  right: auto;
  bottom: auto;
  transform: translateX(-50%);
  z-index: 1100;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(216, 221, 229, 0.9);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  color: #374151;
  box-shadow: 0 8px 24px rgba(24, 32, 42, 0.14);
  font: 700 12px Arial, Helvetica, sans-serif;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.map-context-toggle[data-context-mode="osm"] {
  border-color: #1f6feb;
  background: #eff6ff;
  color: #174ea6;
}

.app-footer {
  left: 16px;
  bottom: 10px;
  z-index: 890;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: min(300px, calc(100vw - 32px));
  min-height: 34px;
  padding: 5px 8px;
  border: 1px solid rgba(216, 221, 229, 0.74);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  color: #53606f;
  font: 700 11px/1 Arial, Helvetica, sans-serif;
  backdrop-filter: blur(4px);
}

.footer-logo-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  line-height: 0;
}

.app-footer img {
  display: block;
  width: auto;
  max-width: 88px;
  height: 30px;
  object-fit: contain;
}

.app-footer a {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  color: #374151;
  text-decoration: none;
  white-space: nowrap;
}

.app-footer a:hover {
  text-decoration: underline;
}

.sector-card {
  color: #18202a;
  font: 13px/1.35 Arial, Helvetica, sans-serif;
}

.status-pill {
  display: inline-block;
  margin-bottom: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #fdae61;
  color: #18202a;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.sector-card strong {
  display: block;
  margin-bottom: 6px;
  font-size: 15px;
}

.sector-card-header {
  margin-bottom: 8px;
}

.card-step {
  display: none;
}

.card-step.active {
  display: block;
}

.sector-card h3 {
  margin: 0 0 7px;
  color: #18202a;
  font-size: 15px;
  line-height: 1.2;
}

.sector-card p {
  margin: 0 0 8px;
  color: #53606f;
  text-align: justify;
}

.sector-card dl {
  display: grid;
  gap: 6px;
  margin: 8px 0 0;
}

.sector-card dl div {
  display: grid;
  grid-template-columns: 116px 1fr;
  gap: 8px;
  padding-top: 6px;
  border-top: 1px solid #eef2f5;
}

.sector-card dt {
  color: #53606f;
  font-weight: 700;
}

.sector-card dd {
  margin: 0;
  color: #18202a;
}

.sector-card dd b {
  display: block;
  margin-bottom: 2px;
}

.sector-card dd small {
  display: block;
  color: #6b7280;
  font-size: 11px;
  line-height: 1.3;
}

.metric-meter {
  display: grid;
  gap: 4px;
  margin-top: 7px;
}

.metric-track {
  position: relative;
  display: block;
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, #2b8cbe 0%, #7bccc4 35%, #fdae61 68%, #a50026 100%);
  box-shadow: inset 0 0 0 1px rgba(17, 24, 39, 0.12);
}

.metric-marker {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  border: 2px solid #ffffff;
  border-radius: 999px;
  background: #111827;
  box-shadow: 0 1px 4px rgba(17, 24, 39, 0.35);
  transform: translate(-50%, -50%);
}

.metric-scale {
  display: flex;
  justify-content: space-between;
  color: #6b7280;
  font-size: 10px;
  line-height: 1;
}

.metric-empty {
  color: #6b7280;
  font-size: 11px;
}

.card-note {
  padding: 8px;
  border-radius: 6px;
  background: #f6f8fa;
  font-size: 12px;
}

.sector-card hr {
  height: 1px;
  margin: 8px 0;
  border: 0;
  background: #d8dde5;
}

.card-nav {
  display: grid;
  grid-template-columns: 42px 1fr 42px;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid #d8dde5;
}

.card-nav button {
  width: 42px;
  height: 36px;
  border: 1px solid #1f6feb;
  border-radius: 8px;
  background: #eff6ff;
  color: #174ea6;
  box-shadow: 0 3px 10px rgba(31, 111, 235, 0.16);
  font: 800 18px Arial, Helvetica, sans-serif;
  cursor: pointer;
}

.card-nav button:hover {
  background: #dbeafe;
}

.card-nav span {
  color: #53606f;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

@media (max-width: 760px) {
  .map-title {
    top: calc(10px + env(safe-area-inset-top, 0px));
    left: 10px;
    right: 168px;
    max-width: none;
    padding: 8px 10px;
  }

  .map-title strong {
    font-size: 15px;
    line-height: 1.2;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .map-title span {
    display: none;
  }

  .map-mode-controls {
    top: calc(52px + env(safe-area-inset-top, 0px));
    left: 10px;
    right: 10px;
    transform: none;
    gap: 6px;
    padding: 6px;
  }

  .map-mode-button {
    flex: 1;
    min-height: 44px;
    padding: 0 8px;
    font-size: 13px;
  }

  .mode-guide {
    top: calc(58px + env(safe-area-inset-top, 0px));
    left: 10px;
    right: 10px;
    width: auto;
    grid-template-columns: 40px 1fr;
    padding: 12px 48px 12px 12px;
    transform: none;
    max-height: min(38vh, calc(100dvh - 200px));
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  .guide-avatar {
    width: 40px;
    height: 40px;
    font-size: 22px;
  }

  .mode-guide p {
    font-size: 13px;
    text-align: justify;
  }

  .guide-close {
    top: 6px;
    right: 6px;
    width: 44px;
    height: 44px;
    font-size: 16px;
  }

  .layer-control {
    top: calc(58px + env(safe-area-inset-top, 0px));
    left: 10px;
    right: 10px;
    width: auto;
    max-height: min(52vh, calc(100dvh - 140px));
  }

  .layer-panel-toggle {
    min-height: 48px;
    font-size: 14px;
  }

  .layer-panel-body {
    max-height: min(calc(52vh - 52px), calc(100dvh - 192px));
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
  }

  .layer-group-header {
    min-height: 44px;
    padding: 0 11px;
    font-size: 14px;
  }

  .layer-option {
    grid-template-columns: 22px 1fr;
    gap: 10px;
    align-items: center;
    min-height: 44px;
    padding: 4px 2px;
  }

  .layer-option input {
    width: 20px;
    height: 20px;
    margin: 0;
  }

  .layer-option small {
    display: block;
    font-size: 11px;
  }

  .layer-control.collapsed {
    top: calc(10px + env(safe-area-inset-top, 0px));
    right: 10px;
    bottom: auto;
    left: auto;
    width: min(148px, calc(48vw - 10px));
    max-height: none;
    box-shadow: 0 10px 28px rgba(24, 32, 42, 0.2);
  }

  .layer-control.collapsed .layer-panel-toggle {
    min-width: 0;
    width: 100%;
    border-bottom: 0;
    border-radius: 10px 10px 0 0;
    min-height: 36px;
    font-size: 12px;
    text-align: center;
  }

  .layer-control.collapsed .layer-panel-body {
    display: none;
  }

  .sector-info {
    top: auto;
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    left: 10px;
    width: auto;
    max-height: min(50vh, calc(100dvh - 120px));
    padding: 14px 48px 14px 14px;
    border-left-width: 0;
    border-top: 4px solid #111827;
    border-radius: 12px 12px 10px 10px;
  }

  .tap-hint {
    left: 10px;
    right: 10px;
    bottom: calc(122px + env(safe-area-inset-bottom, 0px));
    z-index: 930;
    max-width: 360px;
  }

  .floating-legend {
    right: 10px;
    bottom: calc(76px + env(safe-area-inset-bottom, 0px));
    z-index: 920;
    display: block;
    width: min(190px, calc(100vw - 220px));
    min-width: 150px;
    padding: 9px 10px;
    border: 1px solid rgba(216, 221, 229, 0.9);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 10px 28px rgba(24, 32, 42, 0.2);
  }

  .floating-legend .layer-inline-legend {
    margin: 0;
    padding: 0;
    border-top: 0;
  }

  .floating-legend .layer-inline-legend strong,
  .floating-legend .layer-inline-legend em {
    display: none;
  }

  .floating-legend .layer-inline-legend ol {
    gap: 3px;
  }

  .floating-legend .layer-inline-legend li {
    font-size: 11px;
  }

  .map-context-toggle {
    top: calc(58px + env(safe-area-inset-top, 0px));
    right: auto;
    bottom: auto;
    left: 10px;
    transform: none;
    min-height: 34px;
    padding: 0 11px;
    font-size: 11px;
  }

  .app-footer {
    left: 10px;
    right: auto;
    bottom: calc(4px + env(safe-area-inset-bottom, 0px));
    max-width: min(230px, calc(100vw - 118px));
    min-height: 34px;
    padding: 3px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.85);
    box-shadow: none;
    font-size: 9px;
  }

  .app-footer img {
    max-width: 72px;
    height: 28px;
  }

  .app-footer a {
    min-height: 28px;
  }

  .sector-card p {
    text-align: justify;
  }

  .sector-card dl div {
    grid-template-columns: minmax(0, 110px) 1fr;
    gap: 6px;
  }

  .card-nav {
    grid-template-columns: 54px 1fr 54px;
    gap: 10px;
  }

  .card-nav button {
    width: 54px;
    height: 46px;
    font-size: 20px;
  }

  .map-status {
    display: block;
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    left: auto;
    max-width: min(240px, calc(100vw - 72px));
    padding: 8px 10px;
    font-size: 12px;
    z-index: 880;
  }

  .map-status:not(.error) {
    bottom: calc(58px + env(safe-area-inset-bottom, 0px));
  }

  .sector-info:not(.hidden) ~ .map-status:not(.error) {
    opacity: 0;
    pointer-events: none;
  }

  .leaflet-control-zoom {
    display: none;
  }

  .map-stage:has(.sector-info:not(.hidden)) .tap-hint,
  .map-stage:has(.layer-control:not(.collapsed)) .tap-hint {
    display: none;
  }

  .map-stage:has(.sector-info:not(.hidden)) .leaflet-control-attribution {
    max-width: min(250px, calc(100vw - 20px));
    font-size: 10px;
  }

  .map-stage:has(.sector-info:not(.hidden)) .leaflet-bottom {
    z-index: 850;
    pointer-events: none;
  }

  .map-stage:has(.sector-info:not(.hidden)) .floating-legend,
  .map-stage:has(.layer-control:not(.collapsed)) .floating-legend {
    display: none;
  }

  .map-stage:has(.mode-guide:not(.hidden)) .map-context-toggle,
  .map-stage:has(.layer-control:not(.collapsed)) .map-context-toggle {
    display: none;
  }

  .map-stage:has(.mode-guide:not(.hidden)) .app-footer,
  .map-stage:has(.layer-control:not(.collapsed)) .app-footer {
    display: none;
  }
}
