.contacts.section {
  padding-left: 0;
  padding-right: 0;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.contacts {
  background-color: #e9e2d9;
  padding-top: 0;
  padding-bottom: 0;
  overflow: hidden;
  /* svh — стабильная высота, не прыгает при появлении панели браузера */
  min-height: 100vh;
  min-height: 100svh;
  height: 100vh;
  height: 100svh;
  display: flex;
  flex-direction: column;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.contacts__inner {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  min-height: 0;
  max-width: 100%;
}

.contacts__frame {
  position: relative;
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  min-height: 0;
  height: 100%;
}

.contacts__map-title {
  position: absolute;
  top: clamp(24px, 5vw, 51px);
  left: var(--section-padding-x);
  z-index: 5;
  margin: 0;
  max-width: min(18em, calc(100% - var(--section-padding-x) * 2));
  pointer-events: none;
  opacity: 1;
  transform: translate3d(0, 0, 0);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

@media (max-width: 900px) {
  .contacts__map-title--hidden {
    opacity: 0;
    transform: translate3d(0, -12px, 0);
  }
}

.contacts__map-widget {
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  isolation: isolate;
  background: #e9e2d9;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  cursor: grab;
}

.contacts__map-widget--dragging {
  cursor: grabbing;
}

@media (max-width: 900px) {
  .contacts {
    min-height: 75vh;
    min-height: 75svh;
    height: 75vh;
    height: 75svh;
  }
}

.contacts__map-widget * {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.contacts-map__zoom,
.contacts-map__help,
.contacts-map__spot-copy,
.contacts-map__spot-nav {
  -webkit-user-select: none;
  user-select: none;
}

.contacts-map__stage {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 1;
  transform-origin: 0 0;
  will-change: transform;
}

.contacts-map__layer {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 0;
}

.contacts-map__img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: fill;
  pointer-events: none;
  user-select: none;
}

.contacts-map__markers {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 2;
  pointer-events: none;
}

.contacts-map__leaders {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 4;
  display: block;
  overflow: visible;
  pointer-events: none;
}

.contacts-map__leader-path {
  fill: none;
  stroke: #2d495e;
  stroke-width: 1.75;
  stroke-dasharray: 0 5;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.contacts-map__leader-dot {
  fill: #2d495e;
  pointer-events: none;
}

.contacts-map__leader-bend {
  pointer-events: auto;
  cursor: grab;
  touch-action: none;
}

.contacts-map__leader-bend.is-dragging {
  cursor: grabbing;
}

.contacts-map__spot {
  position: absolute;
  z-index: 1;
  width: 0;
  height: 0;
  margin: 0;
  padding: 0;
  overflow: visible;
  color: var(--color-text);
  pointer-events: none;
  transform: none;
}

.contacts-map__spot--home {
  z-index: 3;
}

.contacts-map__spot-pin {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 2;
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: default;
  pointer-events: auto;
  transform: translate(-50%, -100%);
  touch-action: none;
  filter: drop-shadow(0 2px 6px rgba(45, 73, 94, 0.14));
}

.contacts-map__spot-pin-img {
  display: block;
  width: 23px;
  height: auto;
  max-width: none;
  pointer-events: none;
  user-select: none;
}

.contacts-map__spot--home .contacts-map__spot-pin-img {
  width: 44px;
}

.contacts-map__spot-icon {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 1;
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  pointer-events: auto;
  cursor: default;
  /* Опора — верхний правый угол */
  transform: translate(-100%, 0);
  touch-action: none;
  filter: drop-shadow(0 2px 6px rgba(45, 73, 94, 0.14));
}

.contacts-map__spot-icon-anchor {
  display: none;
  position: absolute;
  right: 0;
  top: 0;
  z-index: 6;
  width: 8px;
  height: 8px;
  margin: 0;
  padding: 0;
  border: 1px solid #fff;
  border-radius: 50%;
  background: #e53935;
  box-shadow: 0 0 0 1px rgba(229, 57, 53, 0.35);
  transform: translate(50%, -50%);
  pointer-events: none;
}

.contacts__map-widget--dev .contacts-map__spot-icon-anchor {
  display: block;
}

.contacts-map__spot-art {
  display: block;
  flex-shrink: 0;
  width: 96px;
  height: auto;
  max-width: none;
  pointer-events: none;
  user-select: none;
}

.contacts-map__spot-meta {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 2;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 288px;
  max-width: none;
  min-width: 120px;
  margin: 0;
  padding: 0;
  text-align: left;
  pointer-events: auto;
  cursor: default;
  /* Якорь (tx/ty): верхний левый угол блока */
  transform: none;
  touch-action: none;
}

/* Dev: только визуал, без сдвига layout (иначе текст прыгает при dev:false) */
.contacts__map-widget--dev .contacts-map__spot-meta {
  outline: 1px dashed rgba(45, 73, 94, 0.45);
  outline-offset: 4px;
  background: rgba(233, 226, 217, 0.28);
}

.contacts__map-widget--dev .contacts-map__spot-meta::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  z-index: 3;
  width: 7px;
  height: 7px;
  margin: -3px 0 0 -3px;
  border-radius: 50%;
  background: #2d495e;
  box-shadow: 0 0 0 2px rgba(233, 226, 217, 0.9);
  pointer-events: none;
}

.contacts-map__spot-meta-resize {
  display: none;
  position: absolute;
  top: 0;
  right: -5px;
  width: 10px;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: ew-resize;
  touch-action: none;
}

.contacts-map__spot-meta-resize--left {
  right: auto;
  left: -5px;
}

.contacts__map-widget--dev .contacts-map__spot-meta-resize {
  display: block;
}

.contacts-map__spot-title {
  margin: 0;
  width: 100%;
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--color-text);
  text-wrap: balance;
}

.contacts-map__spot-desc {
  margin: 0;
  width: 100%;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.35;
  color: var(--color-text);
  opacity: 0.68;
}

.contacts-map__spot-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin-top: 4px;
  pointer-events: auto;
}

.contacts-map__spot-copy,
.contacts-map__spot-nav {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #2d495e;
  font-family: var(--font-sans);
  font-size: 10px;
  line-height: 1.2;
  letter-spacing: 0.01em;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  pointer-events: auto;
  touch-action: manipulation;
}

.contacts-map__spot-nav:hover,
.contacts-map__spot-copy:hover {
  opacity: 0.8;
}

.contacts-map__hint {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 4;
  margin: 0;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(233, 226, 217, 0.92);
  color: var(--color-text);
  font-size: 11px;
  line-height: 1.2;
  letter-spacing: 0.02em;
  opacity: 0.85;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.contacts__map-widget:not(.contacts__map-widget--dev) .contacts-map__hint {
  display: none;
}

.contacts__map-widget--dragging .contacts-map__hint {
  opacity: 0;
}

.contacts-map__help {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: 24px;
  background: rgba(45, 73, 94, 0.48);
  -webkit-tap-highlight-color: transparent;
}

.contacts-map__help[hidden] {
  display: none !important;
}

.contacts__map-widget--dev .contacts-map__help {
  display: none !important;
}

.contacts-map__help-card {
  position: relative;
  box-sizing: border-box;
  width: min(360px, 100%);
  margin: 0;
  padding: 18px 40px 16px 20px;
  border: 1px solid rgba(45, 73, 94, 0.12);
  border-radius: 6px;
  background: #e9e2d9;
  color: var(--color-text);
  box-shadow: 0 8px 28px rgba(45, 73, 94, 0.18);
  text-align: left;
}

.contacts-map__help-x {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #2d495e;
  font-family: var(--font-sans);
  font-size: 24px;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.contacts-map__help-x:hover {
  background: rgba(45, 73, 94, 0.08);
}

.contacts-map__help-title {
  margin: 0 0 10px;
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: #2d495e;
}

.contacts-map__help-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.contacts-map__help-list li {
  position: relative;
  margin: 0;
  padding: 4px 0 4px 14px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.4;
  color: rgba(45, 73, 94, 0.9);
}

.contacts-map__help-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.75em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #2d495e;
}

.contacts-map__zoom {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(233, 226, 217, 0.94);
  box-shadow: 0 1px 0 rgba(45, 73, 94, 0.08);
}

.contacts-map__zoom-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--color-text);
  font-size: 1.125rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, opacity 0.2s ease;
}

