/* Активен только при ?cms_edit=1 и успешной авторизации */
html.cms-edit-active {
  scroll-padding-top: 72px;
}

#cms-edit-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100000;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  padding: 0.65rem 1rem;
  background: rgba(10, 10, 15, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-family: Inter, system-ui, sans-serif;
  font-size: 13px;
  color: #f5f5f7;
}

#cms-edit-bar .cms-edit-brand {
  font-weight: 600;
  margin-right: 0.25rem;
  color: #47A5FA;
}

#cms-edit-bar .cms-edit-photo-hint {
  font-size: 11px;
  color: #86868b;
  max-width: 220px;
  line-height: 1.25;
}

#cms-edit-bar button,
#cms-edit-bar .cms-edit-link {
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  border: none;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

#cms-edit-bar button {
  background: #0064E0;
  color: #fff;
}

#cms-edit-bar button.secondary {
  background: rgba(255, 255, 255, 0.12);
  color: #f5f5f7;
}

#cms-edit-bar .cms-edit-breakpoints {
  display: inline-flex;
  gap: 0.35rem;
}

#cms-edit-bar [data-cms-bp].active {
  background: #2f7df0;
}

#cms-edit-bar .cms-edit-langs {
  display: inline-flex;
  gap: 0.25rem;
}

#cms-edit-bar .cms-edit-lang-btn.active {
  background: #2f7df0 !important;
  color: #fff !important;
}

#cms-edit-bar .cms-edit-lang-badge {
  font-size: 11px;
  font-weight: 700;
  color: #f5a623;
  letter-spacing: 0.04em;
}

#cms-edit-bar button.danger {
  background: rgba(255, 69, 58, 0.9);
  color: #fff;
}

#cms-edit-bar .cms-edit-link {
  background: rgba(255, 255, 255, 0.1);
  color: #f5f5f7;
}

#cms-edit-bar #cms-edit-status {
  flex: 1 1 auto;
  min-width: 120px;
  font-size: 12px;
  color: #86868b;
}

#cms-edit-bar #cms-edit-status.ok {
  color: #34c759;
}

#cms-edit-bar #cms-edit-status.err {
  color: #ff453a;
}

#cms-edit-extra {
  width: 100%;
  display: none;
  flex-direction: column;
  gap: 0.35rem;
  padding-top: 0.35rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: 0.25rem;
}

#cms-edit-extra.open {
  display: flex;
}

#cms-edit-extra label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #86868b;
}

#cms-edit-extra input,
#cms-edit-extra textarea {
  width: 100%;
  max-width: 560px;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.35);
  color: #f5f5f7;
  font-size: 12px;
}

#cms-edit-extra textarea {
  min-height: 48px;
  font-family: ui-monospace, monospace;
}

html.cms-edit-active body {
  padding-bottom: 88px;
}

html.cms-edit-active .cms-editable-text {
  outline: 1px dashed rgba(0, 100, 224, 0.45);
  outline-offset: 2px;
  border-radius: 4px;
  min-height: 1.2em;
  cursor: text;
}

html.cms-edit-active .cms-editable-text:focus {
  outline: 2px solid rgba(0, 100, 224, 0.85);
  background: rgba(0, 100, 224, 0.06);
}

html.cms-edit-active img[data-cms-img],
html.cms-edit-active img[data-cms-gallery-idx] {
  cursor: pointer;
  outline: 2px solid rgba(0, 100, 224, 0.35);
  outline-offset: 2px;
  position: relative;
  z-index: 3;
}

html.cms-edit-active.cms-edit-page #cms-main img {
  cursor: pointer;
  outline: 2px solid rgba(0, 100, 224, 0.35);
  outline-offset: 2px;
}

/* Клик доходит до фонового фото героя, а не перехватывается градиентом */
html.cms-edit-active .service-hero-overlay,
html.cms-edit-active .service-hero::after {
  pointer-events: none !important;
}

html.cms-edit-active .service-hero-bg {
  pointer-events: auto;
}

html.cms-edit-active #service-detail-root a.btn,
html.cms-edit-active #service-detail-root a.btn-large,
html.cms-edit-active #cms-main a.btn,
html.cms-edit-active #cms-main a.btn-large {
  cursor: default;
}

