/* City landing visual editor */
body.landing-edit-mode {
  padding-bottom: 5.5rem;
}
body.landing-edit-mode #hero-parallax,
body.landing-edit-mode [data-landing-canvas] {
  outline: 1px dashed rgba(22, 101, 52, 0.35);
  outline-offset: 4px;
}
body.landing-edit-mode [data-landing-item] {
  cursor: grab;
  outline: 2px solid transparent;
  outline-offset: 2px;
  touch-action: none;
}
body.landing-edit-mode [data-landing-item]:hover {
  outline-color: rgba(22, 101, 52, 0.45);
}
body.landing-edit-mode [data-landing-item].is-selected {
  outline-color: #166534;
  /* Do NOT bump z-index here — it was being saved as layer 60 and burying color blocks */
}
body.landing-edit-mode [data-landing-item].is-dragging {
  cursor: grabbing;
  opacity: 0.92;
}
body.landing-edit-mode [data-landing-item] img {
  pointer-events: auto;
  -webkit-user-drag: none;
  user-select: none;
}
body.landing-edit-mode [data-landing-figure] {
  outline: 2px dashed rgba(22, 101, 52, 0.75);
  outline-offset: 2px;
  background-color: transparent;
  min-height: 48px;
  pointer-events: auto !important;
}
body.landing-edit-mode [data-landing-figure].hidden {
  display: block !important;
}
body.landing-edit-mode [data-landing-figure] img {
  pointer-events: auto !important;
}
body.landing-edit-mode [data-landing-figure]::after {
  content: "заменить";
  position: absolute;
  left: 50%;
  top: 8px;
  transform: translateX(-50%);
  z-index: 5;
  font: 700 10px/1 "Plus Jakarta Sans", system-ui, sans-serif;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  background: rgba(22, 101, 52, 0.9);
  padding: 4px 8px;
  border-radius: 999px;
  pointer-events: none;
  white-space: nowrap;
  opacity: 1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}