.contacts-map__zoom-btn:hover:not(:disabled) {
  background: rgba(45, 73, 94, 0.08);
}

.contacts-map__zoom-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.contacts-map__zoom-label {
  min-width: 3.25rem;
  padding: 0 4px;
  font-size: 11px;
  line-height: 1;
  text-align: center;
  font-variant-numeric: tabular-nums;
  color: var(--color-text);
  opacity: 0.75;
  pointer-events: none;
}

.contacts-map__spot--editable .contacts-map__spot-pin,
.contacts-map__spot--editable .contacts-map__spot-icon,
.contacts-map__spot--editable .contacts-map__spot-meta,
.contacts__map-widget--dev .contacts-map__spot-pin,
.contacts__map-widget--dev .contacts-map__spot-icon,
.contacts__map-widget--dev .contacts-map__spot-meta {
  cursor: grab;
}

.contacts-map__spot--editable.is-dragging,
.contacts-map__spot--editable .is-dragging {
  cursor: grabbing;
  z-index: 5;
}

.contacts-map__spot--editable.is-dragging {
  opacity: 0.92;
}

.contacts-map__dev {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 6;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(280px, calc(100% - 24px));
  max-height: calc(100% - 24px);
  padding: 12px;
  overflow: auto;
  border: 1px solid rgba(45, 73, 94, 0.14);
  border-radius: 12px;
  background: rgba(233, 226, 217, 0.97);
  box-shadow: 0 8px 24px rgba(45, 73, 94, 0.12);
  color: var(--color-text);
  pointer-events: auto;
  cursor: default;
  touch-action: auto;
  user-select: text;
}