html.cms-edit-active #service-detail-root a .cms-editable-text,
html.cms-edit-active #cms-main a .cms-editable-text {
  cursor: text;
  outline-offset: 1px;
  display: inline-block;
  min-width: 0.5ch;
}

html.cms-edit-active #service-detail-root .btn .cms-editable-text,
html.cms-edit-active #service-detail-root .btn-large .cms-editable-text,
html.cms-edit-active #cms-main .btn .cms-editable-text,
html.cms-edit-active #cms-main .btn-large .cms-editable-text {
  outline-offset: 1px;
}

html.cms-edit-active .cms-edit-block {
  position: relative;
  margin: 10px 0;
  padding-top: 24px;
  border: 1px dashed rgba(71, 165, 250, 0.35);
  border-radius: 10px;
}

html.cms-edit-active .cms-edit-block.is-dragging {
  opacity: 0.45;
}

html.cms-edit-active .cms-edit-block.is-selected {
  border-color: rgba(71, 165, 250, 0.95);
  box-shadow: 0 0 0 2px rgba(71, 165, 250, 0.2);
}

html.cms-edit-active .cms-edit-block-handle {
  position: absolute;
  top: -1px;
  left: -1px;
  border: 0;
  border-radius: 10px 0 10px 0;
  padding: 0.25rem 0.45rem;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  background: rgba(0, 100, 224, 0.92);
  cursor: grab;
  z-index: 5;
}

html.cms-edit-active .cms-edit-block-delete {
  position: absolute;
  top: -1px;
  right: -1px;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 0 10px 0 10px;
  padding: 0;
  font-size: 18px;
  font-weight: 700;
  line-height: 28px;
  color: #fff;
  background: rgba(220, 38, 38, 0.92);
  cursor: pointer;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, transform 0.15s ease;
}

html.cms-edit-active .cms-edit-block-delete:hover {
  background: #b91c1c;
  transform: scale(1.08);
}

html.cms-edit-active .cms-edit-resize-handle {
  position: absolute;
  top: 6px;
  bottom: 6px;
  width: 10px;
  border-radius: 999px;
  background: rgba(47, 125, 240, 0.9);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.65);
  z-index: 6;
  cursor: ew-resize;
  opacity: 0.9;
}

html.cms-edit-active .cms-edit-resize-handle.left {
  left: -6px;
}

html.cms-edit-active .cms-edit-resize-handle.right {
  right: -6px;
}

/* Правое боковое меню редактора (Блоки / Элемент). */
#cms-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 72px;
  width: 340px;
  z-index: 100001;
  background: rgba(10, 10, 15, 0.96);
  border-left: 1px solid rgba(255, 255, 255, 0.15);
  color: #f5f5f7;
  font-family: Inter, system-ui, sans-serif;
  transform: translateX(calc(100% - 32px));
  transition: transform 0.25s ease;
  display: flex;
  flex-direction: column;
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.35);
}

#cms-sidebar.is-open {
  transform: translateX(0);
}

#cms-sidebar #cms-sidebar-toggle {
  position: absolute;
  top: 50%;
  left: -1px;
  transform: translate(-100%, -50%);
  width: 32px;
  height: 48px;
  border-radius: 8px 0 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-right: none;
  background: rgba(10, 10, 15, 0.96);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
}

#cms-sidebar.is-open #cms-sidebar-toggle {
  transform: translate(0, -50%) rotate(180deg);
  left: -32px;
}

#cms-sidebar .cms-sb-tabs {
  display: flex;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.5rem 0.5rem 0;
  gap: 0.35rem;
  flex: 0 0 auto;
}

#cms-sidebar .cms-sb-tabs button {
  flex: 1;
  padding: 0.55rem 0.5rem;
  border: 0;
  background: transparent;
  color: #a4a4ab;
  font-weight: 600;
  font-size: 13px;
  border-bottom: 2px solid transparent;
  cursor: pointer;
}

#cms-sidebar .cms-sb-tabs button.active {
  color: #fff;
  border-bottom-color: #2f7df0;
}

#cms-sidebar .cms-sb-body {
  flex: 1 1 auto;
  overflow: auto;
  padding: 0.8rem;
}

#cms-sidebar .cms-vp-sub {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #a4a4ab;
  margin: 0.8rem 0 0.35rem;
}