body.landing-edit-mode [data-landing-figure]:hover,
body.landing-edit-mode [data-landing-figure].is-selected {
  outline-color: #166534;
  outline-style: solid;
}
body.landing-edit-mode [data-landing-figure].is-empty-figure {
  outline-color: #b45309;
  background-color: rgba(254, 243, 199, 0.55);
}
body.landing-edit-mode [data-landing-figure].is-empty-figure::after {
  content: "добавить фото";
  background: rgba(180, 83, 9, 0.95);
}
.landing-edit-handle {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  background: #166534;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  z-index: 70;
  touch-action: none;
}
.landing-edit-handle--nw {
  left: -7px;
  top: -7px;
  cursor: nwse-resize;
}
.landing-edit-handle--ne {
  right: -7px;
  top: -7px;
  cursor: nesw-resize;
}
.landing-edit-handle--sw {
  left: -7px;
  bottom: -7px;
  cursor: nesw-resize;
}
.landing-edit-handle--se {
  right: -7px;
  bottom: -7px;
  cursor: nwse-resize;
}
.landing-edit-toolbar {
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  transform: none;
  z-index: 9999;
  display: flex;
  flex-wrap: nowrap;
  gap: 0.35rem 0.55rem;
  align-items: center;
  justify-content: space-between;
  width: auto;
  max-width: none;
  padding: 0.5rem 0.75rem;
  border-radius: 1rem;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  color: #111827;
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 10px 28px rgba(15, 23, 42, 0.08);
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  font-size: 0.8125rem;
  line-height: 1.2;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.landing-edit-toolbar__group {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0 0.2rem;
  flex: 0 0 auto;
}
.landing-edit-toolbar__group + .landing-edit-toolbar__group {
  border-left: 1px solid #e5e7eb;
  padding-left: 0.6rem;
  margin-left: 0.1rem;
}
.landing-edit-toolbar__spacer {
  flex: 1 1 auto;
  min-width: 0.5rem;
}
.landing-edit-toolbar button,
.landing-edit-toolbar label.landing-edit-btn {
  appearance: none;
  border: 1px solid #e5e7eb;
  border-radius: 0.625rem;
  width: 2.35rem;
  height: 2.35rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  background: #fff;
  color: #374151;
  white-space: nowrap;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.landing-edit-toolbar button:hover,
.landing-edit-toolbar label.landing-edit-btn:hover {
  background: #f9fafb;
  border-color: #d1d5db;
  color: #111827;
}
.landing-edit-tip {
  position: fixed;
  z-index: 10050;
  pointer-events: none;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: #111827;
  color: #fff;
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.2;
  white-space: nowrap;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.18);
  opacity: 0;
  transform: translate(-50%, 4px);
  transition: opacity 0.12s ease, transform 0.12s ease;
}
.landing-edit-tip.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}
.landing-edit-tip::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #111827;
}
.landing-edit-toolbar button.primary {
  background: #166534;
  border-color: #166534;
  color: #fff;
}
.landing-edit-toolbar button.primary:hover {
  background: #14532d;
  border-color: #14532d;
  color: #fff;
}
.landing-edit-toolbar button.danger {
  background: #fff;
  border-color: #fecaca;
  color: #b91c1c;
}
.landing-edit-toolbar button.danger:hover {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #991b1b;
}
.landing-edit-toolbar .landing-edit-status {
  color: #6b7280;
  font-weight: 500;
  padding: 0 0.35rem;
  max-width: 18rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.landing-edit-toolbar input[type="file"] {
  display: none;
}
.landing-edit-layer {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.landing-edit-z {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-weight: 600;
  color: #6b7280;
  white-space: nowrap;
}
.landing-edit-z input[type="number"] {
  width: 3rem;
  height: 2.35rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.625rem;
  padding: 0 0.35rem;
  background: #f9fafb;
  color: #111827;
  font: inherit;
  font-weight: 600;
  text-align: center;
}
.landing-edit-z input[type="number"]:focus {
  outline: 2px solid rgba(22, 101, 52, 0.25);
  outline-offset: 1px;
  border-color: #86efac;
  background: #fff;
}
.landing-edit-z input[type="number"]:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.landing-edit-z input[type="number"]::-webkit-outer-spin-button,
.landing-edit-z input[type="number"]::-webkit-inner-spin-button {
  opacity: 1;
}
.landing-edit-open {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 9990;
  border: 1px solid #166534;
  border-radius: 0.75rem;
  padding: 0.65rem 1rem;
  background: #166534;
  color: #fff;
  font-weight: 600;
  font-size: 0.85rem;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
  cursor: pointer;
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
}
.landing-edit-open:hover {
  background: #14532d;
  border-color: #14532d;
}

/* Preview: hide all editor chrome, keep page looking public */
body.landing-preview-mode {
  padding-bottom: 0;
}
body.landing-preview-mode #hero-parallax,
body.landing-preview-mode [data-landing-canvas],
body.landing-preview-mode [data-landing-item],
body.landing-preview-mode [data-landing-figure],
body.landing-preview-mode [data-landing-figure].is-empty-figure,
body.landing-preview-mode [data-landing-item].is-selected,
body.landing-preview-mode [data-landing-item]:hover {
  outline: none !important;
  cursor: default !important;
  /* Do NOT reset background — color blocks (esp. hero-green) use bg on the item itself */
}
body.landing-preview-mode [data-landing-figure] {
  /* Only clear the editor checker/placeholder fill, keep real photos */
  background-image: none !important;
}
body.landing-preview-mode [data-landing-figure]:not([data-landing-bg]) {
  background-color: transparent !important;
}
body.landing-preview-mode [data-landing-figure]::after {
  display: none !important;
}
body.landing-preview-mode .landing-edit-handle,
body.landing-preview-mode .landing-edit-toolbar {
  display: none !important;
}
.landing-preview-exit {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 10000;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: #111827;
  font-size: 1rem;
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 10px 28px rgba(15, 23, 42, 0.08);
  cursor: pointer;
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
}
.landing-preview-exit:hover {
  background: #f9fafb;
  border-color: #d1d5db;
}