.contacts-map__dev-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.2;
}

.contacts-map__dev-note {
  margin: 0;
  font-size: 11px;
  line-height: 1.35;
  opacity: 0.75;
}

.contacts-map__dev-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.contacts-map__dev-btn {
  margin: 0;
  padding: 6px 10px;
  border: 1px solid rgba(45, 73, 94, 0.18);
  border-radius: 999px;
  background: transparent;
  color: var(--color-text);
  font-size: 11px;
  line-height: 1.2;
  cursor: pointer;
}

.contacts-map__dev-btn:hover {
  background: rgba(45, 73, 94, 0.08);
}

.contacts-map__dev-btn--primary {
  background: var(--color-text);
  border-color: var(--color-text);
  color: #e9e2d9;
}

.contacts-map__dev-btn--primary:hover {
  opacity: 0.9;
  background: var(--color-text);
}

.contacts-map__dev-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.contacts-map__dev-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  margin: 0;
  padding: 6px 8px;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.45);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.contacts-map__dev-row:hover {
  background: rgba(255, 255, 255, 0.75);
}

.contacts-map__dev-row-name {
  min-width: 0;
  font-size: 12px;
  line-height: 1.25;
}

.contacts-map__dev-row-coords {
  flex-shrink: 0;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  opacity: 0.7;
  text-align: right;
}

.contacts-map__dev-status {
  margin: 0;
  min-height: 1.2em;
  font-size: 11px;
  line-height: 1.2;
  opacity: 0.7;
}

@media (max-width: 900px) {
  .contacts-map__spot-pin,
  .contacts-map__spot-icon,
  .contacts-map__spot-meta {
    pointer-events: none;
  }

  .contacts-map__spot-actions,
  .contacts-map__spot-copy,
  .contacts-map__spot-nav {
    pointer-events: auto;
  }

  .contacts-map__spot-meta {
    min-width: 80px;
  }

  .contacts-map__spot-title {
    font-size: calc(16px / 1.5);
  }

  .contacts-map__spot-desc {
    font-size: calc(14px / 1.5);
  }

  .contacts-map__spot-copy,
  .contacts-map__spot-nav {
    font-size: calc(10px / 1.5);
  }

  .contacts-map__hint {
    display: none;
  }

  .contacts-map__help {
    padding: 16px;
  }

  .contacts-map__help-card {
    padding: 16px 16px 14px;
  }

  .contacts-map__help-title {
    font-size: 15px;
  }

  .contacts-map__help-list li {
    font-size: 13px;
  }

  .contacts-map__zoom {
    bottom: auto;
    top: 12px;
  }
}

@media (min-width: 901px) {
  .contacts__map-title {
    top: clamp(40px, 6vw, 92px);
  }
}