#cms-sidebar .cms-vp-sub:first-child { margin-top: 0; }

#cms-sidebar .cms-vp-adds,
#cms-sidebar .cms-vp-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
}

#cms-sidebar button,
#cms-sidebar select,
#cms-sidebar input[type="number"],
#cms-sidebar input[type="text"],
#cms-sidebar input[type="color"] {
  width: 100%;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: #f5f5f7;
  padding: 0.4rem 0.5rem;
  font-size: 12px;
  box-sizing: border-box;
}

#cms-sidebar button {
  cursor: pointer;
}

#cms-sidebar button:hover {
  background: rgba(47, 125, 240, 0.32);
}

#cms-sidebar button.danger {
  background: rgba(255, 69, 58, 0.75);
  border-color: transparent;
}

#cms-sidebar label {
  display: block;
  margin-top: 0.55rem;
  margin-bottom: 0.2rem;
  font-size: 11px;
  color: #a4a4ab;
}

#cms-sidebar .cms-vp-row {
  font-size: 12px;
  margin-bottom: 0.45rem;
}

#cms-sidebar .cms-vp-row code {
  background: rgba(255, 255, 255, 0.08);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: ui-monospace, monospace;
}

#cms-sidebar .cms-vp-empty {
  font-size: 12px;
  color: #a4a4ab;
  margin-top: 0.35rem;
  line-height: 1.45;
}

#cms-sidebar .cms-vp-btn-danger {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(220, 38, 38, 0.5);
  border-radius: 8px;
  background: rgba(220, 38, 38, 0.15);
  color: #fecaca;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

#cms-sidebar .cms-vp-btn-danger:hover {
  background: #dc2626;
  color: #fff;
}

#cms-sidebar .cms-vp-bp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 6px;
}

#cms-sidebar .cms-vp-bp-grid label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.82rem;
  color: #c7c9d1;
  margin: 0;
}

#cms-sidebar .cms-vp-bp-grid input {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  color: #e9e9ee;
  font-size: 0.9rem;
}

#cms-sidebar .cms-vp-hint {
  margin: 4px 0 10px;
  font-size: 0.78rem;
  color: #8a8f9a;
  line-height: 1.35;
}

#cms-sidebar .cms-vp-nudge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 0 10px;
}

#cms-sidebar .cms-vp-nudge-row {
  display: flex;
  gap: 4px;
}

#cms-sidebar .cms-vp-nudge button {
  width: 42px;
  height: 36px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: #e9e9ee;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#cms-sidebar .cms-vp-nudge button:hover {
  background: rgba(47, 125, 240, 0.25);
  border-color: #2f7df0;
}

#cms-sidebar .cms-vp-nudge button[data-nudge="reset"] {
  background: transparent;
  font-size: 18px;
  color: #a4a4ab;
}

#cms-sidebar .cms-vp-presets {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

#cms-sidebar .cms-vp-preset {
  flex: 1 1 auto;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  color: #e9e9ee;
  font-size: 12px;
  cursor: pointer;
}

#cms-sidebar .cms-vp-preset.is-active {
  background: #2f7df0;
  border-color: #2f7df0;
  color: #fff;
}

#cms-sidebar .cms-vp-gallery-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 6px;
  margin-bottom: 8px;
}

#cms-sidebar .cms-vp-thumb {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 6px;
  overflow: hidden;
  background: #111;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

#cms-sidebar .cms-vp-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

#cms-sidebar .cms-vp-thumb button {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  font-size: 13px;
  line-height: 18px;
  cursor: pointer;
}

#cms-sidebar .cms-vp-thumb button:hover {
  background: #e03b3b;
}

/* Gallery slots inside the live editor: clickable placeholders the user can
   tap to upload a photo to that exact slot. */
