html.prefs-open,
body.prefs-open {
  overflow: hidden;
}

html.prefs-active,
body.prefs-active {
  overscroll-behavior: none;
}

.prefs-layer[hidden],
.prefs-panel[hidden] {
  display: none !important;
}

.prefs-layer {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(8, 16, 28, 0.62);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  animation: prefsLayerIn 0.22s ease-out;
}

.prefs-panel {
  width: min(100%, 620px);
  border-radius: 18px;
  border: 1px solid rgba(77, 150, 192, 0.28);
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: 0 32px 70px rgba(0, 0, 0, 0.34), 0 6px 22px rgba(77, 150, 192, 0.16);
  animation: prefsPanelIn 0.26s ease-out;
}

.prefs-panel__content {
  padding: 28px;
}

.prefs-panel__content h2 {
  margin: 0 0 12px;
  color: #1d1d1f;
  font-size: clamp(24px, 3vw, 28px);
  line-height: 1.15;
}

.prefs-panel__titlebar {
  position: relative;
  min-height: 36px;
  margin: 0 0 12px;
}

.prefs-panel__logo {
  position: absolute;
  top: 0;
  left: 0;
  width: 34px;
  height: 34px;
  object-fit: contain;
  flex: 0 0 auto;
}

.prefs-panel__titlebar h2 {
  margin: 0;
  text-align: center;
}

.prefs-panel__content p {
  margin: 0;
  color: #4d4d55;
  font-size: 16px;
  line-height: 1.58;
}

.prefs-panel__actions {
  margin-top: 22px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.prefs-panel .btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 12px 22px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.prefs-panel .btn:focus-visible,
.prefs-settings-btn:focus-visible,
.map-placeholder button:focus-visible {
  outline: 3px solid rgba(77, 150, 192, 0.45);
  outline-offset: 2px;
}

.prefs-panel .btn:active {
  transform: translateY(1px);
}

.prefs-panel .btn-primary {
  background: #4d96c0;
  border-color: #4d96c0;
  color: #ffffff;
}

.prefs-panel .btn-primary:hover {
  background: #3f86af;
}

.prefs-panel .btn-secondary {
  background: #ffffff;
  border-color: #cfd7df;
  color: #1d1d1f;
}

.prefs-panel .btn-secondary:hover {
  background: #f4f7fa;
}

.prefs-settings-btn {
  appearance: none;
  border: none;
  background: none;
  color: var(--gray-700);
  font-size: 12px;
  cursor: pointer;
  padding: 0;
  text-decoration: none;
}

.prefs-settings-btn:hover {
  text-decoration: underline;
}

.contact-map {
  width: 100%;
}

.contact-map__slot {
  width: 100%;
  min-height: 450px;
}

.contact-map__slot .map-placeholder {
  min-height: 450px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  border-radius: 14px;
  border: 1px solid rgba(77, 150, 192, 0.3);
  background: linear-gradient(180deg, #f5f8fc 0%, #edf3fa 100%);
  padding: 26px;
  text-align: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.contact-map__slot .map-placeholder p {
  margin: 0;
  color: #4f5964;
}

.contact-map__slot .map-placeholder button {
  appearance: none;
  border: 1px solid #4d96c0;
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  background: #4d96c0;
  color: #ffffff;
  cursor: pointer;
}

.contact-map__slot iframe {
  width: 100%;
  min-height: 450px;
  border: 0;
  border-radius: 12px;
  display: block;
  touch-action: auto;
}

.contact-map__iframe {
  height: clamp(320px, 54vh, 450px);
}

@keyframes prefsLayerIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes prefsPanelIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 640px) {
  .prefs-layer {
    padding: 14px;
  }

  .prefs-panel__content {
    padding: 20px;
  }

  .prefs-panel__actions {
    justify-content: center;
  }

  .contact-map__slot {
    min-height: 320px;
  }

  .contact-map__slot .map-placeholder,
  .contact-map__slot iframe,
  .contact-map__iframe {
    min-height: 320px;
    height: clamp(320px, 52vh, 380px);
  }
}
