/* Atlas 2.1.3 — mobile map stabilization, immediate map consent and direct touch gestures. */

.atlas-section [hidden],
.privacy-backdrop[hidden],
.privacy-panel[hidden] {
  display: none !important;
}

.privacy-map-service {
  min-height: 64px;
  display: none;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid #cfe0c7;
  border-radius: 14px;
  background: linear-gradient(130deg, #f8fbf5, #eef6e8);
}

.privacy-panel.is-map-prompt .privacy-choice--toggle {
  display: none;
}

.privacy-panel.is-map-prompt .privacy-map-service {
  display: grid;
}

.privacy-map-service__mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #fff;
  color: #1f6f43;
  box-shadow: inset 0 0 0 1px rgba(11, 74, 49, .12);
  font-size: 19px;
  font-weight: 900;
}

.privacy-map-service > span:nth-child(2) {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.privacy-map-service strong {
  color: #0b3f2c;
  font-size: 13px;
}

.privacy-map-service small {
  color: #60736a;
  font-size: 10.5px;
  line-height: 1.35;
}

.privacy-map-service b {
  color: #4c7d24;
  font-size: 10px;
  white-space: nowrap;
}

.privacy-panel.is-map-prompt .privacy-panel__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.privacy-panel.is-map-prompt .privacy-panel__actions button {
  min-height: 46px;
  white-space: normal;
}

.official-layers > summary {
  position: relative;
  padding-right: 36px;
  touch-action: manipulation;
}

.official-layers > summary::after {
  content: "";
  position: absolute;
  right: 14px;
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  color: #3f704e;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 160ms ease;
}

.official-layers[open] > summary::after {
  transform: translateY(3px) rotate(225deg);
}

.official-layers:not([open]) > .official-layers__panel {
  display: none !important;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}

.official-layers[open] > .official-layers__panel {
  display: grid;
  max-height: min(52dvh, 440px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.map-legend:not([open]) > :not(summary) {
  display: none !important;
}

.map-legend:not([open]) {
  height: auto !important;
  max-height: 44px !important;
}

.map-legend[open] {
  max-height: min(52dvh, 400px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.map-stage .map-legend {
  top: auto;
  bottom: 14px;
}

.map-stage.is-google .map-legend {
  top: auto;
  bottom: 56px;
}

.map-provider-status[data-state="consent"] .map-provider-status__dot {
  background: #78b82a;
  box-shadow: 0 0 0 4px rgba(120, 184, 42, .14);
}

.map-stage.is-google .google-map {
  touch-action: none;
  overscroll-behavior: contain;
}

.official-layers__panel label,
.map-toolbar__actions button,
.mobile-atlas-bar button,
.map-zoom button {
  touch-action: manipulation;
}

@media (max-width: 820px) {
  .privacy-panel.is-map-prompt {
    bottom: max(8px, env(safe-area-inset-bottom, 0px));
  }

  .privacy-panel.is-map-prompt .privacy-panel__actions {
    grid-template-columns: 1fr;
  }

  .privacy-panel.is-map-prompt .privacy-panel__actions button {
    width: 100%;
    min-height: 48px;
  }

  .privacy-map-service {
    grid-template-columns: 40px minmax(0, 1fr);
  }

  .privacy-map-service b {
    grid-column: 2;
    justify-self: start;
  }

  .atlas-section#atlas {
    padding-inline: env(safe-area-inset-left, 0px) env(safe-area-inset-right, 0px);
  }

  .atlas-commandbar {
    min-height: 58px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px max(8px, env(safe-area-inset-right, 0px)) 6px max(12px, env(safe-area-inset-left, 0px));
  }

  .atlas-commandbar__identity {
    min-width: 0;
    display: flex;
    flex: 1 1 auto;
  }

  .atlas-commandbar__identity small {
    display: none;
  }

  .atlas-commandbar__identity strong {
    display: block;
    font-size: 15px;
  }

  .atlas-commandbar__actions {
    flex: 0 0 auto;
  }

  .atlas-commandbar__actions [data-locate],
  .atlas-commandbar__actions #shareView {
    display: none;
  }

  .atlas-commandbar__actions [data-open-submit] {
    width: 46px;
    min-height: 46px;
    border-radius: 13px;
  }

  .atlas-layout,
  .atlas-layout.is-list-view,
  .atlas-layout.has-detail,
  .atlas-layout.is-list-view.has-detail {
    height: clamp(500px, 64svh, 650px);
    height: clamp(500px, 64dvh, 650px);
    min-height: 500px;
  }

  .map-toolbar {
    min-height: 54px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px;
    padding: 4px max(8px, env(safe-area-inset-right, 0px)) 4px max(12px, env(safe-area-inset-left, 0px));
  }

  .map-toolbar p {
    min-width: 0;
    max-width: none;
    overflow: hidden;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .map-toolbar__actions {
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .map-toolbar__actions button {
    width: 46px;
    min-width: 46px;
    min-height: 46px;
    padding: 0;
  }

  .map-toolbar__actions .map-provider-status {
    width: auto;
    min-width: 0;
    max-width: 168px;
    padding-inline: 10px;
  }

  .map-toolbar__actions .map-provider-status span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

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

  .official-layers {
    z-index: 45;
    top: 10px;
    right: max(10px, env(safe-area-inset-right, 0px));
    left: max(10px, env(safe-area-inset-left, 0px));
    width: auto;
  }

  .official-layers > summary {
    min-height: 54px;
    padding: 8px 38px 8px 12px;
    border-radius: 14px;
  }

  .official-layers > summary b {
    font-size: 12px;
  }

  .official-layers > summary small {
    font-size: 9px;
  }

  .official-layers[open] > summary {
    border-radius: 14px 14px 0 0;
  }

  .official-layers[open] > .official-layers__panel {
    max-height: min(52dvh, 420px);
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .official-layers__panel > p {
    grid-column: 1;
  }

  .official-layers__panel label {
    min-height: 50px;
  }

  .map-national-badges,
  .map-unmapped-badges {
    display: none !important;
  }

  .map-legend,
  .map-zoom {
    bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  }

  .map-stage .map-legend,
  .map-stage.is-google .map-legend {
    top: auto;
    bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  }

  .map-stage.is-google .map-zoom {
    top: auto;
    bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  }

  .mobile-atlas-bar {
    position: sticky;
    z-index: 70;
    bottom: max(8px, env(safe-area-inset-bottom, 0px));
    width: calc(100% - max(16px, calc(env(safe-area-inset-left, 0px) + env(safe-area-inset-right, 0px))));
    min-height: 58px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
    margin: -66px auto 8px;
    padding: 5px;
    border: 1px solid rgba(8, 59, 41, .14);
    border-radius: 16px;
    background: rgba(255, 255, 255, .96);
    color: #083b29;
    box-shadow: 0 13px 38px rgba(0, 43, 25, .2);
  }

  .mobile-atlas-bar button {
    min-width: 0;
    min-height: 48px;
    justify-content: center;
    gap: 5px;
    padding-inline: 6px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: transparent;
    color: #083b29;
    font-size: 11px;
  }

  .mobile-atlas-bar button svg {
    width: 17px;
    height: 17px;
  }

  .mobile-atlas-bar button.is-active {
    border-color: #043923;
    background: #043923;
    color: #fff;
  }

  .mobile-atlas-bar [data-scroll-catalog] {
    border-color: #9de43b;
    background: #9de43b;
    color: #083b29;
  }

  .mobile-atlas-bar [data-scroll-catalog] b {
    background: rgba(255, 255, 255, .72);
    color: #315e22;
  }
}

@media (max-width: 374px) {
  .atlas-commandbar__identity strong {
    font-size: 13px;
  }

  .map-toolbar__actions .map-provider-status {
    max-width: 132px;
    padding-inline: 7px;
  }

  .mobile-atlas-bar button {
    gap: 3px;
    padding-inline: 4px;
    font-size: 10px;
  }

  .map-legend--v17 {
    width: calc(100% - 86px);
  }
}

@media (max-width: 820px) and (max-height: 600px) {
  .atlas-layout,
  .atlas-layout.is-list-view,
  .atlas-layout.has-detail,
  .atlas-layout.is-list-view.has-detail {
    height: clamp(360px, 78dvh, 480px);
    min-height: 360px;
  }

  .official-layers[open] > .official-layers__panel {
    max-height: 70dvh;
  }
}

@media (min-width: 821px) and (max-width: 1023px) and (max-height: 600px) {
  .atlas-layout,
  .atlas-layout.is-list-view,
  .atlas-layout.has-detail,
  .atlas-layout.is-list-view.has-detail {
    height: clamp(380px, 100dvh, 480px);
    min-height: 380px;
  }

  .map-stage {
    min-height: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .official-layers > summary::after {
    transition: none;
  }
}