html.cms-edit-active .block-gallery__slot {
  position: relative;
  margin: 0;
  min-width: 0;
  min-height: 160px;
  aspect-ratio: 4 / 3;
  border-radius: 10px;
  overflow: hidden;
  background: #11111a;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

@media (max-width: 560px) {
  html.cms-edit-active .block-gallery__slot {
    min-height: 0;
    aspect-ratio: 4 / 3;
  }

  html.cms-edit-active .block-gallery__slot .block-gallery__plus {
    font-size: 26px;
  }

  html.cms-edit-active .block-gallery__slot .block-gallery__label {
    font-size: 9px;
    letter-spacing: 0.06em;
  }
}

html.cms-edit-active .block-gallery__slot.is-filled img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

html.cms-edit-active .block-gallery__slot.is-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 2px dashed rgba(47, 125, 240, 0.55);
  background: rgba(47, 125, 240, 0.08);
  color: #9fc5ff;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

html.cms-edit-active .block-gallery__slot.is-empty:hover {
  background: rgba(47, 125, 240, 0.2);
  border-color: #2f7df0;
  color: #fff;
}

html.cms-edit-active .block-gallery__slot .block-gallery__plus {
  font-size: 40px;
  line-height: 1;
  font-weight: 200;
}

html.cms-edit-active .block-gallery__slot .block-gallery__label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

html.cms-edit-active .block-gallery__slot .block-gallery__remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 16px;
  line-height: 24px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease;
}

html.cms-edit-active .block-gallery__slot:hover .block-gallery__remove {
  opacity: 1;
}

html.cms-edit-active .block-gallery__slot .block-gallery__remove:hover {
  background: #e03b3b;
}

html.cms-edit-active.cms-sidebar-open body {
  padding-right: 340px;
}

/* Element overlay — сидит на выделенном элементе. Хэндлы на краях/углу. */
#cms-element-overlay {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 100000;
  display: none;
  box-sizing: border-box;
  border: 2px solid #2f7df0;
  border-radius: 3px;
}

#cms-element-overlay.is-open {
  display: block;
}

#cms-element-overlay .cms-eh {
  position: absolute;
  background: #2f7df0;
  border: 2px solid #fff;
  border-radius: 3px;
  pointer-events: auto;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

#cms-element-overlay .cms-eh-e {
  top: 50%;
  right: -7px;
  width: 12px;
  height: 22px;
  transform: translateY(-50%);
  cursor: ew-resize;
}

#cms-element-overlay .cms-eh-s {
  bottom: -7px;
  left: 50%;
  width: 22px;
  height: 12px;
  transform: translateX(-50%);
  cursor: ns-resize;
}

#cms-element-overlay .cms-eh-se {
  right: -7px;
  bottom: -7px;
  width: 14px;
  height: 14px;
  cursor: nwse-resize;
}

#cms-element-overlay .cms-eh-move {
  top: -22px;
  left: 0;
  right: 0;
  height: 20px;
  width: auto;
  border-radius: 4px 4px 0 0;
  cursor: grab;
  background: #2f7df0 url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="%23fff" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="M5 9l-3 3 3 3M9 5l3-3 3 3M15 19l-3 3-3-3M19 9l3 3-3 3M2 12h20M12 2v20"/></svg>') left 6px center/14px no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding-left: 24px;
}

#cms-element-overlay .cms-eh-move::after {
  content: 'Перенести';
}

#cms-element-overlay .cms-eh-move:active {
  cursor: grabbing;
}

#cms-element-overlay.is-resizing {
  border-style: dashed;
}

body.cms-moving { cursor: grabbing !important; user-select: none; }
body.cms-moving * { user-select: none !important; }

.cms-move-placeholder {
  display: block;
  min-height: 6px;
  min-width: 6px;
  margin: 4px 0;
  background: #2f7df0;
  border-radius: 3px;
  box-shadow: 0 0 12px rgba(47, 125, 240, 0.9);
  outline: 2px dashed rgba(47, 125, 240, 0.6);
  outline-offset: 2px;
  pointer-events: none;
}

.cms-move-ghost {
  max-width: 320px;
  max-height: 160px;
  overflow: hidden;
  background: rgba(10, 10, 15, 0.85);
  border: 1px solid rgba(47, 125, 240, 0.7);
  border-radius: 8px;
  padding: 6px 10px;
  color: #fff;
  font-size: 13px;
}

html.cms-edit-active [data-cms-draggable] {
  position: relative;
}

html.cms-edit-active [data-cms-draggable]:not([draggable])::before { display: none; }

html.cms-edit-active [data-cms-draggable="1"] {
  cursor: grab;
}

html.cms-edit-active [data-cms-draggable="1"]:hover {
  outline: 1px dashed rgba(47, 125, 240, 0.45);
  outline-offset: 3px;
}

html.cms-edit-active .cms-dragging {
  opacity: 0.45 !important;
  outline: 2px dashed #2f7df0 !important;
}

html.cms-edit-active [data-cms-legacy-content] img {
  cursor: grab;
}
html.cms-edit-active [data-cms-legacy-content] img:active {
  cursor: grabbing;
}

html.cms-edit-active .cms-block-quick-tools {
  display: inline-flex;
  gap: 0.25rem;
  margin-bottom: 0.4rem;
}

html.cms-edit-active .cms-block-quick-tools button {
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(10, 10, 15, 0.9);
  color: #fff;
  border-radius: 7px;
  font-size: 11px;
  padding: 0.2rem 0.35rem;
}

html.cms-edit-active .cms-columns-grid {
  display: grid;
  gap: 1rem;
}

html.cms-edit-active .cms-columns-grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

html.cms-edit-active .cms-columns-grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

html.cms-edit-active .cms-columns-col {
  min-height: 80px;
  padding: 0.35rem;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: 10px;
}

html.cms-edit-active .cms-col-item {
  cursor: grab;
}

html.cms-edit-active #service-detail-root,
html.cms-edit-active #cms-main {
  position: relative;
}

html.cms-edit-active #service-detail-root.cms-snap-grid-on::before,
html.cms-edit-active #cms-main.cms-snap-grid-on::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background-image:
    linear-gradient(to right, rgba(71, 165, 250, 0.12) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(71, 165, 250, 0.08) 1px, transparent 1px);
  background-size: 5% 100%, 100% 24px;
}

html.cms-edit-active body.cms-bp-tablet #service-detail-root,
html.cms-edit-active body.cms-bp-tablet #cms-main {
  max-width: 860px;
  margin-left: auto;
  margin-right: auto;
  box-shadow: 0 0 0 2px rgba(71, 165, 250, 0.2);
}

html.cms-edit-active body.cms-bp-mobile #service-detail-root,
html.cms-edit-active body.cms-bp-mobile #cms-main {
  max-width: 440px;
  margin-left: auto;
  margin-right: auto;
  box-shadow: 0 0 0 2px rgba(71, 165, 250, 0.25);
}

/* === Inline element editing (legacy & block content) === */
html.cms-edit-active .cms-inline-editable {
  outline: 1px dashed rgba(0, 100, 224, 0.25);
  outline-offset: 2px;
  border-radius: 3px;
  cursor: text;
  transition: outline-color 0.12s ease;
}

html.cms-edit-active .cms-inline-editable:hover,
html.cms-edit-active [data-cms-legacy-content] img:hover {
  outline: 2px solid rgba(0, 100, 224, 0.65);
  outline-offset: 2px;
}

html.cms-edit-active [data-cms-legacy-content] img {
  cursor: pointer;
  outline: 1px dashed rgba(0, 100, 224, 0.25);
  outline-offset: 2px;
}

html.cms-edit-active .cms-inline-selected,
html.cms-edit-active [data-cms-el-selected] {
  outline: 2px solid #2f7df0 !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 0 4px rgba(47, 125, 240, 0.15);
}

html.cms-edit-active .cms-inline-resize {
  position: absolute;
  right: -6px;
  bottom: -6px;
  width: 14px;
  height: 14px;
  background: #2f7df0;
  border: 2px solid #fff;
  border-radius: 4px;
  cursor: nwse-resize;
  z-index: 20;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

#cms-inspector {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 100002;
  min-width: 260px;
  max-width: 460px;
  padding: 0.55rem 0.65rem;
  background: rgba(10, 10, 15, 0.96);
  color: #f5f5f7;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  font-family: Inter, system-ui, sans-serif;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  display: none;
}

#cms-inspector.is-open {
  display: block;
}

#cms-inspector .cms-insp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

#cms-inspector .cms-insp-tag {
  font-size: 11px;
  font-family: ui-monospace, monospace;
  color: #86868b;
  text-transform: lowercase;
}

#cms-inspector .cms-insp-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
  margin-bottom: 0.35rem;
}

#cms-inspector button,
#cms-inspector input[type="number"],
#cms-inspector input[type="color"] {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #fff;
  border-radius: 6px;
  font-size: 12px;
  padding: 0.3rem 0.5rem;
  cursor: pointer;
}

#cms-inspector button:hover {
  background: rgba(47, 125, 240, 0.4);
}

#cms-inspector button.danger {
  background: rgba(255, 69, 58, 0.85);
  border-color: transparent;
}

#cms-inspector input[type="number"] {
  width: 64px;
  cursor: text;
}

#cms-inspector input[type="color"] {
  width: 34px;
  height: 28px;
  padding: 0;
}

#cms-inspector label {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 11px;
  color: #a4a4ab;
}

/* ============================================================
   Slideshow block in CMS edit mode
   ============================================================ */

/* Wrapper: position relative so the edit button can float */
.cms-sld-wrap {
  position: relative;
  display: block;
}

/* Floating "Edit photos" button on top of the slideshow */
.cms-sld-edit-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 20;
  background: rgba(10, 10, 20, 0.82);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  padding: 0.45rem 0.9rem;
  font-size: 13px;
  font-family: Inter, system-ui, sans-serif;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background 0.15s;
  pointer-events: all;
}
.cms-sld-edit-btn:hover {
  background: rgba(47, 125, 240, 0.85);
  border-color: transparent;
}

/* ============================================================
   Slideshow photo modal
   ============================================================ */

#cms-sld-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200000;
  align-items: center;
  justify-content: center;
}
#cms-sld-modal.is-open {
  display: flex;
}

.cms-sld-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  cursor: pointer;
}

.cms-sld-modal__panel {
  position: relative;
  z-index: 1;
  background: #1c1c22;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  width: min(800px, 94vw);
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: Inter, system-ui, sans-serif;
  color: #f5f5f7;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}

.cms-sld-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}
.cms-sld-modal__title {
  font-size: 15px;
  font-weight: 600;
}
.cms-sld-modal__close {
  background: none;
  border: none;
  color: #888;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.25rem;
}
.cms-sld-modal__close:hover { color: #fff; }

.cms-sld-modal__grid {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-content: flex-start;
}

.cms-sld-modal__empty {
  width: 100%;
  padding: 2rem;
  text-align: center;
  color: #888;
  font-size: 14px;
}

.cms-sld-modal__thumb {
  width: 180px;
  border-radius: 10px;
  overflow: hidden;
  background: #2a2a32;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
}
.cms-sld-modal__thumb img {
  width: 100%;
  height: 130px;
  object-fit: cover;
  display: block;
}
.cms-sld-modal__thumb-btns {
  display: flex;
  gap: 0.4rem;
  padding: 0.5rem;
}
.cms-sld-modal__thumb-btns button {
  flex: 1;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  color: #f5f5f7;
  font-size: 12px;
  padding: 0.35rem 0.4rem;
  cursor: pointer;
  font-family: inherit;
}
.cms-sld-modal__thumb-btns button:hover {
  background: rgba(47, 125, 240, 0.45);
  border-color: transparent;
}
.cms-sld-modal__thumb-btns button.danger {
  background: rgba(255, 69, 58, 0.18);
  border-color: rgba(255, 69, 58, 0.4);
  color: #ff6b60;
}
.cms-sld-modal__thumb-btns button.danger:hover {
  background: rgba(255, 69, 58, 0.75);
  color: #fff;
}

.cms-sld-modal__foot {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.25rem 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.cms-sld-modal__add {
  background: #2f7df0;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.5rem 1rem;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
}
.cms-sld-modal__add:hover { background: #1a68d8; }

.cms-sld-modal__status {
  font-size: 12px;
  color: #a4a4ab;
}

/* When .cms-sld-wrap is also .about-hero__slideshow (inside the text+slide pair),
   make the inner .block-slideshow fill the wrapper absolutely so the 4/3
   aspect-ratio from .about-hero__slideshow is respected. */
.cms-sld-wrap.about-hero__slideshow {
  overflow: hidden;
}
.cms-sld-wrap.about-hero__slideshow .block-slideshow {
  position: absolute;
  inset: 0;
  max-width: none;
  width: 100%;
  height: 100%;
  aspect-ratio: unset;
  border-radius: 0;
  box-shadow: none;
}
