/* Wix Madefor Text loaded upfront so the canvas paints in it from the
 * first frame (user 2026-07-05 "web dùng luôn font Wix madefor text
 * luôn"). @import MUST be at file top per CSS spec — anywhere else is
 * silently ignored. */
@import url('https://fonts.googleapis.com/css2?family=Wix+Madefor+Text:wght@400;500;600;700;800&display=swap');

/* ===== Vendr Editor — Core Styles ===== */
:root {
  --editor-bg: #f0f1f5;
  --editor-surface: #ffffff;
  --editor-surface-hover: #f5f5f7;
  --editor-surface-active: #ecedf3;
  --editor-border: #e0e2e8;
  --editor-text: #1a1a2e;
  --editor-text-secondary: #5f6377;
  --editor-text-muted: #9094a6;

  /* Dark palette — kept for nav areas */
  --nav-bg: #131720;
  --nav-surface: #131720;
  --nav-surface-hover: #1c2130;
  --nav-surface-active: #242a3a;
  --nav-border: #1f2937;
  --nav-text: #e5e7eb;
  --nav-text-secondary: #9ca3af;
  --nav-text-muted: #6b7280;
  --editor-accent: #5B3DF5;
  --editor-accent-hover: #6B4DF8;
  --editor-accent-active: #4A2BE6;
  --editor-success: #22c55e;
  --editor-warning: #f59e0b;
  --editor-danger: #ef4444;
  --editor-premium: #9333ea;

  --mainbar-height: 44px;
  --sidebar-width: 48px;
  --inspector-width: 270px;

  --font-sans: 'Wix Madefor Text', 'Aeonik Pro', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;

  --z-mainbar: 1140;
  --z-sidebar: 1130;
  --z-inspector: 1120;
  --z-canvas: 1;
  --z-modal: 2000;
  --z-tooltip: 3000;
}

/* ===== Reset ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  overflow: hidden;
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--editor-text);
  background: var(--editor-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Dark overrides for top nav only */
.mainbar {
  --editor-bg: var(--nav-bg);
  --editor-surface: var(--nav-surface);
  --editor-surface-hover: var(--nav-surface-hover);
  --editor-surface-active: var(--nav-surface-active);
  --editor-border: var(--nav-border);
  --editor-text: var(--nav-text);
  --editor-text-secondary: var(--nav-text-secondary);
  --editor-text-muted: var(--nav-text-muted);
  color: var(--nav-text);
}

button {
  font-family: inherit;
  font-size: inherit;
  border: none;
  background: none;
  color: inherit;
  cursor: pointer;
  outline: none;
}

button:focus-visible {
  outline: 2px solid var(--editor-accent);
  outline-offset: -2px;
  border-radius: var(--radius-sm);
}

/* ===== Editor Layout ===== */
#editor-root {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
}

/* ===== MAIN BAR (Top Bar) ===== */
.mainbar {
  display: flex;
  align-items: center;
  height: var(--mainbar-height);
  background: var(--nav-bg);
  border-bottom: 1px solid var(--nav-border);
  z-index: var(--z-mainbar);
  padding: 0;
  flex-shrink: 0;
  user-select: none;
}

.mainbar__area {
  display: flex;
  align-items: center;
  height: 100%;
  gap: 2px;
}

.mainbar__left {
  padding-left: 8px;
  flex: 0 0 auto;
}

.mainbar__center {
  flex: 1 1 auto;
  justify-content: center;
}

.mainbar__right {
  padding-right: 0;
  flex: 0 0 auto;
}

/* ===== Main Bar Items ===== */
.mainbar-item {
  display: flex;
  align-items: center;
  height: 100%;
  position: relative;
}

/* --- Logo / Menu Button (aligned with dashboard navbar) --- */
.mainbar-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px;
  height: 36px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.15s;
  margin-right: 8px;
}

.mainbar-logo:hover {
  background: rgba(255, 255, 255, 0.1);
}

.mainbar-logo:active {
  background: rgba(255, 255, 255, 0.15);
}

.mainbar-logo__mark {
  width: 28px;
  height: 28px;
  background: #fff;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 400;
  color: var(--nav-bg);
  line-height: 1;
  flex-shrink: 0;
}

.mainbar-logo__text {
  font-size: 14px;
  font-weight: 400;
  color: #fff;
  letter-spacing: 0.02em;
}

.mainbar-logo__icon {
  width: 24px;
  height: 24px;
  fill: var(--editor-accent);
}

/* --- Separator --- */
.mainbar-sep {
  width: 1px;
  height: 24px;
  background: var(--editor-border);
  margin: 0 6px;
  flex-shrink: 0;
}

/* --- Editor Mode Switch --- */
.mainbar-mode-switch {
  display: flex;
  align-items: stretch;
  align-self: stretch;
  background: var(--editor-surface);
  border-radius: 0;
  padding: 0;
  gap: 0;
}
.mainbar-mode-btn {
  padding: 0 12px;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--editor-text-muted);
  font-size: 12px;
  font-weight: 400;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.mainbar-mode-btn:hover { color: var(--editor-text); }
.mainbar-mode-btn.is-active {
  background: var(--editor-accent);
  color: #fff;
}

/* --- Page Navigation Dropdown --- */
.mainbar-page-nav {
  position: relative;
}

.mainbar-page-nav__trigger {
  display: flex;
  align-items: center;
  align-self: stretch;
  gap: 4px;
  height: 100%;
  padding: 0 12px;
  border-radius: 0;
  transition: background 0.15s;
  font-size: 13px;
  font-weight: 400;
  color: var(--editor-text);
  white-space: nowrap;
}

.mainbar-page-nav__trigger:hover {
  background: var(--editor-surface-hover);
}

.mainbar-page-nav__trigger:active,
.mainbar-page-nav__trigger[aria-expanded="true"] {
  background: var(--editor-surface-active);
}

.mainbar-page-nav__arrow {
  width: 16px;
  height: 16px;
  fill: var(--editor-text-secondary);
  transition: transform 0.2s;
}

.mainbar-page-nav__trigger[aria-expanded="true"] .mainbar-page-nav__arrow {
  transform: rotate(180deg);
}

.mainbar-page-nav__dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 220px;
  max-height: 70vh;
  overflow-y: auto;
  background: var(--editor-surface);
  border: 1px solid var(--editor-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  padding: 4px;
  z-index: var(--z-tooltip);
  display: none;
}

.mainbar-page-nav__dropdown.is-open {
  display: block;
}

/* Group header inside the page-nav dropdown — mirrors the Pages panel's
   group titles so both lists read the same. */
.mainbar-page-nav__group-title {
  padding: 8px 10px 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--nav-text-muted, #868aa5);
}
.mainbar-page-nav__group-title:first-child { padding-top: 4px; }

.mainbar-page-nav__option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--nav-text);
  background: transparent;
  transition: background 0.12s;
  text-align: left;
}

.mainbar-page-nav__option:hover {
  background: var(--editor-surface-hover);
}

.mainbar-page-nav__option.is-active {
  background: var(--editor-surface-active);
  color: var(--editor-accent);
}

.mainbar-page-nav__option-icon {
  width: 16px;
  height: 16px;
  fill: var(--editor-text-secondary);
  flex-shrink: 0;
}

.mainbar-page-nav__option.is-active .mainbar-page-nav__option-icon {
  fill: var(--editor-accent);
}

/* --- Autosave Indicator --- */
.mainbar-autosave {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  height: 32px;
  font-size: 13px;
  color: #e5e7eb;
}

.mainbar-autosave__icon {
  width: 18px;
  height: 18px;
}

.mainbar-autosave--saved .mainbar-autosave__icon {
  fill: var(--editor-success);
}

.mainbar-autosave--saving .mainbar-autosave__icon {
  fill: var(--editor-warning);
  animation: pulse 1.2s ease-in-out infinite;
}

.mainbar-autosave--error .mainbar-autosave__icon {
  fill: var(--editor-danger);
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Reset to blank page button — sits in the dark mainbar, so it must match
   the bar's color treatment (transparent + light-grey text on hover). */
.mainbar-reset {
  display: inline-flex;
  align-items: center;
  align-self: stretch;
  gap: 6px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  border-radius: 0;
  font-size: 12px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.72);
  cursor: pointer;
  font-family: inherit;
  transition: background 0.12s, color 0.12s;
}
.mainbar-reset:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.mainbar-reset svg { flex-shrink: 0; opacity: 0.85; }
.mainbar-reset:hover svg { opacity: 1; }
.mainbar-reset__chev { width: 10px; height: 10px; margin-left: 2px; }

/* Dropdown menu — appears below the Reset button. position:relative on the
 * wrapper so the absolutely-positioned menu anchors to it. Hidden until the
 * wrapper carries .is-open (toggled in initResetButton). */
.mainbar-reset-wrap { position: relative; display: inline-flex; align-self: stretch; }
.mainbar-reset__menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 240px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.16);
  padding: 4px 0;
  z-index: 3000;
  display: none;
}
.mainbar-reset-wrap.is-open .mainbar-reset__menu { display: block; }
.mainbar-reset__item {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  padding: 8px 14px;
  font: inherit;
  font-size: 13px;
  color: #131720;
  cursor: pointer;
  white-space: nowrap;
}
.mainbar-reset__item:hover { background: #f4f4f6; }
.mainbar-reset__sep {
  height: 1px;
  background: #e8e8ec;
  margin: 4px 0;
}

/* Page-history restore panel — shares the reset dropdown's shell, toggled by
 * the `hidden` attribute (JS swaps between .mainbar-reset__menu and this). */
.mainbar-history__panel {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 260px;
  max-height: 360px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.16);
  padding: 4px 0;
  z-index: 3000;
}
.mainbar-reset-wrap:not(.is-open) .mainbar-history__panel { display: none; }
.mainbar-history__panel[hidden] { display: none; }
.mainbar-history__head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px 8px;
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  border-bottom: 1px solid #eee;
  margin-bottom: 4px;
}
.mainbar-history__back {
  border: 0;
  background: transparent;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  color: #131720;
  padding: 0 4px;
}
.mainbar-history__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  padding: 8px 14px;
  font: inherit;
  font-size: 13px;
  color: #131720;
  cursor: pointer;
  white-space: nowrap;
}
.mainbar-history__item:hover { background: #f4f4f6; }
.mainbar-history__when { color: #131720; }
.mainbar-history__reason {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 10px;
  color: #fff;
  background: #9ca3af;
}
.mainbar-history__reason--publish { background: #16a34a; }
.mainbar-history__reason--manual { background: #5B3DF5; }
.mainbar-history__reason--auto { background: #9ca3af; }
.mainbar-history__empty { padding: 12px 14px; font-size: 12px; color: #9ca3af; }

/* --- Breakpoints (Center) --- */
.mainbar-breakpoints {
  display: flex;
  align-items: stretch;
  align-self: stretch;
  gap: 0;
  background: var(--editor-bg);
  border-radius: 0;
  padding: 0;
  position: relative;
}

.mainbar-breakpoint {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 100%;
  border-radius: 0;
  transition: all 0.15s;
  position: relative;
}

.mainbar-breakpoint:hover {
  background: var(--editor-surface-hover);
}

.mainbar-breakpoint.is-active {
  background: transparent;
}

.mainbar-breakpoint__icon {
  width: 24px;
  height: 24px;
  fill: #fff;
  transition: fill 0.15s;
}

.mainbar-breakpoint.is-active .mainbar-breakpoint__icon {
  fill: var(--editor-accent);
}
.mainbar-breakpoints.is-master-context .mainbar-breakpoint.is-active .mainbar-breakpoint__icon {
  fill: #3faf4f;
}

.mainbar-breakpoint:hover .mainbar-breakpoint__icon {
  fill: #fff;
}
.mainbar-breakpoint.is-active:hover .mainbar-breakpoint__icon {
  fill: var(--editor-accent);
}
.mainbar-breakpoints.is-master-context .mainbar-breakpoint.is-active:hover .mainbar-breakpoint__icon {
  fill: #3faf4f;
}

/* --- Viewport Size Display --- */
.mainbar-viewport-size {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 8px;
  height: 30px;
  font-size: 13px;
  color: #e5e7eb;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
  cursor: pointer;
}

.mainbar-viewport-size:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

.mainbar-viewport-size__arrow {
  width: 14px;
  height: 14px;
  fill: #e5e7eb;
}

/* --- Zoom Controls --- */
.mainbar-zoom {
  display: flex;
  align-items: center;
  position: relative;
}

.mainbar-zoom__trigger {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 30px;
  padding: 0 6px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: #e5e7eb;
  transition: all 0.15s;
}

.mainbar-zoom__trigger:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

.mainbar-zoom__arrow {
  width: 14px;
  height: 14px;
  fill: #e5e7eb;
}

.mainbar-zoom__panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  display: none;
  align-items: center;
  gap: 8px;
  background: var(--editor-surface);
  border: 1px solid var(--editor-border);
  border-radius: var(--radius-lg);
  padding: 6px 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  z-index: var(--z-tooltip);
  white-space: nowrap;
}

.mainbar-zoom__panel.is-open {
  display: flex;
}

.mainbar-zoom__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  transition: background 0.12s;
}

.mainbar-zoom__btn:hover {
  background: var(--editor-surface-hover);
}

.mainbar-zoom__btn svg {
  width: 14px;
  height: 14px;
  fill: var(--editor-text);
}

.mainbar-zoom__value {
  font-size: 12px;
  color: var(--editor-text);
  min-width: 36px;
  text-align: center;
}

.mainbar-zoom__reset {
  font-size: 11px;
  color: var(--editor-text-secondary);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  border-left: 1px solid var(--editor-border);
  margin-left: 4px;
  padding-left: 12px;
  transition: all 0.12s;
}

.mainbar-zoom__reset:hover {
  color: var(--editor-text);
  background: var(--editor-surface-hover);
}

/* --- Toolbar icon buttons (undo, redo, etc.) --- */
.mainbar-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  transition: all 0.15s;
  position: relative;
}

.mainbar-icon-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
}

.mainbar-icon-btn:active:not(:disabled) {
  background: rgba(255, 255, 255, 0.15);
}

.mainbar-icon-btn:disabled {
  opacity: 0.7;
  cursor: default;
}

.mainbar-icon-btn svg {
  width: 22px;
  height: 22px;
  fill: #fff;
}

.mainbar-icon-btn:hover:not(:disabled) svg {
  fill: #fff;
}

.mainbar-icon-btn:disabled svg {
  fill: var(--nav-text-secondary);
}

/* --- Language switcher (mainbar) ---
   Mirrors the studio/landing language switcher but rendered with our
   own classes (no Tailwind dependency in the builder). Alpine.js
   drives the open/close state via x-data in the template. */
.langsw { position: relative; display: inline-flex; }
.langsw__trigger {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: transparent;
  border: 0;
  cursor: pointer;
  /* Pin colors directly to nav palette so a higher-specificity rule on
   * `.mainbar button` (or stray reset) can't darken the SVG on hover. */
  color: #9ca3af !important;
  transition: color 0.15s;
}
.langsw__trigger:hover,
.langsw__trigger:focus { color: #ffffff !important; }
.langsw__trigger svg { width: 20px; height: 20px; stroke: currentColor; }
.langsw__menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: #fff;
  border: 1px solid #E5E5E8;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  width: 176px;
  padding: 4px 0;
  z-index: 50;
}
.langsw__menu form { display: block; }
.langsw__item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 16px;
  background: transparent;
  border: 0;
  text-align: left;
  font-family: inherit;
  font-size: 14px;
  color: #374151;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.langsw__item:hover { background: #F3F0FF; }
/* Active row gets the brand-purple wash + white text. Matches the rest
 * of the builder UI (square corners, no border-radius). The check icon
 * the template still emits is hidden — the bg colour IS the selection
 * indicator. */
.langsw__item.is-active {
  background: #5B3DF5;
  color: #ffffff;
}
.langsw__flag { font-size: 16px; line-height: 1; }

/* --- User Avatar --- */
.mainbar-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid var(--editor-accent);
  transition: border-color 0.15s;
  margin: 0 4px;
}

.mainbar-avatar:hover {
  border-color: var(--editor-accent-hover);
}

.mainbar-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mainbar-avatar__fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--editor-accent);
  color: #fff;
  font-size: 12px;
  font-weight: 400;
}
.mainbar-avatar__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* --- Realtime presence: other active editors --- */
.mainbar-presence {
  display: flex;
  align-items: center;
  /* Overlap chips slightly like Figma/Google Docs. */
  padding-left: 6px;
}
.mainbar-presence.is-active { margin: 0 2px 0 4px; }
.mainbar-presence .collab-avatar { margin-left: -6px; }

.collab-avatar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  /* Coloured ring per peer; white gap so overlapping chips stay distinct. */
  box-shadow: 0 0 0 2px var(--collab-accent, #5B3DF5), 0 0 0 4px var(--editor-bg, #1e1e28);
  background: var(--collab-accent, #5B3DF5);
}
.collab-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.collab-avatar__initial {
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  text-transform: uppercase;
}
.collab-avatar--more {
  background: #6b6b7b;
  box-shadow: 0 0 0 2px #6b6b7b, 0 0 0 4px var(--editor-bg, #1e1e28);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
}

/* --- Realtime co-edit: element held by another editor (soft lock) --- */
.canvas-section.collab-locked {
  /* Inset ring so it always paints INSIDE the element's box (an outer outline
   * gets clipped by ancestor overflow / hidden behind sibling content). A
   * child that fully covers the box can still paint over an inset shadow, so
   * we also add a ::after overlay ring on top of everything (user 2026-07-09
   * "viền nằm ngoài, khó nhìn"). */
  box-shadow: inset 0 0 0 2px var(--collab-lock-color, #5B3DF5) !important;
  cursor: not-allowed;
  position: relative;
}
/* Overlay ring painted ABOVE child content so it's visible even when a child
 * (image, bg fill) covers the whole element. pointer-events:none so it never
 * eats clicks. */
.canvas-section.collab-locked::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 2px solid var(--collab-lock-color, #5B3DF5);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
  pointer-events: none;
  z-index: 2147482000;
}
.collab-lock-badge {
  position: absolute;
  top: -20px;
  left: 0;
  z-index: 2147483000;
  padding: 1px 7px;
  border-radius: 4px 4px 4px 0;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.5;
  color: #fff;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}
/* Flipped variant: label sits INSIDE the top-left corner when there's no room
 * above the element (it hugs the viewport top). */
.collab-lock-badge--inside {
  top: 2px;
  left: 2px;
  border-radius: 0 0 4px 0;
}
/* Flash when a user tries to grab a locked element. */
@keyframes collabLockBump {
  0%, 100% { box-shadow: inset 0 0 0 2px var(--collab-lock-color, #5B3DF5); }
  50%      { box-shadow: inset 0 0 0 5px var(--collab-lock-color, #5B3DF5); }
}
.canvas-section.collab-lock-bump {
  animation: collabLockBump 0.4s ease;
}

/* --- Preview Button --- */
.mainbar-preview-btn {
  display: flex;
  align-items: center;
  gap: 0;
  height: 36px;
  border-radius: var(--radius-md);
  margin: 0 2px;
  position: relative;
}

/* Viewport size (editing size) popover */
.mainbar-viewport-size-wrap { position: relative; }
.mainbar-viewport-popover {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  min-width: 340px;
  background: #131720;
  border: 1px solid #2a2f3d;
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.45);
  padding: 16px 18px 14px;
  z-index: var(--z-tooltip);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.14s, transform 0.14s;
  color: #e5e7eb;
  font-family: var(--font-sans);
}
.mainbar-viewport-popover.is-open { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }
.mainbar-viewport-popover__header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mainbar-viewport-popover__title { font-size: 15px; font-weight: 400; color: #fff; }
.mainbar-viewport-popover__close {
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  border: none; background: none; cursor: pointer;
  color: #9ca3af; border-radius: 4px; transition: color 0.12s, background 0.12s;
}
.mainbar-viewport-popover__close:hover { color: #fff; background: rgba(255,255,255,0.08); }
.mainbar-viewport-popover__desc { font-size: 12px; line-height: 1.5; color: #d1d5db; margin: 12px 0 4px; }
.mainbar-viewport-popover__learn {
  border: none; background: none; padding: 0;
  color: #5B3DF5; font-size: 12px; font-weight: 400; cursor: pointer; font-family: var(--font-sans);
  margin-bottom: 14px;
}
.mainbar-viewport-popover__learn:hover { text-decoration: underline; }
.mainbar-viewport-popover__row { display: flex; align-items: center; gap: 10px; padding-top: 12px; border-top: 1px solid #2a2f3d; }
.mainbar-viewport-popover__label { flex: 1; font-size: 13px; color: #e5e7eb; }
.mainbar-viewport-popover__inputgroup {
  display: inline-flex; align-items: center;
  background: #1c2130; border: 1px solid #5B3DF5;
  border-radius: 4px; padding: 0 8px; height: 30px;
}
.mainbar-viewport-popover__input {
  width: 48px; border: none; outline: none; background: transparent;
  color: #fff; font-size: 13px; font-family: var(--font-sans); text-align: left; padding: 0;
}
.mainbar-viewport-popover__unit { font-size: 12px; color: #9ca3af; margin-left: 2px; }
.mainbar-viewport-popover__apply {
  padding: 0 14px; height: 30px;
  background: #2a2f3d; color: #6b7280;
  border: none; border-radius: 4px;
  font-size: 13px; font-weight: 400; cursor: not-allowed;
  font-family: var(--font-sans);
  transition: background 0.12s, color 0.12s;
}
.mainbar-viewport-popover__apply:not([disabled]) { background: #5B3DF5; color: #fff; cursor: pointer; }
.mainbar-viewport-popover__apply:not([disabled]):hover { background: #5B3DF5; }

/* Customize Breakpoints popover (Wix style, dark) */
.mainbar-breakpoint--more { position: relative; }
.mainbar-breakpoints-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: -40px;
  transform: translateY(-4px);
  min-width: 300px;
  background: #131720;
  border: 1px solid #2a2f3d;
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.45);
  padding: 16px 18px 14px;
  z-index: var(--z-tooltip);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.14s, transform 0.14s;
  color: #e5e7eb;
  font-family: var(--font-sans);
}
.mainbar-breakpoints-popover.is-open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.mainbar-breakpoints-popover__header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mainbar-breakpoints-popover__title { font-size: 15px; font-weight: 400; color: #fff; }
.mainbar-breakpoints-popover__actions { display: flex; align-items: center; gap: 2px; }
.mainbar-breakpoints-popover__icon-btn {
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  border: none; background: none; cursor: pointer;
  color: #9ca3af; border-radius: 4px; transition: color 0.12s, background 0.12s;
}
.mainbar-breakpoints-popover__icon-btn:hover { color: #fff; background: rgba(255,255,255,0.08); }
.mainbar-breakpoints-popover__desc { font-size: 12px; line-height: 1.5; color: #9ca3af; margin: 12px 0 14px; }
.mainbar-breakpoints-popover__maxwidth {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13px; color: #e5e7eb;
  padding: 6px 0;
}
.mainbar-breakpoints-popover__list { padding: 4px 0 8px; }
.mainbar-breakpoints-popover__row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0;
  font-size: 13px;
  color: #e5e7eb;
}
.mainbar-breakpoints-popover__row-icon { flex-shrink: 0; color: #e5e7eb; }
.mainbar-breakpoints-popover__row-label { flex: 1; min-width: 0; }
.mainbar-breakpoints-popover__row-max { color: #9ca3af; }
.mainbar-breakpoints-popover__row-actions { display: none; gap: 2px; }
.mainbar-breakpoints-popover__row:hover .mainbar-breakpoints-popover__row-actions { display: inline-flex; }
.mainbar-breakpoints-popover__action {
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  border: none; background: none; cursor: pointer;
  color: #6ea3ff; border-radius: 4px; transition: background 0.12s;
}
.mainbar-breakpoints-popover__action:hover { background: rgba(255,255,255,0.08); }
.mainbar-breakpoints-popover__divider { border: none; border-top: 1px solid #2a2f3d; margin: 8px -18px; }
.mainbar-breakpoints-popover__add {
  display: block;
  width: 100%;
  border: none;
  background: none;
  color: #5B3DF5;
  font-size: 13px;
  font-weight: 400;
  padding: 10px 0 2px;
  cursor: pointer;
  font-family: var(--font-sans);
  text-align: center;
}
.mainbar-breakpoints-popover__add:hover { text-decoration: underline; }

/* Layer context menu: disabled item + submenu chevron */
.layer-context-menu__item.is-disabled,
.layer-context-menu__item[disabled] {
  color: #9aa0b3;
  cursor: default;
  pointer-events: none;
}
.lcm-chevron { font-size: 14px; color: #9aa0b3; }

/* Preview dropdown menu (Wix style) */
.mainbar-preview-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 320px;
  background: #131720;
  border: 1px solid #2a2f3d;
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.45);
  padding: 8px;
  z-index: var(--z-tooltip);
  display: none;
}
.mainbar-preview-menu.is-open { display: block; }
.mainbar-preview-menu__item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
  color: #e5e7eb;
  text-decoration: none;
  font-family: var(--font-sans);
  transition: background 0.12s;
}
.mainbar-preview-menu__item + .mainbar-preview-menu__item { margin-top: 2px; }
.mainbar-preview-menu__item:hover { background: #1c2130; }
.mainbar-preview-menu__icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.mainbar-preview-menu__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mainbar-preview-menu__title { font-size: 14px; font-weight: 400; color: #fff; }
.mainbar-preview-menu__desc { font-size: 12px; color: #9ca3af; line-height: 1.4; }

.mainbar-preview-btn__main {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  transition: background 0.15s;
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  color: #fff;
}

.mainbar-preview-btn__main:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.mainbar-preview-btn__main svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.mainbar-preview-btn__chevron {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 36px;
  transition: background 0.15s;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  color: #fff;
  border: none;
  background: none;
  cursor: pointer;
}

.mainbar-preview-btn__chevron:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.mainbar-preview-btn__chevron svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

/* --- Publish Button --- */
.mainbar-publish-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 0 24px;
  background: #5B3DF5;
  color: #fff;
  font-size: 13px;
  font-weight: 400;
  border-radius: 0;
  transition: all 0.15s;
  white-space: nowrap;
  margin-left: 0;
  align-self: stretch;
}

.mainbar-publish-btn:hover {
  background: var(--editor-accent-hover);
}

.mainbar-publish-btn:active {
  background: var(--editor-accent-active);
  transform: scale(0.97);
}

.mainbar-publish-btn--saving {
  opacity: 0.7;
  pointer-events: none;
}

/* --- Export as Template Button --- */
.mainbar-export-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 0 16px;
  background: transparent;
  color: var(--editor-text);
  font-size: 13px;
  font-weight: 400;
  border-radius: 0;
  white-space: nowrap;
  transition: background 0.15s;
}
.mainbar-export-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}
.mainbar-export-btn:active { transform: scale(0.97); }

/* --- Export Template dialog --- */
.vendr-export-note {
  font-size: 12px;
  color: #4A2BE6;
  background: #eff6ff;
  border-radius: 6px;
  padding: 8px 10px;
  margin: 0 0 14px;
}
.vendr-export-opts {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}
.vendr-export-opt {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.vendr-export-opt:hover { border-color: #c7d2fe; }
.vendr-export-opt:has(input:checked) {
  border-color: #5B3DF5;
  background: #eff6ff;
}
.vendr-export-opt input { margin-top: 2px; accent-color: #5B3DF5; }
.vendr-export-opt__body { display: flex; flex-direction: column; gap: 2px; }
.vendr-export-opt__title { font-size: 13px; font-weight: 400; color: #111827; }
.vendr-export-opt__desc { font-size: 12px; color: #6b7280; line-height: 1.4; }

/* Export-button dropdown menu — popover anchored under the mainbar Export
   button. Two action items: "Export as Template" / "Export Static HTML". */
.vendr-export-menu {
  width: 320px;
  background: #ffffff;
  border: 1px solid #e5e5e8;
  border-radius: 10px;
  box-shadow: 0 18px 50px -12px rgba(10, 10, 15, 0.22), 0 6px 18px -6px rgba(10, 10, 15, 0.10);
  padding: 6px;
  font-family: 'Wix Madefor Text', 'Aeonik Pro', system-ui, sans-serif;
  animation: vendrMenuIn 0.16s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes vendrMenuIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.vendr-export-menu__item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  padding: 12px;
  background: transparent;
  border: 0;
  border-radius: 8px;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease;
}
.vendr-export-menu__item:hover { background: #f7f7f8; }
.vendr-export-menu__icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #F1EEFE;
  color: #5B3DF5;
}
.vendr-export-menu__item:hover .vendr-export-menu__icon {
  background: linear-gradient(135deg, #5B3DF5 0%, #C341E8 55%, #FF6FA3 100%);
  color: #ffffff;
}
.vendr-export-menu__body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.vendr-export-menu__title { font-size: 14px; font-weight: 400; color: #0A0A0B; line-height: 1.25; }
.vendr-export-menu__desc { font-size: 12px; font-weight: 300; color: #52525B; line-height: 1.4; }

/* Tiny toast shown while the static-html zip is being prepared server-side. */
.vendr-export-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10001;
  background: #0A0A0B;
  color: #ffffff;
  font-family: 'Wix Madefor Text', 'Aeonik Pro', system-ui, sans-serif;
  font-size: 13px;
  font-weight: 300;
  padding: 12px 18px;
  border-radius: 8px;
  box-shadow: 0 12px 32px -8px rgba(10, 10, 15, 0.35);
  animation: vendrToastIn 0.2s ease-out;
}
@keyframes vendrToastIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.vendr-export-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  padding: 12px 0;
  color: #16a34a;
}
.vendr-export-msg { font-size: 14px; color: #374151; margin: 0; }
a.vendr-dialog__btn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* --- Tooltip --- */
.vendr-tooltip {
  position: fixed;
  padding: 6px 10px;
  background: #1a1a2e;
  color: #fff;
  font-size: 12px;
  font-weight: 400;
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.08);
  pointer-events: none;
  z-index: 2147483646;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.15s;
}

.vendr-tooltip.is-visible {
  opacity: 1;
}
/* Rich variant: two-line popover used by the breakpoint icons (Desktop /
 * Tablet / Mobile). Allows wrapping so the description doesn't force a
 * single super-wide line. Looks like Wix's breakpoint hover panel. */
.vendr-tooltip--rich {
  padding: 10px 12px 11px;
  max-width: 260px;
  white-space: normal;
  line-height: 1.45;
}
.vendr-tooltip__head {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 6px;
}
.vendr-tooltip__title {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}
.vendr-tooltip__sub {
  font-size: 12px;
  font-weight: 400;
  color: #9ca3af;
}
.vendr-tooltip__desc {
  font-size: 12px;
  color: #d1d5db;
}

.vendr-tooltip__shortcut {
  color: rgba(255,255,255,0.5);
  margin-left: 8px;
  font-size: 11px;
}

/* ===== WORKSPACE (below mainbar) ===== */
.workspace {
  display: flex;
  flex: 1;
  overflow: hidden;
  position: relative;
}

/* ===== Portrait-phone "rotate to landscape" prompt =====
   Below 768px portrait the UI just doesn't have room. Show a friendly
   nudge telling the user to rotate. Landscape phones (height < width,
   even at 360px tall) get the full responsive editor below. */
.editor-mobile-lock {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: linear-gradient(180deg, #f6f7fa 0%, #ffffff 100%);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  text-align: center;
  font-family: var(--font-sans, 'Madefor Display', 'Inter', sans-serif);
}
.editor-mobile-lock__icon {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  background: #eef3ff;
  color: #5B3DF5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}
.editor-mobile-lock__title { font-size: 20px; font-weight: 400; color: #131720; margin: 0 0 10px; }
.editor-mobile-lock__desc {
  font-size: 14px; line-height: 1.55; color: #595d70;
  margin: 0 0 20px; max-width: 320px;
}
.editor-mobile-lock__actions {
  display: flex; gap: 10px; flex-wrap: wrap; justify-content: center;
}
.editor-mobile-lock__btn {
  padding: 10px 18px; border-radius: 8px;
  font-size: 14px; font-weight: 400;
  text-decoration: none; cursor: pointer;
  border: 1px solid transparent; font-family: inherit;
}
.editor-mobile-lock__btn--primary { background: #5B3DF5; color: #fff; }
.editor-mobile-lock__btn--primary:hover { background: #0f62e6; }
.editor-mobile-lock__btn--secondary { background: #fff; color: #131720; border-color: #e2e3ea; }
.editor-mobile-lock__btn--secondary:hover { background: #f4f5f8; }

/* The mobile lock element exists in the markup but no @media rule
   triggers it — builder always shows the desktop UI as the user requested.
   Keeping the styles around so we can re-enable later if needed. */

/* ===== SECONDARY BAR (Left Sidebar) ===== */
.sidebar {
  display: flex;
  flex-direction: column;
  width: var(--sidebar-width);
  background: var(--editor-surface);
  border-right: 1px solid var(--editor-border);
  z-index: var(--z-sidebar);
  flex-shrink: 0;
  user-select: none;
  justify-content: space-between;
}

.sidebar__top,
.sidebar__bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0;
  gap: 0;
}

.sidebar__top {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
}

.sidebar__top::-webkit-scrollbar {
  display: none;
}

.sidebar__bottom {
  border-top: 1px solid var(--editor-border);
}

/* --- Sidebar Button --- */
.sidebar-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 0;
  transition: all 0.15s;
  position: relative;
  flex-shrink: 0;
}

.sidebar-btn::before {
  content: "";
  position: absolute;
  inset: 0 -6px;
  background: transparent;
  transition: background 0.15s;
  z-index: 0;
}
.sidebar-btn > svg { position: relative; z-index: 1; }

.sidebar-btn:hover::before {
  background: var(--editor-surface-hover);
}
.sidebar-btn:hover {
  background: transparent;
}

.sidebar-btn:hover svg {
  fill: var(--editor-text);
}

.sidebar-btn.is-active {
  border-radius: 0;
}

.sidebar-btn.is-active::before {
  content: "";
  position: absolute;
  inset: 0 -6px;
  background: #F1EEFE;
  z-index: 0;
}

.sidebar-btn.is-active svg {
  fill: var(--editor-accent);
  position: relative;
  z-index: 1;
}

.sidebar-btn svg {
  width: 24px;
  height: 24px;
  fill: #000624;
  transition: fill 0.15s;
}

/* --- Sidebar Panel (slide-out) — LIGHT THEME --- */
.sidebar-panel {
  --panel-bg: #ffffff;
  --panel-surface: #f5f5f5;
  --panel-surface-hover: #ebebeb;
  --panel-surface-active: #e0e0f0;
  --panel-border: #e0e0e0;
  /* User 2026-06-22: inspector text was reading too gray on the white
   * panel; flatten the 3-tier hierarchy (primary/secondary/muted) into
   * a single pure-black so labels read at full contrast. Hierarchy now
   * comes from size / weight / divider position, not colour washout. */
  --panel-text: #000000;
  --panel-text-secondary: #000000;
  --panel-text-muted: #000000;

  position: relative;
  width: 0;
  height: 100%;
  background: var(--panel-bg);
  border-right: none;
  z-index: var(--z-sidebar);
  overflow: hidden;
  transition: width 0.2s ease;
  display: flex;
  flex-direction: column;
  color: var(--panel-text);
  flex-shrink: 0;
}

.sidebar-panel.is-open {
  width: 270px;
  border-right: 1px solid var(--panel-border);
}

.sidebar-panel.is-wide.is-open {
  /* Per-category width — JS sets data-add-cat on the panel so each
   * Add Elements tab can be as narrow or wide as its content needs.
   * Defaults to 480px (Quick Add's 3-tile grid). Categories that show
   * section previews (Sections / Design Kits / Wireframes / Containers)
   * bump up to 720px so the right pane has room for full-bleed cards. */
  width: 480px;
}
.sidebar-panel.is-wide.is-open[data-add-cat="sections"],
.sidebar-panel.is-wide.is-open[data-add-cat="designkits"],
.sidebar-panel.is-wide.is-open[data-add-cat="wireframes"],
.sidebar-panel.is-wide.is-open[data-add-cat="containers"],
.sidebar-panel.is-wide.is-open[data-add-cat="layouttools"] {
  width: 720px;
}
.sidebar-panel.is-wide.is-open[data-add-cat="assets"] {
  width: 560px;
}

/* Layers panel: grow with deeply-nested layer trees so long names aren't
   clipped. Other panels keep their fixed width. */
.sidebar-panel.is-open:has(.sp-layers) {
  width: auto;
  min-width: 270px;
  max-width: 520px;
}
.sidebar-panel.is-wide .sidebar-panel__body {
  padding: 0;
  display: flex;
  flex-direction: row;
  overflow: hidden;
}

.sidebar-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 44px;
  padding: 0 12px 0 16px;
  border-bottom: 1px solid var(--panel-border);
  flex-shrink: 0;
}

.sidebar-panel__title {
  font-size: 13px;
  font-weight: 400;
  color: var(--panel-text);
}

.sidebar-panel__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  transition: background 0.12s;
}

.sidebar-panel__close:hover {
  background: var(--panel-surface-hover);
}

.sidebar-panel__close svg {
  width: 16px;
  height: 16px;
  fill: var(--panel-text-secondary);
}

/* Per-panel search slot — sits between title and close button. Empty by
 * default; the Add Elements panel populates it with a compact search box
 * (≈140px wide so the title still has room to breathe). */
.sidebar-panel__search-slot {
  flex: 0 0 auto;
  margin-left: auto;
  margin-right: 8px;
  display: flex;
  align-items: center;
}
.sidebar-panel__search-slot:empty { display: none; }
.sidebar-panel__search-slot .sp-search {
  width: 140px;
  margin: 0;
  padding: 0;
}
.sidebar-panel__search-slot .sp-search input {
  height: 28px;
  font-size: 12px;
}

.sidebar-panel__body {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  position: relative;
}
.sidebar-panel__body:has(.sp-styles__topbar) { padding: 0; }
/* Full-width hover for sp-item rows in Quick Add / Sections / Assets / Design
   Kits / etc. — break out of the panel padding via negative margins so the
   hover bg reaches the panel edges, then re-add the inset via the item's
   own horizontal padding. The Layers panel uses a different item class so
   isn't affected. */
.sidebar-panel__body .sp-item {
  border-radius: 0;
  margin-left: -14px;
  margin-right: -14px;
  padding-left: 14px;
  padding-right: 14px;
}
/* Hide scrollbar in the Layers panel — list scrolls invisibly. */
.sidebar-panel__body:has(.sp-layers) {
  scrollbar-width: none; /* Firefox */
}
.sidebar-panel__body:has(.sp-layers)::-webkit-scrollbar {
  display: none; /* Chromium / Safari */
}
/* Pin the search bar to the top of the Layers panel so scrolling the long
   layer list doesn't scroll the search out of view. Visuals stay identical
   — only position behaviour changes. */
.sidebar-panel__body:has(.sp-layers) > .sp-search {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--panel-bg, #fff);
}

/* ===== Font picker (inspector) ===== */
/* Text Style picker — Wix-style trigger button + popover list */
.insp-style-trigger {
  display: flex; width: 100%; box-sizing: border-box;
  align-items: center; justify-content: space-between;
  height: 30px;
  padding: 0 8px 0 10px;
  border: 1px solid #e2e3ea;
  border-radius: 4px;
  background: #fff;
  font-size: 13px;
  color: #131720;
  cursor: pointer;
  font-family: var(--font-sans);
  text-align: left;
}
.insp-style-trigger:hover { border-color: #868aa5; }
.insp-style-trigger__name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.insp-style-dropdown {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.16);
  z-index: 6000;
  padding: 6px 0;
  font-family: var(--font-sans);
  min-width: 260px;
}
.insp-style-dropdown__item {
  display: flex; align-items: center; gap: 12px;
  width: 100%;
  padding: 8px 14px;
  background: none; border: none; cursor: pointer;
  font-family: inherit; font-size: 13px; color: #131720;
  text-align: left;
}
.insp-style-dropdown__item:hover { background: #f4f5f8; }
.insp-style-dropdown__item.is-active { background: #F1EEFE; color: var(--editor-accent); }
.insp-style-dropdown__swatch {
  width: 16px; height: 16px; flex-shrink: 0;
  background: #000;
  border-radius: 2px;
}
.insp-style-dropdown__name { flex: 1; }
.insp-style-dropdown__size { color: #6b6b6b; font-size: 12px; }
.insp-style-dropdown__footer {
  display: flex; justify-content: space-between;
  border-top: 1px solid #e5e5e5;
  padding: 8px 14px 6px;
  margin-top: 6px;
}
.insp-style-dropdown__footer-btn {
  background: none; border: none; cursor: pointer;
  color: var(--editor-accent);
  font-size: 12px; font-family: inherit;
  padding: 0;
}
.insp-style-dropdown__footer-btn:hover { text-decoration: underline; }

.insp-font-trigger {
  display: flex !important;
  width: 100% !important;
  box-sizing: border-box;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: 30px;
  padding: 0 8px 0 10px;
  border: 1px solid #e2e3ea;
  border-radius: 4px;
  background: #ffffff;
  font-size: 13px;
  color: #131720;
  cursor: pointer;
  width: 160px;
  transition: border-color 0.12s, background 0.12s;
}
.insp-font-trigger:hover { border-color: #c5cad2; background: #f9fafc; }
.insp-font-trigger:focus { outline: 0; border-color: #5B3DF5; }
.insp-font-trigger__name {
  flex: 1;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.insp-font-trigger__chev { color: #868aa5; flex-shrink: 0; }

.insp-font-picker {
  position: fixed;
  z-index: 100000;
  width: 280px;
  max-height: 360px;
  background: #ffffff;
  border: 1px solid #e2e3ea;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 6, 36, 0.16), 0 0 0 1px rgba(0, 6, 36, 0.04);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.insp-font-picker__search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid #ececec;
  color: #868aa5;
}
.insp-font-picker__search input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 13px;
  font-family: inherit;
  color: #131720;
  min-width: 0;
}
.insp-font-picker__search input::placeholder { color: #868aa5; }
.insp-font-picker__list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0;
}
.insp-font-picker__group { padding: 4px 0; }
.insp-font-picker__group-title {
  font-size: 11px;
  font-weight: 400;
  color: #868aa5;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 6px 12px;
}
.insp-font-picker__item {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  padding: 8px 12px;
  font-size: 16px;
  color: #131720;
  cursor: pointer;
  font-family: inherit;
  line-height: 1.2;
}
.insp-font-picker__item:hover { background: #f4f5f8; }
.insp-font-picker__item.is-active {
  background: #F1EEFE;
  color: #5B3DF5;
}

/* ===== Site Styles panel (Wix-style) =====
   The Site Styles panel renders its own title + action buttons in a single
   topbar, so we hide the global panel header for this view. */
.sidebar-panel__body:has(.sp-styles__topbar) { padding: 0; }
.sidebar-panel:has(.sp-styles__topbar) > .sidebar-panel__header { display: none; }

.sp-styles__topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid #ececec;
}
.sp-styles__title {
  font-size: 16px;
  font-weight: 400;
  color: #131720;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sp-styles__topbar-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.sp-styles__icon-btn {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  border-radius: 4px;
  cursor: pointer;
  color: #131720;
  transition: background 0.12s;
}
.sp-styles__icon-btn:hover { background: #f4f5f8; }
.sp-styles__icon-btn--sm { width: 24px; height: 24px; }
.sp-styles__icon-btn--accent { color: #5B3DF5; }

.sp-styles__tabs {
  display: flex;
  gap: 4px;
  padding: 8px 16px;
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 1px solid #ececec;
}
.sp-styles__tabs::-webkit-scrollbar { display: none; }
.sp-styles__tab {
  padding: 6px 12px;
  border: 0;
  background: transparent;
  border-radius: 4px;
  font-family: inherit;
  font-size: 13px;
  color: #131720;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s, color 0.12s;
}
.sp-styles__tab:hover { background: #f4f5f8; }
.sp-styles__tab.is-active { background: #F1EEFE; color: #5B3DF5; font-weight: 400; }

.sp-styles__block { border-bottom: 1px solid #ececec; }
/* Match the inspector section header — same bg, padding, hover, transitions
   so the visual language is consistent across panels. */
.sp-styles__block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: #f0f1f5;
  cursor: pointer;
  user-select: none;
  transition: background 0.12s;
}
.sp-styles__block-header:hover { background: #e8e9ee; }
.sp-styles__block-title {
  font-size: 14px;
  font-weight: 400;
  color: #131720;
}
.sp-styles__block-actions { display: flex; gap: 4px; }
.sp-styles__chevron { color: #131720; }
.sp-styles__block.is-collapsed .sp-styles__block-body { display: none; }
.sp-styles__block.is-collapsed .sp-styles__chevron-svg { transform: rotate(-90deg); }
/* Chevron icon — match the small triangle used by inspector section
   headers so the visual language is consistent across all panels. */
.sp-styles__chevron-svg {
  transition: transform 0.2s;
}
.sp-styles__chevron-svg.is-collapsed { transform: rotate(-90deg); }
.sp-styles__block-body { padding: 8px 0; }

/* Color list */
.sp-styles__color-list { list-style: none; margin: 0; padding: 0; }
.sp-styles__color-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  cursor: pointer;
  transition: background 0.12s;
}
.sp-styles__color-row:hover { background: #f4f5f8; }
.sp-styles__color-swatch {
  width: 22px;
  height: 22px;
  border-radius: 3px;
  flex-shrink: 0;
  border: 1px solid transparent;
}
.sp-styles__color-swatch--light { border-color: #e2e3ea; }
.sp-styles__color-name {
  flex: 1;
  font-size: 13px;
  color: #131720;
}
.sp-styles__color-hex {
  font-size: 13px;
  color: #868aa5;
  font-family: 'SF Mono', Menlo, Consolas, monospace;
}

/* Fonts list */
.sp-styles__font-row {
  padding: 10px 16px;
  font-size: 14px;
  color: #131720;
  cursor: pointer;
  transition: background 0.12s;
}
.sp-styles__font-row:hover { background: #f4f5f8; }

/* Text styles list */
.sp-styles__text-list { list-style: none; margin: 0; padding: 0; }
.sp-styles__text-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  cursor: pointer;
  transition: background 0.12s;
}
.sp-styles__text-row:hover { background: #f4f5f8; }
.sp-styles__text-preview {
  font-weight: 400;
  font-size: 16px;
  color: #131720;
  width: 28px;
}
.sp-styles__text-name {
  flex: 1;
  font-size: 13px;
  color: #131720;
}
.sp-styles__text-size {
  font-size: 13px;
  color: #868aa5;
}

/* Max width */
.sp-styles__maxwidth-illu {
  display: flex;
  justify-content: center;
  padding: 16px;
}
.sp-styles__maxwidth-illu img {
  max-width: 220px;
  width: 100%;
  height: auto;
}
.sp-styles__maxwidth-desc {
  font-size: 12px;
  color: #595d70;
  margin: 0 16px 16px;
  line-height: 1.5;
}
.sp-styles__link { color: #5B3DF5; text-decoration: none; }
.sp-styles__link:hover { text-decoration: underline; }
.sp-styles__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-top: 1px solid #f4f5f8;
}
.sp-styles__row:first-of-type { border-top: 0; }
.sp-styles__row-label {
  font-size: 13px;
  color: #131720;
  padding: 0 16px;
}
.sp-styles__num-input {
  display: inline-flex;
  align-items: center;
  border: 1px solid #e2e3ea;
  border-radius: 4px;
  padding: 0 8px;
  height: 32px;
  background: #fff;
  width: 92px;
}
.sp-styles__num-input:focus-within { border-color: #5B3DF5; }
.sp-styles__num-input input {
  border: 0;
  outline: 0;
  flex: 1;
  font-size: 13px;
  background: transparent;
  color: #131720;
  width: 100%;
  min-width: 0;
}
.sp-styles__num-input span {
  font-size: 12px;
  color: #868aa5;
  margin-left: 4px;
}

/* Transitions */
.sp-styles__transition-note {
  font-size: 12px;
  color: #5B3DF5;
  margin: 0 16px 16px;
  line-height: 1.5;
}
.sp-styles__transitions {
  display: flex;
  gap: 12px;
  padding: 0 16px 16px;
}
.sp-styles__transition {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
}
.sp-styles__transition-thumb {
  width: 80px;
  height: 80px;
  border: 1px solid #e2e3ea;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  transition: border-color 0.12s, background 0.12s;
}
.sp-styles__transition:hover .sp-styles__transition-thumb { border-color: #c5cad2; }
.sp-styles__transition.is-active .sp-styles__transition-thumb {
  border-color: #5B3DF5;
  background: #F1EEFE;
}
.sp-styles__transition-label {
  font-size: 12px;
  color: #131720;
}
.sp-styles__transition.is-active .sp-styles__transition-label { color: #5B3DF5; }

/* ===== Sidebar Panel Components (sp-*) ===== */

/* Search — Wix-style pill input: white bg, light border, grey icon. */
.sp-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 6px;
  background: #ffffff;
  border: 1px solid #e2e3ea;
  margin-bottom: 12px;
  color: #868aa5;
  transition: border-color 0.12s, background 0.12s;
}
.sp-search:hover { border-color: #c5cad2; }
.sp-search:focus-within { border-color: #5B3DF5; background: #ffffff; }
.sp-search > svg { flex-shrink: 0; color: #868aa5; }
.sp-search__input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: #131720;
  font-size: 13px;
  font-family: inherit;
  min-width: 0;
}
.sp-search__input::placeholder { color: #868aa5; }

/* Section */
.sp-section { margin-bottom: 16px; }
.sp-section__title {
  font-size: 11px;
  font-weight: 400;
  color: var(--panel-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

/* Item row */
.sp-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 8px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--panel-text);
  background: none;
  border: none;
  cursor: pointer;
  transition: background 0.12s;
  text-align: left;
}
.sp-item:hover { background: var(--panel-surface-hover); }
.sp-item.is-active {
  background: var(--panel-surface-active);
  color: var(--editor-accent);
}
.sp-item__icon {
  width: 20px;
  flex-shrink: 0;
  text-align: center;
  font-size: 14px;
  line-height: 1;
}
.sp-item__label { flex: 1; min-width: 0; }
.sp-item__badge {
  font-size: 11px;
  color: var(--panel-text-muted);
  background: var(--panel-surface);
  padding: 1px 6px;
  border-radius: 8px;
}
.sp-item__arrow {
  flex-shrink: 0;
  color: var(--panel-text-muted);
}

/* Grid (for Add Elements) */
.sp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}
.sp-grid__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 4px;
  border-radius: var(--radius-sm);
  background: #ffffff;
  border: 1px solid #e0e0e0;
  color: var(--panel-text);
  cursor: pointer;
  transition: border-color 0.12s;
  font-size: 11px;
}
.sp-grid__card:hover {
  border-color: #000000;
  background: #ffffff;
}
.sp-grid__icon { font-size: 20px; line-height: 1; }
.sp-grid__label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* Empty state */
.sp-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 32px 16px;
  color: var(--panel-text-muted);
}
.sp-empty__icon { margin-bottom: 12px; opacity: 0.5; }
.sp-empty__title {
  font-size: 13px;
  font-weight: 400;
  color: var(--panel-text-secondary);
  margin-bottom: 6px;
}
.sp-empty__desc { font-size: 12px; line-height: 1.5; }

/* ===== Code panel (live JSON debug view) =====
 * Replaces the placeholder Page/Site/Packages list with a live mirror of
 * the selected section's runtime state. Used to verify what's actually
 * in `state.sections` when the canvas / inspector are misreporting
 * numbers. */
/* Custom Code editor — per-element HTML / CSS / JS that the production
   renderer scopes behind `[data-section-id="…"]`. Sits above the live
   JSON debugger in the Code panel. */
.sp-custom-code {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border-bottom: 1px solid #e5e5e8;
  padding: 12px 14px 10px;
}
.sp-custom-code__header { margin-bottom: 10px; }
.sp-custom-code__title {
  font-size: 12px;
  font-weight: 500;
  color: #0A0A0B;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.sp-custom-code__subtitle {
  margin-top: 4px;
  font-size: 11px;
  color: #8e8e97;
  font-weight: 300;
  font-family: 'Aeonik Pro Mono', ui-monospace, monospace;
  word-break: break-all;
}
.sp-custom-code__tabs {
  display: flex;
  gap: 4px;
  background: #f4f5f8;
  border-radius: 8px;
  padding: 3px;
  margin-bottom: 8px;
}
.sp-custom-code__tab {
  flex: 1;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 12px;
  font-weight: 400;
  color: #52525B;
  padding: 5px 0;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.sp-custom-code__tab:hover { color: #0A0A0B; }
.sp-custom-code__tab.is-active {
  background: #ffffff;
  color: #5B3DF5;
  box-shadow: 0 1px 2px rgba(10,10,15,0.06);
}
.sp-custom-code__panes { position: relative; }
.sp-custom-code__editor {
  display: none;
  width: 100%;
  min-height: 220px;
  border: 1px solid #e5e5e8;
  border-radius: 6px;
  padding: 10px 12px;
  background: #fafafb;
  font-family: 'JetBrains Mono', 'Aeonik Pro Mono', ui-monospace, SFMono-Regular, monospace;
  font-size: 12px;
  line-height: 1.55;
  color: #0A0A0B;
  resize: vertical;
  outline: none;
  box-sizing: border-box;
  tab-size: 2;
}
.sp-custom-code__editor.is-active { display: block; }
.sp-custom-code__editor:focus { border-color: #5B3DF5; background: #ffffff; }
.sp-custom-code__editor:disabled { background: #f4f5f8; color: #8e8e97; cursor: not-allowed; }
.sp-custom-code__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 11px;
}
.sp-custom-code__hint { color: #8e8e97; font-weight: 300; }
.sp-custom-code__btn {
  background: transparent;
  border: 1px solid #e5e5e8;
  color: #52525B;
  font-family: inherit;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: border-color 0.12s, color 0.12s;
}
.sp-custom-code__btn:hover { border-color: #5B3DF5; color: #5B3DF5; }

.sp-code-debug {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  padding: 8px;
  box-sizing: border-box;
}
.sp-code-debug__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--editor-border);
}
.sp-code-debug__title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--editor-text);
}
.sp-code-debug__actions { display: inline-flex; align-items: center; gap: 6px; }
.sp-code-debug__live {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--editor-text-muted);
  cursor: pointer;
}
.sp-code-debug__live input { margin: 0; }
.sp-code-debug__btn {
  width: 24px;
  height: 24px;
  border: 1px solid var(--editor-border);
  background: transparent;
  color: var(--editor-text);
  border-radius: 4px;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s, border-color 0.12s;
}
.sp-code-debug__btn:hover { background: var(--editor-surface); border-color: var(--editor-accent); }
.sp-code-debug__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 11px;
  color: var(--editor-text-muted);
  min-height: 22px;
}
.sp-code-debug__meta:empty { display: none; }
.sp-code-debug__pill {
  background: #F1EEFE;
  color: #5B3DF5;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.sp-code-debug__id {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  color: var(--editor-text);
}
.sp-code-debug__origin,
.sp-code-debug__children {
  font-size: 11px;
  color: var(--editor-text-muted);
}
.sp-code-debug__body {
  flex: 1;
  margin: 0;
  padding: 10px 12px;
  background: var(--editor-surface);
  border: 1px solid var(--editor-border);
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.65;
  color: var(--editor-text);
  overflow: auto;
  white-space: normal;
  word-break: break-word;
  user-select: text;
}

/* === JSON tree styling (rebuilt 2026-06-25 — was a plain JSON.stringify
 * dump in a <pre>, now a fold-able tree with change-flash highlights). === */

/* One row per key-value (or array index) pair. Each row holds a chevron
 * (collapsible) or a non-collapsible primitive value. */
.sp-code-debug__row {
  display: block;
  position: relative;
}
/* Per-field delete button in the Code panel — a small × pinned at the right
   of each object-property row, revealed on hover. */
.sp-code-debug__del {
  position: absolute;
  right: 2px;
  top: 0;
  width: 16px;
  height: 16px;
  line-height: 14px;
  text-align: center;
  border: none;
  background: transparent;
  color: #b91c1c;
  font-size: 13px;
  cursor: pointer;
  border-radius: 3px;
  opacity: 0;
  transition: opacity 0.1s, background 0.1s;
}
.sp-code-debug__row:hover > .sp-code-debug__del { opacity: 0.75; }
.sp-code-debug__del:hover { opacity: 1 !important; background: rgba(185, 28, 28, 0.1); }

/* Children of an expanded object/array — indented under their parent
 * with a thin dotted guide line so the user can trace the level. */
.sp-code-debug__nested {
  margin-left: 8px;
  padding-left: 10px;
  border-left: 1px dotted rgba(0,0,0,0.13);
}

/* Chevron toggle. Sits at the start of every object/array row. */
.sp-code-debug__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border: none;
  background: transparent;
  color: var(--panel-text-secondary);
  font-size: 9px;
  cursor: pointer;
  padding: 0;
  margin-right: 2px;
  vertical-align: middle;
  user-select: none;
  border-radius: 3px;
  transition: background 0.1s, color 0.1s;
}
.sp-code-debug__toggle:hover {
  background: rgba(91, 61, 245, 0.08);
  color: #5B3DF5;
}

/* Token colours (VSCode-light-ish palette so it reads on the white panel). */
.sp-code-debug__key {
  color: #0451A5;
  font-weight: 500;
}
.sp-code-debug__colon {
  color: var(--panel-text-secondary);
  margin-right: 2px;
}
.sp-code-debug__br {
  color: #6A737D;
}
.sp-code-debug__comma {
  color: #6A737D;
}
.sp-code-debug__elided {
  color: var(--panel-text-muted);
  font-style: italic;
  opacity: 0.6;
}
.sp-code-debug__str  { color: #A31515; }
.sp-code-debug__num  { color: #098658; }
.sp-code-debug__bool { color: #0000FF; }
.sp-code-debug__null { color: #808080; font-style: italic; }

/* Recently changed leaf — bright yellow that holds for ~8 s (the
 * timestamp window in refreshCodeDebug). Holds long enough for the
 * user to hover and see the previous value chip. */
.sp-code-debug__leaf {
  position: relative;
  display: inline-block;
}
.sp-code-debug__leaf.is-changed {
  background: linear-gradient(90deg, rgba(255, 211, 0, 0.55), rgba(255, 211, 0, 0.25));
  border-radius: 3px;
  padding: 1px 4px;
  box-shadow: 0 0 0 1px rgba(255, 211, 0, 0.65);
  animation: sp-code-debug-flash 0.35s ease-out 1;
  cursor: help;
}
@keyframes sp-code-debug-flash {
  0%   { background: rgba(255, 235, 100, 0.95); box-shadow: 0 0 0 1px rgba(245, 180, 0, 0.95); }
  100% { background: linear-gradient(90deg, rgba(255, 211, 0, 0.55), rgba(255, 211, 0, 0.25)); }
}
/* Previous-value chip — hidden by default, slides in on hover. The
 * user asked for this 2026-06-25: "với highlight thay đổi, khi sờ vào
 * sẽ hiện ra giá trị cũ bên cạnh". */
.sp-code-debug__old {
  display: inline-block;
  margin-left: 6px;
  padding: 0 6px;
  background: rgba(40, 40, 40, 0.78);
  color: #fff;
  border-radius: 3px;
  font-size: 0.85em;
  font-style: italic;
  vertical-align: baseline;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.14s, transform 0.14s;
  pointer-events: none;
  white-space: nowrap;
}
.sp-code-debug__leaf.is-changed:hover .sp-code-debug__old {
  opacity: 1;
  transform: translateX(0);
}

/* Wider sidebar panel when the Code debugger is the active body. JSON
 * paths get long fast (e.g. settings.padding_left_unit) and a 270 px
 * panel wraps them awkwardly. */
.sidebar-panel.is-open:has(.sp-code-debug) {
  width: 520px;
}

/* Buttons */
.sp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 400;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  border: none;
  text-decoration: none;
}
.sp-btn--primary {
  background: var(--editor-accent);
  color: #fff;
}
.sp-btn--primary:hover { background: var(--editor-accent-hover); }
.sp-btn--ghost {
  background: none;
  color: var(--panel-text-secondary);
  border: 1px solid var(--panel-border);
}
.sp-btn--ghost:hover { background: var(--panel-surface-hover); color: var(--panel-text); }
.sp-btn--sm { padding: 4px 10px; font-size: 11px; }

/* Pages panel */
.sp-pages-actions { margin-bottom: 12px; }

/* Color swatches (Site Styles) */
.sp-colors {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.sp-color-swatch {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--panel-border);
  cursor: pointer;
  transition: transform 0.12s;
}
.sp-color-swatch:hover { transform: scale(1.15); }

/* App Market cards */
.sp-apps-grid { display: flex; flex-direction: column; gap: 4px; }
.sp-app-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 8px;
  border-radius: var(--radius-sm);
  transition: background 0.12s;
  cursor: pointer;
}
.sp-app-card:hover { background: var(--panel-surface-hover); }
.sp-app-card__icon { font-size: 22px; width: 32px; text-align: center; flex-shrink: 0; }
.sp-app-card__info { flex: 1; min-width: 0; }
.sp-app-card__name { font-size: 13px; font-weight: 400; color: var(--panel-text); }
.sp-app-card__desc { font-size: 11px; color: var(--panel-text-muted); margin-top: 2px; }

/* Site Checker */
.sp-check-summary { text-align: center; padding: 12px 0 16px; }
.sp-check-score {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 12px;
}
.sp-check-score__value {
  font-size: 36px;
  font-weight: 400;
  color: var(--panel-text);
  line-height: 1;
}
.sp-check-score__label {
  font-size: 11px;
  color: var(--panel-text-muted);
  margin-top: 4px;
}
.sp-check-desc { font-size: 12px; color: var(--panel-text-muted); line-height: 1.5; }

/* Sitemap tree */
.sp-sitemap { padding: 8px 0; }
.sp-sitemap__tree { padding-left: 0; }
.sp-sitemap__node {
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--panel-text);
  cursor: pointer;
  transition: background 0.12s;
  border-left: 2px solid var(--panel-border);
  margin-left: 12px;
}
.sp-sitemap__node:hover { background: var(--panel-surface-hover); }
.sp-sitemap__node--root {
  border-left: none;
  margin-left: 0;
  font-weight: 400;
  color: var(--editor-accent);
}
.sp-sitemap__children { margin-top: 4px; }

/* App panels (Blog, Store, Bookings, Events) */
.sp-app-intro {
  text-align: center;
  padding: 32px 24px 24px;
}
.sp-app-intro__icon {
  margin-bottom: 12px;
  opacity: 0.7;
}
.sp-app-intro__icon svg {
  width: 40px;
  height: 40px;
  color: var(--panel-text-secondary);
}
.sp-app-intro__title {
  font-size: 15px;
  font-weight: 400;
  color: var(--panel-text);
  margin-bottom: 8px;
}
.sp-app-intro__desc {
  font-size: 12px;
  line-height: 1.5;
  color: var(--panel-text-muted);
  margin-bottom: 16px;
}
.sp-app-intro__btn {
  gap: 6px;
}
.sp-app-intro__btn.is-added {
  background: var(--panel-surface);
  color: var(--panel-text-muted);
  cursor: default;
  pointer-events: none;
}
.sp-app-elements {
  padding: 0 0 8px;
}
.sp-app-elements__divider {
  height: 1px;
  background: var(--panel-border);
  margin: 0 16px 8px;
}
.sp-app-elements__group-label {
  font-size: 11px;
  font-weight: 400;
  color: var(--panel-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 10px 16px 4px;
}

/* ===== Add Elements Two-Pane (Wix-style) ===== */

/* Left rail — narrower, cleaner type, indigo highlight when active. */
.add-nav {
  width: 168px;
  flex-shrink: 0;
  border-right: 1px solid #e5e7eb;
  background: #fff;
  overflow-y: auto;
  padding: 0;
  scrollbar-width: thin;
  scrollbar-color: #d0d3da transparent;
}
.add-nav__item {
  display: block;
  width: 100%;
  padding: 8px 16px;
  margin: 0;
  font-size: 13px;
  font-weight: 400;
  color: #131720;
  background: none;
  border: none;
  border-radius: 0;
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
  transition: color 0.12s, background 0.12s;
  font-family: var(--font-sans);
}
.add-nav__item:hover {
  background: #f4f5f8;
}
.add-nav__item.is-active {
  color: var(--editor-accent, #5B3DF5);
  background: #F1EEFE;
  font-weight: 400;
}
.add-nav__divider {
  height: 1px;
  background: #e5e7eb;
  margin: 10px 0;
}

/* ===== Site Pages panel ===== */
.pages-toolbar {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 14px 8px;
  background: #fff;
  position: sticky; top: 0; z-index: 2;
}
.pages-toolbar__search {
  flex: 1; display: flex; align-items: center; gap: 8px;
  height: 34px; padding: 0 10px;
  border: 1px solid #e0e0e0; border-radius: 4px;
  color: var(--panel-text-muted, #888);
}
.pages-toolbar__search:focus-within { border-color: var(--editor-accent, #5B3DF5); }
.pages-toolbar__input {
  flex: 1; min-width: 0;
  border: none; outline: none; background: transparent;
  font-family: inherit; font-size: 13px;
  color: var(--panel-text);
}
.pages-toolbar__add {
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  background: none; border: none; cursor: pointer;
  color: var(--panel-text);
  border-radius: 4px;
}
.pages-toolbar__add:hover { background: #f4f5f8; }
.pages-groups { padding-bottom: 12px; }
.pages-group { }
.pages-group__header {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%;
  padding: 12px 16px;
  background: #f0f1f5;
  border: none;
  cursor: pointer;
  font-family: inherit;
}
.pages-group__title {
  font-size: 13px; font-weight: 400;
  color: var(--panel-text-secondary, #3b3d4d);
  letter-spacing: 0.3px;
}
.pages-group__arrow {
  color: var(--panel-text-secondary, #3b3d4d);
  transition: transform 0.15s; transform: rotate(-90deg);
}
.pages-group__arrow.is-open { transform: rotate(0deg); }
.pages-group__body { padding: 0; }
.pages-group.is-collapsed .pages-group__body { display: none; }
.pages-item {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 8px 16px;
  background: none; border: none; cursor: pointer;
  font-family: inherit; font-size: 13px;
  color: var(--panel-text);
  text-align: left;
  border-radius: 0;
}
.pages-item:hover { background: #f4f5f8; }
.pages-item.is-active {
  background: #F1EEFE;
  color: var(--editor-accent, #5B3DF5);
}
.pages-item__label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pages-item__home {
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--editor-accent, #5B3DF5);
  flex: none;
}
.pages-item__more {
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--panel-text-muted, #888);
  opacity: 0;
  flex: none;
}
.pages-item:hover .pages-item__more,
.pages-item.is-active .pages-item__more { opacity: 1; }

.pages-footer {
  flex: 0 0 auto;
  border-top: 1px solid #e0e0e0;
  background: #fff;
  padding: 10px 16px;
}
.pages-footer__btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: none; cursor: pointer;
  color: var(--editor-accent, #5B3DF5);
  font-family: inherit; font-size: 13px; font-weight: 400;
  padding: 4px 0;
}

/* Pages panel uses zero body padding so headers + items reach full width.
   Flex column so: toolbar (search) + footer (Add New Page) stay fixed while
   ONLY the .pages-groups list scrolls between them. The whole body no longer
   scrolls as one block (which used to let the search bar scroll away and the
   absolute-positioned footer drift to the end of the content instead of
   staying pinned — user 2026-07-09 "panel pages scroll đang bị lỗi"). */
.sidebar-panel__body:has(.pages-groups) {
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.sidebar-panel__body:has(.pages-groups) .pages-toolbar { flex: 0 0 auto; }
.sidebar-panel__body:has(.pages-groups) .pages-groups {
  flex: 1 1 auto;
  overflow-y: auto;
  min-height: 0;
  padding-bottom: 12px;
}

/* Inline "New Page" rename input — replaces the pages-item button
 * while the user is typing the new page name. Enter / Blur commits;
 * Escape cancels. */
.pages-item--editing {
  display: block;
  padding: 6px 16px;
  border-left: 3px solid transparent;
  background: transparent;
}
.pages-item__rename {
  width: 100%;
  height: 30px;
  padding: 0 8px;
  border: 1px solid #116dff;
  border-radius: 4px;
  background: #fff;
  color: var(--panel-text, #000624);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  box-shadow: 0 0 0 2px rgba(17, 109, 255, 0.15);
}
.pages-item__rename:focus { border-color: #116dff; }

/* Add-Page popover — SINGLE card housing three items (Page / Dynamic /
 * Custom Member) separated by thin dividers. Fixed position, anchored
 * next to the trigger. Wix-style: white card, thin border, blue "Add"
 * button. User 2026-07-02 "3 option phải nằm trên một bảng thôi". */
.vendr-add-page-pop {
  position: fixed;
  z-index: 10000;
  width: 260px;
  background: #fff;
  border: 1px solid #e2e3ea;
  border-radius: 8px;
  padding: 4px 0;
  box-shadow: 0 4px 12px rgba(15, 20, 40, 0.08);
}
.vendr-add-page-pop__item {
  padding: 14px 16px;
}
.vendr-add-page-pop__sep {
  border: 0;
  border-top: 1px solid #eeeff2;
  margin: 0;
}
.vendr-add-page-pop__title {
  font-size: 14px;
  font-weight: 500;
  color: #131720;
  margin-bottom: 4px;
}
.vendr-add-page-pop__desc {
  font-size: 12px;
  color: #52525B;
  margin-bottom: 10px;
  line-height: 1.4;
}
.vendr-add-page-pop__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 60px;
  height: 30px;
  padding: 0 14px;
  border: none;
  border-radius: 4px;
  background: #116dff;
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s;
}
.vendr-add-page-pop__btn:hover      { background: #3d8aff; }
.vendr-add-page-pop__btn:disabled   { background: #c4c8d2; cursor: not-allowed; }

/* ===== Visual Sitemap — full-screen overlay ===== */
/* Sit BETWEEN the mainbar (56px) and the left sidebar (48px), so both stay
   visible while the sitemap takes over the canvas + right inspector area. */
.sitemap-overlay {
  position: fixed;
  top: var(--mainbar-height, 56px);
  left: var(--sidebar-width, 48px);
  right: 0;
  bottom: 0;
  background: #fff;
  z-index: 50;
  display: flex; flex-direction: column;
  font-family: var(--font-sans);
  color: var(--panel-text);
}
.sitemap-overlay__header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px;
  border-bottom: 1px solid #e0e0e0;
}
.sitemap-overlay__title { font-size: 16px; font-weight: 400; }
.sitemap-overlay__header-actions { display: flex; align-items: center; gap: 4px; }
.sitemap-overlay__icon-btn {
  width: 30px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  border: none; background: none; cursor: pointer;
  color: var(--panel-text);
  border-radius: 4px;
}
.sitemap-overlay__icon-btn:hover { background: #f4f5f8; }
.sitemap-overlay__tabs {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 24px;
  border-bottom: 1px solid #e0e0e0;
}
.sitemap-overlay__tabs-inner { display: flex; align-items: center; gap: 4px; }
.sitemap-tab {
  padding: 6px 14px;
  background: none; border: none; cursor: pointer;
  font-family: inherit; font-size: 13px;
  color: var(--panel-text);
  border-radius: 4px;
}
.sitemap-tab:hover { background: #f4f5f8; }
.sitemap-tab.is-active { background: #F1EEFE; color: var(--editor-accent, #5B3DF5); font-weight: 400; }
.sitemap-overlay__edit {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: none; cursor: pointer;
  color: var(--editor-accent, #5B3DF5);
  font-family: inherit; font-size: 13px;
}
.sitemap-overlay__body {
  flex: 1;
  overflow: auto;
  padding: 16px 24px 24px;
}
.sitemap-group { margin-top: 18px; }
.sitemap-group:first-child { margin-top: 0; }
.sitemap-group__header {
  display: flex; align-items: center; gap: 14px;
  padding: 8px 0;
}
.sitemap-group__toggle {
  display: inline-flex; align-items: center; gap: 8px;
  background: none; border: none; cursor: pointer;
  font-family: inherit;
  color: var(--panel-text);
}
.sitemap-group__arrow {
  color: var(--panel-text);
  transition: transform 0.15s; transform: rotate(-90deg);
}
.sitemap-group__arrow.is-open { transform: rotate(0deg); }
.sitemap-group__title { font-size: 14px; font-weight: 400; }
.sitemap-group__add {
  background: none; border: none; cursor: pointer;
  color: var(--editor-accent, #5B3DF5);
  font-size: 13px; font-weight: 400;
  padding: 4px 10px;
  border-radius: 4px;
}
.sitemap-group__add:hover { background: #F1EEFE; }
.sitemap-group__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 8px;
}
.sitemap-group.is-collapsed .sitemap-group__grid { display: none; }

.sitemap-card {
  border: 1px solid transparent;
  border-radius: 4px;
  background: #fff;
}
.sitemap-card__header {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px;
}
.sitemap-card__home-icon { display: inline-flex; align-items: center; color: var(--editor-accent, #5B3DF5); }
.sitemap-card__title {
  flex: 1; min-width: 0;
  font-size: 13px; font-weight: 400;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sitemap-card__status {
  font-size: 12px;
  color: var(--panel-text-secondary, #3b3d4d);
  background: #ece6f5;
  padding: 2px 8px;
  border-radius: 4px;
  flex: none;
}
.sitemap-card__more {
  background: none; border: none; cursor: pointer;
  color: var(--panel-text-muted, #888);
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 4px;
}
.sitemap-card__more:hover { background: #f4f5f8; }
.sitemap-card__blocks {
  border: 1px solid #c5cad2;
  border-radius: 4px;
  padding: 8px;
  display: flex; flex-direction: column; gap: 6px;
  background: #fff;
}
.sitemap-block {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px;
  border: 1px solid #c5cad2;
  border-radius: 4px;
  background: #fff;
  font-size: 13px;
  color: var(--panel-text);
}
.sitemap-block--header,
.sitemap-block--footer {
  background: #effdf0;
  border-color: #b4e3bd;
  color: #197a3a;
}
.sitemap-block__icon { display: inline-flex; align-items: center; flex: none; }
.sitemap-block__label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sitemap-block__pin { flex: none; color: var(--panel-text-muted, #888); }

/* Live search dropdown for the Add panel header search box. */
.add-search-results {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  max-height: 60vh;
  overflow-y: auto;
  font-family: var(--font-sans);
}
.add-search-results__group-label {
  font-size: 11px;
  font-weight: 400;
  color: var(--panel-text-muted, #7a7d8c);
  background: #f0f1f5;
  padding: 6px 12px;
  letter-spacing: 0.3px;
}
.add-search-results__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 12px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
  color: #131720;
  text-align: left;
  font-family: inherit;
}
.add-search-results__item:hover { background: #f4f5f8; }
.add-search-results__icon {
  width: 20px; height: 20px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--panel-text-secondary, #3b3d4d);
  flex: none;
}
.add-search-results__icon svg,
.add-search-results__icon img { width: 20px; height: 20px; }
.add-search-results__label { flex: 1; min-width: 0; }
.add-search-results__empty {
  padding: 14px 12px;
  font-size: 13px;
  color: var(--panel-text-muted, #7a7d8c);
  text-align: center;
}

/* Right content column */
.add-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
  background: #fff;
}
.add-content__search {
  padding: 10px 12px 0;
  flex-shrink: 0;
}
.add-content__body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 12px;
  scrollbar-width: thin;
  scrollbar-color: #d0d3da transparent;
}
.add-content__body::-webkit-scrollbar { width: 6px; }
.add-content__body::-webkit-scrollbar-thumb { background: #d0d3da; border-radius: 3px; }
.add-content__body::-webkit-scrollbar-track { background: transparent; }

/* Element cards for Add panel */
.add-el-grid {
  display: grid;
  grid-template-columns: repeat(3, 88px);
  gap: 12px;
  justify-content: start;
}
.add-el-card {
  width: 88px;
  height: 101px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 6px 8px;
  border-radius: var(--radius-md);
  background: #ffffff;
  border: 1px solid #e0e0e0;
  color: var(--panel-text);
  cursor: grab;
  transition: border-color 0.15s;
  font-size: 11px;
  box-sizing: border-box;
}
.add-el-card:hover {
  border-color: #000000;
  background: #ffffff;
}
.add-el-card:active {
  cursor: grabbing;
  transform: scale(0.97);
}
.add-el-card__preview {
  width: 100%;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--panel-text-secondary);
}
.add-el-card__preview svg,
.add-el-card__preview img {
  max-width: 100%;
  height: 100%;
  object-fit: contain;
}
/* Wix Studio preset artwork in Quick Add tiles — letterboxed by the preview
   container so all 16 cards align cleanly regardless of the source SVG
   aspect ratio. */
.add-el-card__preview .quick-add-preset__img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  object-fit: contain;
}
.add-el-card__label {
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  text-align: center;
}

/* ===== Sections two-pane (inside Add content body) ===== */
.add-content__body:has(.sec-nav) {
  display: flex;
  flex-direction: row;
  padding: 0;
  overflow: hidden;
}

.sec-nav {
  width: 168px;
  flex-shrink: 0;
  border-right: 1px solid #e5e7eb;
  background: #fff;
  overflow-y: auto;
  padding: 0;
  scrollbar-width: thin;
  scrollbar-color: #d0d3da transparent;
}
.sec-nav__group-label {
  font-size: 13px;
  font-weight: 400;
  color: var(--panel-text-secondary, #3b3d4d);
  letter-spacing: 0.3px;
  padding: 14px 16px;
  background: #f0f1f5;
}
.sec-nav__item {
  display: block;
  width: 100%;
  padding: 8px 16px;
  margin: 0;
  font-size: 13px;
  font-weight: 400;
  color: #131720;
  background: none;
  border: none;
  border-radius: 0;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-sans);
  transition: color 0.12s, background 0.12s;
}
.sec-nav__item:hover { background: #f4f5f8; }
.sec-nav__item.is-active {
  color: var(--editor-accent, #5B3DF5);
  background: #F1EEFE;
  font-weight: 400;
}
.sec-nav__divider {
  display: none;
}

.sec-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.sec-content__body {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  scrollbar-width: thin;
}

/* Section template cards */
.sec-template-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-md);
  border: 1px solid var(--panel-border);
  overflow: hidden;
  cursor: grab;
  transition: border-color 0.15s, box-shadow 0.15s;
  margin-bottom: 10px;
  background: var(--panel-bg);
}
.sec-template-card:hover {
  border-color: var(--editor-accent);
  box-shadow: 0 2px 8px rgba(37,99,235,0.12);
}
.sec-template-card:active { cursor: grabbing; }
.sec-template-card {
  position: relative; /* anchor for __actions overlay */
}
.sec-template-card__preview {
  height: 180px;
  background: var(--panel-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--panel-text-muted);
  overflow: hidden;
}
/* Hover-only Update / Delete buttons in the top-right corner of each
 * user-asset card. Hidden by default (opacity 0 + pointer-events:none
 * so they don't catch clicks meant for the card itself). Fades in on
 * card hover. Used only on .sec-template-card--user (rendered by
 * mountUserAssets in 06-panels.js). */
.sec-template-card__actions {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 6px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.14s ease;
  z-index: 2;
}
.sec-template-card:hover .sec-template-card__actions {
  opacity: 1;
  pointer-events: auto;
}
.sec-template-card__btn {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--panel-text);
  box-shadow: 0 1px 3px rgba(10, 10, 15, 0.2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: color 0.12s, background 0.12s;
}
.sec-template-card__btn:hover { background: #fff; color: var(--editor-accent); }
.sec-template-card__btn--delete:hover { color: #c14444; }
.sec-template-card__btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  color: var(--panel-text-muted);
}
.sec-template-card__btn[disabled]:hover {
  background: rgba(255, 255, 255, 0.96);
  color: var(--panel-text-muted);
}
/* User-uploaded asset preview: stretch the image to fill the card the
 * same way Wix's section thumbnails do — no whitespace, no inset. */
.sec-template-card__preview--user {
  height: 180px;
  padding: 0;
}
.sec-template-card__preview--user img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.sec-template-card__info {
  padding: 8px 10px;
}
.sec-template-card__label {
  font-size: 12px;
  font-weight: 400;
  color: var(--panel-text);
  margin-bottom: 2px;
}
.sec-template-card__desc {
  font-size: 11px;
  color: var(--panel-text-muted);
  line-height: 1.4;
}

/* ===== Canvas ===== */
.editor-canvas {
  flex: 1;
  /* Subtle blue/violet wash behind the page so the canvas area feels
   * cohesive with the AI bar gradient below it. Kept very light so it
   * doesn't compete with the user's design. */
  background:
    radial-gradient(80% 60% at 0% 0%, rgba(178, 199, 255, 0.18) 0%, transparent 60%),
    radial-gradient(80% 60% at 100% 100%, rgba(220, 205, 255, 0.14) 0%, transparent 60%),
    var(--editor-bg);
  /* Column flex: urlbar sits on top of __stage. __stage owns the
   * old row-direction layout (handles + viewport) inside it. */
  display: flex;
  flex-direction: column;
  align-items: stretch;
  /* z-index makes .editor-canvas a stacking context. Without this, the
   * absurdly-high z-index of .canvas-section.is-selected (2147481000,
   * needed so its sibling-relative toolbar doesn't get clipped) leaks
   * into the DOCUMENT'S root stacking context and out-stacks every
   * mainbar dropdown/popover (which sit at --z-tooltip = 3000). With
   * the canvas now a contained context at --z-canvas = 1, the section
   * z-indexes only matter inside the canvas, and the mainbar popovers
   * paint above the whole canvas as expected. */
  z-index: var(--z-canvas);
  position: relative;
  /* Horizontal scroll when auto-fit hits 50% floor and viewport still
   * wider than available. Vertical scroll: usually the inner viewport
   * handles it, but when the outer canvas shrinks (e.g. AI Chat panel
   * opens and steals vertical space) the 720px viewport gets clipped at
   * the bottom — overflow-y:auto on the outer lets the user scroll down
   * to reach the rest of the viewport instead of being stuck. */
  overflow-x: auto;
  /* overflow-y: scroll (not auto) — the always-visible bar reserves 15 px
   * of width unconditionally, so canvas.clientWidth stays constant across
   * layout changes. With `auto`, the vertical bar toggled on/off whenever
   * canvas content H sat right at the visible-H threshold (very common
   * at zoom 79 % + AI panel open); each toggle shifted clientWidth by
   * 15 px → applyAutoFit re-computed scale → viewport re-sized →
   * scrollbar re-toggled → infinite loop (user 2026-07-04
   * "canvas-urlbar cứ nhảy 1001 ↔ 1016"). */
  overflow-y: scroll;
  /* Top padding gives the urlbar a bit of breathing room from the
   * mainbar; the rest comes from __stage below. */
  padding: 24px 0 0;
  min-width: 0;
}

/* Tablet / Mobile breakpoint range guide — pair of dashed vertical
 * lines centred in the canvas marking the breakpoint's max W (1000 px
 * for Tablet, 750 px for Mobile) + a rotated text label on the left.
 * Purely visual; pointer-events disabled so it never blocks clicks. JS
 * (updateBreakpointRangeGuides) sets the width per breakpoint and tears
 * the element down on Desktop. */
.editor-canvas__range-guide {
  position: absolute;
  top: 24px;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 1;
}
.editor-canvas__range-guide__line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 0;
  border-left: 1px dashed rgba(10, 10, 15, 0.28);
}
.editor-canvas__range-guide__line--left  { left: 0; }
.editor-canvas__range-guide__line--right { right: 0; }
.editor-canvas__range-guide__label {
  position: absolute;
  top: 60px;
  left: -32px;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-family: var(--font-sans, system-ui);
  font-size: 12px;
  color: var(--panel-text-secondary, #3b3d4d);
  white-space: nowrap;
  letter-spacing: 0.2px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
/* Counter-rotate the device icon so the glyph reads upright while the
 * label text stays in its vertical orientation. */
.editor-canvas__range-guide__icon {
  display: inline-flex;
  writing-mode: horizontal-tb;
  transform: rotate(180deg);
}

/* Stage = the row layout that holds [handle - viewport - handle]. Lives
 * inside .editor-canvas as the row below .canvas-urlbar. Inherits the
 * 32px padding the canvas used to carry. */
.editor-canvas__stage {
  flex: 1;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  justify-content: center;
  /* offsetParent for the absolutely-positioned W-preview handles so their
   * top:50% measures from the stage (viewport area) middle, not the outer
   * canvas (which includes the urlbar + padding-top — making handles sit
   * a chunk below visual centre). */
  position: relative;
  min-height: 0;
  /* No padding-top → viewport sits flush against the urlbar above. The
   * 32px on the sides + bottom preserves the breathing room the canvas
   * always had. */
  padding: 0 32px 32px;
}
/* Vertical viewport label — JS positions it just left of the canvas
 * viewport (the page). Text reads bottom-up. The SVG icon is rotated
 * back 180° so the device stays upright while the label reads from
 * the bottom. */
.editor-canvas__vp-label {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 400;
  color: var(--panel-text-secondary, #3b3d4d);
  font-family: var(--font-sans, system-ui);
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  pointer-events: none;
  z-index: 10;
  white-space: nowrap;
  letter-spacing: 0.2px;
}
/* Un-rotate the icon so the monitor/tablet/phone glyph stays upright. */
.editor-canvas__vp-label-icon {
  display: inline-flex;
  transform: rotate(180deg);
  writing-mode: horizontal-tb;
}
.editor-canvas__vp-label svg {
  flex-shrink: 0;
}

/* Site-wide canvas font default — Wix Madefor Text (user 2026-07-05
 * "web dùng luôn font Wix madefor text luôn"). Every unstyled text /
 * button / menu inside the canvas viewport inherits this face; explicit
 * font-family emits in buildTextStyle / buildButtonStyle / etc. still
 * win via inline `style="font-family:…"`. The @import at the top of
 * this file loads the Google Fonts stylesheet upfront so this rule
 * paints the face from the first frame. */
.editor-canvas__viewport {
  font-family: "Wix Madefor Text", system-ui, sans-serif;
  width: 1280px;
  /* Height comes from applyBreakpoint() as a min-height floor; the parent's
   * align-items:stretch lets the viewport grow above that floor when room
   * is available. Don't set height here or the floor wins permanently. */
  min-height: 720px;
  flex-shrink: 0;
  /* position:relative so the absolutely-positioned W-preview handles
   * (.editor-canvas__resize-handle) anchor to the viewport edges. */
  position: relative;
  /* The 0.3s width/min-height transition is great for breakpoint
   * switches (smooth viewport reshape) but disastrous during a live
   * W-preview drag — every per-frame width set kicks off a fresh 300 ms
   * animation, so the visible viewport always lags behind the cursor.
   * The .is-w-previewing class kills the transition mid-drag and
   * restores it on mouseup, where the snap-back to breakpoint W reads
   * cleanly. */
  transition: width 0.3s ease, min-height 0.3s ease;
  transform-origin: top center;
  box-shadow: 0 10px 22px -8px rgba(10,10,15,0.55), 0 3px 8px -3px rgba(10,10,15,0.32);
  /* Fixed W×H per breakpoint (applyBreakpoint) so the canvas has a defined
   * bottom edge — needed for "pin to bottom of screen" to dock against the
   * frame instead of the browser window.
   *
   * overflow-x: hidden — page width matches breakpoint exactly; the spurious
   * horizontal scrollbar that overflow:auto produced was caused by the
   * vertical scrollbar eating ~15px and making content overflow horizontally,
   * not by any element actually extending past the right edge.
   *
   * overflow-y: scroll — keep the H scrollbar visible at all times so
   * the user always sees the scrollable surface the published site has
   * (avoids the "scrollbar disappears when nothing is selected" surprise
   * and gives a consistent layout width). */
  overflow-x: hidden;
  overflow-y: scroll;
  /* Force an explicit 15px scrollbar gutter so the canvas usable area is
   * 1265 px (= 1280 breakpoint − 15 px scrollbar), matching the design
   * baseline stack children use for % conversions. Overlay / auto-hide
   * scrollbars (macOS default, some Chrome installs) would otherwise
   * give the canvas 1280 usable and shift stored % values off by 1.2%
   * (user 2026-07-06 "scroll bar 15px của tôi vứt đâu rồi?"). */
  scrollbar-gutter: stable;
}
.editor-canvas__viewport::-webkit-scrollbar {
  width: 15px;
}
.editor-canvas__viewport::-webkit-scrollbar-track {
  background: #f2f3f5;
}
.editor-canvas__viewport::-webkit-scrollbar-thumb {
  background: #c8ccd2;
  border-radius: 8px;
  border: 3px solid #f2f3f5;
}
.editor-canvas__viewport::-webkit-scrollbar-thumb:hover {
  background: #a8adb5;
}

/* Page-level selection ring. Drawn as a pseudo-element with the same
 * insanely-high z-index pattern as .canvas-section.is-selected::after
 * so it paints ABOVE the section content that fills the page (header /
 * footer / hero often span edge-to-edge and would otherwise hide an
 * inside outline). `position: relative` is already on
 * .editor-canvas__page, so the ::after anchors to it. */
.editor-canvas__page.is-page-selected {
  position: relative;
}
.editor-canvas__page.is-page-selected::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 2px solid var(--editor-accent);
  pointer-events: none;
  z-index: 2147481000;
}

/* Two thin grip bars rendered as FLEX SIBLINGS of the viewport inside
 * .editor-canvas — so they sit OUTSIDE the canvas page (just to the left
 * and right of its edges) and stay visible regardless of selection
 * state. Previously they were absolutely positioned inside the viewport
 * and a selected section's huge z-index painted over them. The flex
 * container's justify-content:center keeps the [handle–viewport–handle]
 * trio centered as a group; align-self:center vertically centers each
 * handle against the viewport. */
.editor-canvas__resize-handle {
  /* Anchored to .editor-canvas__stage (position:relative). Decoupled from
   * the viewport's flex layout + transform:scale, so the handle never
   * drifts off-screen or disappears regardless of zoom level or
   * W-preview state. Vertical position is set by JS (syncResizeHandlesY)
   * to match the painted viewport centre — CSS percentages would miss
   * the transform:scale + min-height-vs-stretch interplay at small
   * zooms. */
  position: absolute;
  top: 50%;
  width: 4px;
  height: 30px;
  border-radius: 2px;
  background: rgba(10, 10, 15, 0.55);
  cursor: ew-resize;
  pointer-events: auto;
  transform: translateY(-50%);
  transition: background 0.15s ease, transform 0.15s ease;
  z-index: 5;
  background-clip: padding-box;
}
.editor-canvas__resize-handle:hover,
.editor-canvas.is-w-previewing .editor-canvas__resize-handle {
  background: rgba(10, 10, 15, 0.78);
  transform: translateY(-50%) scaleX(1.3);
}
/* Left/right inline positions are set by JS (syncResizeHandlesPos) so
 * each handle rides the painted viewport edge — at rest it sits at the
 * canvas content edges; during a W-preview drag it follows the viewport
 * outward in lockstep with the cursor. */
/* During a width-preview drag, suppress section hover outlines so the
 * user sees the raw responsive layout without editing noise. */
.editor-canvas__viewport.is-w-previewing .canvas-section.is-hover::after,
.editor-canvas__viewport.is-w-previewing .canvas-section.is-hover::before {
  opacity: 0;
}
/* Floating dimensions tooltip shown while dragging the W-preview handle.
 * Lives at body level (position:fixed) and follows the cursor with a
 * small offset. Device icon (monitor / tablet / phone) + "W × H" pill,
 * dark background so it reads over any canvas content underneath. */
.editor-canvas__drag-tip {
  position: fixed;
  pointer-events: none;
  z-index: 2147483600;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: rgba(10, 10, 15, 0.88);
  color: #fff;
  font-family: var(--font-sans, system-ui);
  font-size: 12px;
  font-weight: 500;
  border-radius: 6px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  white-space: nowrap;
}
.editor-canvas__drag-tip svg { flex-shrink: 0; opacity: 0.9; }
/* Hide the inspector panel for the duration of the W-preview drag.
 * visibility:hidden keeps the layout slot occupied so the canvas
 * doesn't reflow on drag start / end — only the panel's heavy paint
 * cost (lots of nested form rows, color swatches, etc.) goes away.
 * Inspector toggle button hides too so the panel doesn't appear to
 * reappear under the cursor. */
/* Fully unmount the side chrome (sidebar + inspector + toggle) during the
 * W-drag so the canvas can EXPAND to fill the freed space and the user
 * sees the page at the actual previewed width without the panels
 * compressing it. `visibility: hidden` left them in the layout (a blank
 * gutter) which the user reported as "trạng thái đóng tạm thời" — half-
 * closed. `display: none` collapses the flex slots entirely. */
body.is-w-previewing .inspector-panel,
body.is-w-previewing .inspector-panel__toggle,
body.is-w-previewing .sidebar,
body.is-w-previewing .sidebar-panel {
  display: none !important;
}
/* While the user is dragging the canvas-W handle, hide every editor
 * chrome overlay so the canvas reads exactly as the published page
 * would at that width. Only the W-preview handles + the dimensions
 * tooltip survive (those ARE the interaction). */
body.is-w-previewing .canvas-section__toolbar,        body.is-anim-previewing .canvas-section__toolbar,
body.is-w-previewing .canvas-section__bc,             body.is-anim-previewing .canvas-section__bc,
body.is-w-previewing .canvas-section__bc-anim,        body.is-anim-previewing .canvas-section__bc-anim,
body.is-w-previewing .canvas-section__label,          body.is-anim-previewing .canvas-section__label,
body.is-w-previewing .canvas-section-dock-line,       body.is-anim-previewing .canvas-section-dock-line,
body.is-w-previewing .canvas-section-plus,            body.is-anim-previewing .canvas-section-plus,
body.is-w-previewing .canvas-section__bc-seg,         body.is-anim-previewing .canvas-section__bc-seg,
body.is-w-previewing .canvas-section__pad-hover-hl,   body.is-anim-previewing .canvas-section__pad-hover-hl,
body.is-w-previewing .canvas-section__pad-hl,         body.is-anim-previewing .canvas-section__pad-hl,
body.is-w-previewing .canvas-section__margin-hover-hl,body.is-anim-previewing .canvas-section__margin-hover-hl,
body.is-w-previewing .cs-stack-gap-hl,                body.is-anim-previewing .cs-stack-gap-hl,
body.is-w-previewing .cs-resize-handle,               body.is-anim-previewing .cs-resize-handle,
body.is-w-previewing .cs-rotate-zone,                 body.is-anim-previewing .cs-rotate-zone,
body.is-w-previewing .editor-canvas__range-guide,     body.is-anim-previewing .editor-canvas__range-guide,
body.is-w-previewing .canvas-add-divider,             body.is-anim-previewing .canvas-add-divider {
  opacity: 0 !important;
  pointer-events: none !important;
}
/* Selection / hover ring on every canvas-section (incl. page-level
 * outline added via ::after). Suppress during the W-drag and anim preview. */
body.is-w-previewing .canvas-section.is-selected::after,            body.is-anim-previewing .canvas-section.is-selected::after,
body.is-w-previewing .canvas-section.is-hover::after,               body.is-anim-previewing .canvas-section.is-hover::after,
body.is-w-previewing .canvas-section.is-layer-hover::after,         body.is-anim-previewing .canvas-section.is-layer-hover::after,
body.is-w-previewing .editor-canvas__page.is-page-selected::after,  body.is-anim-previewing .editor-canvas__page.is-page-selected::after {
  border-color: transparent !important;
}
/* Hide the GFPP toolbar + breadcrumb while the user is dragging an
 * element so they don't trail behind the cursor / overlap the move
 * guides. onUp removes the class and re-runs positionCanvasToolbar to
 * re-show + re-anchor them. Covers BOTH the in-section markup and the
 * detached-to-body copies. */
body.is-element-dragging .canvas-section__toolbar,
body.is-element-dragging .canvas-section__bc,
body.is-element-dragging .canvas-section__bc-anim {
  opacity: 0 !important;
  pointer-events: none !important;
}
/* canvas-area has overflow:hidden by default so editor chrome
 * (breadcrumb, ai-bar) doesn't bleed out — but during a W-preview drag
 * we want the viewport to paint over the now-hidden sidebars/inspector,
 * not get clipped at the canvas-area edges. Same for .editor-canvas
 * (overflow-x:auto by default — would chop the viewport at its right
 * edge once the user drags past). */
body.is-w-previewing .canvas-area,
body.is-w-previewing .editor-canvas { overflow: visible; }
/* Lift the canvas above its hidden flex siblings during preview so
 * stacking-context quirks (sidebar-panel z-index 20+, inspector default
 * z-stack) can't paint a ghost over the over-spilling viewport. */
body.is-w-previewing .canvas-area { z-index: 50; position: relative; }
/* The "centered" cross marker is a snapshot positioned with literal
 * left:Xpx;top:Ypx in the section's coordinate space — it doesn't move
 * when the W-preview drag re-centres elements via the renderer's
 * auto-margin. Hide it for the duration of the drag instead of trying
 * to recompute every frame. (updateCenteredFlag rebuilds the cross on
 * the next selection change or drag, so it picks up the correct centre
 * after the user releases.) */
body.is-w-previewing .canvas-section-plus {
  display: none;
}
/* Kill the width / min-height transition mid-drag — see comment on
 * .editor-canvas__viewport above. The viewport's W is set per frame
 * during a W-preview drag; the default 300 ms ease would chase every
 * intermediate value instead of locking to the current cursor. */
.editor-canvas__viewport.is-w-previewing {
  transition: none;
}
.editor-canvas__page {
  background: #ffffff;
  /* Flex column so we can use `order` to render the pin-bottom header last
   * visually, and `margin-top:auto` to push it to the flex-end when content
   * is shorter than the viewport. min-height:100% keeps the page filling the
   * viewport frame even with sparse content. */
  display: flex;
  flex-direction: column;
  min-height: 100%;
  box-shadow: 0 1px 12px rgba(0,0,0,0.1), 0 0 0 1px rgba(0,0,0,0.04);
  border-radius: 4px;
  background: #ffffff;
}

.editor-canvas__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  color: #999;
  gap: 12px;
}
.editor-canvas__empty svg { opacity: 0.4; }
.editor-canvas__empty p { font-size: 14px; margin: 0; }
/* Dedicated CTA class — kept separate from .canvas-add-divider__btn so
 * the pill's position:absolute + opacity:0 rules don't leak in. */
.editor-canvas__empty-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  background: transparent;
  border: none;
  padding: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
  transition: color 0.12s;
}
.editor-canvas__empty-cta:hover { color: #2d5dff; }
.editor-canvas__empty-cta:hover svg { opacity: 1; }
.editor-canvas__empty-cta p { font-size: 14px; margin: 0; }

/* --- Canvas Section --- */
.canvas-section {
  position: relative;
  cursor: pointer;
}
/* (Selected element no longer needs a z-index lift. Toolbar +
 * breadcrumb were the original reason — they used to overflow above the
 * section box and got hidden behind the next sibling's content. Now
 * positionCanvasToolbar detaches them to <body>, where they paint at
 * the very top regardless of canvas z-ordering. Forcing the selected
 * section above siblings (even at z-index 30) made it cover unrelated
 * elements that were designed to layer on top — so leave it at auto.) */
/* Selection / hover border drawn as a pseudo-element overlay so it sits on
   top of inner content (header/footer/section inner divs would otherwise
   paint over a plain outline). Inset 0 + border 2px keeps the 2px thickness
   inside the section box. */
.canvas-section::after {
  content: "";
  position: absolute;
  inset: 0;
  /* Base = 1 px transparent so hover only needs to change color. Selected
   * overrides to 2 px accent (see `.canvas-section.is-selected::after`).
   * Previous 2 px base caused a flash on mouse-leave: border-width
   * snapped 1 → 2 px INSTANTLY while border-color faded 0.15 s, so a
   * brief "thick faded" ring appeared (user 2026-07-02 "trong một tích
   * tắc nó bị hiện outline cũ dày"). */
  border: 1px solid transparent;
  pointer-events: none;
  z-index: 10;
  transition: border-color 0.15s;
}
/* Root sections default to white so the page background (which the user
   can darken) doesn't bleed through if a child element doesn't paint
   over the whole section. */
.canvas-section[data-section-type="header"],
.canvas-section[data-section-type="footer"],
.canvas-section[data-section-type="section"] {
  /* Transparent — the inner `.cs-header` / `.cs-footer` / `.cs-section`
   * paints its own background. Force with !important since some legacy
   * builds still ship a specific rule that painted the outer wrapper
   * white (user 2026-07-06 vẫn không hoạt động sau lần fix đầu). */
  background-color: transparent !important;
  background-image: none !important;
}
/* Hover only when not selected AND when no descendant is currently
 * selected — hovering an ancestor while editing a child should NOT paint
 * the ancestor's tint over the child (user 2026-07-02: "bg khi hover sẽ
 * không kích hoạt khi hover phần tử cấp cao hơn trong khi phần tử cấp
 * thấp hơn đang được select"). `:not(:has(.is-selected))` filters out any
 * canvas-section that contains the current selection. */
/* `:not(:has(.canvas-section:hover))` blocks the hover style from firing on
 * the ancestor when the cursor is actually on a descendant — CSS :hover
 * bubbles up the tree, so without this rule hovering a Text lit up the
 * Text AND its Stack AND its Section simultaneously (user 2026-07-02
 * "chuột nằm ở element con nhưng nó cũng tự nhận là đang hover element cha").
 * The `:not(:has(.is-selected))` guard was removed 2026-07-02: if the cursor
 * is REALLY on the section's own chrome (not on a descendant), the user
 * clearly is hovering the section — even if its descendant is what's
 * currently selected. `:not(:has(.canvas-section:hover))` already handles
 * the "hover bubbled up from a child" case, so the extra selected-desc
 * guard was silently suppressing legitimate hover intent. */
.canvas-section[data-section-type="header"].is-layer-hover:not(.is-selected)::after,
.canvas-section[data-section-type="footer"].is-layer-hover:not(.is-selected)::after,
.canvas-section[data-section-type="section"].is-layer-hover:not(.is-selected)::after {
  border-color: rgba(37, 99, 235, 0.9);
}
/* Split background from border: bg tint only fires when the hovered element
 * doesn't contain the current selection — otherwise hovering the Section
 * that holds your active edit paints a blue wash over your work, which
 * feels like the selection is being competed over (user 2026-07-02
 * "select element, hover vào cha của element đó thì không highlight bg
 * cha nó"). Border still shows so the hover intent is visible. */
.canvas-section[data-section-type="header"].is-layer-hover:not(.is-selected):not(:has(.is-selected))::after,
.canvas-section[data-section-type="footer"].is-layer-hover:not(.is-selected):not(:has(.is-selected))::after,
.canvas-section[data-section-type="section"].is-layer-hover:not(.is-selected):not(:has(.is-selected))::after {
  background: rgba(45, 93, 255, 0.08);
}
/* Mirror hover effect on children/grandchildren when the Layers panel is
 * pointing at them. `.is-layer-hover` is added by the layers panel
 * mouseenter handler and removed on mouseleave — same blue outline the
 * user gets from hovering the element directly on canvas. */
.canvas-section.is-layer-hover:not(.is-selected)::after {
  border-color: rgba(37, 99, 235, 0.9);
  background: rgba(45, 93, 255, 0.08);
}
/* A section is hoverable iff one of its ancestors has .is-section-active.
   That ancestor must be the IMMEDIATE container (no other .canvas-section
   between them). We approximate that by:
   1. Enabling hover on any descendant of an active container.
   2. Cancelling when there's an intermediate .canvas-section that is NOT
      itself active — that means the user hasn't drilled into it yet. */
/* Nearest-active-descendant hover: hover only fires on the OUTERMOST
 * canvas-section descendant of the active container. Cursor over a
 * grandchild (Text inside Stack inside active Section) rolls the target
 * up to the direct child (Stack) — user hasn't drilled into the Stack
 * yet, so the child is not a hover target of its own (user 2026-07-04
 * "chưa select Stack thì hover vào Stack hay child chỉ được kích hoạt
 * event hover Stack").
 *
 * Wired by initCanvasEvents' updateHoverTarget: it walks up from the
 * cursor to the nearest .is-section-active ancestor, tags the outermost
 * .canvas-section on the way with .is-hover-target, and clears the
 * previous target. Purely a class swap — no CSS `>` gymnastics needed
 * for the variable-depth DOM chain (Section → cs-section →
 * cs-section__inner → Stack). */
.canvas-section.is-hover-target:not(.is-selected)::after,
.canvas-section.is-layer-hover-parent:not(.is-selected)::after {
  border-color: rgba(37, 99, 235, 0.9);
}
.canvas-section.is-hover-target:not(.is-selected):not(:has(.is-selected))::after,
.canvas-section.is-layer-hover-parent:not(.is-selected):not(:has(.is-selected))::after {
  background: rgba(45, 93, 255, 0.08);
}
/* Legacy grandchild-cancel rule (was needed when hover applied to any
 * descendant); removed 2026-07-04 because the direct-child selector
 * above already excludes grandchildren by construction. Keeping it fought
 * the Stack-hover child-outline rule below via higher specificity, so
 * grandchildren lost their preview ring under the cursor. */
.canvas-section.is-selected::after {
  border-width: 2px;
  border-color: var(--editor-accent);
}
/* Passive outline — 1-level neighbours of the selected element. JS toggles
 * either `.is-passive-outline-parent` or `.is-passive-outline-child`
 * depending on the direction:
 *   • Direct PARENT of the selected element  → 2 px faint ring (thicker,
 *     signals "your edit lives inside this container").
 *   • Direct CHILDREN of the selected element → 1 px faint ring (thinner,
 *     signals "these move / resize with your edit").
 * Rendered on `::after` (z-index 10 above opaque child bg like Button).
 * Stops at 1 hop — Text inside Stack inside Section only lights the Stack,
 * not the Section (user 2026-07-02). */
.canvas-section.is-passive-outline-parent:not(.is-selected)::after {
  border-width: 2px;
  border-color: rgba(45, 93, 255, 0.35);
}
.canvas-section.is-passive-outline-child:not(.is-selected)::after {
  border-color: rgba(45, 93, 255, 0.35);
}
/* Hover mirror of the passive child outline: hovering a Stack (inside an
 * active Section) previews what its direct children look like when the
 * Stack is selected — same 1 px 0.35 blue ring around each direct
 * child. Matches the passive-child treatment used when the Stack itself
 * is selected (user 2026-07-04 "hiệu ứng hover của stack cũng phải hiện
 * outline child của nó"). Scoped via `:has()` so the outline appears
 * only while the parent Stack is being hovered. */
.canvas-section[data-section-type="stack"].is-hover-target:not(.is-selected)
  > .canvas-section__content > .cs-stack > .canvas-section:not(.is-selected)::after,
.canvas-section[data-section-type="stack"].is-layer-hover-parent:not(.is-selected)
  > .canvas-section__content > .cs-stack > .canvas-section:not(.is-selected)::after {
  border-color: rgba(45, 93, 255, 0.35);
}

/* Padding highlight band — drawn on the selected canvas-section as a
 * peach-orange overlay sitting between the section border and the content.
 * The four strips (top/right/bottom/left) get their thickness from CSS vars
 * (--pad-top/right/bottom/left) that JS (applyPaddingHighlight) writes
 * from the inner element's computed padding. pointer-events: none lets
 * clicks fall through to children. */
.canvas-section.has-padding-hl,
.editor-canvas__page.has-padding-hl {
  position: relative;
}
/* Band overlay covers the section's full bounding box. Translucent mint
 * tint so any element stacked above (sticky header overlap=next, etc.)
 * stays visible through it. Sits above content but pointer-events: none
 * lets clicks fall through; each strip re-enables pointer-events for hover. */
/* Grid track hover — mint overlay on every cell whose grid span includes
 * the currently-hovered Column/Row row in the Inspector. Cells are
 * tagged via JS with .is-grid-hover-hi. ::after layer because the cell
 * already uses ::before for other states. */
/* Inspector hover → per-track overlay inside .cs-section-grid. Each
 * overlay is itself a grid item placed on (cell-col-span × hovered-row)
 * or (hovered-col × cell-row-span), so spans show only the slice that
 * intersects the hovered track. */
.cs-grid-track-hi {
  background: rgba(91, 61, 245, 0.14);
  pointer-events: none;
  z-index: 1;
}
/* Gap-band overlay painted by highlightGapHover (inspector hover on the
 * Gaps X/Y inputs). Sits in the gutter between grid tracks — translucent
 * brand-purple so it reads as a layout indicator rather than blocking
 * canvas content. */
.cs-grid-gap-hi {
  background: rgba(91, 61, 245, 0.14);
  pointer-events: none;
  z-index: 1;
}
/* Padding hover band — translucent purple overlay appended INSIDE the
 * target canvas-section by highlightPaddingHover. Stays in the same
 * stacking context as the Add Section pill (the editor viewport's
 * stacking context, created by applyAutoFit's transform:scale), so the
 * pill always reads above this overlay. Z-order inside the viewport:
 *   persistent mint (z:0) < this overlay (z:2147483645) < Add Section (z:2147483646)
 */
.canvas-section__pad-hover-hl {
  position: absolute !important;
  inset: 0 !important;
  pointer-events: none;
  z-index: 2147483645;
}
.canvas-section__pad-hover-hl > span {
  position: absolute;
  background: rgba(91, 61, 245, 0.35);
  pointer-events: none;
}
.canvas-section__pad-hover-hl > span.pad-t { top: 0; left: 0; right: 0; height: var(--pad-top, 0); }
.canvas-section__pad-hover-hl > span.pad-b { bottom: 0; left: 0; right: 0; height: var(--pad-bottom, 0); }
/* L/R sweep the FULL height (top:0 → bottom:0) so the hover overlay
 * paints over the persistent mint pad-t/pad-b corners. Otherwise the
 * mint corner peeks through when the user hovers only L or R. */
.canvas-section__pad-hover-hl > span.pad-l { left: 0; top: 0; bottom: 0; width: var(--pad-left, 0); }
.canvas-section__pad-hover-hl > span.pad-r { right: 0; top: 0; bottom: 0; width: var(--pad-right, 0); }
/* Numeric px label centered inside each padding band. Small pill so it
 * reads over the translucent purple slab regardless of underlying
 * content colour. `min-width` lets a single-digit value ("2") still
 * paint at a legible size, `white-space:nowrap` keeps two-digit values
 * on one line inside narrow L/R bands. */
.canvas-section__pad-hover-hl > span > .pad-val {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(91, 61, 245, 0.95);
  color: #fff;
  font: 500 11px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-style: normal;
  padding: 3px 6px;
  border-radius: 3px;
  min-width: 12px;
  text-align: center;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
/* Offset the px number away from the small drag bar (which sits dead-centre)
 * so it doesn't overlap it (user 2026-07-10 "con số px không nên đè lên thanh
 * ngang nhỏ, nên cách một khoảng trên/dưới"). Top/bottom bands: nudge the
 * label OUTWARD toward the section edge (up for pad-t, down for pad-b). Left/
 * right bands: nudge sideways toward the edge. The bar stays centred. */
.canvas-section__pad-hover-hl > span.pad-t > .pad-val {
  top: auto;
  bottom: calc(50% + 10px);
  transform: translate(-50%, 0);
}
.canvas-section__pad-hover-hl > span.pad-b > .pad-val {
  top: calc(50% + 10px);
  transform: translate(-50%, 0);
}
.canvas-section__pad-hover-hl > span.pad-l > .pad-val {
  left: auto;
  right: calc(50% + 8px);
  transform: translate(0, -50%);
}
.canvas-section__pad-hover-hl > span.pad-r > .pad-val {
  left: calc(50% + 8px);
  transform: translate(0, -50%);
}
/* Hide the label when the band is too narrow to fit it (< ~24px). Uses
 * container queries so each span independently decides. Falls back to
 * always-show when container queries aren't supported. */
.canvas-section__pad-hover-hl > span { container-type: size; }
/* The px label now sits OUTSIDE the band (offset ~10px above/below/beside the
 * centred drag bar — see below), so a THIN band no longer needs to hide it;
 * the old ≤20px hide made small paddings (e.g. 14px) show no number (user
 * 2026-07-10 "padding nhỏ quá không hiện label"). Only hide when the band is
 * essentially zero (padding ≈ 0) — nothing to label there. */
@container (max-width: 3px) { .pad-val { display: none; } }
@container (max-height: 3px) { .pad-val { display: none; } }
/* Margin hover band — translucent brand-purple slab between the selected
 * element and its nearest section/page parent. Painted with position:fixed
 * on <body> so transforms / overflow on intermediate wrappers can't clip
 * it. z-index must beat .canvas-section.is-selected (2147481000) so the
 * band shows above the selected element's stacking context. Pointer-events
 * off so it never blocks canvas interaction. */
.canvas-section__margin-hover-hl {
  background: rgba(91, 61, 245, 0.14);
  pointer-events: none;
  z-index: 2147481200;
}

.canvas-section__pad-hl {
  position: absolute;
  inset: 0;
  pointer-events: none;
  /* Sit BELOW any selected canvas-section's stacking context (z:30) and
   * way below the breadcrumb chip (z: max). Negative z keeps it under
   * everything except the section's own background. */
  z-index: 0;
}
/* Stack item-spacing highlight — a faint translucent band over each gap
 * between a selected Stack's items. The band itself is NOT interactive;
 * only the centre dash (__bar) resizes the gap on hover/drag. */
.cs-stack-gap-hl {
  position: absolute;
  z-index: 9;
  background: rgba(45, 93, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: background 0.12s;
}
/* When the user is grabbing the gap divider (hover or active drag),
 * the whole band highlights so the gap zone is unmistakable. */
.cs-stack-gap-hl.is-hot { background: rgba(45, 93, 255, 0.22); }
/* Centre dash — the only grabbable part. A short thin bar (no rounded
 * corners) perpendicular to the drag axis. */
.cs-stack-gap-hl__bar {
  pointer-events: auto;
  flex: none;
  background: rgba(45, 93, 255, 0.85);
  transition: background 0.1s;
}
.cs-stack-gap-hl--vertical   .cs-stack-gap-hl__bar { width: 12px; height: 2px; cursor: ns-resize; }
.cs-stack-gap-hl--horizontal .cs-stack-gap-hl__bar { width: 2px; height: 12px; cursor: ew-resize; }
.cs-stack-gap-hl__bar:hover { background: rgba(45, 93, 255, 1); }
/* Hovering the bar highlights the whole containing band via :has() so we
 * don't need a JS listener to toggle the class for hover-only state. */
.cs-stack-gap-hl:has(.cs-stack-gap-hl__bar:hover) {
  background: rgba(45, 93, 255, 0.22);
}
/* The resize-grabber bar is only meaningful when the Stack itself is the
 * selected element. When focus has drilled into a child, the band still
 * renders as a layout indicator, but the drag handle is hidden — you
 * can't resize the parent Stack's gap while editing a child of it.
 *
 * Direct-child combinator (`>`) is critical: bands are appended directly
 * to the Stack's canvas-section wrapper, so this only targets THIS
 * Stack's own bands. A descendant combinator would also reach into
 * nested Stacks' bands (which sit deeper inside outer.canvas-section)
 * and hide their drag handles too — exactly the bug that made inner
 * Stack bars invisible when an outer Stack ancestor was parent-of-
 * selection. */
.canvas-section[data-section-type="stack"].is-stack-context:not(.is-selected) > .cs-stack-gap-hl > .cs-stack-gap-hl__bar,
.canvas-section[data-section-type="stack"].is-stack-context:not(.is-selected) > .cs-stack-gap-hl > .cs-stack-gap-hl__num {
  display: none;
}
.cs-stack-gap-hl__num {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translateY(-50%);
  margin-left: 16px;
  font-size: 11px;
  line-height: 1;
  color: #fff;
  background: rgba(45, 93, 255, 0.95);
  border-radius: 3px;
  padding: 2px 5px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.1s;
  pointer-events: none;
}
.cs-stack-gap-hl__bar:hover ~ .cs-stack-gap-hl__num { opacity: 1; }
/* When a Stack is in "selection context" — either the Stack itself is
 * selected or any of its descendants is — faintly outline its first-level
 * child elements so the layout structure stays visible while the user
 * edits anything inside the Stack. `.is-stack-context` is JS-toggled
 * (selectSection) so this works without `:has()` support. The `>` chain
 * keeps the rule to this Stack's own direct items — a nested Stack's
 * children won't match. outline doesn't affect layout. */
/* Stack children now share the generic `.is-passive-outline::after` path
 * (JS toggles the class on each direct child when the stack is selected).
 * No stack-specific ::before pseudo needed. */
/* Stack's own outline when a child is the selected element. When the
 * Stack itself is selected the standard `.is-selected::after` solid blue
 * border shows instead — so this rule excludes that case to avoid a
 * double-outline. Same faint blue as the children outline so the layout
 * map reads as one consistent thing. */
.canvas-section[data-section-type="stack"].is-stack-context:not(.is-selected) {
  outline: 1px solid rgba(45, 93, 255, 0.35);
  outline-offset: -1px;
  transition: outline-color 0.15s;
}
/* Brighten the layout-map outline on the element under the cursor so
 * hover feedback isn't swallowed by the constant 0.35 outline. Without
 * this, the standard hover `::after` (a 0.4 blue border 2px inside the
 * box) is barely distinguishable from the static 0.35 outline 1px outside
 * — the user reads it as "I can't hover this element". */
/* Stack children hover: rely on the generic hover-on-section-active rule
 * above (::after 1 px 0.9 blue + bg tint). No ::before override needed. */
.canvas-section[data-section-type="stack"].is-stack-context:not(.is-selected):hover {
  outline-color: rgba(37, 99, 235, 0.9);
}

/* Breadcrumb chip — sits just below the GFPP toolbar on the selected
 * canvas-section. Collapsed by default to a single blue pill showing the
 * element's type with a back-arrow prefix; on hover the chip expands to
 * the full ancestor chain (Section › Stack › Text) and each segment
 * becomes a clickable button. Wired via [data-bc-id] in the capture-phase
 * canvas click handler. */
.canvas-section__bc {
  position: fixed;
  top: 0;
  left: 0;
  display: inline-flex;
  align-items: center;
  background: #5B3DF5;
  color: #fff;
  border-radius: 4px;
  /* Above every selected canvas-section (2147481000) but BELOW floating
   * popovers / draggable side panels (.ml-panel, .cs-cart-panel at
   * 2147483600). The old `2147483647 !important` outranked those panels
   * too, so the Menu Layout panel ended up hidden by the breadcrumb of
   * the element it edits — user 2026-07-05 "bc-seg is-current đang nằm
   * trên cửa sổ Menu Layout". */
  z-index: 2147481050;
  isolation: isolate;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
  font-family: var(--font-sans);
  line-height: 1.4;
  overflow: hidden;
}
.canvas-section.is-selected > .canvas-section__bc {
  opacity: 1;
  pointer-events: auto;
}
.canvas-section__bc-seg {
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.75);
  font-size: 11px;
  font-weight: 400;
  padding: 6px 10px;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: color 0.12s;
}
.canvas-section__bc-seg:hover,
.canvas-section__bc-seg.is-current { color: #fff; }
.canvas-section__bc-sep {
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  font-weight: 400;
  user-select: none;
  padding: 0 1px;
}
/* Collapsed state — only show the current segment, with a back-arrow
 * prefix that hints "hover to see the parent chain". */
.canvas-section__bc:not(:hover) .canvas-section__bc-seg:not(.is-current),
.canvas-section__bc:not(:hover) .canvas-section__bc-sep {
  display: none;
}
.canvas-section__bc:not(:hover) .canvas-section__bc-seg.is-current::before {
  content: "\2039\00a0";
  font-weight: 400;
  margin-right: 1px;
}
/* Animation indicator (lightning bolt) — separate pink pill that sits
 * next to the breadcrumb when the element has any anim_<trigger> set.
 * Same fixed-positioning model as .canvas-section__bc; positionCanvasToolbar
 * pins it just after the breadcrumb's right edge. Clicking it opens the
 * Animations & Effects inspector tab for the element. */
.canvas-section__bc-anim {
  position: fixed;
  top: 0;
  left: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: #ec4899;
  color: #fff;
  cursor: pointer;
  line-height: 1;
  z-index: 2147483647 !important;
  isolation: isolate;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s, background 0.12s, left 0.15s;
  font-family: inherit;
}
.canvas-section.is-selected > .canvas-section__bc-anim {
  opacity: 1;
  pointer-events: auto;
}
.canvas-section__bc-anim:hover { background: #db2777; }
.canvas-section__bc-anim svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  display: block;
}
/* The selected element's label is redundant — the breadcrumb chip
 * names it. Hide just that one. Hover labels on OTHER elements stay
 * visible so the user can scan around the canvas (esp. when they've
 * selected a parent and want to identify a child by hovering it). */
body:has(.canvas-section.is-selected) .canvas-section.is-selected > .canvas-section__label {
  opacity: 0;
}

/* Corner "+" — Wordpress-style add-child button. Sits at the bottom-right
 * of every container-type element (rendered by renderCanvasSection when
 * sec.type is in CANVAS_CONTAINER_TYPES). Hidden by default, fades in
 * when the parent canvas-section is hovered or selected. Clicking it
 * selects the container + opens the Add panel — the existing add-element
 * routing at 06-panels.js:1360 reads state.selectedSection and drops the
 * new block into its children array. */
.canvas-section__corner-add {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #000;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  z-index: 2147481001;
  transition: opacity 0.12s, background 0.12s;
  font-family: inherit;
}
/* + Add-element-inside button only shows on the SELECTED container.
 * Previously it also lit up on hover / layer-hover / section-active,
 * which made the plus icon spam-appear on every ancestor as the user
 * navigated the layers panel or moved the cursor (user 2026-07-02). */
.canvas-section.is-selected > .canvas-section__corner-add {
  opacity: 1;
  pointer-events: auto;
}
.canvas-section__corner-add:hover { background: #1e293b; }
.canvas-section__corner-add svg { display: block; }
/* W-preview / animation-preview hides editor chrome — drop the corner-add too. */
body.is-w-previewing .canvas-section__corner-add,
body.is-anim-previewing .canvas-section__corner-add {
  display: none;
}
/* "+" gutter buttons for adding a new column/row between two existing
 * tracks. Only rendered for gutters where no cell spans across.
 *
 * Wix-style: a thin blue divider bar runs the full length of the gutter
 * with a circular "+" centred on it. The button is a grid item placed
 * on the track to the LEFT (col) or ABOVE (row) the gutter; the bar +
 * "+" are absolutely positioned on the gutter line itself. Hidden by
 * default; appears when the parent Section Grid is active AND hovered. */
/* Outer button is a transparent grid item placed on the track to the
 * LEFT (col) or ABOVE (row) the gutter. It carries pointer-events:none
 * so its giant bounding box doesn't swallow mouse events meant for the
 * cell underneath. Only the thin divider bar and the round "+" disc
 * re-enable pointer-events to receive hover + click. */
.cs-grid-add-track {
  position: relative;
  align-self: stretch;
  justify-self: stretch;
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 0;
  z-index: 11;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s;
}
/* Show only when the user hovers the button itself (or its hit-zone
 * pseudo) — not the whole grid. Outer button has pointer-events:none
 * so only the ::after hit-zone + SVG receive hover, which propagates
 * up to the button's :hover state. */
/* Track-divider bars surface only while the user is editing the grid
 * (selection is Section or Cell). Drilling deeper hides them — the user
 * is editing an element inside a cell, not resizing tracks. */
.canvas-section.is-grid-edit-active .cs-grid-add-track:hover {
  opacity: 1;
}

/* Wide invisible hit-zone straddling the gutter — picks up the user's
 * intent when they hover NEAR the divider (a few px of slop on each
 * side) without making the entire track row interactive.
 *
 * Pointer-events is disabled by default and re-enabled only when the
 * parent Section is in grid-edit mode. Without this, hovering over the
 * invisible strip changed the cursor to col-resize / row-resize even
 * though the JS mousedown handler refused to start a drag — visually
 * confusing ("looks draggable, but isn't"). */
.cs-grid-add-track::after {
  content: "";
  position: absolute;
  pointer-events: none;
}
.canvas-section.is-grid-edit-active .cs-grid-add-track::after {
  pointer-events: auto;
}
/* SVG "+" disc — same gate so it doesn't grab clicks/cursor outside grid edit.
 * CRITICAL: the button spans the WHOLE track (grid-column: ci/ci+1), so a
 * centred SVG would sit in the MIDDLE of the cell and steal its hover/click,
 * making the cell un-selectable and showing "Add column" everywhere the user
 * hovered (user 2026-07-07 "hover cell 1 bị hiện add column, không select
 * được"). Pin the "+" to the track BOUNDARY (the gutter edge) so only that
 * narrow strip is interactive; the rest of the button stays inert. */
.cs-grid-add-track > svg {
  pointer-events: none;
  position: absolute;
}
.cs-grid-add-track--col > svg {
  top: 50%;
  right: 0;
  transform: translate(50%, -50%);
}
.cs-grid-add-track--row > svg {
  left: 50%;
  bottom: 0;
  transform: translate(-50%, 50%);
}
.canvas-section.is-grid-edit-active .cs-grid-add-track > svg { pointer-events: auto; }
/* Hit-zone straddles ONLY the gutter, centred on the track boundary. The
 * button element spans the whole column (grid-column: ci/ci+1) so its box
 * covers the entire cell — but pointer-events on the button is none, and this
 * ::after is the only interactive part. It must stay INSIDE the gap, never
 * bleed into the cell, or it swallows the cell's hover/click. With a large
 * gap (e.g. 60px) the old `gap/2 + 8` offset + 16px width pushed the zone
 * ~38px past the button edge, deep into the neighbouring cell — cell 1 became
 * un-hoverable and showed "Add column" everywhere (user 2026-07-07). Clamp the
 * zone to at most the gap width, centred on the boundary. */
.cs-grid-add-track--col::after {
  top: 0; bottom: 0;
  right: calc(min(var(--gap-x, 10px), 20px) / -2 - 3px);
  width: calc(min(var(--gap-x, 10px), 20px) + 6px);
  cursor: col-resize;
}
.cs-grid-add-track--row::after {
  left: 0; right: 0;
  bottom: calc(min(var(--gap-y, 10px), 20px) / -2 - 3px);
  height: calc(min(var(--gap-y, 10px), 20px) + 6px);
  cursor: row-resize;
}
/* "+" disc returns to a pointer — its job is to add a track, not resize. */
.cs-grid-add-track > svg { cursor: pointer; }

/* The divider bar itself — visual only, no pointer events (::after above
 * handles hover detection). Sits centred in the gap. */
.cs-grid-add-track::before {
  content: "";
  position: absolute;
  background: #5B3DF5;
  pointer-events: none;
}
.cs-grid-add-track--col::before {
  top: 0; bottom: 0;
  right: calc((var(--gap-x, 10px) / 2 + 1px) * -1);
  width: 2px;
}
.cs-grid-add-track--row::before {
  left: 0; right: 0;
  bottom: calc((var(--gap-y, 10px) / 2 + 1px) * -1);
  height: 2px;
}

/* The "+" disc sits centred on the bar — white plus on a blue circle.
 * On hover the disc scales up so the user has confirmation that the
 * cursor is on the actual click target (not just the wider hit-zone). */
.cs-grid-add-track > svg {
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #5B3DF5;
  border: 1px solid #5B3DF5;
  color: #fff;
  padding: 3px;
  box-sizing: border-box;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
  transition: transform 0.12s;
  pointer-events: auto;
  z-index: 2;
}
.cs-grid-add-track::after { z-index: 1; }
.cs-grid-add-track::before { z-index: 1; }
.cs-grid-add-track--col > svg {
  top: 50%;
  right: calc((var(--gap-x, 10px) / 2 + 10px) * -1);
  transform: translateY(-50%);
}
.cs-grid-add-track--row > svg {
  left: 50%;
  bottom: calc((var(--gap-y, 10px) / 2 + 10px) * -1);
  transform: translateX(-50%);
}
.cs-grid-add-track--col > svg:hover { transform: translateY(-50%) scale(1.25); }
.cs-grid-add-track--row > svg:hover { transform: translateX(-50%) scale(1.25); }

.has-padding-hl .canvas-section__pad-hl > span {
  position: absolute;
  /* Translucent mint so the band reveals whatever is stacked underneath
   * (a sticky header overlapping the next section, etc.). */
  background: rgba(196, 235, 232, 0.55);
  /* Click-through so the band never blocks selecting elements that sit
   * beneath it — e.g. a sticky header overlapping the section below. */
  pointer-events: none;
}
/* Persistent overlay band geometry — non-overlapping. T/B own the
 * corners (left:0 → right:0), L/R sit in the MIDDLE vertical strip only.
 * Same geometry the inspector-hover path already produced; canvas hover
 * uses the SAME function so it produces identical DOM/CSS. */
.has-padding-hl .canvas-section__pad-hl > span.pad-t {
  top: 0; left: 0; right: 0;
  height: var(--pad-top, 0);
}
.has-padding-hl .canvas-section__pad-hl > span.pad-b {
  bottom: 0; left: 0; right: 0;
  height: var(--pad-bottom, 0);
}
.has-padding-hl .canvas-section__pad-hl > span.pad-l {
  left: 0; top: var(--pad-top, 0); bottom: var(--pad-bottom, 0);
  width: var(--pad-left, 0);
}
.has-padding-hl .canvas-section__pad-hl > span.pad-r {
  right: 0; top: var(--pad-top, 0); bottom: var(--pad-bottom, 0);
  width: var(--pad-right, 0);
}
/* ── Padding band hover + drag bar (matches the Stack item-spacing
 *    pattern at .cs-stack-gap-hl). Each band is interactive: hover
 *    brightens it, and a small grabbable bar sits at the band's centre
 *    perpendicular to the side it controls. Drag the bar to resize the
 *    matching padding_<side> setting. */
.has-padding-hl .canvas-section__pad-hl > span {
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s;
}
.has-padding-hl .canvas-section__pad-hl > span:hover {
  background: rgba(91, 61, 245, 0.22);
}
/* When the hover overlay is active on this section, the user IS over a
 * persistent span (canvas-hover path) — but we don't want that span to
 * brighten to purple-22, because the hover overlay already paints
 * purple-35 above it. Without this, the canvas path looks different
 * from the inspector path: inspector keeps all persistent spans at
 * mint-55 (mouse is in inspector, not on any span) → uniform blend
 * along the strip; canvas without this rule has middle = purple-22 +
 * purple-35 stacked (darker), corners = mint-55 + purple-35 (mint-
 * tinged) — what the user reads as "top/bot đè trái/phải". Locking
 * the persistent span back to mint-55 here matches the inspector look. */
.canvas-section.has-padding-hover-hl > .canvas-section__pad-hl > span:hover,
.editor-canvas__page.has-padding-hover-hl > .canvas-section__pad-hl > span:hover {
  background: rgba(196, 235, 232, 0.55);
}
.has-padding-hl .canvas-section__pad-hl > span > .pad-bar {
  pointer-events: auto;
  flex: none;
  background: transparent;
  position: relative;
  opacity: 0;
  transition: opacity 0.12s;
}
/* Drag bar only surfaces when the user hovers its band. Matches the Stack
 * gap pattern (bar is the only grabbable; the surrounding band is just
 * the visual cue). */
.has-padding-hl .canvas-section__pad-hl > span:hover > .pad-bar { opacity: 1; }
/* Visible part of the bar — a centred coloured line. Sits inside a much
 * bigger transparent hit zone (the .pad-bar itself) so the user can grab
 * it with imperfect aim. */
.has-padding-hl .canvas-section__pad-hl > span > .pad-bar::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  background: rgba(91, 61, 245, 0.85);
  border-radius: 1px;
  transition: background 0.1s;
}
.has-padding-hl .canvas-section__pad-hl > span > .pad-bar:hover::after {
  background: rgba(91, 61, 245, 1);
}
/* Horizontal bars (top / bottom padding): big enough hit zone for an
 * imperfect mouse target; visible line stays a small 22 × 3 px dash. */
.has-padding-hl .canvas-section__pad-hl > span.pad-t > .pad-bar,
.has-padding-hl .canvas-section__pad-hl > span.pad-b > .pad-bar {
  width: 56px; height: 16px; cursor: ns-resize;
}
.has-padding-hl .canvas-section__pad-hl > span.pad-t > .pad-bar::after,
.has-padding-hl .canvas-section__pad-hl > span.pad-b > .pad-bar::after {
  width: 22px; height: 3px;
}
.has-padding-hl .canvas-section__pad-hl > span.pad-l > .pad-bar,
.has-padding-hl .canvas-section__pad-hl > span.pad-r > .pad-bar {
  width: 16px; height: 56px; cursor: ew-resize;
}
.has-padding-hl .canvas-section__pad-hl > span.pad-l > .pad-bar::after,
.has-padding-hl .canvas-section__pad-hl > span.pad-r > .pad-bar::after {
  width: 3px; height: 22px;
}
/* While actively dragging a padding bar, kill text selection + show the
 * resize cursor everywhere so the drag feels uninterrupted. */
body.is-padding-dragging,
body.is-padding-dragging * { user-select: none !important; }

.canvas-section__label {
  position: absolute;
  top: -20px;
  left: 0;
  background: transparent;
  /* Default = hover state colour (blue). Selected state overrides below
   * with purple (--editor-accent). Convention: hover = blue, select =
   * purple — applies to both outline and the label sitting on it. */
  color: rgb(37, 99, 235);
  font-size: 12px;
  font-weight: 400;
  padding: 0;
  border-radius: 0;
  z-index: 10;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
  pointer-events: none;
  font-family: var(--font-sans);
  text-transform: none;
  letter-spacing: 0;
}
.canvas-section.is-selected > .canvas-section__label {
  color: var(--editor-accent);
}
/* Section-level labels sit just below the toolbar (outside hitbox) */
.canvas-section[data-section-type="header"] > .canvas-section__label,
.canvas-section[data-section-type="section"] > .canvas-section__label,
.canvas-section[data-section-type="footer"] > .canvas-section__label {
  top: -20px;
}
/* Global sections (Header/Footer) are GREEN — but ONLY when they live in a
   global band (.canvas-global-band, i.e. site-wide via __global_top/bottom).
   A header/footer added as a normal page section stays the default blue like
   any other section. Scoping on the band ancestor (not the element type)
   keeps "green = global" honest. User 2026-07-09: "add Header từ Add element
   vẫn thấy xanh lá ở Canvas". */
.canvas-global-band .canvas-section[data-section-type="header"]:hover:not(.is-selected)::after,
.canvas-global-band .canvas-section[data-section-type="footer"]:hover:not(.is-selected)::after {
  border-color: rgba(63, 175, 79, 0.4) !important;
}
.canvas-global-band .canvas-section[data-section-type="header"].is-selected::after,
.canvas-global-band .canvas-section[data-section-type="footer"].is-selected::after {
  border-color: #2f9d40 !important;
}
.canvas-global-band .canvas-section[data-section-type="header"] > .canvas-section__label,
.canvas-global-band .canvas-section[data-section-type="footer"] > .canvas-section__label {
  color: #3faf4f;
}
.canvas-global-band .canvas-section[data-section-type="header"].is-selected > .cs-resize-handle,
.canvas-global-band .canvas-section[data-section-type="footer"].is-selected > .cs-resize-handle {
  border-color: #2f9d40;
}
/* Element-level labels sit just below the toolbar (outside hitbox) */
.canvas-section[data-section-type="image"] > .canvas-section__label,
.canvas-section[data-section-type="text"] > .canvas-section__label,
.canvas-section[data-section-type="paragraph"] > .canvas-section__label,
.canvas-section[data-section-type="heading"] > .canvas-section__label,
.canvas-section[data-section-type="title"] > .canvas-section__label,
.canvas-section[data-section-type="button"] > .canvas-section__label,
.canvas-section[data-section-type="menu"] > .canvas-section__label {
  top: -20px;
}
/* Label visibility:
   - Root sections (header/footer/section): label shows on hover OR when
     selected. Hovering a descendant keeps the parent's label visible
     (parent owns the area, descendants are inside it).
   - Children: label shows on hover (only when their ancestor root is
     active) and when they themselves are selected. */
/* :hover bubbles up the DOM, so hovering a descendant Text also fires
 * :hover on the Section wrapper — which was making the Section's corner
 * label appear whenever the cursor was ANYWHERE inside the Section
 * (user 2026-07-02 "không hover vào section nhưng vẫn hiện label").
 * Add `:not(:has(.canvas-section:hover))` so root labels only surface
 * when the cursor is on the Section's OWN chrome, not a child element. */
/* Label visibility follows `.is-hover-target` (JS-driven, see
 * updateHoverTarget in 04-canvas-events.js) — same "outermost hover-
 * eligible descendant of the active container" contract as the outline
 * / bg rules above. Layer-panel hover uses its own `.is-layer-hover`
 * class. Selected element always shows its own label. */
.canvas-section.is-hover-target > .canvas-section__label,
.canvas-section[data-section-type="header"].is-layer-hover > .canvas-section__label,
.canvas-section[data-section-type="footer"].is-layer-hover > .canvas-section__label,
.canvas-section[data-section-type="section"].is-layer-hover > .canvas-section__label,
.canvas-section.is-selected > .canvas-section__label {
  opacity: 1;
}
.canvas-section.is-section-active .canvas-section.is-layer-hover:not(:has(.canvas-section.is-layer-hover)) > .canvas-section__label {
  opacity: 1;
}

/* ===== Canvas Section Toolbar (Wix-style GFPP) ===== */
.canvas-section__toolbar {
  /* position:fixed so the toolbar escapes the canvas's overflow clip —
   * JS (positionCanvasToolbar) writes left/top in viewport coords every
   * scroll/resize/selection change. */
  position: fixed;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  gap: 0;
  height: 44px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 0;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15), 0 0 0 1px rgba(0,0,0,0.04);
  padding: 0 4px;
  z-index: 2147482000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
  white-space: nowrap;
}
/* In multi-select mode, only the PRIMARY selected element shows its
 * floating toolbar — otherwise N selection rings stack N toolbars on
 * top of each other. The single bar acts as the shared GFPP for the
 * group; per-element actions only make sense on a single selection. */
body.is-multi-select .canvas-section.is-selected:not(.is-primary-selected) > .canvas-section__toolbar,
body.is-multi-select .canvas-section.is-selected:not(.is-primary-selected) > .canvas-section__bc,
body.is-multi-select .canvas-section.is-selected:not(.is-primary-selected) > .canvas-section__bc-anim {
  display: none;
}
.canvas-section.is-selected > .canvas-section__toolbar {
  opacity: 1;
  pointer-events: auto;
}
/* Stack "Hug Overflow" action button — attached to <body> by
 * syncStackHugAction, positioned in screen coords at the stack's top-right
 * corner when a flex child overflows the stack's cross axis. Wix-style
 * compact white tile with a 20 px hug-arrows glyph. */
.canvas-stack-hug-action {
  position: fixed;
  top: 0;
  left: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 4px;
  background: #ffffff;
  color: #000624;
  box-shadow: 0 2px 6px rgba(0,0,0,0.18);
  cursor: pointer;
  z-index: 2147482000;
  transition: background 0.15s, transform 0.1s;
}
.canvas-stack-hug-action:hover { background: #f4f5f8; }
.canvas-stack-hug-action:active { transform: scale(0.94); }
.canvas-stack-hug-action svg { display: block; width: 20px; height: 20px; }
/* (The old `.canvas-section.is-selected { z-index: 2147481000 }` was
 * there to keep the floating toolbar from being clipped by siblings.
 * positionCanvasToolbar now detaches the toolbar + breadcrumb to <body>
 * — they paint at the very top of the document on their own, so the
 * selected element no longer needs to hijack the entire z-stack. The
 * rule used to drag a selected image OVER unrelated elements that
 * should layer above it. Earlier rule at line ~3043 (`z-index: 30`)
 * provides the modest lift we still want for a contained stacking
 * context.) */
.cs-toolbar__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 10px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 13px;
  color: #000;
  border-radius: 4px;
  font-family: var(--font-sans);
  white-space: nowrap;
  height: 36px;
  line-height: 1;
}
.cs-toolbar__btn:hover {
  background: #f0f0f0;
}
.cs-toolbar__btn--name {
  font-weight: 400;
}
.cs-toolbar__btn--name svg:last-child {
  margin-left: 2px;
  opacity: 0.5;
}
.cs-toolbar__btn--icon {
  padding: 6px;
  width: 36px;
}
.cs-toolbar__btn--icon svg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}
/* Link/active toolbar button — shows the element already has a link set.
   Icon paints in the editor accent (blue) so users can tell at a glance.
   The Image/Button SVGs don't set fill="currentColor", so we paint paths
   explicitly; the Text SVG uses currentColor and picks up color anyway. */
.cs-toolbar__btn--icon.is-active {
  color: var(--editor-accent);
}
.cs-toolbar__btn--icon.is-active svg,
.cs-toolbar__btn--icon.is-active svg path {
  fill: var(--editor-accent);
}
/* 3-dot "more" button: color-only hover, no bg — matches layer 3-dots */
.cs-toolbar__btn[data-toolbar-action="more"]:hover {
  background: transparent;
  color: var(--editor-accent);
}
.cs-toolbar__icon {
  display: flex;
  align-items: center;
  margin-right: 4px;
}
/* Toolbar SVGs — default rendering. Toolbar now uses position:fixed
 * outside the canvas's transform stack so it's already at the native
 * pixel grid; no special hints needed. */
.cs-toolbar__icon svg {
  width: 20px;
  height: 20px;
}
.cs-toolbar__sep {
  width: 1px;
  height: 24px;
  background: #e0e0e0;
  margin: 0 2px;
  flex-shrink: 0;
}

/* ===== Vendr Dialog (modal) ===== */
.vendr-dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
}
.vendr-dialog {
  background: #fff;
  border-radius: 12px;
  width: 400px;
  max-width: 90vw;
  box-shadow: 0 12px 40px rgba(0,0,0,0.25);
  overflow: hidden;
}
.vendr-dialog__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #e5e7eb;
}
.vendr-dialog__title {
  font-size: 16px;
  font-weight: 400;
  color: #111;
}
.vendr-dialog__close {
  background: none;
  border: none;
  font-size: 20px;
  color: #666;
  cursor: pointer;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}
.vendr-dialog__close:hover { background: #f0f0f0; }
.vendr-dialog__body {
  padding: 20px;
}
.vendr-dialog__label {
  display: block;
  font-size: 12px;
  font-weight: 400;
  color: #555;
  margin-bottom: 6px;
}
.vendr-dialog__input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 13px;
  font-family: var(--font-sans);
  outline: none;
  color: #111;
}
.vendr-dialog__input:focus {
  border-color: var(--editor-accent);
  box-shadow: 0 0 0 2px rgba(37,99,235,0.15);
}
.vendr-dialog__or {
  text-align: center;
  color: #999;
  font-size: 12px;
  margin: 12px 0;
}
.vendr-dialog__upload-btn {
  display: block;
  text-align: center;
  padding: 10px;
  border: 1.5px dashed #d1d5db;
  border-radius: 6px;
  color: var(--editor-accent);
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
}
.vendr-dialog__upload-btn:hover {
  background: #f8faff;
  border-color: var(--editor-accent);
}
.vendr-dialog__preview {
  text-align: center;
}
.vendr-dialog__footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid #e5e7eb;
}
.vendr-dialog__btn {
  padding: 8px 20px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
  border: none;
  font-family: var(--font-sans);
}
.vendr-dialog__btn--cancel {
  background: #f3f4f6;
  color: #333;
}
.vendr-dialog__btn--cancel:hover { background: #e5e7eb; }
.vendr-dialog__btn--primary {
  background: var(--editor-accent);
  color: #fff;
}
.vendr-dialog__btn--primary:hover { background: var(--editor-accent-hover); }

/* --- Canvas Section Content Previews --- */
.canvas-section__content {
  font-family: var(--font-sans);
  color: #333;
  /* Positioning context so the section-centre pink cross (appended inside
   * here so it scrolls with content) anchors to the section, not the page. */
  position: relative;
  /* Explicit transparent so any legacy inline bg from a prior editor
   * build (or from a plugin) can't paint over the page background when
   * the header's own bg goes to opacity 0. */
  background-color: transparent;
}

/* Header preview — default bg is white so the inspector's "Background"
 * swatch value (which falls back to #ffffff when unset) matches what's
 * actually painted. Border stays so the section edge is still visible. */
.cs-header {
  /* Use background-color (not shorthand) so an inline
   * `background-color: rgba(...,0)` from the renderer at bg_opacity=0
   * cleanly overrides — CSS shorthand `background:` was resetting
   * every subproperty, including transparent inline overrides in some
   * browsers (user 2026-07-06 "header opacity 0 không hoạt động"). */
  background-color: #ffffff;
  min-height: 48px;
  position: relative;
  /* Wix-style content-box: H setting = CONTENT area, padding INFLATES
   * outer (per user 2026-06-25: "default section H 494, add padding 45/45
   * → new outer H must be 584"). Universal `* { box-sizing: border-box }`
   * reset would otherwise pull padding INTO H, making outer always equal
   * to H regardless of padding — opposite of the Wix model. Same applies
   * to .cs-section / .cs-footer below. */
  box-sizing: content-box;
}

/* Inner positioning context for absolute children of root sections
 * (header / footer / section / container / card). Padding lives on the
 * outer .cs-* element; absolute children sit inside this inner box so they
 * measure their `left/top` and `%` widths from the CONTENT box (after
 * padding) rather than the padding box. Increasing parent padding visibly
 * shrinks any child whose size is `%`. */
/* data-inner-min0: the OUTER .cs-section carries a border-box min-height/height
 * (grid section with an explicit Min H, or the vh-box) and must be the sole
 * height authority. The inner must NOT inherit that floor (the default rule
 * below sets min-height:inherit) — a content-box inner floored at the outer
 * value + the section padding would balloon the outer to value+padding (user
 * 2026-07-13: "100vh=1108 render 1328"; "Min H 1116 render 1266"). Reset the
 * inner to a natural, content-driven height so the outer's border-box min-height
 * governs the box and padding sits INSIDE it. */
.cs-section[data-inner-min0] > .cs-section__inner,
.cs-header[data-inner-min0] > .cs-section__inner,
.cs-footer[data-inner-min0] > .cs-section__inner {
  min-height: 0;
  height: auto;
}
.cs-section__inner {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: inherit;
  /* Apply Max Width — Section/Header/Footer caps its inner content box
   * at the page's max width (default 1600 px) BY DEFAULT. The OUTER
   * section still spans full viewport so the background colour bleeds
   * edge to edge, but absolutely-positioned children are anchored to a
   * centered, max-1600 px inner box — exactly what Wix does, and what
   * the user's "Apply Max Width" setting is supposed to produce.
   *
   * Why default-apply: the renderer used to add a `.has-max-width` class
   * only when settings.apply_max_width was true, but published HTML
   * compiled by older editor.js bundles missed that class and the live
   * /preview page therefore did NOT respect the max-width setting until
   * the user re-published. Making the cap the default means EVERY
   * `.cs-section__inner` — fresh canvas, old compiled HTML, anything —
   * picks up the limit automatically. To opt OUT, render with
   * `.no-max-width` (emitted when settings.apply_max_width === false). */
  max-width: var(--page-max-width, 1600px);
  margin-left: auto;
  margin-right: auto;
}
/* Kept as an alias so older HTML (and the explicit `has-max-width`
 * emit in the canvas renderer) still works; the rule is now redundant
 * with the base style above but it doesn't hurt and avoids breaking
 * any downstream selector. */
.cs-section__inner.has-max-width {
  max-width: var(--page-max-width, 1600px);
  margin-left: auto;
  margin-right: auto;
}
/* Explicit opt-out: render this class when settings.apply_max_width is
 * false so the section's content can stretch edge to edge again. */
.cs-section__inner.no-max-width {
  max-width: none;
  margin-left: 0;
  margin-right: 0;
}

/* Footer preview — same rationale as .cs-header above. */
.cs-footer {
  background-color: #ffffff;
  min-height: 48px;
  position: relative;
  /* See .cs-header note above — H setting = content area, padding adds. */
  box-sizing: content-box;
}

/* Section preview */
.cs-section {
  min-height: 200px;
  position: relative;
  /* See .cs-header note above — H setting = content area, padding adds. */
  box-sizing: content-box;
}
/* Section/Header/Footer hosting a cell grid: stretch the grid to the full
 * box. Header & Footer need the SAME treatment as Section — without it the
 * grid doesn't sit inside the parent's padding box, so Header/Footer
 * padding wouldn't visibly inset the grid. */
.cs-section:has(.cs-section-grid),
.cs-header:has(.cs-section-grid),
.cs-footer:has(.cs-section-grid) {
  display: flex;
  flex-direction: column;
}
.cs-section > .cs-section-grid,
.cs-header > .cs-section-grid,
.cs-footer > .cs-section-grid {
  flex: 1 1 auto;
  min-width: 0;
}
.cs-section > .cs-section-grid {
  min-height: 200px;
}

/* Container preview */
.cs-container { position: relative; }
.cs-card { position: relative; box-sizing: border-box; }

/* Center empty prompt in section/header/footer/container */
.cs-section:has(.canvas-empty-prompt),
.cs-header:has(.canvas-empty-prompt),
.cs-footer:has(.canvas-empty-prompt),
.cs-container:has(.canvas-empty-prompt) {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* === Empty section prompt ("Choose your starting point") ===
 * Open layout: no card / shadow / border on the wrapper itself; just the
 * title above a row of three big square tile-buttons. Each tile is a
 * bordered square holding the SVG illustration; the label sits below the
 * tile as plain text (not inside it). Matches the reference Wix screen. */
.canvas-empty-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  padding: 32px 24px;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  /* Hidden until the owning Section (or Header/Footer) is hovered or
   * selected — otherwise every empty section on the page displays the
   * "Choose your starting point" prompt at once, which is noisy
   * (user 2026-07-02). */
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}
.canvas-section[data-section-type="section"]:hover .canvas-empty-prompt,
.canvas-section[data-section-type="header"]:hover .canvas-empty-prompt,
.canvas-section[data-section-type="footer"]:hover .canvas-empty-prompt,
.canvas-section[data-section-type="section"].is-selected .canvas-empty-prompt,
.canvas-section[data-section-type="header"].is-selected .canvas-empty-prompt,
.canvas-section[data-section-type="footer"].is-selected .canvas-empty-prompt {
  opacity: 1;
  pointer-events: auto;
}
.canvas-empty-prompt__title {
  font-size: 16px !important;
  font-weight: 400;
  color: #2b2f38;
  line-height: 1.4;
}
.canvas-empty-prompt__actions {
  display: flex;
  gap: 24px;
}
.canvas-empty-prompt__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  cursor: pointer;
  font-family: inherit;
}
.canvas-empty-prompt__thumb {
  width: 100px;
  height: 100px;
  background: #fff;
  border: 1px solid #d8dde4;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.canvas-empty-prompt__item:hover .canvas-empty-prompt__thumb {
  border-color: #5B3DF5;
  box-shadow: 0 0 0 1px #5B3DF5;
}
.canvas-empty-prompt__thumb svg { height: 35px; width: auto; }
.canvas-empty-prompt__item span {
  font-size: 16px !important;
  color: #2b2f38;
  font-weight: 400;
  line-height: 1.4;
}

/* Page layer item */
.layer-item--page {
  font-weight: 400;
  padding-left: 0;
}

/* Hero preview — pure layout. Padding / bg / colour / typography come
 * from the inspector via buildSectionStyle, so no hardcoded defaults. */
.cs-hero {
  min-height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background-size: cover;
  background-position: center;
  position: relative;
  text-align: center;
}
.cs-hero__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.4);
}
.cs-hero__inner { position: relative; z-index: 1; }
.cs-hero h2 { margin: 0; }
.cs-hero p  { margin: 0; }
.cs-hero .cs-btn {
  display: inline-block;
  padding: 10px 24px;
  margin-top: 8px;
}

/* Heading preview — typography comes from inspector via buildTextStyle */
.cs-heading { padding: 0; }
.cs-heading h1, .cs-heading h2, .cs-heading h3,
.cs-heading h4, .cs-heading h5, .cs-heading h6 { margin: 0; }

/* The published/preview page loads Tailwind's CDN, whose preflight resets
   h1–h6 to `font-size:inherit;font-weight:inherit`. The editor canvas does
   NOT load Tailwind, so a heading with no explicit inspector font-size shows
   at its natural size in the canvas but collapses to body text in preview —
   and an auto-width heading then shifts off-centre. editor.css is loaded by
   both, so restore the UA heading metrics here. Inline styles emitted by
   buildTextStyle still win (higher specificity), so explicit sizes are kept. */
.cs-heading h1 { font-size: 2em;    font-weight: bold; }
.cs-heading h2 { font-size: 1.5em;  font-weight: bold; }
.cs-heading h3 { font-size: 1.17em; font-weight: bold; }
.cs-heading h4 { font-size: 1em;    font-weight: bold; }
.cs-heading h5 { font-size: 0.83em; font-weight: bold; }
.cs-heading h6 { font-size: 0.67em; font-weight: bold; }

/* Paragraph preview */
.cs-paragraph { padding: 0; line-height: 1.3; }

/* Dashed connector from the selected element to a docked parent edge.
 * Drawn inside .canvas-section__content so it scrolls with canvas
 * content and reflows on parent resize. JS (updateDockIndicators) sets
 * left/top/width/height per dock side. */
.canvas-section-dock-line {
  position: absolute;
  pointer-events: none;
  z-index: 9;
  /* Promote to its own compositor layer. Inside the zoomed viewport
     (transform: scale) Chrome otherwise leaves ghost trails of the dashed
     line while dragging — the DOM node is removed each frame (verified via
     [DOCK] census: no accumulation) but the GPU doesn't clear the old paint
     until mouseup. A dedicated layer repaints cleanly per frame. */
  will-change: transform;
  transform: translateZ(0);
}
/* Selection distance bars: dashed GREEN by default, BLUE when the edge is
   docked — matches the drag-time measure lines (green = free gap, blue =
   anchored). Replaces the old purple dock connector. */
.canvas-section-dock-line--h {
  height: 0;
  border-top: 1px dashed #22c55e;
}
.canvas-section-dock-line--v {
  width: 0;
  border-left: 1px dashed #22c55e;
}
.canvas-section-dock-line--h.is-docked { border-top-color: #2563eb; }
.canvas-section-dock-line--v.is-docked { border-left-color: #2563eb; }
.canvas-section-dock-label {
  position: absolute;
  pointer-events: none;
  z-index: 10;
  transform: translate(-50%, -50%);
  background: #22c55e;
  color: #fff;
  font-size: 11px;
  font-weight: 400;
  padding: 1px 5px;
  border-radius: 3px;
  font-family: var(--font-sans);
  white-space: nowrap;
  will-change: transform;
}
.canvas-section-dock-label.is-docked { background: #2563eb; }

/* Legacy: `data-cqi-container` used to trigger `container-type: inline-size`
 * so buildTextStyle's `cqi`-unit font-size tracked the wrapper's live width.
 * That approach was abandoned when font-size moved to
 * `calc(var(--scale-cap-w) * ratio)`, which resolves against the viewport,
 * not the wrapper. The `container-type: inline-size` rule survived as dead
 * weight — worse, `contain: inline-size` (implicit under container-type)
 * strips descendant intrinsic-width contributions, collapsing
 * `width: max-content` (Hug mode) to 0. Removed 2026-07-01. */

/* Previous fix used `transform: translateY(0.075em)` to nudge glyphs down
 * inside the line-box (compensating for descender slack in titles). But
 * `em` scales with font-size — larger fonts got a bigger visual shift, so
 * switching text_style (Heading 1 → Heading 2 → Paragraph 2 …) left every
 * style landing at a subtly different offset relative to the selection
 * outline. User 2026-07-04: "mỗi kiểu nó hơi lệch 1 tí so với giữa".
 *
 * Dropped the nudge — text now uses the natural line-box baseline, so
 * changing style keeps the outline box tight and the glyph position
 * predictable across every style. */

/* Allow the browser to synthesize bold + italic for canvas text. Without
 * this, the Bold toggle does nothing when the element uses the default
 * font (Aeonik Pro): only AeonikPro-Regular.woff2 ships, and body sets
 * `font-synthesis: none` so the browser can't fake the missing 700
 * weight. User-picked fonts that ship a real bold file still load their
 * native glyphs — this only opens the door for fallback synthesis. */
.canvas-section__content,
.canvas-section__content * { font-synthesis: weight style; }

/* Section center-plus marker — anchored inside .editor-canvas so it stays
 * clipped to the canvas (not over inspectors / popups). High z-index so
 * absolutely-positioned children of the same section (Container, Image,
 * etc.) don't render on top and hide the pink crosshair. */
.canvas-section-plus {
  position: absolute; width: 12px; height: 12px;
  transform: translate(-50%, -50%);
  pointer-events: none; z-index: 2147480000;
}
.canvas-section-plus::before, .canvas-section-plus::after {
  content: ''; position: absolute; background: #ff4d87;
}
.canvas-section-plus::before { left: 50%; top: 0; bottom: 0; width: 1px; transform: translateX(-50%); }
.canvas-section-plus::after  { top: 50%; left: 0; right: 0; height: 1px; transform: translateY(-50%); }

/* Set image as background button — inside top-right of selected image */
.cs-set-bg {
  position: absolute; top: 8px; right: 8px;
  width: 28px; height: 28px; padding: 0;
  background: #fff; border: 1px solid rgba(0,0,0,0.12); border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  display: none; align-items: center; justify-content: center;
  cursor: pointer; color: var(--editor-text, #1a1a2e); z-index: 10;
}
.canvas-section.is-selected > .cs-set-bg { display: flex; }
.cs-set-bg:hover { color: var(--editor-accent, #5B3DF5); border-color: var(--editor-accent, #5B3DF5); }

/* Menu Design sub-sections */
.insp-slider-row { display: flex; align-items: center; gap: 10px; }
.insp-slider-row .insp-opacity-slider { flex: 1; }
.insp-adjust-input--sm { width: 70px; flex-shrink: 0; }

.insp-radio-group { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.insp-radio { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; color: var(--panel-text-secondary); }
.insp-radio input { display: none; }
.insp-radio__dot { width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--panel-border); flex-shrink: 0; position: relative; background: #fff; }
.insp-radio input:checked + .insp-radio__dot { border-color: var(--editor-accent); border-width: 5px; }

.insp-borders-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.insp-borders-diagram { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 0; }
.insp-borders-row { display: flex; align-items: center; justify-content: center; gap: 8px; }
.insp-borders-row--middle { width: 100%; justify-content: space-between; }
.insp-border-edge { flex-shrink: 0; }
.insp-border-input-group { display: flex; align-items: center; gap: 6px; margin-bottom: -10px; z-index: 2; position: relative; background: #fff; padding: 2px; }
.insp-border-size-input { display: inline-flex; align-items: center; border: 1px solid var(--panel-border); border-radius: 4px; padding: 0 6px; height: 24px; background: #fff; }
.insp-border-size-input input { width: 28px; border: none; outline: none; background: transparent; font-size: 12px; text-align: center; font-family: var(--font-sans); color: var(--panel-text); }
.insp-border-size-input span { font-size: 11px; color: var(--panel-text-muted); margin-left: 2px; }
.insp-border-size-input--side { }
.insp-border-color { width: 18px; height: 18px; border-radius: 3px; border: 1px solid var(--panel-border); cursor: pointer; flex-shrink: 0; padding: 0; }
.insp-border-color:hover { border-color: var(--editor-accent); }
.insp-border-style-mini { display: inline-flex; align-items: center; gap: 2px; cursor: pointer; padding: 0 4px; height: 24px; border: 1px solid var(--panel-border); border-radius: 4px; background: #fff; }
.insp-border-style-mini__preview { width: 24px; border-top: 2px solid var(--panel-text-secondary); }
.insp-border-style-mini__chev { color: var(--panel-text-secondary); }
.insp-border-lock { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border: none; background: var(--editor-accent); color: #fff; border-radius: 6px; cursor: pointer; flex-shrink: 0; }
.insp-border-lock:not(.is-locked) { background: var(--panel-surface); color: var(--panel-text-secondary); }

.insp-divider-controls { display: flex; align-items: center; gap: 8px; }
.insp-select--tiny { height: 24px; font-size: 12px; padding: 0 8px; background-size: 14px; padding-right: 24px; }

.insp-corners-wrap { position: relative; padding: 4px 0; }
.insp-corners-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.insp-corner-input { display: flex; align-items: center; gap: 4px; border: 1px solid var(--panel-border); border-radius: 4px; padding: 2px 6px; height: 28px; background: #fff; }
.insp-corner-input__icon { display: inline-flex; align-items: center; color: var(--editor-accent); flex-shrink: 0; }
.insp-corner-input input { flex: 1; width: 28px; border: none; outline: none; background: transparent; font-size: 12px; font-family: var(--font-sans); color: var(--panel-text); }
.insp-corner-input__unit { font-size: 11px; color: var(--panel-text-muted); }
.insp-corners-lock { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--panel-border); background: #fff; color: var(--editor-accent); border-radius: 4px; cursor: pointer; z-index: 1; }
.insp-corners-lock.is-locked { background: var(--editor-accent); color: #fff; border-color: var(--editor-accent); }

.insp-add-shadow-btn { display: inline-flex; align-items: center; gap: 6px; background: none; border: none; color: var(--editor-accent); cursor: pointer; font-size: 13px; font-weight: 400; padding: 4px 0; font-family: var(--font-sans); }
.insp-add-shadow-btn:hover { text-decoration: underline; }
.insp-remove-shadow-btn { background: none; border: none; color: var(--editor-accent); cursor: pointer; font-size: 13px; padding: 4px 0; font-family: var(--font-sans); }
.insp-remove-shadow-btn:hover { text-decoration: underline; }
.insp-info-icon { display: inline-flex; align-items: center; color: var(--panel-text-muted); cursor: help; }

.insp-style-btn__chev { width: 8px; height: 8px; margin-left: 2px; color: var(--panel-text-secondary); }

/* ===== Menu design target selector ===== */
.insp-target-cards { display: flex; gap: 8px; margin-bottom: 14px; }
.insp-target-card {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; padding: 10px 6px; border: 1px solid var(--panel-border); border-radius: 6px;
  background: #fff; cursor: pointer; font-size: 12px; color: var(--panel-text-secondary);
  font-family: var(--font-sans); transition: border-color 0.12s, background 0.12s;
  line-height: 1.3; text-align: center;
}
.insp-target-card:hover { border-color: var(--editor-accent); background: #f0f5ff; }
.insp-target-card.is-active { border-color: var(--editor-accent); background: #f0f5ff; color: var(--editor-accent); }
.insp-target-card svg { flex-shrink: 0; }

/* ===== {{token}} autocomplete popup (inline text edit) ===== */
.vendr-token-ac {
  position: fixed;
  z-index: 2147483647;
  min-width: 220px;
  max-width: 320px;
  max-height: 260px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #e3e4e8;
  border-radius: 8px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.14);
  padding: 4px;
  font-family: 'Wix Madefor Text', system-ui, sans-serif;
}
.vendr-token-ac__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}
.vendr-token-ac__item.is-active,
.vendr-token-ac__item:hover {
  background: #f0edff;
}
.vendr-token-ac__label {
  color: #4a2be6;
  font-weight: 600;
  font-family: ui-monospace, Menlo, Consolas, monospace;
}
.vendr-token-ac__hint {
  color: #8a8d99;
  font-size: 12px;
}

/* ===== Manage Menu floating panel ===== */
/* === Manage Menu panel — Wix-style === */
.mm-panel {
  position: fixed;
  width: 340px;
  height: 500px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 28px rgba(0, 6, 36, 0.16), 0 0 0 1px rgba(0, 6, 36, 0.04);
  display: flex; flex-direction: column;
  z-index: 2000;
  font-family: var(--font-sans);
}
.mm-panel__header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 18px 14px;
  cursor: move; user-select: none;
}
.mm-panel__header:active { cursor: grabbing; }
.mm-panel__title { font-size: 16px; font-weight: 400; color: #131720; line-height: 24px; }
.mm-panel__header-btns { display: flex; gap: 0; }
.mm-panel__icon-btn {
  background: none; border: none; cursor: pointer;
  width: 32px; height: 32px; border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  color: #131720;
}
.mm-panel__icon-btn:hover { background: rgba(19, 23, 32, 0.06); }
/* Field "Which menu is displayed?" */
.mm-panel__field { padding: 4px 18px 16px; }
.mm-panel__field-label-top {
  display: flex; align-items: center; gap: 4px;
  font-size: 14px; color: #131720; font-weight: 400;
  margin-bottom: 6px;
}
.mm-panel__field-label-top .mm-info-icon { color: #868aa5; display: inline-flex; }
.mm-panel__select-wrap { position: relative; }
.mm-panel__select-input {
  width: 100%; height: 36px; padding: 0 32px 0 12px;
  border: 1px solid #c5cad2; border-radius: 4px; background: #fff;
  font-size: 14px; color: #131720; font-weight: 400; cursor: pointer;
  appearance: none; outline: none; font-family: inherit;
  transition: border-color 0.12s, box-shadow 0.12s;
  text-align: left;
}
.mm-panel__select-input:hover { border-color: #131720; }
.mm-panel__select-input:focus { border-color: #5B3DF5; box-shadow: 0 0 0 2px rgba(17,109,255,0.2); }
.mm-panel__select-arrow {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  color: #131720; pointer-events: none; display: flex;
}
.mm-panel__content { padding: 0; flex: 1; overflow-y: auto; min-height: 0; }
/* Menu items list — full-width rows, no horizontal padding on container */
.mm-list { list-style: none; padding: 0; margin: 0; }
.mm-item {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  cursor: pointer;
  min-height: 36px;
  position: relative;
  background: #fff;
  transition: background 0.12s;
}
.mm-item:hover { background: #E7F0FF; }
.mm-item.is-dragging { opacity: 0.45; background: #E7F0FF; }
.mm-item.is-drop-before::before { content: ''; position: absolute; left: 0; right: 0; top: -1px; height: 2px; background: #5B3DF5; }
.mm-item.is-drop-after::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: #5B3DF5; }
.mm-item__drag {
  color: #5B3DF5; cursor: grab; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  height: 24px; width: 12px;
}
.mm-item.is-dragging .mm-item__drag { cursor: grabbing; }
.mm-item__icon {
  color: #131720; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  width: 24px; height: 24px;
}
.mm-item__label {
  flex: 1;
  font-size: 14px; color: #131720; font-weight: 400;
  cursor: pointer;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  min-width: 0;
}
.mm-item__more {
  background: none; border: none; cursor: pointer;
  width: 28px; height: 28px;
  border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  color: #131720; opacity: 0; flex-shrink: 0;
  transition: opacity 0.12s, background 0.12s;
}
.mm-item:hover .mm-item__more,
.mm-item.is-selected .mm-item__more { opacity: 1; }
.mm-item__more:hover { background: rgba(19, 23, 32, 0.1); }
/* Context menu */
.mm-item__ctx-menu {
  position: fixed; background: #fff;
  border-radius: 4px;
  box-shadow: 0 2px 12px rgba(0, 6, 36, 0.16), 0 0 0 1px rgba(0, 6, 36, 0.06);
  min-width: 160px; z-index: 3000; padding: 6px 0;
}
.mm-item__ctx-btn {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 8px 16px; border: none; background: none; cursor: pointer;
  font-size: 14px; color: #131720; font-family: inherit; text-align: left;
}
.mm-item__ctx-btn:hover { background: rgba(19, 23, 32, 0.06); }
.mm-item__ctx-btn--danger { color: #df3131; }
.mm-item__ctx-btn--danger:hover { background: rgba(223, 49, 49, 0.06); }
/* Footer with Add Item — exact Wix SidePanelFooter spec */
.mm-panel__footer {
  margin-top: auto;
  border-top: 1px solid #DFE5EB;
  padding: 18px 24px;
  display: flex; align-items: center; justify-content: center;
}
.mm-add-btn {
  display: inline-flex; align-items: center;
  background: transparent; border: 0; cursor: pointer;
  font-size: 14px; font-weight: 400; line-height: 18px;
  color: #5B3DF5; font-family: inherit;
  padding: 0; height: 18px;
  transition: color 0.1s linear;
  outline: 0;
}
.mm-add-btn:hover { color: #5999FF; background: transparent; }
.mm-add-btn:active { color: #5999FF; }
.mm-add-btn svg { width: 24px; height: 24px; padding-right: 6px; box-sizing: content-box; }
.mm-edit-overlay {
  position: fixed; inset: 0; z-index: 2500; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.35);
}
.mm-edit-dialog {
  background: #fff; border-radius: 10px; width: 360px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2); overflow: hidden;
}
.mm-edit-dialog__header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid #e0e0e0;
}
.mm-edit-dialog__title { font-size: 14px; font-weight: 400; color: #000624; }
.mm-edit-dialog__body { padding: 18px; display: flex; flex-direction: column; gap: 12px; color: #000624; }
.mm-edit-dialog__label { font-size: 12px; font-weight: 400; color: #000624; margin-bottom: 4px; display: block; }
.mm-edit-dialog__input {
  width: 100%; height: 34px; border: 1px solid #e0e0e0; border-radius: 6px;
  font-size: 13px; padding: 0 10px; color: #111; font-family: var(--font-sans); outline: none;
}
.mm-edit-dialog__input:focus { border-color: var(--editor-accent); }
.mm-edit-dialog__footer {
  padding: 12px 18px; border-top: 1px solid #e0e0e0;
  display: flex; justify-content: flex-end; gap: 8px;
}
.mm-edit-dialog__btn {
  height: 32px; padding: 0 16px; border-radius: 6px; font-size: 13px;
  font-family: var(--font-sans); cursor: pointer; border: 1px solid #e0e0e0;
  background: #f5f5f5; color: #3b3d4d;
}
.mm-edit-dialog__btn--primary {
  background: var(--editor-accent); color: #fff; border-color: var(--editor-accent);
}
.mm-edit-dialog__btn--primary:hover { opacity: 0.9; }

/* Link button inside Edit Menu Item dialog */
.mm-edit-link-btn {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; padding: 8px 12px;
  background: #fff; border: 1px solid #d8d8d8; border-radius: 4px;
  font-size: 13px; color: #000624; cursor: pointer; font-family: inherit;
  text-align: left;
}
.mm-edit-link-btn:hover { border-color: #b0b0b0; }
.mm-edit-link-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.mm-edit-link-btn svg { color: var(--editor-accent); flex-shrink: 0; }

/* === Link Panel (Wix "What do you want to link to?") === */
.mm-link-panel {
  position: fixed; top: 90px; left: 90px;
  width: 600px; max-height: 540px;
  background: #fff; border: 1px solid #e0e0e0; border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  z-index: 10001;
  font-family: var(--font-sans);
  display: flex; flex-direction: column;
}
.mm-link-panel__header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid #e8e8e8;
  cursor: move; user-select: none;
}
.mm-link-panel__header:active { cursor: grabbing; }
.mm-link-panel__title { font-size: 15px; font-weight: 400; color: #000624; }
.mm-link-panel__body { display: flex; flex: 1; min-height: 320px; overflow: hidden; }
/* Left side: radio button list of link types */
.mm-link-tabs {
  list-style: none; margin: 0; padding: 14px 16px;
  border-right: 1px solid #e8e8e8;
  width: 200px; flex-shrink: 0;
  display: flex; flex-direction: column; gap: 2px;
}
.mm-link-tab {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 4px; cursor: pointer;
  font-size: 14px; color: #000624; font-weight: 400;
  border-radius: 4px; transition: background 0.12s;
}
.mm-link-tab:hover { background: #f5f5f5; }
.mm-link-tab__radio {
  width: 18px; height: 18px; border: 1.5px solid #c0c0c0; border-radius: 50%;
  flex-shrink: 0; position: relative; background: #fff; transition: all 0.12s;
}
.mm-link-tab.is-active .mm-link-tab__radio {
  border-color: var(--editor-accent);
  background: var(--editor-accent);
}
.mm-link-tab.is-active .mm-link-tab__radio::after {
  content: ''; position: absolute; inset: 4px;
  background: #fff; border-radius: 50%;
}
.mm-link-tab.is-active { font-weight: 400; }
.mm-link-panel__content { flex: 1; padding: 18px 22px; overflow-y: auto; }
.mm-link-section { margin-bottom: 14px; }
.mm-link-section__label { display: block; font-size: 13px; color: #000624; font-weight: 400; margin-bottom: 8px; }
.mm-link-divider { border: none; border-top: 1px solid #e8e8e8; margin: 16px 0; }
.mm-link-list { list-style: none; margin: 0; padding: 0; max-height: 280px; overflow-y: auto; }
.mm-link-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; cursor: pointer; border-radius: 4px;
  font-size: 13px; color: #000624; transition: background 0.12s;
}
.mm-link-row:hover { background: #f5f5f5; }
.mm-link-row.is-selected { background: rgba(17,109,255,0.08); }
.mm-link-row__radio {
  width: 16px; height: 16px; border: 1.5px solid #c0c0c0; border-radius: 50%;
  flex-shrink: 0; position: relative; background: #fff; transition: all 0.12s;
}
.mm-link-row__radio.is-checked { border-color: var(--editor-accent); background: var(--editor-accent); }
.mm-link-row__radio.is-checked::after {
  content: ''; position: absolute; inset: 4px;
  background: #fff; border-radius: 50%;
}
.mm-link-radio {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: #000624; cursor: pointer;
  padding: 6px 0;
}
.mm-link-radio input { accent-color: var(--editor-accent); }
.mm-link-panel__footer {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 20px; border-top: 1px solid #e8e8e8;
}
.mm-link-panel__footer-right { display: flex; gap: 8px; }

/* === Shared link picker (Text toolbar + Manage Menu) — radio-list layout
 * matching the Wix screenshot: kinds on the left, contextual on the right.
 * Reuses the existing `.mm-link-panel` shell + footer. */
.mm-link-panel--radio { width: 580px; max-height: 560px; }
.mm-link-panel__head-actions { display: flex; align-items: center; gap: 8px; }
.mm-link-help {
  width: 28px; height: 28px; border-radius: 50%;
  border: none; background: transparent; cursor: pointer;
  font-size: 14px; color: var(--panel-text-secondary, #3b3d4d);
  font-weight: 400;
}
.mm-link-help:hover { background: #f5f5f5; }
.mm-link-panel__body--split { display: flex; flex: 1; min-height: 360px; }
.mm-link-radios {
  list-style: none; margin: 0; padding: 16px 12px;
  border-right: 1px solid #e8e8e8;
  width: 190px; flex-shrink: 0;
  display: flex; flex-direction: column; gap: 2px;
}
.mm-link-radio-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 8px; cursor: pointer;
  font-size: 14px; color: #000624;
  border-radius: 4px; transition: background 0.12s;
}
.mm-link-radio-row:hover { background: #f5f5f5; }
.mm-link-radio-row.is-selected { color: var(--editor-accent); font-weight: 400; }
.mm-link-radio-dot {
  width: 18px; height: 18px; border: 1.5px solid #c0c0c0; border-radius: 50%;
  flex-shrink: 0; position: relative; background: #fff; transition: all 0.12s;
}
.mm-link-radio-dot.is-checked { border-color: var(--editor-accent); background: var(--editor-accent); }
.mm-link-radio-dot.is-checked::after {
  content: ''; position: absolute; inset: 4px;
  background: #fff; border-radius: 50%;
}
.mm-link-content { flex: 1; padding: 18px 22px; overflow-y: auto; }
.mm-link-content__section { margin-bottom: 18px; }
.mm-link-content__section:last-child { margin-bottom: 0; }
.mm-link-content__label {
  display: block; font-size: 13px; color: #000624;
  margin-bottom: 8px; font-weight: 400;
}
.mm-link-content__note {
  margin: 0; font-size: 13px; line-height: 1.5;
  color: #5f6168;
}
.mm-link-select, .mm-link-input {
  width: 100%; height: 36px; padding: 0 12px;
  border: 1px solid #e0e0e0; border-radius: 4px;
  font-size: 13px; color: #000624; background: #fff;
  font-family: inherit;
  outline: none;
  transition: border-color 0.12s;
}
.mm-link-select:focus, .mm-link-input:focus { border-color: var(--editor-accent); }
.mm-link-target-radio {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: #000624;
  padding: 6px 0; cursor: pointer;
}
.mm-link-target-radio input { accent-color: var(--editor-accent); }

/* Add Item dropdown (Site pages / Link / Dropdown) */
.mm-add-dropdown {
  position: fixed; min-width: 200px; z-index: 10001;
  background: #fff; border: 1px solid #e0e0e0; border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  padding: 4px; display: flex; flex-direction: column;
}
.mm-add-dropdown__item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border: none; background: transparent;
  font-size: 13px; color: #000624; font-weight: 400;
  text-align: left; cursor: pointer; border-radius: 4px;
  font-family: inherit;
}
.mm-add-dropdown__item:hover { background: #f5f5f5; }
.mm-add-dropdown__item svg { color: #3b3d4d; flex-shrink: 0; }

/* === Add Site Pages side panel === */
.mm-pages-panel {
  position: fixed; top: 80px; left: 80px; width: 288px;
  background: #fff; border: 1px solid #e0e0e0; border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  z-index: 10000; display: flex; flex-direction: column;
  max-height: 540px; font-family: var(--font-sans);
}
.mm-pages-panel__header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid #e8e8e8;
  user-select: none; cursor: move;
}
.mm-pages-panel__header:active { cursor: grabbing; }
.mm-pages-panel__title { font-size: 14px; font-weight: 400; color: #000624; }
.mm-pages-panel__body { flex: 1; overflow-y: auto; }
.mm-pages-accordion { padding: 0; }
.mm-pages-accordion__header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; cursor: pointer; user-select: none;
  background: #f0f1f5; transition: background 0.12s;
}
.mm-pages-accordion__header:hover { background: #e8e9ee; }
.mm-pages-accordion__title { font-size: 13px; color: #000624; font-weight: 400; }
.mm-pages-accordion__caret { color: #000624; transition: transform 0.15s; }
.mm-pages-accordion.is-collapsed .mm-pages-accordion__caret { transform: rotate(-90deg); }
.mm-pages-accordion.is-collapsed .mm-pages-list { display: none; }
.mm-pages-list { list-style: none; margin: 0; padding: 4px 0; }
.mm-pages-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 16px; cursor: pointer;
  font-size: 13px; color: #000624; font-weight: 400;
  transition: background 0.12s;
}
.mm-pages-item:hover { background: #f5f5f5; }
.mm-pages-item--added { cursor: not-allowed; opacity: 0.55; }
.mm-pages-item--added:hover { background: transparent; }
.mm-pages-item__check {
  width: 16px; height: 16px; border: 1.5px solid #c0c0c0; border-radius: 3px;
  display: flex; align-items: center; justify-content: center;
  background: #fff; color: #fff; flex-shrink: 0;
  transition: all 0.12s;
}
.mm-pages-item__check.is-checked { background: var(--editor-accent); border-color: var(--editor-accent); }
.mm-pages-item__label { flex: 1; }
.mm-pages-item__badge { font-size: 11px; color: #7a7d8c; font-weight: 400; }
.mm-pages-empty { padding: 16px; color: #7a7d8c; font-size: 13px; }
.mm-pages-panel__footer {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 12px 16px; border-top: 1px solid #e8e8e8;
}
.mm-pages-btn {
  padding: 7px 16px; border-radius: 18px; font-size: 13px; font-weight: 400;
  border: 1px solid transparent; cursor: pointer; font-family: inherit;
  transition: all 0.12s;
}
.mm-pages-btn--secondary { background: #fff; border-color: #d0d0d0; color: #000624; }
.mm-pages-btn--secondary:hover { background: #f5f5f5; }
.mm-pages-btn--primary { background: var(--editor-accent); color: #fff; }
.mm-pages-btn--primary:hover { opacity: 0.9; }
.mm-pages-btn--primary.is-disabled,
.mm-pages-btn--primary[disabled] { opacity: 0.4; cursor: not-allowed; }

/* === Site Menus panel (Manage Site Menus) === */
.mm-sites-panel {
  position: fixed; top: 80px; left: 80px; width: 280px;
  background: #fff; border: 1px solid #e0e0e0; border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  z-index: 10000; display: flex; flex-direction: column;
  max-height: 480px; font-family: var(--font-sans);
}
.mm-sites-panel__header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid #e8e8e8;
}
.mm-sites-panel__title { font-size: 14px; font-weight: 400; color: #000624; }
.mm-sites-panel__intro { padding: 12px 16px; font-size: 12px; color: #3b3d4d; line-height: 1.5; border-bottom: 1px solid #f0f0f0; }
.mm-sites-list { list-style: none; margin: 0; padding: 6px 0; flex: 1; overflow-y: auto; }
.mm-sites-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; cursor: pointer; transition: background 0.12s;
  font-size: 13px; color: #000624; font-weight: 400;
}
.mm-sites-item:hover { background: #f5f5f5; }
.mm-sites-item.is-selected { background: rgba(17,109,255,0.08); }
.mm-sites-item__name { flex: 1; }
.mm-sites-item__more {
  background: none; border: none; padding: 4px; border-radius: 4px;
  cursor: pointer; color: #000624; opacity: 0; transition: opacity 0.12s;
}
.mm-sites-item:hover .mm-sites-item__more,
.mm-sites-item.is-selected .mm-sites-item__more { opacity: 1; }
.mm-sites-item__more:hover { background: #e8e8e8; }
.mm-sites-panel__footer {
  padding: 10px 16px; border-top: 1px solid #e8e8e8;
}
.mm-sites-add-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: none; cursor: pointer;
  font-size: 13px; color: var(--editor-accent); font-weight: 400;
  padding: 4px 0; font-family: inherit;
}
.mm-sites-add-btn:hover { text-decoration: underline; }

/* ===== Menu Layout Panel ===== */
.ml-panel {
  position: fixed; top: 120px; left: calc(50% - 156px);
  width: 312px; background: #fff;
  border: 1px solid #e0e0e0; border-radius: 8px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.14);
  /* Must clear the selected canvas-section z-index (2147481000) so the
   * panel never hides behind the very element it edits. */
  z-index: 2147483600; font-family: var(--font-sans);
  overflow: hidden;
}

/* ── Cart Settings panel (toolbar > Settings) ─────────────────────── */
/* Anchored to the right edge of the canvas area (just left of the
 * inspector panel) so it sits beside the element being edited, never
 * over it. User can drag it freely from the header. */
.cs-cart-panel {
  position: fixed; top: 96px; right: 340px;
  width: 460px; background: #fff;
  border: 1px solid #e5e5e8;
  box-shadow: 0 8px 28px rgba(0,0,0,0.16);
  z-index: 2147483600; font-family: var(--font-sans);
  overflow: hidden;
}
/* Two-column shell: nav on left, content on right (matches Wix layout). */
.cs-cart-panel__shell { display: flex; min-height: 420px; max-height: 600px; }
.cs-cart-panel__nav {
  width: 130px; background: #FAFBFC; border-right: 1px solid #ececec;
  display: flex; flex-direction: column; padding: 10px 0; flex-shrink: 0;
}
.cs-cart-panel__nav-item {
  background: transparent; border: 0; cursor: pointer;
  text-align: left; font-family: inherit; font-size: 13px;
  padding: 9px 18px; color: #4a4e6b;
  transition: background 0.12s, color 0.12s;
}
.cs-cart-panel__nav-item:hover { background: #f3f4f7; color: #0a0a0b; }
.cs-cart-panel__nav-item.is-active {
  background: #EAF7FF; color: #116DFF; font-weight: 500;
}
.cs-cart-panel__nav-sep { flex: 1; }
.cs-cart-panel__nav-upgrade {
  background: transparent; border: 0; cursor: pointer;
  text-align: left; font-family: inherit; font-size: 13px;
  padding: 9px 18px; margin: 10px 0; color: #5B3DF5; font-weight: 500;
}
.cs-cart-panel__nav-upgrade:hover { background: rgba(91, 61, 245, 0.08); }
/* Override the original single-pane body. */
.cs-cart-panel__body { padding: 18px; overflow-y: auto; flex: 1; }
.cs-cart-panel__header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid #ececec;
  cursor: move; background: #fff; user-select: none;
}
.cs-cart-panel__title { font-size: 14px; font-weight: 500; color: #0a0a0b; }
.cs-cart-panel__close {
  background: transparent; border: 0; cursor: pointer;
  font-size: 20px; color: #868aa5; padding: 0 6px; line-height: 1;
}
.cs-cart-panel__close:hover { color: #0a0a0b; }
.cs-cart-panel__body { padding: 16px; max-height: 540px; overflow-y: auto; }
.cs-cart-panel__label {
  font-size: 12px; font-weight: 500; color: #4a4e6b;
  margin-bottom: 10px; text-transform: uppercase; letter-spacing: 0.04em;
}
.cs-cart-panel__grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px;
}
.cs-cart-panel__icon {
  background: #EAF7FF; border: 0; cursor: pointer;
  height: 64px; padding: 8px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.12s;
}
.cs-cart-panel__icon:hover { background: #D3EDFF; }
.cs-cart-panel__icon.is-selected { background: #116DFF; }
/* Icon SVG: max-content sized so it never blows past the tile. Wix uses
 * a 24-28px target height — width follows the SVG's own aspect ratio. */
.cs-cart-panel__icon-svg {
  max-height: 28px; max-width: 80%;
  width: auto; height: 28px;
  display: block; flex-shrink: 0;
}
.cs-cart-panel__divider {
  height: 1px; background: #ececec; margin: 18px -16px;
}
.cs-cart-panel__section-title {
  font-size: 13px; font-weight: 500; color: #0a0a0b;
  margin-bottom: 12px; text-align: center;
}
.cs-cart-panel__row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 0; gap: 12px;
}
.cs-cart-panel__row-label { font-size: 13px; color: #4a4e6b; }
.cs-cart-panel__color {
  width: 32px; height: 32px; border: 1px solid #d8dbe6;
  cursor: pointer; padding: 0; background: transparent;
}
.cs-cart-panel__num {
  width: 80px; padding: 6px 8px; font-family: inherit; font-size: 13px;
  border: 1px solid #d8dbe6; outline: none; color: #0a0a0b;
}
.cs-cart-panel__num:focus { border-color: #116DFF; }
/* Toggle switch */
.cs-cart-panel__switch {
  position: relative; display: inline-block; width: 36px; height: 20px;
  cursor: pointer; flex-shrink: 0;
}
.cs-cart-panel__switch input { opacity: 0; width: 0; height: 0; }
.cs-cart-panel__switch span {
  position: absolute; inset: 0; background: #d8dbe6;
  border-radius: 10px; transition: background 0.15s;
}
.cs-cart-panel__switch span::before {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; background: #fff; border-radius: 50%;
  transition: transform 0.15s;
}
.cs-cart-panel__switch input:checked + span { background: #116DFF; }
.cs-cart-panel__switch input:checked + span::before { transform: translateX(16px); }
/* Segmented control (Position / Size preset) */
.cs-cart-panel__seg {
  display: flex; border: 1px solid #d8dbe6; overflow: hidden; margin-bottom: 14px;
}
.cs-cart-panel__seg-btn {
  flex: 1; background: #fff; border: 0; cursor: pointer;
  font-family: inherit; font-size: 13px; padding: 8px 12px; color: #4a4e6b;
  transition: background 0.12s, color 0.12s;
  border-right: 1px solid #d8dbe6;
}
.cs-cart-panel__seg-btn:last-child { border-right: 0; }
.cs-cart-panel__seg-btn:hover { background: #f3f4f7; }
.cs-cart-panel__seg-btn.is-active { background: #116DFF; color: #fff; }
/* Manage tab placeholder */
.cs-cart-panel__manage-empty {
  text-align: center; padding: 40px 20px;
}
.cs-cart-panel__manage-title { font-size: 16px; font-weight: 500; color: #0a0a0b; margin-bottom: 8px; }
.cs-cart-panel__manage-desc { font-size: 13px; color: #4a4e6b; margin-bottom: 18px; line-height: 1.5; }
.cs-cart-panel__manage-btn {
  background: #116DFF; color: #fff; border: 0; cursor: pointer;
  font-family: inherit; font-size: 14px; padding: 10px 24px;
  font-weight: 500;
}
.cs-cart-panel__manage-btn:hover { background: #0e5dd6; }
.ml-panel__header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid #e8e8e8;
  cursor: move; background: #fff; user-select: none;
}
.ml-panel__header:active { cursor: grabbing; }
.ml-panel__title { font-size: 14px; font-weight: 400; color: #000624; }
.ml-panel__close {
  background: none; border: none; cursor: pointer; padding: 4px;
  font-size: 16px; color: #3b3d4d; line-height: 1; border-radius: 4px;
}
.ml-panel__close:hover { background: #f0f0f0; color: #000624; }
.ml-panel__body { padding: 4px 0 8px; max-height: 70vh; overflow-y: auto; color: #000624; }
.ml-section { padding: 14px 16px; border-bottom: 1px solid #DFE5EB; }
.ml-section:last-child { border-bottom: none; }
.ml-section--row { display: flex; align-items: center; justify-content: space-between; }
.ml-section__label { font-size: 14px; font-weight: 400; color: #131720; margin-bottom: 10px; }
.ml-section--row .ml-section__label { margin-bottom: 0; }
.ml-divider { display: none; }
/* Thumbnail cards (Menu type / Direction) */
.ml-thumbs { display: flex; gap: 10px; }
.ml-thumb {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px;
  border: 1.5px solid #d0d0d0; border-radius: 6px; padding: 6px 4px;
  cursor: pointer; background: #fff; outline: none;
  transition: border-color 0.12s;
}
.ml-thumb:hover { border-color: #a0a0a0; }
.ml-thumb--selected { border-color: var(--editor-accent); background: rgba(17,109,255,0.04); }
.ml-thumb__img { display: flex; align-items: center; justify-content: center; width: 100%; overflow: hidden; }
.ml-thumb__img svg { max-width: 100%; height: auto; }
.ml-thumb__label { font-size: 12px; color: #131720; text-align: center; font-weight: 400; }
.ml-thumb--selected .ml-thumb__label { color: var(--editor-accent); }
/* 2-col number inputs with icon prefix */
.ml-inputs2 { display: grid; grid-template-columns: 100px 100px; gap: 12px; }
.ml-num-field {
  display: flex; align-items: center; gap: 8px;
  border: 1px solid #c5cad2; border-radius: 4px;
  padding: 0 12px; height: 36px; background: #fff;
  transition: border-color 0.12s;
}
.ml-num-field:hover { border-color: #131720; }
.ml-num-field:focus-within { border-color: #5B3DF5; box-shadow: 0 0 0 2px rgba(17,109,255,0.2); }
.ml-num-field__icon { display: inline-flex; align-items: center; color: #131720; flex-shrink: 0; }
.ml-num-field__input { flex: 1; min-width: 0; border: none; outline: none; background: transparent; font-size: 14px; font-weight: 400; font-family: var(--font-sans); color: #131720; padding: 0; }
.ml-num-field__input::-webkit-outer-spin-button,
.ml-num-field__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.ml-num-field__unit { font-size: 14px; color: #868aa5; flex-shrink: 0; font-weight: 400; }
/* Alignment square thumbnail cards */
.ml-aligns { display: flex; gap: 6px; }
.ml-thumb--sq {
  width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
  border: 1.5px solid #d0d0d0; border-radius: 4px;
  background: #fff; cursor: pointer;
  transition: border-color 0.12s;
}
.ml-thumb--sq:hover { border-color: #a0a0a0; }
.ml-thumb--sq.ml-thumb--selected { border-color: var(--editor-accent); background: rgba(17,109,255,0.06); }

/* Smart drag guides */
/* Outranks .canvas-section.is-selected (2147481000) so the pink centering
 * crosshair + smart-guide lines stay visible above the element being
 * dragged — otherwise a freshly-added Container that grabs the selected
 * stacking lift sits on top of the guide layer. */
#canvas-guides { position: fixed; inset: 0; pointer-events: none; z-index: 2147482500; }
.canvas-guide { position: fixed; pointer-events: none; }
.canvas-guide--v { width: 1px; background: #ff4d87; box-shadow: 0 0 0 0.5px rgba(255,77,135,0.4); }
.canvas-guide--h { height: 1px; background: #ff4d87; box-shadow: 0 0 0 0.5px rgba(255,77,135,0.4); }
.canvas-guide-plus {
  position: fixed; width: 10px; height: 10px; transform: translate(-50%, -50%);
  pointer-events: none;
}
.canvas-guide-plus::before, .canvas-guide-plus::after {
  content: ''; position: absolute; background: #ff4d87;
}
.canvas-guide-plus::before { left: 50%; top: 0; bottom: 0; width: 1px; transform: translateX(-50%); }
.canvas-guide-plus::after { top: 50%; left: 0; right: 0; height: 1px; transform: translateY(-50%); }

/* Green measurement lines (element → parent edges) */
.canvas-measure { position: fixed; pointer-events: none; }
.canvas-measure--v { width: 0; border-left: 1px dashed #22c55e; }
.canvas-measure--h { height: 0; border-top: 1px dashed #22c55e; }
.canvas-measure-cap {
  position: fixed; background: #22c55e; pointer-events: none;
  transform: translate(-50%, -50%);
}
.canvas-measure-cap--v { width: 8px; height: 1px; }
.canvas-measure-cap--h { width: 1px; height: 8px; }
.canvas-measure-label {
  position: fixed; transform: translate(-50%, -50%);
  background: #22c55e; color: #fff; font-size: 11px; font-weight: 400;
  padding: 2px 6px; border-radius: 3px; font-family: var(--font-sans);
  white-space: nowrap;
}
/* Docked edge → blue instead of green (the gap is an anchored margin). */
.canvas-measure--v.is-docked { border-left-color: #2563eb; }
.canvas-measure--h.is-docked { border-top-color: #2563eb; }
.canvas-measure-cap.is-docked { background: #2563eb; }
.canvas-measure-label.is-docked { background: #2563eb; }
.canvas-guide-badge {
  position: fixed; background: rgba(0,6,36,0.9); color: #fff;
  font-size: 11px; font-weight: 400; padding: 4px 8px; border-radius: 4px;
  font-family: var(--font-sans); white-space: nowrap; pointer-events: none;
}
.canvas-size-badge {
  position: fixed; background: rgba(0,6,36,0.9); color: #fff;
  font-size: 11px; font-weight: 400; padding: 3px 7px; border-radius: 3px;
  font-family: var(--font-sans); white-space: nowrap; pointer-events: none;
}

/* Inline text edit state — the canvas-section's own selection ring
 * already paints the editor-accent box around the element; a second
 * outline 2 px outside the glyph wrapper just doubles up. Keep only the
 * cursor + user-select hints. */
.cs-heading h1.is-editing, .cs-heading h2.is-editing, .cs-heading h3.is-editing, .cs-heading h4.is-editing, .cs-heading h5.is-editing, .cs-heading h6.is-editing,
.cs-paragraph.is-editing,
.cs-btn.is-editing {
  cursor: text;
  user-select: text;
  -webkit-user-select: text;
  /* Browsers paint a default 1-2 px focus outline on every focused
   * contenteditable. With the canvas already showing the section's
   * selection outline + bounding handles, the extra outline reads as
   * "a second box around the text" (user-reported 2026-06-28: "click
   * đúp edit text trong element text đang bị hiện thêm một bounding
   * box quanh chữ nữa, bỏ đi"). The selection state already conveys
   * editability so we drop the native outline. */
  outline: none !important;
  box-shadow: none !important;
}
.canvas-section.is-text-editing { cursor: text; }
.canvas-section.is-text-editing > .cs-resize-handle,
.canvas-section.is-text-editing > .cs-rotate-zone,
.canvas-section.is-text-editing > .canvas-section__toolbar,
.canvas-section.is-text-editing > .canvas-section__label { display: none !important; }

/* Image preview — element-level block. Width is fully controlled by inline
 * `width: <img_w><img_w_unit>` from the renderer. NO max-width cap here: a
 * legacy `max-width: 100%` clamped a stack-child image whose img_w was 125 %
 * (default 290 px in a 232 px stack) back down to the parent's width. */
.canvas-section[data-section-type="image"] { display: block; }
/* Move cursor only when the parent root section is active (selected). */
.canvas-section.is-section-active .canvas-section[data-section-type="image"],
.canvas-section.is-section-active .canvas-section[data-section-type="text"],
.canvas-section.is-section-active .canvas-section[data-section-type="paragraph"],
.canvas-section.is-section-active .canvas-section[data-section-type="heading"],
.canvas-section.is-section-active .canvas-section[data-section-type="title"],
.canvas-section.is-section-active .canvas-section[data-section-type="button"],
.canvas-section.is-section-active .canvas-section[data-section-type="menu"] {
  cursor: move;
}
/* Self-active (the child itself is selected) — also show move */
.canvas-section[data-section-type="image"].is-selected,
.canvas-section[data-section-type="text"].is-selected,
.canvas-section[data-section-type="paragraph"].is-selected,
.canvas-section[data-section-type="heading"].is-selected,
.canvas-section[data-section-type="title"].is-selected,
.canvas-section[data-section-type="button"].is-selected,
.canvas-section[data-section-type="menu"].is-selected { cursor: move; }
.cs-image { position: relative; overflow: hidden; }
/* Stretched image — simple "fill cs-section__inner" model.
 *   Wrapper W ← cs-section__inner − margin_left − margin_right
 *   cs-section__inner already honours `apply_max_width` (caps at 1600 px
 *   when ON, no cap when OFF), so the wrapper automatically inherits that
 *   behaviour. No escape math, no CSS vars, no DOM measurement.
 *   Image content (<img>) fills .cs-image via object-fit: cover. */
.canvas-section[data-section-type="image"] .cs-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  vertical-align: top;
}
/* STRETCHED image — fill-and-scale model.
 *
 * K = the design-baseline cover scale factor, stored as `--stretch-img-k`
 *     on .cs-image. K = max(1, natural_ratio × container_h_design /
 *     container_w_design). At the design baseline, K × container_w = the
 *     <img> width that exactly cover-fills the container (so the image
 *     fills section with no gap and no excess crop).
 *
 *   <img> width = K × 100% of .cs-image (= K × container W).
 *   <img> height = auto (natural ratio drives H = width / natural_ratio).
 *
 *   At W = W_design:
 *     img.W = K × W_design = container_h_design × natural_ratio
 *     img.H = img.W / natural_ratio = container_h_design
 *     → img fills container EXACTLY at design.
 *
 *   At W > W_design:
 *     img.W = K × W > K × W_design (image wider than design size)
 *     img.H = img.W / natural_ratio (proportional grow)
 *     → image bitmap SCALES UP uniformly. Visible region = container_w ×
 *       container_h (centered, overflow clipped). The horizontal portion
 *       of the SOURCE image visible stays constant — exactly the user's
 *       expectation. */
.canvas-section[data-img-stretch="1"] .cs-image {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  /* Establish a positioning context so the absolutely-positioned <img>
   * below is measured against the wrapper, NOT the section. */
  position: relative;
}
.canvas-section[data-img-stretch="1"] .cs-image > img {
  /* CRITICAL — break the K feedback loop. The stretched <img> is sized
   * `width: K×100%; height: auto`, so its rendered height = K × wrapperW /
   * natural_ratio. If it participated in NORMAL flow, that height would
   * contribute to the wrapper's own content height. When the wrapper's H is
   * not definite (e.g. a dock top+bottom image inside a cell whose height
   * resolves to `auto` in the preview environment), wrapperH follows imgH,
   * and syncStretchedImageK reads that inflated wrapperH back into K →
   * imgH grows → wrapperH grows → K grows. Log showed h ratcheting
   * 4.3M → 6.5M px, K = 11014 (user 2026-07-09 "loop vĩnh viễn, H cứ tăng").
   *
   * position:absolute + centering removes the <img> from flow entirely:
   * it can never push the wrapper taller, so the wrapper's H stays purely
   * from its own box (anchor pair / cell height) and the loop is cut at the
   * source regardless of how the surrounding layout resolves. */
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: calc(var(--stretch-img-k, 1) * 100%) !important;
  height: auto !important;
  min-width: 0;
  max-width: none;
  max-height: none;
  object-fit: initial !important;
  flex-shrink: 0;
  display: block;
}
/* Full-bleed image sits BEHIND cs-section__inner in DOM order so the
 * normal content paints on top. But that means empty regions of
 * cs-section__inner — which span the section's full width when
 * apply_max_width caps it at 1600 px — would swallow clicks meant for
 * the image behind. Make cs-section__inner pointer-transparent and
 * re-enable each canvas-section descendant explicitly so children
 * (text, button, …) stay clickable. */
.cs-section__inner { pointer-events: none; }
.cs-section__inner .canvas-section,
.cs-section__inner .cs-stack-gap-hl,
/* NOTE: .canvas-section__pad-hover-hl was here but is REMOVED — it's an
 * inset:0 overlay highlight (base pointer-events:none). Re-enabling it made it
 * cover the whole element and swallow hover, so its own mouseover-driven
 * rebuild flashed the tint on/off (user 2026-07-08 "hover padding Stack nháy
 * bg"). It never needs pointer-events; leave its base none. */
/* Grid children need clicks — EXCEPT the add-track buttons. Those span a whole
 * column/row (grid-column: ci/ci+1) so their box covers the full cell; their
 * base rule sets pointer-events:none precisely so only the narrow ::after
 * hit-zone + the "+" disc are interactive. This higher-specificity selector was
 * re-enabling the whole button box, so it covered cell 1 and swallowed its
 * click/hover ("Add column" everywhere, cell un-selectable, bg flicker — user
 * 2026-07-08). Exclude add-track so its base none stands. Cells stay clickable
 * via the .canvas-section rule above. */
.cs-section__inner .cs-section-grid > *:not(.cs-grid-add-track) { pointer-events: auto; }
/* `.canvas-section__pad-hl` deliberately stays at `pointer-events: none`
 * (set in its base rule) — the overlay div is full-size (`inset: 0`),
 * so re-enabling it here would have it swallow clicks across the
 * entire content area. The interactive bands (`> span.pad-t/-b/-l/-r`)
 * and drag bars carry their own `pointer-events: auto` so hover and
 * drag still work. User-reported 2026-06-27: "không click được Stack
 * trên canvas" — Element-from-point at Stack centre returned the
 * pad-hl overlay because of the now-removed selector here. */

/* Resize handles for image */
.cs-resize-handle {
  position: absolute;
  width: 8px;
  height: 8px;
  /* box-sizing: border-box keeps the border inside the 8-px box so the
   * total footprint stays 8×8 and the offset math (-4px, margin -4px)
   * lands centres exactly on the element edge/corner. Without this the
   * default content-box added 2 px to each dimension, making corners
   * sit 1 px inside the corner and edges 1 px offset horizontally
   * (user 2026-07-06 "8 hình tròn resize vẫn chưa nằm đúng vị trí"). */
  box-sizing: border-box;
  background: #fff;
  border: 1px solid var(--editor-accent, #5B3DF5);
  border-radius: 50%;
  z-index: 11;
  display: none;
}
.canvas-section.is-selected > .cs-resize-handle { display: block; }
/* Centres of the handles sit on the 2px selection outline (drawn by ::after
   at inset 0). The outline runs y=0..2 from the box's inside edge, so we
   shift handles 1px inward from the previous -5px so the dot's centre
   lands exactly on the outline's middle. */
/* Symmetric offset: handle size 8, offset -4 → box centred exactly ON
 * the element edge (half in, half out). Same for corners and edges so
 * every dot centre lands on the same outline line (user 2026-07-06
 * "hình tròn ở các góc vẫn chưa thẳng hàng so với hình tròn ở các
 * cạnh"). Old asymmetric -3 / margin -4 shifted corners 1 px inward
 * while edges sat 1 px inward too — arithmetic-equal, but the mixed
 * `top/left` vs `margin` roundings didn't render pixel-identical. */
.cs-resize-handle--nw { top: -4px; left: -4px; cursor: nw-resize; }
.cs-resize-handle--n  { top: -4px; left: 50%; margin-left: -4px; cursor: n-resize; }
.cs-resize-handle--ne { top: -4px; right: -4px; cursor: ne-resize; }
.cs-resize-handle--w  { top: 50%; margin-top: -4px; left: -4px; cursor: w-resize; }
.cs-resize-handle--e  { top: 50%; margin-top: -4px; right: -4px; cursor: e-resize; }
.cs-resize-handle--sw { bottom: -4px; left: -4px; cursor: sw-resize; }
.cs-resize-handle--s  { bottom: -4px; left: 50%; margin-left: -4px; cursor: s-resize; }
.cs-resize-handle--se { bottom: -4px; right: -4px; cursor: se-resize; }

/* Section edge bands — full-width strips at top and bottom of root sections.
 * Hidden by default (so neighbouring sections' edges never overlap a
 * non-selected section's seam); shown only when the section is selected. */
.cs-resize-edge {
  position: absolute;
  left: 0;
  right: 0;
  height: 6px;
  z-index: 4;
  cursor: row-resize;
  background: transparent;
  display: none;
}
.cs-resize-edge--n { top: -3px; }
.cs-resize-edge--s { bottom: -3px; }
.canvas-section.is-selected > .cs-resize-edge {
  display: block;
}

/* Rotate zones — invisible areas just outside each corner handle.
   When the mouse is in this zone (outside the resize dot), cursor becomes rotate. */
.cs-rotate-zone {
  position: absolute;
  width: 20px;
  height: 20px;
  z-index: 4; /* below resize handles (z:5) so resize dot takes priority */
  display: none;
  /* Rotate cursor SVG */
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 4v6h6'/%3E%3Cpath d='M3.51 15a9 9 0 1 0 2.13-9.36L1 10'/%3E%3C/svg%3E") 11 11, crosshair;
}
.canvas-section.is-selected > .cs-rotate-zone { display: block; }
.cs-rotate-zone--nw { top: -14px; left: -14px; }
.cs-rotate-zone--ne { top: -14px; right: -14px; }
.cs-rotate-zone--sw { bottom: -14px; left: -14px; }
.cs-rotate-zone--se { bottom: -14px; right: -14px; }

.cs-image img { width: 100%; height: 100%; object-fit: cover; display: block; vertical-align: top; }
/* Wrapper controls H via aspect-ratio + height:auto (see applyCanvasSectionStyles
 * scale-auto branch). .cs-image and <img> always fill 100% — never height:auto —
 * so a manual H drag that rewrites img_ratio actually shows the new proportion
 * instead of leaving dead space below an intrinsic-ratio <img>. */
.cs-image { line-height: 0; font-size: 0; }
.canvas-section[data-section-type="image"] { line-height: 0; font-size: 0; }
.cs-image__placeholder {
  background: #f0f0f0;
  border: 2px dashed #ccc;
  min-width: 120px;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  font-size: 13px;
}
/* VideoBox — fills its wrapper, clips to the box. video/iframe cover by default
 * (buildVideoFilterStyle sets object-fit). line-height:0 kills the inline gap. */
.cs-video { position: relative; overflow: hidden; width: 100%; height: 100%; line-height: 0; font-size: 0; }
.canvas-section[data-section-type="video"] { line-height: 0; font-size: 0; }
.cs-video > video, .cs-video > iframe { display: block; width: 100%; height: 100%; }
.cs-video__placeholder { min-width: 120px; min-height: 80px; }

/* Button preview */
/* When a button section is selected/sized in the builder, the user-set
   width/height lives on the outer .canvas-section. We want every layer
   between that outer box and the actual visible .cs-btn to fill 100%
   so the hitbox matches the visible button — no invisible padding ring. */
.canvas-section[data-section-type="button"] { display: inline-block; }
.canvas-section[data-section-type="button"] > .canvas-section__content { width: 100%; height: 100%; }
.canvas-section[data-section-type="image"] > .canvas-section__content { width: 100%; height: 100%; overflow: hidden; }
/* Basic Shape: mirror Image's __content sizing so the inner
 * `.cs-basic-shape` (width:100%; height:100%) resolves to definite
 * dimensions. Without this rule, height:100% collapses to 0 because
 * the parent's height was auto → the black square/mask painted at
 * 0×0 and the user saw nothing (user 2026-07-05 "trên canvas shape
 * vẫn không hiển thị"). */
.canvas-section[data-section-type="basic-shape"] > .canvas-section__content { width: 100%; height: 100%; }
/* Menu Hamburger mode: same reasoning — the `.cs-menu-hamburger` flex
 * box needs a definite parent height to centre the 40×30 SVG on the
 * middle of the 40×40 wrapper. Without this, __content was auto-sized
 * to the SVG's 30px height and align-items:center had nothing to
 * centre against, so the icon stuck to the top of the wrapper (user
 * 2026-07-05 "3 gạch của hamburger đang không nằm đúng center"). */
.canvas-section[data-section-type="menu"] > .canvas-section__content { width: 100%; height: 100%; }

/* Menu hamburger dual-emit toggles (preview + published). compileSection
 * emits both variants side-by-side when _bp.<layer>.menu_layout_type is
 * 'hamburger'; `data-menu-hb` on the wrapper lists the BPs where
 * hamburger wins. Static rules toggle visibility per BP so the correct
 * variant paints without inline <style> (which SanitizeBuilderHTML
 * strips from compiled_html — see memory sanitizer-strips-style).
 *
 * `!important` because both variants emit inline `display:flex` for
 * their own layout (nav is a flex row, hamburger div centres the SVG),
 * and inline styles beat class/attribute selectors without it. Using
 * `flex` (not `block`) for the on-state so the variants keep their
 * flex layout when visible. */
[data-menu-slot] > [data-menu-variant="regular"]   { display: flex !important; }
[data-menu-slot] > [data-menu-variant="hamburger"] { display: none !important; }
[data-menu-hb~="desktop"] > [data-menu-variant="regular"]   { display: none !important; }
[data-menu-hb~="desktop"] > [data-menu-variant="hamburger"] { display: flex !important; }
@media(max-width:1000px) {
  [data-menu-hb~="tablet"] > [data-menu-variant="regular"]   { display: none !important; }
  [data-menu-hb~="tablet"] > [data-menu-variant="hamburger"] { display: flex !important; }
}
@media(max-width:750px) {
  [data-menu-hb~="mobile"] > [data-menu-variant="regular"]   { display: none !important; }
  [data-menu-hb~="mobile"] > [data-menu-variant="hamburger"] { display: flex !important; }
}
/* Preview runtime mode — editor.js loaded inside the preview iframe to
 * render canvas-style. Hide all editor chrome decorations that
 * renderCanvas emits (labels / toolbars / breadcrumbs / resize handles
 * / rotate zones / corner-add buttons / dock lines / anchor lines /
 * selection outlines). The published site's <a>/<h1>/<button> etc.
 * remain visible; only the editor overlays go away. */
body.vendr-preview-runtime .canvas-section__label,
body.vendr-preview-runtime .canvas-section__toolbar,
body.vendr-preview-runtime .canvas-section__bc,
body.vendr-preview-runtime .canvas-section__bc-anim,
body.vendr-preview-runtime .canvas-section__corner-add,
body.vendr-preview-runtime .canvas-section__pad-hl,
body.vendr-preview-runtime .canvas-section__pad-hover-hl,
body.vendr-preview-runtime .cs-resize-handle,
body.vendr-preview-runtime .cs-resize-edge,
body.vendr-preview-runtime .cs-rotate-zone,
body.vendr-preview-runtime .cs-stack-gap-hl,
body.vendr-preview-runtime .editor-canvas__resize-handle,
body.vendr-preview-runtime .editor-canvas__vp-label,
body.vendr-preview-runtime .canvas-add-divider,
body.vendr-preview-runtime .canvas-section-plus,
body.vendr-preview-runtime .editor-canvas__empty,
body.vendr-preview-runtime .editor-canvas__empty-cta,
body.vendr-preview-runtime .editor-canvas__range-guide,
body.vendr-preview-runtime .add-section-menu,
/* Grid track "+"/resize buttons span the WHOLE grid (1774×514) with
 * cursor:pointer — in preview they covered every section, made the cursor
 * look permanently hoverable and swallowed link clicks (user 2026-07-10
 * "chuột chỗ nào cũng ở trạng thái hover nút"). They're a builder-only
 * affordance; hide them entirely in preview. */
body.vendr-preview-runtime .cs-grid-add-track,
body.vendr-preview-runtime .cs-cell-gutter,
body.vendr-preview-runtime #add-section-menu { display: none !important; }
body.vendr-preview-runtime .canvas-section::before,
body.vendr-preview-runtime .canvas-section::after { display: none !important; }
body.vendr-preview-runtime .canvas-section.is-selected::after,
body.vendr-preview-runtime .canvas-section.is-hover::after { display: none !important; }
/* Preview is a real browsable page: every link + interactive control must
 * receive clicks. The editor sets `.cs-section__inner { pointer-events:none }`
 * (so clicks fall through to a full-bleed image behind the content) and only
 * re-enables grid children — a menu <a> inside a header/nav isn't a grid child
 * so its click was swallowed (user 2026-07-10 "bấm vào không có gì xảy ra").
 * In preview, force the inner content + all links/buttons back to interactive. */
body.vendr-preview-runtime .cs-section__inner { pointer-events: auto !important; }
body.vendr-preview-runtime a[href],
body.vendr-preview-runtime button,
body.vendr-preview-runtime .cs-menu a,
body.vendr-preview-runtime nav a,
body.vendr-preview-runtime .cs-btn,
body.vendr-preview-runtime .cs-cart { pointer-events: auto !important; cursor: pointer; }
/* LIVE / PUBLISHED site (/{token}/… served by SiteHandler) reuses editor.css
 * for the .cs-* runtime classes but does NOT carry `body.vendr-preview-runtime`
 * (that flag is only set inside the preview iframe wrapper). Without it, the
 * editor's `.cs-section__inner { pointer-events:none }` rule stayed in force and
 * every menu <a>/button inside a header/nav was un-clickable AFTER navigating
 * to a dynamic page like /category/... (user 2026-07-10 "bấm menu để điều trang
 * thì không bấm được nút"). Scope the SAME re-enable to `.vendr-page`, which
 * wraps every live/published page but is absent in the editor canvas
 * (`.editor-canvas`) — so the builder's click-through behaviour is unchanged. */
.vendr-page .cs-section__inner { pointer-events: auto !important; }
.vendr-page a[href],
.vendr-page button,
.vendr-page .cs-menu a,
.vendr-page nav a,
.vendr-page .cs-btn,
.vendr-page .cs-cart { pointer-events: auto !important; cursor: pointer; }
/* Preview is a real page, not the editor: the canvas-section wrappers must NOT
 * show the editor's move/grab cursor everywhere (user 2026-07-10 "chuột lúc
 * nào cũng ở bàn tay") and must NOT eat clicks meant for the link/content
 * underneath. Reset every editor wrapper to the default cursor + let clicks
 * pass through to real content; links/buttons above re-assert pointer. */
body.vendr-preview-runtime .canvas-section,
body.vendr-preview-runtime .canvas-section__content,
body.vendr-preview-runtime .cs-section,
body.vendr-preview-runtime .cs-header,
body.vendr-preview-runtime .cs-footer,
body.vendr-preview-runtime .cs-container,
body.vendr-preview-runtime .cs-card,
body.vendr-preview-runtime .cs-cell,
body.vendr-preview-runtime .cs-stack { cursor: default !important; }
/* Preview canvas fills the iframe. Override editor.css's shell lock
 * (`html, body { height:100%; overflow:hidden }`) so the page scrolls
 * when content exceeds the iframe height (user 2026-07-06 "preview
 * không scroll được hết nội dung"). Memory: editor-css-locks-body. */
/* Preview scroll: only the ROOT (html) scrolls. Giving BOTH html and body
   overflow-y:auto produced TWO scrollbars once the page grew taller than the
   viewport (user 2026-07-09 "có tận 2 thanh scroll"). Body is overflow:visible
   so its content flows up into the single html scroller. */
html:has(body.vendr-preview-runtime) { height: auto !important; overflow-y: auto !important; overflow-x: hidden !important; max-width: 100vw !important; width: 100% !important; }
body.vendr-preview-runtime { height: auto !important; min-height: 100% !important; overflow-y: visible !important; overflow-x: hidden !important; max-width: 100vw !important; width: 100% !important; }
body.vendr-preview-runtime, body.vendr-preview-runtime .editor-canvas,
body.vendr-preview-runtime .editor-canvas__page,
body.vendr-preview-runtime .editor-canvas__stage { padding: 0 !important; margin: 0 !important; background: #fff !important; height: auto !important; overflow-x: hidden !important; overflow-y: visible !important; max-width: 100vw !important; width: 100% !important; }
body.vendr-preview-runtime .editor-canvas__viewport { transform: none !important; width: 100% !important; max-width: 100vw !important; min-height: auto !important; height: auto !important; overflow-x: hidden !important; overflow-y: visible !important; box-shadow: none !important; }
body.vendr-preview-runtime .canvas-section { cursor: default !important; }
body.vendr-preview-runtime .canvas-section:hover { outline: none !important; }

/* Preview toolbar simulation — same swap keyed off body[data-vp] so
 * clicking a device button on a wide browser also flips the menu
 * (user 2026-07-06 "hamburgur đâu?"). Duplicated because the @media
 * rules above don't fire when the actual window is wider. */
body[data-vp="tablet"] [data-menu-hb~="tablet"] > [data-menu-variant="regular"]   { display: none !important; }
body[data-vp="tablet"] [data-menu-hb~="tablet"] > [data-menu-variant="hamburger"] { display: flex !important; }
body[data-vp="mobile"] [data-menu-hb~="tablet"] > [data-menu-variant="regular"]   { display: none !important; }
body[data-vp="mobile"] [data-menu-hb~="tablet"] > [data-menu-variant="hamburger"] { display: flex !important; }
body[data-vp="mobile"] [data-menu-hb~="mobile"] > [data-menu-variant="regular"]   { display: none !important; }
body[data-vp="mobile"] [data-menu-hb~="mobile"] > [data-menu-variant="hamburger"] { display: flex !important; }
/* Lines: stretch content layer so the inner .cs-line (width:100% / height:100%) fills the wrapper */
.canvas-section[data-section-type="hline"] > .canvas-section__content,
.canvas-section[data-section-type="vline"] > .canvas-section__content,
.canvas-section[data-section-type="line"] > .canvas-section__content { width: 100%; height: 100%; display: block; }
/* Cell: the content layer must fill the grid track so the inner .cs-cell
 * (the positioning context for child elements) is the cell's true size —
 * otherwise it collapses to content height and centering / absolute
 * placement of children is measured against a tiny box. */
.canvas-section[data-section-type="cell"] > .canvas-section__content { width: 100%; height: 100%; }
/* Button H is content-driven: font-size × line-height + padding + border.
 * `height: auto` lets .cs-btn's intrinsic size flow up through .cs-button
 * to the .canvas-section wrapper. User 2026-07-02 "H render = H content
 * + borders + padding". Wrapper needs `min-height:0` so a parent flex/
 * grid doesn't force a taller box. */
.cs-button { padding: 0; display: block; width: 100%; height: auto; min-height: 0; }
.cs-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: auto;
  min-height: 0;
  /* No default padding — the value comes ONLY from the button's stored
   * padding_* settings (emitted inline by buildButtonStyle). A CSS default
   * of 12/15 silently padded buttons that carry no padding in their JSON
   * (older buttons), so their rendered H didn't match the model
   * H = pad + max(height, text). Zero here means "no padding unless the
   * data says so" (user 2026-07-09 "button cũ chưa có padding trong json
   * nên nó vậy ... render padding 0"). */
  padding: 0;
  border-radius: 0;
  font-size: 14px;
  font-weight: 400;
  /* Line-height for "Automatic" line-spacing mode. Browser `normal` on
   * Helvetica/Aeonik ≈ 1.15 → 14 × 1.15 + 16 padding + 2 border = 34 px
   * button H, but the reference (Wix) resolves to 36 px. 1.3 → 14 ×
   * 1.3 ≈ 18 + 18 = 36 px, matching. Custom mode overrides via inline
   * `line-height` from buildButtonStyle. User 2026-07-02 "Automatic H
   * phải 36 chứ không phải 34". */
  line-height: 1.3;
  box-sizing: border-box;
  /* Wrap between WORDS but never inside a word. User 2026-06-28 wanted
   * "Start Now" to break to two lines when the button gets too narrow —
   * that's `white-space: normal` + `word-break: normal`. User 2026-07-02
   * saw the label break MID-word ("S / t / a / r / t") at bp=375 — that's
   * `overflow-wrap: anywhere` firing as a last resort when even one word
   * doesn't fit. Dropping to `overflow-wrap: normal` (default) means a
   * word that won't fit simply overflows the button instead of shattering
   * character-by-character; the neighbouring word still gets to break on
   * the whitespace.
   *
   * `text-align: center` matches buildButtonStyle's stated default ("emit
   * only when the user picked a non-default value"). Wrapped multi-line
   * labels ("Start" / "Now") stayed left-aligned before because
   * `text-align: inherit` picked up the default `left` from the section
   * cascade. User 2026-07-02 "alignment mặc định của text trong button
   * phải là ở giữa". Inspector-set value emits inline and wins. */
  white-space: normal;
  word-break: normal;
  overflow-wrap: normal;
  text-align: center;
  /* Baseline interactivity so buttons feel clickable even before the user
   * defines explicit hover_* settings. Custom hover styles (emitted as
   * scoped <style data-button-id=…> tags) use !important and still win. */
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease, transform 0.15s ease;
}
/* Default button styles only used when the inspector hasn't set bg/colour
 * (matched via style="" being empty). Inspector-driven inline styles always
 * win because they hit the element directly. */
.cs-btn--primary { background: #000000; color: #fff; }
.cs-btn--outline { background: transparent; color: #000000; border: 2px solid #000000; }
/* Subtle default hover (only applies when the user hasn't defined a custom
 * hover via the inspector — the scoped <style> rule for that button has
 * higher specificity / !important and overrides). */
.cs-button:hover .cs-btn--primary { filter: brightness(1.15); }
.cs-button:hover .cs-btn--outline { background: rgba(0, 0, 0, 0.06); }

/* Container/Row/Column preview — pure layout. Border / bg / padding all
 * come from the inspector via buildContainerStyle. */
.cs-container--row {
  display: flex;
  gap: 8px;
}
.cs-container--row > .canvas-section {
  flex: 1;
}

/* Feature cards preview */
.cs-feature-cards { padding: 24px 40px; }
.cs-feature-cards__title { font-size: 22px; font-weight: 400; text-align: center; margin-bottom: 20px; }
.cs-feature-cards__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.cs-feature-card {
  background: #f8fafc;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
}
.cs-feature-card__icon { font-size: 28px; margin-bottom: 8px; }
.cs-feature-card__title { font-size: 14px; font-weight: 400; margin-bottom: 4px; }
.cs-feature-card__desc { font-size: 12px; color: #666; }

/* Product grid preview */
.cs-product-grid { padding: 24px 40px; }
.cs-product-grid__title { font-size: 22px; font-weight: 400; margin-bottom: 16px; }
.cs-product-grid__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.cs-product-card {
  background: #f8fafc;
  border-radius: 6px;
  overflow: hidden;
}
.cs-product-card__img { height: 100px; background: #e5e7eb; }
.cs-product-card__info { padding: 8px; }
.cs-product-card__name { font-size: 12px; font-weight: 400; }
.cs-product-card__price { font-size: 11px; color: #666; margin-top: 2px; }

/* Gallery preview */
.cs-gallery { padding: 16px 40px; }
.cs-gallery__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cs-gallery__item { background: #e5e7eb; border-radius: 4px; height: 100px; overflow: hidden; }
.cs-gallery__item img { width: 100%; height: 100%; object-fit: cover; }

/* Contact form preview */
.cs-contact-form { padding: 24px 40px; max-width: 500px; margin: 0 auto; }
.cs-contact-form__title { font-size: 20px; font-weight: 400; margin-bottom: 16px; text-align: center; }
.cs-contact-form__field { margin-bottom: 12px; }
.cs-contact-form__field label { display: block; font-size: 12px; font-weight: 400; color: #555; margin-bottom: 4px; }
.cs-contact-form__field input,
.cs-contact-form__field textarea {
  width: 100%;
  border: 1px solid #d0d5dd;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 13px;
  box-sizing: border-box;
  pointer-events: none;
}
.cs-contact-form__field textarea { height: 80px; resize: none; }

/* Divider preview */
.cs-divider { padding: 8px 40px; }
.cs-divider hr { border: none; border-top: 1px solid #e5e7eb; margin: 0; }

/* Spacer preview */
.cs-spacer {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ccc;
  font-size: 11px;
  border: 1px dashed #e0e0e0;
  margin: 0 40px;
}

/* Banner preview */
.cs-banner {
  padding: 40px;
  text-align: center;
  background: #f0f4ff;
}
.cs-banner h3 { font-size: 22px; font-weight: 400; margin: 0 0 8px; }
.cs-banner p { font-size: 14px; color: #555; margin: 0 0 12px; }

/* Text-image preview */
.cs-text-image {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 24px 40px;
}
.cs-text-image__text { flex: 1; }
.cs-text-image__img { flex: 1; background: #e5e7eb; border-radius: 6px; height: 180px; }
.cs-text-image__img img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; }

/* Testimonials preview */
.cs-testimonials { padding: 24px 40px; text-align: center; }
.cs-testimonial { background: #f8fafc; border-radius: 8px; padding: 20px; margin: 0 auto; max-width: 500px; }
.cs-testimonial__quote { font-size: 14px; font-style: italic; color: #555; margin-bottom: 12px; }
.cs-testimonial__name { font-size: 13px; font-weight: 400; }
.cs-testimonial__role { font-size: 11px; color: #999; }

/* FAQ preview */
.cs-faq { padding: 24px 40px; }
.cs-faq__item { border-bottom: 1px solid #e5e7eb; padding: 12px 0; }
.cs-faq__q { font-size: 14px; font-weight: 400; }
.cs-faq__a { font-size: 13px; color: #666; margin-top: 4px; }

/* Generic block preview */
.cs-generic {
  padding: 24px 40px;
  background: #fafafa;
  border: 1px dashed #e0e0e0;
  text-align: center;
  color: #999;
  font-size: 13px;
}
.cs-generic__type {
  font-weight: 400;
  color: #666;
  text-transform: capitalize;
}

/* Video preview — fills the user-dragged wrapper box. Removed the fixed
 * `padding: 16px 40px` + `aspect-ratio: 16/9` lock (user-reported
 * 2026-06-28: "sai kích thước so với cell — đang mặc định 16/9, chưa
 * thay đổi được kích thước"). Default size is set at insert time in
 * addNewSection (560 × 315 = 16:9 by convention) but the user can then
 * resize via the canvas handles or the inspector W/H. The player itself
 * fills 100/100 of its wrapper — no aspect-ratio rule so the box stays
 * whatever ratio the user dragged. */
.cs-video { width: 100%; height: 100%; }

/* Embed HTML wrapper must fill the canvas-section box so the iframe (or
 * empty-state placeholder) occupies the full outline the user dragged.
 * Forces the content slot to 100%/100% too — the default content rule
 * only sets position:relative. */
.canvas-section[data-section-type="embed-html"] > .canvas-section__content {
  width: 100%;
  height: 100%;
}
.cs-embed-html {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  border-radius: inherit;
}
.cs-embed-html__frame { display: block; width: 100%; height: 100%; border: 0; }
.cs-embed-html--empty {
  display: grid;
  place-items: center;
  background: repeating-linear-gradient(135deg, #f8f9fb 0 8px, #f0f2f5 8px 16px);
  border: 1px dashed #cbd5e1;
}
.cs-embed-html__placeholder {
  text-align: center;
  font-family: 'Aeonik', system-ui, sans-serif;
  color: #475569;
  padding: 24px;
}
.cs-video__player {
  background: #000;
  border-radius: 6px;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 40px;
}

/* Stats preview */
.cs-stats { padding: 24px 40px; display: flex; justify-content: center; gap: 40px; text-align: center; }
.cs-stat__number { font-size: 32px; font-weight: 400; color: #5B3DF5; }
.cs-stat__label { font-size: 13px; color: #666; }

/* --- Add Section Button (between sections) --- */
/* ===== Empty Section Prompt ===== */
.canvas-empty-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 40px 20px;
  opacity: 0;
  transition: opacity 0.15s;
  pointer-events: none;
}
/* Show prompt when the owning section is hovered or selected */
.canvas-section[data-section-type="section"]:hover > .canvas-section__content .canvas-empty-actions,
.canvas-section[data-section-type="section"].is-selected > .canvas-section__content .canvas-empty-actions {
  opacity: 1;
  pointer-events: auto;
}
.canvas-empty-actions__btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 20px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  color: #555;
  font-size: 12px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, color 0.15s;
  font-family: var(--font-sans);
  min-width: 120px;
}
.canvas-empty-actions__btn:hover {
  border-color: var(--editor-accent);
  color: var(--editor-accent);
  box-shadow: 0 2px 8px rgba(37,99,235,0.1);
}
.canvas-empty-actions__btn svg {
  opacity: 0.6;
}
.canvas-empty-actions__btn:hover svg {
  opacity: 1;
  stroke: var(--editor-accent);
}

/* ===== Add Section Divider ===== */
/* Must outrank EVERY canvas-chrome layer: .canvas-section.is-selected
 * (2147481000), the floating section toolbar (.canvas-section__toolbar =
 * 2147482000), the W-preview drag-tip (2147483600), and the canvas-urlbar
 * row above the viewport. We sit at 2147483646 — one below MAX_INT, which
 * the breadcrumb chip occupies with `!important`. */
.canvas-add-divider {
  position: relative;
  height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2147483646;
}
.canvas-add-divider__btn {
  position: absolute;
  height: 24px;
  z-index: 2147483646;
  padding: 4px 12px 4px 8px;
  border-radius: 24px;
  border: 0;
  background: #5B3DF5;
  color: #fff;
  font-size: 12px;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s, background 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-family: var(--font-sans);
  white-space: nowrap;
  box-sizing: border-box;
  /* Hidden pill must NOT catch hover — otherwise the invisible (opacity:0)
   * button still fires its native `title="Add Section"` tooltip (black bg,
   * white text) when the user hovers near it with nothing selected (user
   * 2026-07-11 "vẫn hiện label bg đen chữ trắng"). pointer-events is switched
   * back to auto only by the show rules below. */
  pointer-events: none;
}
.canvas-add-divider__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.canvas-add-divider__icon svg { display: block; width: 14px; height: 14px; }
.canvas-add-divider__icon svg path { fill: #fff; }
.canvas-add-divider__label { display: inline-block; }
/* Add Section pill shows only next to the SELECTED section — one above
 * (divider that is followed by the selected section) and one below
 * (divider immediately after the selected section). Previously it lit up
 * on any hover anywhere in the canvas, which felt noisy (user 2026-07-02
 * "chỉ hiện khi Section được Select thôi"). Self-hover kept so the pill
 * stays clickable once visible. */
.canvas-add-divider:has(+ .canvas-section.is-selected) .canvas-add-divider__btn,
.canvas-section.is-selected + .canvas-add-divider .canvas-add-divider__btn {
  opacity: 1;
  pointer-events: auto;
}
/* Self-hover keeps the pill visible ONLY when it's already eligible — i.e. the
 * divider sits directly above or below the SELECTED section. A bare
 * `.canvas-add-divider:hover` (the old rule) lit the "+ Add Section" pill on
 * hover ANYWHERE even with nothing selected (user 2026-07-11 "chưa select
 * Section mà hover gần Add Section nó vẫn hiện"). Gate the hover on the same
 * adjacent-to-selected condition so an unselected canvas never shows it. */
.canvas-add-divider:has(+ .canvas-section.is-selected):hover .canvas-add-divider__btn,
.canvas-section.is-selected + .canvas-add-divider:hover .canvas-add-divider__btn {
  opacity: 1;
  pointer-events: auto;
}
.canvas-add-divider__btn:hover {
  background: #0f62e6;
  color: #fff;
}

/* Add Section Menu */
.add-section-menu {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15), 0 0 0 1px rgba(0,0,0,0.06);
  padding: 6px 0;
  min-width: 180px;
}
.add-section-menu__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 16px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 13px;
  color: var(--panel-text);
  text-align: left;
  font-family: var(--font-sans);
}
.add-section-menu__item:hover {
  background: #F1EEFE;
  color: var(--editor-accent);
}
.add-section-menu__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  color: var(--editor-accent);
}

/* ===== Layers Tree ===== */
/* Full-width items: sidebar body padding is 14px, we offset with negative margin
   and indent inward using --level inline CSS var */
.layer-item {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 -14px;
  padding: 4px 14px 4px calc(8px + var(--level, 0) * 16px);
  height: 36px;
  cursor: pointer;
  transition: background 0.12s;
  font-size: 13px;
  color: #000624;
  user-select: none;
}
.layer-item:hover { background: var(--panel-surface-hover); }
.layer-item.is-active { background: #F1EEFE; color: var(--editor-accent); }
.layer-item.is-dragging { opacity: 0.5; }
/* Hidden state — dim row + eye-off marker. The "..." menu's Hide
 * toggle flips sec.settings._hidden; the canvas emits
 * `style="display:none"` so the element vanishes entirely (not just
 * dim). No strike-through on the label per user 2026-07-02 "không cần
 * gạch ngang text". Descendants of a hidden section inherit the same
 * dim via `.is-hidden-ancestor` — the layers-panel renderer walks the
 * tree and marks every child that lives under a hidden ancestor. */
.layer-item.is-hidden,
.layer-item.is-hidden-ancestor { opacity: 0.55; }
.layer-item.is-hidden .layer-item__label,
.layer-item.is-hidden-ancestor .layer-item__label { color: #8e8e97; }
.layer-item.is-hidden .layer-item__icon,
.layer-item.is-hidden-ancestor .layer-item__icon { opacity: 0.5; }
/* Real eye-off button — replaces the ::after decoration so the click
 * is captured and Show can toggle _hidden off. User 2026-07-02
 * "bấm vào con mắt cho layers là show lại". */
.layer-item__eye {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-right: 2px;
  border: none;
  background: transparent;
  color: #8e8e97;
  cursor: pointer;
  border-radius: 4px;
  padding: 0;
  opacity: 1;
  transition: color 0.12s, background 0.12s;
}
.layer-item__eye:hover  { color: var(--editor-accent, #5B3DF5); background: var(--panel-surface-hover, #f4f5f8); }
.layer-item__eye svg    { display: block; }
.layer-item { position: relative; }
.layer-item.is-drop-inside { background: #d8e8fd; box-shadow: inset 0 0 0 2px var(--editor-accent); }
/* Blue bar drawn between two layer-items to indicate drop position. */
.layer-drop-indicator {
  position: absolute;
  height: 2px;
  background: var(--editor-accent, #5B3DF5);
  pointer-events: none;
  z-index: 50;
  transform: translateY(-1px);
}
.layer-drop-indicator::before {
  content: '';
  position: absolute;
  left: -3px; top: -3px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--editor-accent, #5B3DF5);
}
.layer-item.is-descendant-of-active { background: #f0f6ff; color: var(--editor-accent); }
.layer-item.is-descendant-of-active .layer-item__icon { color: var(--editor-accent); }
/* Master rows (Header, Footer):
   - Default: text black (inherits), icon green (handled above)
   - Active (this row selected): text green, bg green
   - Descendant-of-active (a child of Header/Footer is selected): text green, bg blue (same as other descendants) */
.layer-item--master.is-active { color: #3faf4f; background: #e6f6e9; }
.layer-item--master.is-descendant-of-active { color: #3faf4f; /* bg inherits blue from .is-descendant-of-active rule above */ }
/* Children of an active Header/Footer keep normal blue highlight — no override needed */

.layer-item__toggle {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  cursor: pointer;
  color: #000624;
  padding: 0;
  flex-shrink: 0;
  border-radius: 3px;
  transition: background 0.12s, transform 0.15s;
}
.layer-item__toggle:hover { background: var(--panel-surface-hover); }
.layer-item__toggle.is-expanded { transform: rotate(90deg); }
/* Toggle arrow always stays black regardless of highlight */
.layer-item.is-active .layer-item__toggle,
.layer-item.is-descendant-of-active .layer-item__toggle,
.layer-item--master .layer-item__toggle,
.layer-item--in-master.is-descendant-of-active .layer-item__toggle { color: #000624; }
.layer-item__toggle--empty {
  visibility: hidden;
}

.layer-item__icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #000624;
}
.layer-item.is-active .layer-item__icon { color: var(--editor-accent); }
/* Header/Footer icon — always green, regardless of row state */
.layer-item__icon--master { color: #3faf4f; }
.layer-item.is-active .layer-item__icon--master,
.layer-item.is-descendant-of-active .layer-item__icon--master,
.layer-item--master .layer-item__icon--master,
.layer-item--master.is-active .layer-item__icon--master,
.layer-item--master.is-descendant-of-active .layer-item__icon--master { color: #3faf4f; }

/* Image thumbnail */
.layer-item__thumb {
  display: inline-block;
  width: 20px;
  height: 20px;
  border-radius: 3px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-color: #f0f1f5;
}
.layer-item__icon svg {
  width: 20px;
  height: 20px;
}

.layer-item__label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 400;
  font-size: 12px;
  color: var(--panel-text-secondary);
}

.layer-item__visibility {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--panel-text-muted);
  padding: 0;
  flex-shrink: 0;
  border-radius: 3px;
  opacity: 0;
  transition: opacity 0.12s, color 0.12s;
}
.layer-item:hover .layer-item__visibility,
.layer-item__visibility.is-hidden {
  opacity: 1;
}
.layer-item__visibility.is-hidden {
  color: var(--panel-text-muted);
  opacity: 0.5;
}
.layer-item__visibility:hover {
  color: var(--panel-text);
  background: var(--panel-surface-hover);
}

.layer-item__more {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  cursor: pointer;
  color: #000624;
  padding: 0;
  flex-shrink: 0;
  border-radius: 3px;
  opacity: 0;
  transition: opacity 0.12s;
}
.layer-item:hover .layer-item__more {
  opacity: 1;
}
.layer-item__more:hover {
  color: var(--editor-accent);
  background: transparent;
}

.layer-context-menu {
  position: absolute;
  z-index: 100;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  padding: 4px 0;             /* vertical only — items + dividers span edge to edge */
  min-width: 200px;
  max-height: 70vh;
  overflow-y: auto;
  overflow-x: hidden;
}
.layer-context-menu__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 7px 12px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 12px;
  color: var(--panel-text);
  border-radius: 0;           /* full-width hover with no rounded gap on the edges */
  text-align: left;
  white-space: nowrap;
}
.layer-context-menu__item:hover {
  background: var(--panel-surface-hover);
}
.layer-context-menu__item--danger {
  color: #ef4444;
}
.layer-context-menu__item--danger:hover {
  background: rgba(239,68,68,0.1);
}
.lcm-shortcut {
  font-size: 11px;
  color: var(--panel-text-muted);
  margin-left: auto;
}
.layer-context-menu__divider {
  height: 1px;
  background: var(--panel-border);
  margin: 4px 0;              /* no side margin — spans the whole width */
}
/* Arrange submenu (Move Forward / Bring to Front / …) — add an icon
 * slot on the left. */
.lcm-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  color: var(--panel-text-muted, #52525B);
  flex-shrink: 0;
}
.layer-context-menu__item:hover .lcm-ico { color: var(--panel-text, #131720); }

/* Canvas context menu (white, fixed on body) */
.canvas-context-menu {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.18);
  min-width: 220px;
  padding: 4px 0;
  max-height: 70vh;
  overflow-y: auto;
  overflow-x: hidden;
}
.canvas-context-menu .layer-context-menu__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 8px 14px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 13px;
  color: #111;
  border-radius: 0;
  text-align: left;
  white-space: nowrap;
  font-family: var(--font-sans);
}
.canvas-context-menu .layer-context-menu__item:hover {
  background: #f0f3ff;
}
.canvas-context-menu .layer-context-menu__item--danger {
  color: #d32f2f;
}
.canvas-context-menu .layer-context-menu__item--danger:hover {
  background: rgba(211,47,47,0.08);
}
.canvas-context-menu .lcm-shortcut {
  font-size: 11px;
  color: #999;
  margin-left: auto;
}
.canvas-context-menu .layer-context-menu__divider {
  height: 1px;
  background: #e5e7eb;
  margin: 3px 0;
}
.layer-rename-input {
  width: 100%;
  padding: 1px 4px;
  font-size: 12px;
  border: 1px solid var(--accent);
  border-radius: 3px;
  background: var(--panel-surface);
  color: var(--panel-text);
  outline: none;
}

.layer-children {
  padding-left: 0;
}
.layer-children.is-collapsed {
  display: none;
}

/* ===== Inspector Panel (Right Side) ===== */
.inspector-panel {
  --panel-bg: #ffffff;
  --panel-surface: #f5f5f5;
  --panel-surface-hover: #ebebeb;
  --panel-surface-active: #e0e0f0;
  --panel-border: #e0e0e0;
  /* User 2026-06-22: inspector text was reading too gray on the white
   * panel; flatten the 3-tier hierarchy (primary/secondary/muted) into
   * a single pure-black so labels read at full contrast. Hierarchy now
   * comes from size / weight / divider position, not colour washout. */
  --panel-text: #000000;
  --panel-text-secondary: #000000;
  --panel-text-muted: #000000;

  position: relative;
  height: 100%;
  width: var(--inspector-width);
  background: var(--panel-bg);
  border-left: 1px solid var(--panel-border);
  display: flex;
  flex-direction: column;
  color: var(--panel-text);
  z-index: var(--z-inspector);
  overflow: hidden;
  transition: width 0.25s ease;
  flex-shrink: 0;
}
.inspector-panel.is-collapsed {
  width: 0;
  border-left: none;
}
/* Toggle button lives in .workspace, positioned at right edge of inspector */
.inspector-panel__toggle {
  position: absolute;
  right: var(--inspector-width);
  top: 12px;
  width: 28px;
  height: 48px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-right: none;
  border-radius: 6px 0 0 6px;
  color: #000624;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: calc(var(--z-inspector) + 1);
  transition: right 0.25s ease, background 0.15s, color 0.15s;
}
.workspace:has(.inspector-panel.is-collapsed) .inspector-panel__toggle {
  right: 0;
}
.inspector-panel__toggle:hover {
  background: #f5f5f5;
  color: #000624;
}
.inspector-panel__toggle svg {
  transition: transform 0.25s ease;
}
.workspace:has(.inspector-panel.is-collapsed) .inspector-panel__toggle svg {
  transform: rotate(180deg);
}

.inspector-panel__header {
  padding: 0;
  border-bottom: 1px solid var(--panel-border);
  flex-shrink: 0;
}

.inspector-panel__title {
  display: none;
}

.inspector-panel__tabs {
  display: flex;
  height: 40px;
}

.inspector-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 400;
  color: var(--panel-text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.inspector-tab:hover {
  color: var(--panel-text);
}
.inspector-tab.is-active {
  color: var(--editor-accent);
  border-bottom-color: var(--editor-accent);
}

.inspector-panel__body {
  flex: 1;
  overflow-y: auto;
  padding: 0;
  user-select: text;
  -webkit-user-select: text;
  scrollbar-width: none;
}
.inspector-panel__body::-webkit-scrollbar {
  display: none;
}

.inspector-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: var(--panel-text-muted);
  font-size: 13px;
  text-align: center;
  padding: 24px;
}

/* Sticky top (header + tabs + alignment bar) */
.insp-sticky-top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--panel-bg, #fff);
}

/* Inspector header */
.insp-header { padding: 16px 16px 4px; }
.insp-header__name {
  font-size: 14px;
  font-weight: 700;
  color: var(--panel-text);
}

/* Alignment bar (image inspector) */
.insp-align-bar {
  display: flex;
  gap: 0;
  padding: 8px 16px;
  border-bottom: 1px solid var(--panel-border);
}
.insp-align-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  color: #000624;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.12s;
}
.insp-align-btn:hover { background: var(--panel-surface); }

/* Size grid (X/Y + W/H with lock) */
.insp-size-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 24px;
  gap: 6px;
  margin-top: 8px;
  align-items: center;
}
/* Without aspect-ratio lock there's no third column to reserve — give the
 * inputs the full width (no 24px reserved gutter). */
.insp-size-grid--no-lock {
  grid-template-columns: 1fr 1fr;
}
.insp-size-lock {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: none;
  background: none;
  color: #bbb;
  cursor: pointer;
  padding: 0;
  border-radius: 4px;
}
.insp-size-lock:hover { color: #666; background: #f0f0f0; }
.insp-size-lock.is-locked { color: var(--editor-accent, #5B3DF5); }
.insp-size-lock .lock-icon--locked { display: none; }
.insp-size-lock .lock-icon--unlocked { display: block; }
.insp-size-lock.is-locked .lock-icon--locked { display: block; }
.insp-size-lock.is-locked .lock-icon--unlocked { display: none; }

/* Responsive behavior */
.insp-responsive-behavior {
  margin-top: 2px;
}
.insp-responsive-behavior__label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 400;
  color: var(--panel-text-secondary, #999);
  margin-bottom: 4px;
}

/* Responsive behavior trigger (custom dropdown button) */
.resp-behavior-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 30px;
  padding: 0 8px 0 10px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 400;
  color: var(--panel-text-secondary);
  transition: border-color .15s;
  font-family: var(--font-sans);
}
.resp-behavior-trigger:hover {
  border-color: #5B3DF5;
}
.resp-behavior-trigger__label {
  flex: 1;
  text-align: left;
}
.resp-behavior-trigger svg {
  flex-shrink: 0;
  color: var(--panel-text-secondary);
  width: 14px;
  height: 14px;
}

/* Responsive behavior dropdown */
.resp-behavior-dropdown {
  background: #fff;
  border-radius: 0;
  box-shadow: 0 4px 20px rgba(0,0,0,.15), 0 0 0 1px rgba(0,0,0,.06);
  overflow: hidden;
  animation: respDropIn .12s ease-out;
}
@keyframes respDropIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.resp-behavior-dropdown__options {
  border-bottom: 1px solid #e8eaed;
}
.resp-behavior-dropdown__item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 400;
  color: var(--panel-text-secondary);
  text-align: left;
  transition: background .1s;
  font-family: var(--font-sans);
}
.resp-behavior-dropdown__item:hover {
  background: var(--panel-surface, #f5f5f5);
  color: var(--panel-text-secondary);
}
.resp-behavior-dropdown__item.is-selected {
  background: #F1EEFE;
  color: #5B3DF5;
  font-weight: 400;
}
.resp-behavior-dropdown__item.is-selected:hover {
  background: #E8E2FD;
}
.resp-behavior-dropdown__check {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: #5B3DF5;
}
.resp-behavior-dropdown__label {
  flex: 1;
}
.resp-behavior-dropdown__preview {
  padding: 0;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.resp-behavior-dropdown__gif {
  width: 100%;
  height: auto;
  display: block;
}

/* Custom CSS row */
.insp-custom-css {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  margin: 0 -16px;
  padding-left: 16px;
  padding-right: 16px;
  border-top: 1px solid var(--panel-border);
}
.insp-custom-css__left {
  display: flex;
  align-items: center;
  gap: 6px;
}
.insp-custom-css__gen {
  display: flex;
  align-items: center;
  gap: 4px;
  border: none;
  background: none;
  color: var(--editor-accent);
  font-size: 12px;
  font-weight: 400;
  cursor: pointer;
}
.insp-custom-css span { font-size: 13px; color: var(--panel-text); }
.insp-custom-css__gen:hover { text-decoration: underline; }

/* Field label (Wix style) */
.insp-field-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  line-height: 16px;
  color: var(--panel-text-secondary);
  margin-bottom: 10px;
  font-weight: 400;
}

/* Info icon */
.insp-info-icon {
  color: var(--panel-text-muted);
  flex-shrink: 0;
  cursor: help;
}

/* Divider */
.insp-divider {
  border: none;
  border-top: 1px solid var(--panel-border);
  margin: 8px -16px;
}
.insp-divider--short {
  border: none;
  border-top: 1px solid var(--panel-border);
  margin: 12px 0;
  width: 100%;
}

/* Wix-style toggle switch (animated pill) */
.insp-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  flex-shrink: 0;
}
.insp-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.insp-switch__track {
  position: relative;
  width: 32px;
  height: 18px;
  background: #b6c1cd;
  border-radius: 10px;
  transition: background 0.25s ease;
  border: 1px solid rgba(0,0,0,0.08);
}
.insp-switch__thumb {
  position: absolute;
  width: 14px;
  height: 14px;
  left: 2px;
  top: 1px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.25s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.insp-switch input:checked + .insp-switch__track {
  background: var(--editor-accent);
}
.insp-switch input:checked + .insp-switch__track .insp-switch__thumb {
  transform: translateX(14px);
}

/* Opacity row (slider + value input + optional color picker) */
.insp-opacity-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.insp-opacity-row .insp-opacity-val { flex: 0 0 60px; }
.insp-opacity-slider {
  flex: 1;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: linear-gradient(90deg, #e0e0e0 0%, var(--editor-accent) 100%);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
  /* Block text selection so dragging the thumb off the track doesn't
   * start highlighting labels above — that selection steals subsequent
   * mousemove events and the slider stops responding mid-drag. */
  user-select: none;
  -webkit-user-select: none;
}
/* While a slider is held down, suppress selection across the WHOLE
 * inspector body — the native range input releases pointer when it
 * exits its own bounding box, so without this the drag dies whenever
 * the cursor crosses an adjacent label. JS toggles `.is-sliding` on
 * the body during the drag. */
#inspector-body.is-sliding,
#inspector-body.is-sliding * {
  user-select: none !important;
  -webkit-user-select: none !important;
}
/* Plain track for numeric sliders (Width, Distance, Blur, etc.) — filled portion
   blue (accent), unfilled portion grey. The fill percentage is set via the
   --fill custom property and updated by paintPlainSliders() on render + input. */
.insp-opacity-slider--plain {
  background: linear-gradient(
    90deg,
    var(--editor-accent) 0%,
    var(--editor-accent) var(--fill, 0%),
    #e0e0e0 var(--fill, 0%),
    #e0e0e0 100%
  );
}
.insp-opacity-slider--checker {
  background-image:
    linear-gradient(90deg, transparent 0%, var(--slider-color, #000) 100%),
    linear-gradient(45deg, #ccc 25%, transparent 25%),
    linear-gradient(-45deg, #ccc 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #ccc 75%),
    linear-gradient(-45deg, transparent 75%, #ccc 75%) !important;
  background-size: 100% 100%, 6px 6px, 6px 6px, 6px 6px, 6px 6px;
  background-position: 0 0, 0 0, 0 3px, 3px -3px, -3px 0;
}
.insp-opacity-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--editor-accent);
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}
/* Numeric input matching Wix base UI: 32px tall, hover light-blue tint,
   focus blue border, suffix unit at the right edge with brand-blue colour. */
.insp-opacity-val {
  display: flex;
  align-items: center;
  border: 1px solid #e2e3ea;
  border-radius: 4px;
  overflow: hidden;
  height: 32px;
  flex: 1;
  min-width: 0;
  background: #ffffff;
  transition: border-color 0.12s, background 0.12s;
}
.insp-opacity-val:hover {
  border-color: #868aa5;
  background: #d3edff;
  cursor: pointer;
}
.insp-opacity-val:hover input { color: #2b5672; cursor: pointer; }
.insp-opacity-val:focus-within {
  border-color: #5B3DF5;
  background: #ffffff;
  box-shadow: inset 0 0 3px 0 rgba(0, 90, 132, 0.25);
}
.insp-opacity-val:focus-within input { color: #131720; cursor: text; }
.insp-opacity-val input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  text-align: left;
  font-size: 13px;
  color: #131720;
  background: transparent;
  font-family: var(--font-sans);
  padding: 0 0 0 8px;
  cursor: text;
}
.insp-opacity-val input::selection { background-color: #c3daff; }
.insp-opacity-val span {
  font-size: 11px;
  color: #9aa0ac;
  font-weight: 400;
  padding-right: 8px;
  flex-shrink: 0;
}

/* Color picker swatch (square at start of opacity row) */
.insp-color-pick {
  width: 30px;
  height: 30px;
  border-radius: 4px;
  border: 1px solid #dde1e6;
  cursor: pointer;
  flex-shrink: 0;
}
.insp-color-pick--light {
  border-color: #d0d0d0;
}

/* Shadow controls */
.insp-shadow-controls { margin-top: 12px; }
.insp-shadow-controls.is-hidden { display: none; }

/* Angle dial — bigger circle to make rotation easier to grab. Paired
 * value input shrunk so the dial dominates the row. */
/* Angle dial — Wix's "control-angle-input" (72px circle with a knob orbiting
 * the rim, optional radius hint line, blue accent on :active). Used by
 * shadow_angle in Design tab AND animation Direction in Adjust panel. The
 * outer wrapper has padding-left:54px in Wix to leave room for a label —
 * we omit that since our rows already have their own label column. */
.insp-angle-row { display: flex; align-items: center; gap: 14px; }
.insp-angle-dial { width: 72px; height: 72px; flex-shrink: 0; }
.insp-angle-dial__circle {
  width: 72px; height: 72px;
  border: 4px solid #d9e1e8;
  border-radius: 50%;
  position: relative;
  box-sizing: border-box;
  cursor: pointer;
}
.insp-angle-dial__circle::after {
  /* Thin radius line from the centre up to the knob — visual hint that the
   * knob is hinged on the centre. Rotates with the circle. */
  content: '';
  position: absolute;
  left: calc(50% - 1px);
  top: 0;
  width: 0;
  height: 32px;
  border-left: 1px solid #d9e1e8;
  pointer-events: none;
}
.insp-angle-dial__circle:active { border-color: var(--editor-accent); }
.insp-angle-dial__circle:active::after { border-left-color: var(--editor-accent); }
.insp-angle-dial__center {
  width: 6px; height: 6px;
  background: #d9e1e8;
  border-radius: 50%;
  position: absolute;
  top: calc(50% - 3px); left: calc(50% - 3px);
  pointer-events: none;
}
.insp-angle-dial__circle:active .insp-angle-dial__center { background: var(--editor-accent); }
.insp-angle-dial__knob {
  width: 16px; height: 16px;
  background: var(--editor-accent);
  border: 4px solid #fff;
  border-radius: 50%;
  position: absolute;
  /* Sit on the top edge of the circle (12 o'clock) when not rotated. The
   * parent circle handles `transform: rotate(--dir)`; this knob position is
   * static relative to that rotation. */
  top: -8px;
  left: calc(50% - 8px);
  box-sizing: border-box;
  box-shadow: 0 1px 3px 0 rgba(43, 86, 114, 0.6);
  cursor: pointer;
}
.insp-angle-dial__circle:hover .insp-angle-dial__knob {
  background: #7fccf7;
  box-shadow: 0 0 8px 1px #7fccf7;
}
.insp-angle-dial__circle:active .insp-angle-dial__knob {
  background: var(--editor-accent);
  box-shadow: 0 0 8px 1px #7fccf7;
}
/* Narrower value input next to the dial — matches Wix layout. */
.insp-angle-row .insp-opacity-val { flex: 0 0 72px; }

/* Corner Radius Input (1:1 copy from Wix reference) */
/* ── Corners — per-corner radius control ──────────────────────────────
 * 2×2 grid of corner inputs; each input wears an L-shaped bracket whose
 * corner radius mirrors the typed value (live preview). A link toggle
 * sits in the centre. Markup: .control-corner-radius-input holds
 * .top / label.control-boolean.link / .bottom, each .control-corner has
 * an .input-container + .corner-border. */
/* === Corners control — port of Wix's CSS verbatim ===
 * Spec from the Wix reference html: 192×132 wrapper, padding 9px 24px 14px.
 * Two flex rows (.top / .bottom) justify-content:space-between with a
 * link puck align-self:center between them. Each .control-corner is a
 * flex column ([input, bar] for .top, reversed for .bottom). Bracket
 * bar = 40×22 with ONE border edge + a 42px side margin to push it
 * toward the inner side of its column. The four bars meet to outline a
 * small rectangle around the link puck. */
.composite-corner-radius-input-labeled {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 4px 0 8px;
}
.composite-corner-radius-input-labeled .control-label {
  display: block;
  margin: 9px 0 0 24px;
}
.composite-corner-radius-input-labeled .control-label-base {
  font-size: 13px;
  color: var(--panel-text-secondary, #131720);
}

.control-corner-radius-input {
  /* Wix's 192×132 spec is content-box (padding outside). The editor's
   * global * { box-sizing: border-box } reset would otherwise pull
   * padding INTO the 192px, leaving only 144px of inner space — the
   * 40+42 bar arrangement overflows that and the 4 corner bars
   * collide / clip. Override back to content-box here. */
  box-sizing: content-box;
  width: 192px;
  height: 132px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 9px 24px 14px;
  margin: 0;
}
.control-corner-radius-input .top,
.control-corner-radius-input .bottom {
  display: flex;
  justify-content: space-between;
}

.control-corner { display: flex; position: relative; }
.control-corner.top    { flex-direction: column; }
.control-corner.bottom { flex-direction: column-reverse; }
.control-corner.left   { align-items: flex-start; }
.control-corner.right  { align-items: flex-end; }

/* Input chip — 64×24 with the px* suffix anchored to the bottom-right. */
.input-container.numeric-corner {
  display: inline-flex;
  align-items: center;
  position: relative;
  z-index: 1;
  min-width: 64px;
  width: 64px;
}
/* Wix input chip: no resting border, transparent fill — hovering the
 * wrapper tints all four chips light blue (#eaf7ff). Padded right for
 * the 22px-wide suffix. */
.input-container.numeric-corner input {
  width: 64px;
  height: 24px;
  padding: 0 24px 0 10px;
  border: 1px solid #e0e3eb;
  border-radius: 4px;
  font-size: 12px;
  font-family: var(--font-sans);
  color: #162d3d;
  outline: none;
  background: #fff;
  text-align: left;
  box-sizing: border-box;
  transition: background 0.1s, color 0.1s, border-color 0.1s;
}
.input-container.numeric-corner input:hover {
  background: #f3f4f6;
  cursor: pointer;
}
.input-container.numeric-corner input:focus {
  background: #fff;
  border-color: #7fccf7;
  box-shadow: inset 0 0 3px 0 rgba(0,90,132,0.25);
  cursor: text;
}
.input-text-suffix {
  position: absolute;
  right: 6px;
  bottom: 4.5px;
  font-size: 11px;
  color: #162d3d;
  pointer-events: none;
  user-select: none;
}
.input-container.numeric-corner:hover .input-text-suffix { color: #2b5672; }

/* Bracket bar — Wix spec: 40×22, ONE border edge, 42px side margin to
 * push it toward the inner edge of its column. */
.corner-border {
  width: 40px;
  height: 22px;
  border: 0 solid #7a92a5;
  pointer-events: none;
  display: block;
  position: static;
  visibility: visible;
  margin: 0;
  box-sizing: border-box;
}
.top.control-corner .corner-border    { border-top-width: 2px;    margin-top: 6px;    }
.bottom.control-corner .corner-border { border-bottom-width: 2px; margin-bottom: 6px; }
.right.control-corner .corner-border  { border-right-width: 2px;  margin-right: 42px; }
.left.control-corner .corner-border   { border-left-width: 2px;   margin-left: 42px;  }
.composite-corner-radius-input-labeled:hover .control-corner-radius-input.locked .control-corner .corner-border,
.control-corner-radius-input.locked:hover .control-corner .corner-border {
  border-color: #7fccf7;
}
.control-corner .numeric-corner:hover ~ .corner-border { border-color: #7fccf7; }

/* Link puck — Wix spec: 24px wide, flex 22px 0 0 (vertical size), with
 * a 1px border that picks the unlocked color from currentColor and is
 * filled blue when locked. */
.control-corner-radius-input .control-boolean.link {
  position: static;
  transform: none;
  align-self: center;
  width: 24px;
  flex: 22px 0 0;
  border-radius: 6px;
  border: 1px solid;
  background: #fff;
  color: #7a92a5;
  cursor: pointer;
  display: flex;
  overflow: hidden;
}
.control-corner-radius-input .control-boolean.link input { display: none; }
.control-corner-radius-input .control-boolean.link .symbol {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  color: inherit;
}
.control-corner-radius-input .control-boolean.link .symbol svg {
  display: block;
  align-self: center;
  width: 24px;
  height: 24px;
  fill: currentColor;
}
.control-corner-radius-input.locked .control-boolean.link {
  background: #3899ec;
  border-color: #3899ec;
}
.control-corner-radius-input.locked .control-boolean.link svg { fill: #fff; }
.control-corner-radius-input.locked .control-boolean.link:hover {
  background: #4eb7f5;
  border-color: #4eb7f5;
}
.control-label-base {
  font-size: 12px;
  line-height: 16px;
  color: #595d70;
}

/* Icon tabs (pen / lightning) */
.insp-icon-tabs { display: flex; gap: 0; padding: 0; border-bottom: 1px solid var(--panel-border); }
.insp-icon-tab { flex: 1; display: flex; align-items: center; justify-content: center; padding: 12px 0; border: none; background: none; cursor: pointer; color: #000624; border-bottom: 2px solid transparent; transition: color 0.12s, border-color 0.12s; }
.insp-icon-tab:hover { color: var(--panel-text); }
.insp-icon-tab.is-active { color: var(--editor-accent); border-bottom-color: var(--editor-accent); }

/* Block (non-collapsible, e.g. Size) */
.insp-block { padding: 14px 16px; border-bottom: 1px solid var(--panel-border); }
.insp-block__header { display: flex; align-items: center; justify-content: space-between; font-size: 13px; font-weight: 400; color: var(--panel-text-secondary); }
.insp-block__more { border: none; background: none; cursor: pointer; color: var(--panel-text-muted); font-size: 18px; letter-spacing: 0; padding: 2px 4px; border-radius: 4px; line-height: 1; }
.insp-block__more:hover { color: var(--editor-accent); background: transparent; }

/* Advanced settings popover (Size block) */
.insp-adv-menu { position: relative; }
.insp-adv-popover {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 260px;
  background: #fff;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  padding: 14px 16px;
  z-index: var(--z-tooltip);
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity 0.12s, transform 0.12s;
}
.insp-adv-popover.is-open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.insp-adv-popover__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.insp-adv-popover__label { font-size: 13px; font-weight: 400; color: var(--panel-text-secondary); }
.insp-adv-popover__hint { font-size: 12px; line-height: 1.5; color: var(--panel-text-muted); margin-top: 10px; }
.insp-adv-popover__link { color: var(--editor-accent); text-decoration: none; }
.insp-adv-popover__link:hover { text-decoration: underline; }

/* Size block — basic + advanced rows now render together (no toggle).
   The data-advanced attribute is kept but no longer drives visibility. */

/* Multi-inspector mode: we reuse the single-element inspector markup for
 * the primary section, then hide blocks that can't be edited as a group.
 * Only the Design section + the alignment bar stay; Size, Position,
 * Adjust, Anchor (and the duplicate "Text" header / icon tabs) are
 * per-element and don't make sense across a multi-selection. */
/* Drop the duplicate per-element header (e.g. "Text") emitted by the
 * single-element inspector — we prepend our own `.insp-multi-title`
 * with "Multiple Elements". */
#inspector-body.is-multi-inspector > .insp-header,
#inspector-body.is-multi-inspector .insp-sticky-top > .insp-header,
#inspector-body.is-multi-inspector > .insp-icon-tabs,
#inspector-body.is-multi-inspector .insp-sticky-top > .insp-icon-tabs,
#inspector-body.is-multi-inspector .insp-size-block,
#inspector-body.is-multi-inspector .insp-block.insp-size-block {
  display: none !important;
}
/* "Multiple Elements" header for multi-selection mode. Same look as
 * `.insp-header` but lives outside the hide rules above. */
.insp-multi-title {
  padding: 14px 16px;
  border-bottom: 1px solid var(--panel-border);
}
.insp-multi-title .insp-header__name {
  font-size: 15px;
  font-weight: 400;
  color: var(--panel-text);
}
/* Hide every collapsible major/section that ISN'T the Design block —
 * Position / Adjust / Anchor / Layout etc. The :has() selector keeps
 * the Design section (its header carries data-insp-toggle="*-design"). */
#inspector-body.is-multi-inspector .insp-major:not(:has(> .insp-major__header[data-insp-toggle$="-design"])) {
  display: none !important;
}
/* Divider between the basic rows (X/Y, px* W/H) and the advanced rows
 * (real-unit W/H, Min W/H, Max W/H). Targets the FIRST advanced row,
 * which is always the one directly following a basic row. */
.insp-size-block .insp-basic-only + .insp-adv-only {
  border-top: 1px solid var(--panel-border);
  padding-top: 26px;
  margin-top: 10px !important;
  position: relative;
}
/* "Advanced" label sits in the padding above the first advanced row,
 * positioned absolute so it doesn't disrupt the row's flex layout. */
.insp-size-block .insp-basic-only + .insp-adv-only::before {
  content: "Advanced";
  position: absolute;
  top: 6px;
  left: 0;
  font-size: 12px;
  font-weight: 400;
  color: var(--panel-text-secondary);
  line-height: 1;
}

/* Inline "Advanced" toggle in the Size block header (replaces the 3-dot popover) */
.insp-size-header { display: flex; align-items: center; justify-content: space-between; }
.insp-size-adv-toggle { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 11px; color: var(--panel-text-muted, #6b6b6b); user-select: none; }
.insp-size-adv-toggle input { display: none; }
.insp-size-adv-toggle .insp-toggle__track { position: relative; display: inline-block; width: 24px; height: 14px; background: #d0d3da; border-radius: 7px; transition: background 0.15s; }
.insp-size-adv-toggle .insp-toggle__track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 10px; height: 10px; background: #fff; border-radius: 50%; transition: transform 0.15s; box-shadow: 0 1px 2px rgba(0,0,0,0.2); }
.insp-size-adv-toggle input:checked + .insp-toggle__track { background: var(--editor-accent, #5B3DF5); }
.insp-size-adv-toggle input:checked + .insp-toggle__track::after { transform: translateX(10px); }
.insp-size-adv-toggle__label { font-weight: 400; }

/* Size field (bordered box with X/Y/W/H) */
.insp-size-field { display: flex; align-items: center; border: 1px solid #e0e0e0; border-radius: 4px; padding: 0 8px; height: 30px; flex: 1; background: #fff; gap: 2px; min-width: 0; transition: background .15s, border-color .15s; }
.insp-size-field:hover { background: #f3f4f6; }
.insp-size-field:focus-within { border-color: var(--editor-accent); background: #fff; }
.insp-size-field__label { font-size: 11px; color: #999; margin-right: 2px; font-weight: 400; flex-shrink: 0; white-space: nowrap; }
.insp-size-field__input { flex: 1; border: none; outline: none; font-size: 13px; color: #333; background: transparent; width: 30px; min-width: 0; font-family: var(--font-sans); font-weight: 400; text-align: center; }
.insp-size-field__input:disabled { color: #aaa; }
.insp-size-field--none { justify-content: space-between; background: #fff; }
.insp-size-field--none .insp-size-field__unit { color: var(--editor-accent); }
/* None state has no value — caret + any typed text stay muted grey so the
   field reads as "empty / not set" instead of an authored zero. The unit
   suffix keeps its accent color because the user can still click it to
   pick a real unit. */
.insp-size-field--none .insp-size-field__input { color: #aaa; }
.insp-size-field--none .insp-size-field__input::placeholder { color: transparent; }
.insp-size-field--none .insp-size-field__label { color: #c0c0c0; }
.insp-size-field__input::placeholder { color: #bbb; font-size: 12px; }
.insp-size-field__unit { font-size: 10px; color: var(--editor-accent); flex-shrink: 0; cursor: pointer; padding: 2px 4px; border-radius: 3px; transition: background 0.12s; }
.insp-size-field__unit:hover { background: #f0f0ff; }
/* Basic px* labels are static (no dropdown); only advanced unit triggers
   (.insp-size-unit-trigger) are clickable. */
.insp-size-field__unit:not(.insp-size-unit-trigger) { cursor: default; pointer-events: none; color: #999; }
.insp-size-field__unit:not(.insp-size-unit-trigger):hover { background: transparent; }

/* Unit dropdown */
.insp-unit-dropdown { background: #fff; border: 1px solid #e0e0e0; border-radius: 6px; box-shadow: 0 6px 20px rgba(0,0,0,0.12); padding: 4px; z-index: 6000; min-width: 160px; }

.cs-layout-dropdown { background: #fff; border: 1px solid #e0e0e0; border-radius: 0; box-shadow: 0 6px 20px rgba(0,0,0,0.12); padding: 0; z-index: 6000; min-width: 180px; display: flex; flex-direction: column; }
.cs-layout-dropdown__item { display: flex; align-items: center; gap: 8px; padding: 8px 14px; background: none; border: none; font-family: var(--font-sans); font-size: 13px; color: var(--panel-text-secondary, #3b3d4d); cursor: pointer; border-radius: 0; text-align: left; }
.cs-layout-dropdown__item:hover { background: var(--panel-surface, #f5f5f5); }
.cs-layout-dropdown__item.is-active { background: #F1EEFE; color: #5B3DF5; font-weight: 400; }
.cs-layout-dropdown__item.is-active:hover { background: #E8E2FD; }
.cs-layout-dropdown__icon { display: inline-flex; align-items: center; justify-content: center; color: inherit; flex-shrink: 0; }
.insp-unit-dropdown__item { padding: 7px 12px; font-size: 13px; color: #333; border-radius: 4px; cursor: pointer; transition: background 0.1s; }
.insp-unit-dropdown__item:hover { background: #f5f5ff; }
.insp-unit-dropdown__item.is-active { color: var(--editor-accent); font-weight: 400; background: #F1EEFE; }

/* Major section (Design, Layout, Position, Cursor, Anchor) */
.insp-major { border-bottom: 1px solid var(--panel-border); }
.insp-major__header { display: flex; align-items: center; justify-content: space-between; padding: 0 16px; cursor: pointer; user-select: none; background: #f0f1f5; height: 44px; box-sizing: border-box; line-height: 1; flex-shrink: 0; }
.insp-major__header:hover { background: #e8e9ee; }
.insp-major__title {
  font-size: 13px;
  font-weight: 700;
  color: var(--panel-text);
  letter-spacing: 0.3px;
}
.insp-major__arrow {
  display: inline-block;
  flex: 0 0 8px;
  width: 8px !important;
  height: 8px !important;
  min-width: 8px;
  min-height: 8px;
  max-width: 8px;
  max-height: 8px;
  color: var(--panel-text-secondary);
  transition: transform 0.15s;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
  overflow: visible;
  vertical-align: middle;
}
.insp-major__arrow.is-open { transform: rotate(0deg); }
.insp-major__body { padding: 14px 16px 18px; }
.insp-major__body.is-collapsed { display: none; }
/* If body contains sub-sections, they handle their own padding — remove outer padding */
.insp-major__body:has(> .insp-sub) { padding: 0 16px; }
.insp-major__body > .insp-sub:first-child { border-top: none; }
.insp-major__body > .insp-sub:last-child { border-bottom: none; }

/* Margins grid (Position section) */
.insp-margins-header { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; margin-bottom: 8px; }
.insp-margins-unit { font-size: 11px; color: var(--editor-accent); cursor: pointer; display: flex; align-items: center; gap: 2px; }
.insp-margins-grid { display: flex; flex-direction: column; gap: 8px; }
.insp-margin-row { display: flex; gap: 8px; }
.insp-margin-cell { display: flex; align-items: center; gap: 4px; flex: 1; }
.insp-dock-btn {
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; flex-shrink: 0;
  border: 1px solid #dde1e6; border-radius: 4px;
  background: #fff; cursor: pointer; color: #7a7a7a;
  transition: all .15s;
}
.insp-dock-btn:hover { border-color: #5B3DF5; color: #5B3DF5; }
.insp-dock-btn.is-docked { background: #F1EEFE; border-color: #5B3DF5; color: #5B3DF5; }
.insp-dock-btn svg { width: 18px; height: 18px; }
.insp-margin-input-wrap {
  display: flex; align-items: center;
  border: 1px solid #dde1e6; border-radius: 4px;
  height: 30px; flex: 1; padding: 0 6px;
  background: #fff;
  transition: border-color .15s, background .15s;
}
.insp-margin-input-wrap:hover { background: #f3f4f6; }
.insp-margin-input-wrap:focus-within { border-color: #5B3DF5; background: #fff; }
.insp-margin-input {
  flex: 1; border: none; outline: none;
  font-size: 13px; color: var(--panel-text);
  background: transparent; width: 30px;
  font-family: var(--font-sans);
}
.insp-margin-input__suffix { font-size: 10px; color: #aaa; flex-shrink: 0; }
/* "auto" margin — the element is anchored to the opposite edge, so this
 * side isn't editable. Shown muted on a faint fill. */
.insp-margin-input-wrap.is-auto {
  background: var(--panel-surface, #f3f4f6);
  border-color: #e3e5ea;
}
.insp-margin-input-wrap.is-auto .insp-margin-input {
  color: var(--panel-text-muted, #9aa0ac);
  cursor: default;
}
/* Disabled by parent Stack / opposite-side dock — matches the Size
   advanced "--disabled" greyed look so the user sees it's not editable. */
.insp-margin-input-wrap.is-disabled {
  background: #f5f5f5;
  border-color: #e0e0e0;
}
.insp-margin-input-wrap.is-disabled .insp-margin-input,
.insp-margin-input-wrap.is-disabled .insp-unit-suffix {
  color: #999;
  cursor: not-allowed;
}
.insp-dock-btn.is-disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: #f5f5f5;
  border-color: #e0e0e0;
  color: #999;
}
.insp-dock-btn.is-disabled:hover {
  border-color: #e0e0e0;
  color: #999;
  background: #f5f5f5;
}

/* Unit selector button (header + inline suffix) */
.insp-unit-btn {
  display: inline-flex; align-items: center; gap: 2px;
  border: none; background: none; cursor: pointer;
  font-size: 11px; color: #5B3DF5; padding: 2px 4px;
  border-radius: 3px; transition: background .1s;
}
.insp-unit-btn:hover { background: #F1EEFE; }
.insp-unit-btn svg { flex-shrink: 0; }
.insp-unit-suffix {
  border: none; background: none; cursor: pointer;
  font-size: 11px; color: #5B3DF5; padding: 0 6px 0 2px;
  flex-shrink: 0; transition: color .1s;
}
.insp-unit-suffix:hover { color: #4A2BE6; }

/* Margins (Position section) unit pickers — no hover feedback at all:
 * the common-unit button keeps no background and the per-side suffix keeps
 * its base colour on hover. */
.insp-margins-header .insp-unit-btn:hover { background: none; }
.insp-margins-grid .insp-unit-suffix:hover { color: #5B3DF5; }

/* Unit dropdown */
.unit-dropdown {
  background: #fff; border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0,0,0,.14), 0 0 0 1px rgba(0,0,0,.06);
  padding: 4px 0; min-width: 60px;
  animation: respDropIn .1s ease-out;
}
.unit-dropdown__item {
  display: block; width: 100%; padding: 6px 14px;
  border: none; background: none; cursor: pointer;
  font-size: 13px; color: #000624; text-align: left;
  transition: background .1s;
}
.unit-dropdown__item:hover { background: #F1EEFE; }
.unit-dropdown__item.is-selected { color: #5B3DF5; font-weight: 400; }

/* Checkbox (Wix style) */
.insp-checkbox { display: flex; align-items: center; cursor: pointer; flex-shrink: 0; }
.insp-checkbox input { display: none; }
.insp-checkbox__box {
  width: 18px; height: 18px; border: 2px solid #b6c1cd; border-radius: 4px;
  display: flex; align-items: center; justify-content: center; transition: all 0.15s;
}
.insp-checkbox input:checked + .insp-checkbox__box {
  background: var(--editor-accent); border-color: var(--editor-accent);
}
.insp-checkbox input:checked + .insp-checkbox__box::after {
  content: ''; display: block; width: 5px; height: 9px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); margin-top: -2px;
}

/* Inline field (label + value on same row) */
.insp-inline-field { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.insp-inline-field__label { font-size: 12px; color: var(--panel-text-secondary); min-width: 56px; flex-shrink: 0; }

/* Transform rows (Scale, Skew, Translate) */
.insp-transform-row { display: flex; align-items: center; gap: 4px; margin-bottom: 8px; }
.insp-transform-row__label { font-size: 12px; color: var(--panel-text-secondary); min-width: 56px; flex-shrink: 0; }
.insp-transform-row__axis { font-size: 11px; color: #999; flex-shrink: 0; text-transform: uppercase; }

/* Adjust note */
.insp-adjust-note { font-size: 12px; line-height: 1.5; color: var(--panel-text-muted); margin: 8px 0 14px; }

/* Sub-section inside Design (Background, Border, etc.) */
.insp-sub { border-top: 1px solid var(--panel-border); margin: 0 -16px; }
.insp-sub__header { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; cursor: pointer; font-size: 13px; font-weight: 400; color: var(--panel-text-secondary); }
.insp-sub__header:hover { background: var(--panel-surface); }
.insp-sub__arrow { color: var(--panel-text-secondary); transition: transform 0.15s; }
.insp-sub__arrow.is-collapsed { transform: rotate(-90deg); }
/* Container top / bottom padding = the divider's per-side margin so
 * EVERY cục (block between `<hr class="insp-divider">`s) has the same
 * 16 px breathing room above and below. Divider margin bumped to 16
 * below so both containers agree. User 2026-07-02: mỗi cục div phải có
 * khoảng trên/dưới bằng nhau và 16 px. */
.insp-sub__body { padding: 16px; }
.insp-sub__body > .insp-divider { margin-top: 16px; margin-bottom: 16px; }
/* `.insp-toggle-row` ships with its own 10 px vertical padding (used
 * elsewhere as its natural row height). When it lands as a cục inside
 * .insp-sub__body that internal padding stacks on top of the divider
 * margin + container padding, so the Apply-text-shadow cục looked much
 * taller than its neighbours. Strip the internal padding here so the
 * cục obeys the shared 16 px rule. User 2026-07-02 "cục apply text
 * shadow khoảng lớn thế". */
.insp-sub__body > .insp-toggle-row { padding-top: 0; padding-bottom: 0; }
.insp-sub__body.is-collapsed { display: none; }
.insp-sub__divider { border: none; border-top: 1px solid var(--panel-border); margin: 14px -16px; }

/* Global Sections panel (Wix-style) */
.sp-global__desc {
  font-size: 12px;
  line-height: 1.5;
  color: var(--panel-text-secondary);
  margin: 4px 0 16px;
}
.sp-global__group { margin-bottom: 8px; }
.sp-global__group-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--panel-border);
  font-size: 13px;
  font-weight: 400;
  color: var(--panel-text);
}
.sp-global__group-arrow { color: var(--panel-text); transition: transform 0.15s; }
.sp-global__item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--panel-border);
  cursor: pointer;
}
.sp-global__item:hover { background: var(--panel-surface-hover); }
.sp-global__handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  color: var(--panel-text-muted);
  cursor: grab;
  flex-shrink: 0;
}
.sp-global__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #3faf4f;
  flex-shrink: 0;
}
.sp-global__label {
  font-size: 13px;
  color: var(--panel-text);
  flex: 1 1 0;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sp-global__badge {
  font-size: 11px;
  color: var(--panel-text-muted);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sp-global__check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #3faf4f;
  flex-shrink: 0;
}
.sp-global__more {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--panel-text);
  opacity: 0;
  border-radius: 4px;
  flex-shrink: 0;
  transition: opacity 0.12s, color 0.12s;
}
.sp-global__item:hover .sp-global__more { opacity: 1; }
.sp-global__more:hover { color: var(--editor-accent); }

/* "Add to page" link — Wix style: plain blue text, no border/background. */
.sp-global__add {
  border: 0;
  background: transparent;
  color: var(--editor-accent, #5B3DF5);
  font-size: 13px;
  font-weight: 400;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
  font-family: inherit;
  transition: color 0.12s;
}
.sp-global__add:hover { color: #0f62e6; text-decoration: underline; }
/* When not in use, the "Default" badge feels redundant — fade it. */
.sp-global__item.is-not-in-use .sp-global__badge { opacity: 0.55; }

/* 3-dot context menu (Edit / Add to More Pages / Rename / Duplicate / Delete) */
.sp-global-menu {
  position: absolute;
  z-index: 50;
  background: #fff;
  border: 1px solid #e2e3ea;
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0, 6, 36, 0.14), 0 0 0 1px rgba(0, 6, 36, 0.04);
  padding: 6px 0;
  min-width: 200px;
  font-size: 13px;
}
.sp-global-menu__item {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  padding: 8px 16px;
  font-family: inherit;
  font-size: 13px;
  color: #131720;
  cursor: pointer;
  transition: background 0.1s;
}
.sp-global-menu__item:hover:not(:disabled) { background: #f4f5f8; }
.sp-global-menu__item.is-disabled,
.sp-global-menu__item:disabled {
  color: #c5cad2;
  cursor: default;
}
.sp-global-menu__item.is-danger:not(:disabled) { color: #131720; }
.sp-global-menu__item.is-danger:not(:disabled):hover { color: #b91c1c; background: #fef2f2; }

/* Size block — 3-dots context menu dropdown */
.insp-size-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 180px;
  background: #fff;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  padding: 4px;
  z-index: var(--z-tooltip);
  display: none;
}
.insp-size-menu.is-open { display: block; }
.insp-size-menu__item {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: none;
  background: none;
  text-align: left;
  font-size: 13px;
  color: var(--panel-text);
  cursor: pointer;
  border-radius: 4px;
  font-family: var(--font-sans);
}
.insp-size-menu__item:hover { background: var(--panel-surface-hover); }

/* Responsive behavior block (label + dropdown) */
.insp-resp-behavior-block { padding: 0; margin-top: 12px; }
.insp-resp-behavior-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--panel-text-secondary);
  margin-bottom: 8px;
  margin-top: 12px;
}

/* Scale text (shown in advanced Size mode) */
.insp-scale-text { padding: 4px 0; }
.insp-scale-text__hint { font-size: 12px; color: var(--panel-text-secondary); line-height: 1.5; margin-top: 8px; }

/* Font size Max-min collapsible */
.insp-fs-range { margin-top: 10px; }
.insp-fs-range__header {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 4px 0; border: none; background: none; cursor: pointer;
  font-size: 13px; color: var(--panel-text-secondary); font-family: var(--font-sans);
}
.insp-fs-range__header:hover { color: var(--panel-text-secondary); }
.insp-fs-range__arrow { color: var(--panel-text-secondary); transition: transform 0.15s; }
.insp-fs-range__arrow.is-collapsed { transform: rotate(-90deg); }
.insp-fs-range__body { padding-top: 8px; }
.insp-fs-range__body.is-collapsed { display: none; }
.insp-fs-range__row { display: flex; align-items: center; gap: 8px; }
.insp-fs-range__label { font-size: 13px; color: var(--panel-text-secondary); flex-shrink: 0; }
.insp-fs-range__unit {
  border: none; background: none; cursor: pointer;
  color: var(--panel-text-secondary); font-size: 12px; font-weight: 400;
  font-family: var(--font-sans); flex-shrink: 0; padding: 0 2px;
}
.insp-fs-range__unit:hover { color: var(--panel-text); }

/* Text inspector — Adjust section */
.insp-adjust-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0; }
.insp-adjust-row__label { font-size: 13px; color: var(--panel-text-secondary); flex-shrink: 0; }
.insp-adjust-xy { display: flex; align-items: center; gap: 8px; }
.insp-adjust-input--sm { width: 74px !important; padding: 0 6px; }
.insp-adjust-input__unit-link { color: var(--editor-accent) !important; font-weight: 400; }
.insp-text-horizontal-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 4px 0; }
.insp-text-horizontal-row__label { font-size: 13px; color: var(--panel-text-secondary); flex: 1; }
.insp-font-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; }
.insp-font-weight { width: 110px; }
.insp-adjust-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.insp-adjust-input {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  padding: 0 8px;
  height: 30px;
  background: #fff;
  min-width: 0;
  flex: 0 0 auto;
  width: 100px;
  transition: background .15s, border-color .15s;
}
.insp-adjust-2col .insp-adjust-input { width: auto; }
.insp-adjust-input:hover { background: #f3f4f6; }
.insp-adjust-input:focus-within { border-color: var(--editor-accent); background: #fff; }
.insp-adjust-input input {
  /* Shrink the text input so its sibling unit-trigger / suffix span stays
   * visible. min-width:0 prevents flex from pushing the trailing unit
   * outside the box on small numbers (e.g. "100%" vs "0"). */
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-size: 13px;
  color: var(--panel-text);
  font-family: var(--font-sans);
  padding: 0;
}
.insp-adjust-input__prefix { font-size: 11px; color: var(--panel-text-muted); flex-shrink: 0; }
.insp-adjust-input > span:last-child { font-size: 11px; color: var(--panel-text-muted); flex-shrink: 0; }
/* Axis label (X / Y) sits OUTSIDE the input box, like Wix */
.insp-adjust-axis-label {
  font-size: 12px;
  color: var(--panel-text-secondary, #666);
  flex-shrink: 0;
  width: 12px;
  text-align: center;
}
/* Unit trigger button inside an .insp-adjust-input — looks like the unit text but clickable */
.insp-unit-trigger {
  border: none;
  background: transparent;
  padding: 0;
  font: inherit;
  font-size: 11px;
  color: var(--editor-accent, #5B3DF5);
  cursor: pointer;
  flex-shrink: 0;
  font-weight: 400;
}
.insp-unit-trigger:hover { color: #4A2BE6; }

/* Text inspector specific */
.insp-size-coords { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.insp-size-field.is-disabled { opacity: 0.6; }
.insp-size-field.is-disabled input { cursor: not-allowed; }
.insp-size-field--disabled { background: #f5f5f5; border-color: #e0e0e0; }
.insp-size-field--disabled input { cursor: not-allowed; color: #999; }
.insp-size-field--disabled .insp-size-field__unit { color: #999; }

/* Sub divider above the Responsive behavior row */
hr.insp-sub-divider { border: 0; border-top: 1px solid var(--panel-border, #e5e5e5); margin: 16px -16px 0; }
/* Variant of insp-sub without the default top border (used inside Line Design) */
.insp-sub.insp-sub--no-divider { border-top: 0; }

/* Line style thumbnail picker (Wix-style) */
.insp-line-style-picker { display: flex; align-items: center; gap: 6px; margin: 4px 0 12px 0; }
.insp-line-style-arrow { width: 24px; height: 56px; flex-shrink: 0; border: none; background: transparent; color: #5B3DF5; cursor: pointer; border-radius: 4px; display: flex; align-items: center; justify-content: center; }
.insp-line-style-arrow:hover { background: #f0f4f8; }
.insp-line-style-track { display: flex; gap: 8px; flex: 1; overflow-x: auto; padding: 2px; }
.insp-line-style-track::-webkit-scrollbar { display: none; }
.insp-line-style-thumb { width: 70px; height: 56px; border: 2px solid transparent; border-radius: 6px; background: #fff; cursor: pointer; padding: 0; display: flex; align-items: center; justify-content: center; transition: border-color 0.15s ease, background 0.15s ease; flex-shrink: 0; }
.insp-line-style-thumb:hover { border-color: #80b1ff; background: rgba(127, 204, 247, 0.2); }
.insp-line-style-thumb.is-selected { border-color: #ff7d38; background: #fff; }
.insp-line-style-thumb svg { display: block; }

/* Custom CSS row */
.insp-custom-css-row { display: flex; align-items: center; justify-content: space-between; margin-top: 18px; padding-top: 14px; border-top: 1px solid #ececec; }
.insp-custom-css-link { background: transparent; border: none; color: #2b2e36; font-size: 13px; cursor: pointer; padding: 0; }
.insp-custom-css-link:hover { color: #5B3DF5; }
.insp-custom-css-generate { display: flex; align-items: center; gap: 4px; background: transparent; border: none; color: #5B3DF5; font-size: 13px; font-weight: 400; cursor: pointer; padding: 0; }
.insp-custom-css-generate svg { color: #5B3DF5; }
.insp-custom-css-generate:hover { color: #0e5ce6; }
.insp-text-input-row { display: inline-flex; align-items: center; gap: 4px; border: 1px solid #e0e0e0; border-radius: 4px; padding: 0 8px; height: 30px; background: #fff; width: 100px; }
.insp-text-input-row:focus-within { border-color: var(--editor-accent); }
.insp-text-input { width: 100%; border: none; outline: none; background: transparent; font-size: 13px; color: var(--panel-text); font-family: var(--font-sans); padding: 0; }
.insp-text-input__suffix { font-size: 11px; color: var(--panel-text-muted); flex-shrink: 0; }
.insp-spacing-unit {
  border: none; background: none; cursor: pointer;
  font-size: 11px; color: var(--editor-accent);
  font-weight: 400; padding: 0 2px;
  font-family: var(--font-sans); flex-shrink: 0;
  transition: color .1s;
}
.insp-spacing-unit:hover { color: #4A2BE6; }
.insp-spacing-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.insp-spacing-cell { display: flex; align-items: center; gap: 8px; min-width: 0; }
.insp-spacing-field { display: inline-flex; align-items: center; gap: 6px; border: 1px solid #e0e0e0; border-radius: 4px; padding: 0 8px; height: 30px; background: #fff; flex: 1; min-width: 0; }
.insp-spacing-field:focus-within { border-color: var(--editor-accent); }
.insp-spacing-icon { color: var(--panel-text-secondary); flex-shrink: 0; }
.insp-color-picker-row { display: flex; align-items: center; gap: 10px; padding: 4px 0; }
.insp-style-buttons { display: flex; gap: 4px; align-items: center; }
.insp-style-divider { display: inline-block; width: 1px; height: 20px; background: var(--panel-border); margin: 0 4px; }
.insp-style-btn {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--panel-text);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
.insp-style-btn:hover { background: var(--panel-surface-hover); }
.insp-style-btn.is-active { background: #F1EEFE; border-color: var(--editor-accent); color: var(--editor-accent); }

/* Wix-style Color Picker popover */
/* ===== 3-tab Color Picker (Solid / Gradient / Fluid) ===== */
.vendr-cp3 {
  position: fixed;
  width: 280px;
  background: #fff;
  border: 1px solid #e0e2e8;
  border-radius: 0;
  box-shadow: 0 12px 40px rgba(0,0,0,0.18);
  z-index: 5200;
  font-family: var(--font-sans, system-ui);
  color: #0a0a0b;
}
.vendr-cp3__header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 12px;
  border-bottom: 1px solid #eef0f4;
  cursor: move;
}
.vendr-cp3__title { font-size: 14px; font-weight: 400; }
.vendr-cp3__close { border: 0; background: none; cursor: pointer; padding: 4px; border-radius: 4px; color: #6b6f7a; }
.vendr-cp3__close:hover { background: #f3f4f6; }
.vendr-cp3__tabs {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  border-bottom: 1px solid #eef0f4;
}
.vendr-cp3__tab {
  border: 0; background: none; cursor: pointer; padding: 12px 0;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  position: relative;
}
.vendr-cp3__tab.is-active::after {
  content: ''; position: absolute; left: 25%; right: 25%; bottom: 0; height: 2px; background: #3B82F6;
}
.vendr-cp3__tab-dot { width: 28px; height: 28px; border-radius: 50%; display: block; }
.vendr-cp3__tab.is-active .vendr-cp3__tab-dot { box-shadow: 0 0 0 1.5px #fff inset; }
.vendr-cp3__tab-dot--solid    { background: #0a0a0b; }
.vendr-cp3__tab-dot--gradient { background: radial-gradient(circle at 30% 30%, #fff, #6b6f7a 60%, #1a1d27); }
.vendr-cp3__tab-dot--fluid    { background: radial-gradient(circle at 30% 30%, #9CC0FF 0%, transparent 55%), radial-gradient(circle at 70% 70%, #1a1d27 0%, transparent 55%), #6b6f7a; }
.vendr-cp3__body { padding: 14px 16px 16px; }
.vendr-cp3__section { margin-bottom: 14px; }
.vendr-cp3__section + .vendr-cp3__section { padding-top: 14px; border-top: 1px solid #eef0f4; }
.vendr-cp3__section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; font-size: 13px; color: #1a1d27; }
.vendr-cp3__link { border: 0; background: none; cursor: pointer; color: #3B82F6; font-size: 13px; font-family: inherit; padding: 0; }
.vendr-cp3__link:hover { text-decoration: underline; }
.vendr-cp3__grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.vendr-cp3__grid--lg { grid-template-columns: repeat(6, 1fr); }
/* Theme colors: small, tight, squared with subtle radius. Stretches to fill row. */
.vendr-cp3__grid--theme {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
}
.vendr-cp3__grid--theme .vendr-cp3__swatch--sq {
  width: 100%; aspect-ratio: 1 / 1; height: auto;
}
/* My colors: round circles with comfortable spacing. */
.vendr-cp3__grid--my {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.vendr-cp3__swatch {
  width: 36px; height: 36px;
  border: 1px solid #d8dde4; border-radius: 8px;
  cursor: pointer; padding: 0;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.vendr-cp3__swatch--sq {
  width: 32px; height: 32px;
  border-radius: 4px;
  border: 1px solid rgba(0,0,0,0.06);
}
.vendr-cp3__swatch--round {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.08);
}
.vendr-cp3__swatch:hover { border-color: #3B82F6; }
.vendr-cp3__swatch.is-active { box-shadow: 0 0 0 2px #3B82F6, 0 0 0 4px #fff inset; }
.vendr-cp3__swatch--add { background: #fff; color: #3B82F6; display: inline-flex; align-items: center; justify-content: center; border-style: dashed; }
.vendr-cp3__swatch--lg {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.08);
}
.vendr-cp3__hex { text-align: right; font-size: 12px; color: #6b6f7a; margin-top: 10px; font-family: var(--font-mono, ui-monospace, monospace); }

/* Tab Gradient — match the Wix reference: rounded select with caret,
 * tall preview rectangle (slightly rounded corners, no harsh border),
 * thick stops bar with chunky circular handles, large square swatch on
 * the right of the opacity row. */
.vendr-cp3__row { margin-bottom: 14px; }
.vendr-cp3__row--between { display: flex; align-items: center; justify-content: space-between; }
.vendr-cp3__select {
  width: 100%; height: 36px; padding: 0 12px;
  border: 1px solid #e0e3eb; border-radius: 10px; background: #fff;
  font-size: 14px; font-family: inherit; color: #0a0a0b;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b6f7a' stroke-width='2'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
.vendr-cp3__preview {
  width: 100%; height: 170px;
  border-radius: 4px;
  margin-bottom: 14px;
  position: relative;
  background: #f3f4f6;
  overflow: hidden;
}
.vendr-cp3__preview--fluid { cursor: crosshair; border-radius: 6px; }
.vendr-cp3__preview--grad  { cursor: default; }
/* Angle dial — large semi-transparent ring centred on the preview
 * (linear) or on the current center handle (conic via JS positioning).
 * The handle is a small dot pinned on the ring's edge at angle deg. */
.vendr-cp3__angle-dial {
  position: absolute;
  left: 50%; top: 50%;
  width: 96px; height: 96px;
  transform: translate(-50%, -50%);
  border: 1.5px solid rgba(255,255,255,0.9);
  border-radius: 50%;
  background: rgba(0,0,0,0.10);
  pointer-events: auto;
  cursor: grab;
  display: flex; align-items: center; justify-content: center;
}
.vendr-cp3__angle-dial:active { cursor: grabbing; }
.vendr-cp3__angle-text {
  color: #fff; font-size: 14px; font-weight: 400;
  text-shadow: 0 1px 2px rgba(0,0,0,0.35);
  pointer-events: none; user-select: none;
}
.vendr-cp3__angle-handle {
  position: absolute;
  width: 12px; height: 12px;
  background: #fff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 1.5px rgba(0,0,0,0.25);
  pointer-events: none;
}
/* Center handle for radial / conic — small white dot, drag to move
 * the gradient's center. */
.vendr-cp3__center-handle {
  position: absolute;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid rgba(0,0,0,0.25);
  transform: translate(-50%, -50%);
  cursor: grab;
  box-shadow: 0 0 0 1.5px rgba(255,255,255,0.85);
}
.vendr-cp3__center-handle:active { cursor: grabbing; }
/* Stops row — bar carries the gradient itself (live preview),
 * handles are big circles with the stop's color inside. The active
 * stop gets a small caret pointing down below the bar (a CSS triangle
 * hung on .is-active). */
.vendr-cp3__stops-row { display: flex; align-items: center; gap: 4px; margin: 4px 0 18px; }
.vendr-cp3__stops-bar {
  flex: 1; height: 8px; border-radius: 999px;
  position: relative; cursor: pointer;
  background: linear-gradient(90deg, #5B3DF5 0%, #3B82F6 100%);
  margin-right: 4px;
}
.vendr-cp3__stop-handle {
  position: absolute; top: 50%; transform: translate(-50%, -50%);
  width: 20px; height: 20px; border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.25), 0 1px 2px rgba(0,0,0,0.15);
  cursor: grab;
  z-index: 1;
}
.vendr-cp3__stop-handle.is-active {
  box-shadow: 0 0 0 1.5px #3B82F6, 0 1px 2px rgba(0,0,0,0.15);
}
.vendr-cp3__stop-handle.is-active::after {
  content: ''; position: absolute;
  left: 50%; top: 100%; transform: translate(-50%, 6px);
  border: 4px solid transparent;
  border-top-color: #3B82F6;
}
.vendr-cp3__icon-btn {
  border: 0; background: none; cursor: pointer; color: #6b6f7a;
  width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 4px;
  flex-shrink: 0;
}
.vendr-cp3__icon-btn:hover { background: #f3f4f6; color: #1a1d27; }

/* Opacity row — checker-pattern track + circle thumb, with the right-
 * hand square showing the resolved color/stop. */
.vendr-cp3__opacity-row { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.vendr-cp3__opacity {
  flex: 1; height: 10px; -webkit-appearance: none; appearance: none;
  background:
    linear-gradient(90deg, transparent 0%, #3B82F6 100%),
    linear-gradient(45deg, #ccc 25%, transparent 25%),
    linear-gradient(-45deg, #ccc 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #ccc 75%),
    linear-gradient(-45deg, transparent 75%, #ccc 75%);
  background-size: 100% 100%, 8px 8px, 8px 8px, 8px 8px, 8px 8px;
  background-position: 0 0, 0 0, 0 4px, 4px -4px, -4px 0;
  border-radius: 999px; outline: none;
}
.vendr-cp3__opacity::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; border: 1.5px solid #3B82F6;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
  cursor: grab;
}
.vendr-cp3__opacity::-moz-range-thumb {
  width: 16px; height: 16px; border-radius: 50%;
  background: #fff; border: 1.5px solid #3B82F6;
}
.vendr-cp3__opacity-val { font-size: 13px; color: #0a0a0b; min-width: 44px; text-align: left; }
.vendr-cp3__stop-swatch {
  width: 36px; height: 36px; border-radius: 8px;
  border: 1px solid #d8dde4;
  cursor: pointer; padding: 0; flex-shrink: 0;
}

/* Size / Spread sliders (Fluid tab) — label above, slider + value
 * row below, matches the reference layout. */
.vendr-cp3__slider-row { margin-bottom: 14px; }
.vendr-cp3__slider-label {
  display: block;
  font-size: 13px; color: #0a0a0b; margin-bottom: 6px;
}
.vendr-cp3__slider-row .vendr-cp3__opacity-row {
  display: flex; align-items: center; gap: 12px;
}

/* Tab Fluid */
.vendr-cp3__fluid-handle {
  position: absolute; transform: translate(-50%, -50%);
  width: 24px; height: 24px; border-radius: 50%;
  background: transparent !important; /* show the gradient through */
  border: 3px solid #fff;
  box-shadow: 0 0 0 1.5px rgba(0,0,0,0.35), 0 1px 3px rgba(0,0,0,0.2);
  cursor: grab;
}
.vendr-cp3__fluid-handle.is-active {
  box-shadow: 0 0 0 2px #3B82F6, 0 0 0 3.5px #fff, 0 1px 3px rgba(0,0,0,0.25);
}

/* Legacy single-tab picker — kept for fallback if needed */
.vendr-colorpicker {
  position: fixed;
  width: 260px;
  background: #fff;
  border: 1px solid #e0e2e8;
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.16);
  padding: 14px 16px 16px;
  z-index: 5000;
  font-family: var(--font-sans);
  color: #000624;
}
.vendr-colorpicker__header { display: flex; align-items: center; justify-content: space-between; padding-bottom: 10px; border-bottom: 1px solid #e0e2e8; margin-bottom: 12px; cursor: move; }
.vendr-colorpicker__title { font-size: 14px; font-weight: 400; }
.vendr-colorpicker__close { border: none; background: none; cursor: pointer; color: #000624; padding: 4px; border-radius: 4px; display: inline-flex; }
.vendr-colorpicker__close:hover { background: #f0f1f5; }
.vendr-colorpicker__section { margin-bottom: 12px; }
.vendr-colorpicker__section + .vendr-colorpicker__section { padding-top: 12px; border-top: 1px solid #e0e2e8; }
.vendr-colorpicker__section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; font-size: 13px; color: #000624; }
.vendr-colorpicker__link { border: none; background: none; cursor: pointer; color: var(--editor-accent); font-size: 13px; font-weight: 400; font-family: var(--font-sans); padding: 0; }
.vendr-colorpicker__link:hover { text-decoration: underline; }
.vendr-colorpicker__grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.vendr-colorpicker__swatch {
  width: 30px;
  height: 30px;
  border: 1px solid #d0d3dd;
  border-radius: 6px;
  cursor: pointer;
  padding: 0;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.vendr-colorpicker__swatch:hover { border-color: var(--editor-accent); }
.vendr-colorpicker__swatch.is-active { border-color: var(--editor-accent); box-shadow: 0 0 0 2px var(--editor-accent) inset, 0 0 0 1px var(--editor-accent); }
.vendr-colorpicker__swatch--add { background: #fff; color: var(--editor-accent); display: inline-flex; align-items: center; justify-content: center; border-style: dashed; }
.vendr-colorpicker__swatch--add:hover { background: #f4f9ff; }
.vendr-colorpicker__hex { text-align: right; font-size: 12px; color: #7a7d8c; margin-top: 8px; font-family: var(--font-mono); }

/* ===== Custom Color Panel (opened via "+ Add") ===== */
.vendr-ccp {
  position: fixed;
  width: 280px;
  background: #fff;
  border-radius: 0;
  box-shadow: 0 7px 8px -4px rgba(0,0,0,0.15), 0 12px 17px 2px rgba(0,0,0,0.1), 0 5px 22px 4px rgba(0,0,0,0.09);
  z-index: 5300;
  font-family: var(--font-sans);
  color: #000624;
  overflow: hidden;
}
.vendr-ccp__header {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid #e5e5e5;
  cursor: move;
}
.vendr-ccp__back, .vendr-ccp__close {
  background: none; border: none; cursor: pointer;
  padding: 4px; border-radius: 4px; display: inline-flex; color: #000624;
}
.vendr-ccp__back:hover, .vendr-ccp__close:hover { background: #f4f5f8; }
.vendr-ccp__title { flex: 1; font-size: 14px; font-weight: 400; }

.vendr-ccp__sb {
  position: relative;
  width: 100%;
  height: 180px;
  cursor: crosshair;
}
.vendr-ccp__sb-handle {
  position: absolute;
  width: 13px; height: 13px;
  border: 1px solid #fff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  box-sizing: border-box;
}

.vendr-ccp__hue {
  position: relative;
  margin: 14px 18px 0;
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(to right, red, #ff0, #0f0, #0ff, #00f, #f0f, red);
  cursor: pointer;
}
.vendr-ccp__hue-handle {
  position: absolute;
  top: 50%;
  width: 16px; height: 16px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: transparent;
  transform: translate(-50%, -50%);
  box-shadow: 0 2px 1px rgba(22, 45, 61, 0.48), 0 0 3px rgba(22, 45, 61, 0.12);
  pointer-events: none;
}

.vendr-ccp__preview {
  padding: 14px 48px 8px;
  display: flex; justify-content: center;
}
.vendr-ccp__preview-prev {
  width: 100%; height: 14px;
  border: 1px solid #e1e3e6;
  border-radius: 6px;
  cursor: pointer;
  padding: 0;
  background: var(--ccp-color, #5B3DF5);
}

.vendr-ccp__tabs {
  display: flex;
  border-bottom: 1px solid #e5e5e5;
  padding: 0 14px;
}
.vendr-ccp__tab {
  flex: 1;
  background: none;
  border: none;
  padding: 10px 0;
  font-size: 12px;
  font-weight: 400;
  color: var(--editor-accent);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  font-family: var(--font-sans);
  transition: color 0.15s, border-color 0.15s;
}
.vendr-ccp__tab:hover { color: #2b5672; }
.vendr-ccp__tab.is-active { color: #2b5672; border-bottom-color: var(--editor-accent); }

.vendr-ccp__inputs {
  display: flex; gap: 8px; align-items: center;
  padding: 12px 16px;
}
.vendr-ccp__eyedrop {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  border: none; background: none; cursor: pointer;
  color: var(--editor-accent);
  border-radius: 0;
  padding: 0;
}
.vendr-ccp__eyedrop:hover { color: #0f62e6; }
.vendr-ccp__field {
  flex: 1; min-width: 0;
  position: relative;
  display: flex; align-items: center; gap: 4px;
}
.vendr-ccp__field--hex { flex: 1; }
.vendr-ccp__prefix {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: #000624;
  pointer-events: none;
}
.vendr-ccp__label {
  position: absolute;
  bottom: -16px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  color: #7a7d8c;
}
.vendr-ccp__input {
  flex: 1; min-width: 0;
  height: 32px;
  padding: 0 6px;
  text-align: center;
  border: 1px solid #e2e3ea;
  border-radius: 0;
  font-size: 14px;
  color: #131720;
  outline: none;
  background: #fff;
  font-family: var(--font-sans);
}
.vendr-ccp__field--hex .vendr-ccp__input { padding-left: 10px; text-align: left; }
.vendr-ccp__input:hover { border-color: #868aa5; }
.vendr-ccp__input:focus { border-color: var(--editor-accent); }

.vendr-ccp__footer {
  display: flex; justify-content: space-between;
  padding: 16px 18px 18px;
  margin-top: 12px;
}
.vendr-ccp__btn {
  min-width: 88px;
  height: 32px;
  padding: 6px 16px;
  border-radius: 0;
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
  font-family: var(--font-sans);
  border: 1px solid transparent;
  transition: background 0.12s;
}
.vendr-ccp__btn--cancel {
  background: #fff;
  border-color: #e2e3ea;
  color: var(--editor-accent);
}
.vendr-ccp__btn--cancel:hover { background: #f4f5f8; }
.vendr-ccp__btn--add {
  background: var(--editor-accent);
  color: #fff;
}
.vendr-ccp__btn--add:hover { background: #0f62e6; }

/* Color while scrolling nested Color row */
.insp-cws-group[data-cws="off"] .insp-cws-only { display: none; }
.insp-cws-group { padding: 0; }
.insp-cws-group .insp-toggle-row { padding: 4px 0; }
.insp-cws-only { margin-top: 8px !important; }
/* Tighter sub-section divider when adjacent to a CWS group */
.insp-cws-group + hr.insp-sub__divider,
hr.insp-sub__divider + .insp-cws-group { margin-top: 8px; margin-bottom: 8px; }

/* Pattern overlay nested grid — 12 thumbnails per page, 4×3 layout. */
.insp-pattern-group[data-pattern="off"] .insp-pattern-only { display: none; }
/* Change layout — custom dropdown with an icon next to the label. Uses
 * .insp-select sizing so it lines up with every other inspector select. */
.insp-layout-pick { position: relative; }
.insp-layout-pick__trigger {
  display: flex; align-items: center;
  width: 100%; height: 30px;
  padding: 0 8px 0 10px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  color: var(--panel-text-secondary, #3b3d4d);
  gap: 8px;
}
.insp-layout-pick__trigger:hover { border-color: #c5cad2; }
.insp-layout-pick__trigger .insp-layout-pick__icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px;
  color: var(--panel-text-secondary, #3b3d4d);
}
.insp-layout-pick__trigger .insp-layout-pick__label { flex: 1; text-align: left; }
.insp-layout-pick__trigger .insp-layout-pick__chev {
  color: var(--panel-text-muted, #888);
}
.insp-layout-pick__menu {
  position: absolute;
  top: calc(100% + 4px); left: 0; right: 0;
  margin: 0; padding: 0;
  list-style: none;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 0;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  z-index: 80;
}
.insp-layout-pick__opt {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  border-radius: 0;
  cursor: pointer;
  font-size: 13px;
  color: var(--panel-text-secondary, #3b3d4d);
}
.insp-layout-pick__opt:hover { background: var(--panel-surface, #f5f5f5); }
.insp-layout-pick__opt.is-selected {
  background: #F1EEFE;
  color: var(--editor-accent, #5B3DF5);
}
.insp-layout-pick__opt .insp-layout-pick__icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px;
}

.insp-pattern-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 14px;
}
.insp-pattern-item {
  aspect-ratio: 1 / 1;
  border: 1px solid #d0d3dd;
  border-radius: 6px;
  cursor: pointer;
  padding: 0;
  background: #fff;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.insp-pattern-item:hover { border-color: #9aa4b8; }
.insp-pattern-item.is-active { border-color: var(--editor-accent); box-shadow: 0 0 0 1px var(--editor-accent); }
.insp-pattern-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}
.insp-pattern-dots { display: flex; justify-content: center; gap: 6px; margin-top: 14px; }
.insp-pattern-dot { width: 8px; height: 8px; border-radius: 50%; background: #d0d3dd; cursor: pointer; transition: background 0.15s; border: none; padding: 0; }
.insp-pattern-dot.is-active { background: var(--editor-accent); }

/* Background — Color row (Wix style: label | slider | input% | swatch) */
.insp-bg-color-row { display: flex; align-items: center; gap: 10px; padding: 4px 0; }
.insp-bg-color-row__label { font-size: 13px; color: var(--panel-text-secondary); flex-shrink: 0; }
.insp-bg-color-row__slider-wrap { flex: 1; display: flex; align-items: center; min-width: 0; }
/* Stacked variant: label sits ABOVE the controls row */
.insp-bg-color-row--stacked { flex-direction: column; align-items: stretch; gap: 6px; }
.insp-bg-color-row--stacked .insp-bg-color-row__label { font-size: 12px; color: var(--panel-text-secondary, #555); }
.insp-bg-color-row__controls { display: flex; align-items: center; gap: 10px; }
.insp-bg-color-row--stacked .insp-bg-color-row__controls { width: 100%; }
.insp-bg-opacity-slider { width: 100%; height: 4px; -webkit-appearance: none; appearance: none; border-radius: 2px; outline: none; background: linear-gradient(to right, transparent 0%, var(--editor-accent) 100%); cursor: pointer; }
.insp-bg-opacity-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: var(--editor-accent); border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.2); cursor: pointer; }
.insp-bg-opacity-slider::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--editor-accent); border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.2); cursor: pointer; border-width: 2px; }
.insp-bg-opacity-input { display: flex; align-items: center; border: 1px solid #e0e0e0; border-radius: 4px; height: 28px; padding: 0 6px; background: #fff; flex-shrink: 0; }
.insp-bg-opacity-input:focus-within { border-color: var(--editor-accent); }
.insp-bg-opacity-input input { width: 28px; border: none; outline: none; background: transparent; font-size: 13px; font-family: var(--font-sans); color: var(--panel-text); text-align: center; padding: 0; }
.insp-bg-opacity-input span { font-size: 11px; color: var(--panel-text-muted); margin-left: 2px; }
.insp-bg-swatch { width: 28px; height: 28px; border-radius: 6px; border: 1px solid #d0d3dd; cursor: pointer; flex-shrink: 0; transition: border-color 0.15s, box-shadow 0.15s; }
.insp-bg-swatch:hover { border-color: var(--editor-accent); box-shadow: 0 0 0 1px var(--editor-accent); }

/* Media label + empty state card (Wix style) */
.insp-media-label { font-size: 13px; color: var(--panel-text-secondary); margin-bottom: 10px; font-weight: 400; }
.insp-media-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 96px;
  padding: 18px 12px;
  background: #f4f5f8;
  border: 1px dashed #c4c8d2;
  border-radius: 6px;
  cursor: pointer;
  color: var(--editor-accent, #5B3DF5);
  font-family: var(--font-sans);
  transition: background 0.15s, border-color 0.15s;
}
.insp-media-empty:hover { background: #ebeef3; border-color: var(--editor-accent, #5B3DF5); }
.insp-media-empty__plus { display: inline-flex; align-items: center; justify-content: center; color: var(--editor-accent, #5B3DF5); }

/* Media preview (bg image set) */
.insp-media-preview {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 8px; background: #fff;
  border: 1px solid var(--panel-border); border-radius: 6px;
  cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s;
}
.insp-media-preview:hover { border-color: var(--editor-accent); }
.insp-media-preview__thumb {
  width: 48px; height: 48px; border-radius: 4px; flex-shrink: 0;
  background-size: cover; background-position: center;
  background-color: #f3f4f6;
}
.insp-media-preview__info { flex: 1; min-width: 0; }
.insp-media-preview__name { font-size: 13px; font-weight: 400; color: var(--panel-text); }
.insp-media-preview__meta { font-size: 11px; color: var(--panel-text-secondary); margin-top: 2px; }
.insp-media-preview__remove {
  background: none; border: none; color: var(--panel-text-secondary);
  padding: 4px; cursor: pointer; border-radius: 4px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
}
.insp-media-preview__remove:hover { background: #f3f4f6; color: #ef4444; }

/* Flash highlight when bg was just set from "Set as background" */
.insp-media-preview.is-just-set, .insp-media-empty.is-just-set {
  animation: inspMediaFlash 1.2s ease;
}
@keyframes inspMediaFlash {
  0% { box-shadow: 0 0 0 3px rgba(17,109,255,0.4); }
  100% { box-shadow: 0 0 0 0 rgba(17,109,255,0); }
}
.insp-media-empty__text { font-size: 13px; font-weight: 400; color: var(--editor-accent, #5B3DF5); }

/* Background media — populated state (Wix layout: full-width thumb + Change
 * Media link row + Opacity slider + Fitting options select + describe textarea). */
.insp-bg-media { display: block; width: 100%; }
.insp-bg-media__thumb {
  width: 100%;
  height: 140px;
  border-radius: 6px;
  border: 1px solid var(--panel-border);
  background-size: cover;
  background-position: center;
  background-color: #f4f5f8;
}
.insp-bg-media__actions {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--panel-border);
}
.insp-bg-media__change {
  background: none; border: none; padding: 0;
  font-family: inherit; font-size: 13px;
  color: var(--editor-accent, #5B3DF5);
  cursor: pointer;
}
.insp-bg-media__icons { display: inline-flex; gap: 4px; }
.insp-bg-media__icon {
  width: 26px; height: 26px;
  display: inline-flex; align-items: center; justify-content: center;
  background: none; border: none; cursor: pointer;
  color: var(--panel-text);
  border-radius: 4px;
}
.insp-bg-media__icon:hover { background: #f4f5f8; }
.insp-bg-media__desc {
  width: 100%; box-sizing: border-box;
  min-height: 60px;
  padding: 8px 10px;
  border: 1px solid var(--panel-border);
  border-radius: 4px;
  font-family: inherit; font-size: 13px;
  color: var(--panel-text);
  resize: vertical;
  background: #fff;
}
.insp-bg-media__desc:focus { outline: none; border-color: var(--editor-accent, #5B3DF5); }

/* Focal Point — inline editing mode on the inspector thumbnail. When
 * .is-focal-editing is set, a draggable dot appears on top of the thumb
 * and Change Media / Remove icons get disabled until the user confirms. */
.insp-bg-media.is-focal-editing .insp-bg-media__thumb {
  cursor: crosshair;
}
.insp-bg-media.is-focal-editing .insp-bg-media__change,
.insp-bg-media.is-focal-editing .insp-bg-media__icon[data-action="remove-bg-media"] {
  opacity: 0.4;
  pointer-events: none;
}
.insp-bg-media.is-focal-editing .insp-bg-media__icon[data-action="bg-media-focal"] {
  color: var(--editor-accent, #5B3DF5);
  background: #F1EEFE;
}
.insp-bg-media__focal-dot {
  position: absolute;
  width: 18px; height: 18px;
  margin-left: -9px; margin-top: -9px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: rgba(17, 109, 255, 0.35);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.4), 0 2px 6px rgba(0,0,0,0.45);
  pointer-events: none;
  cursor: grab;
}
.insp-bg-media__focal-dot::before {
  content: "";
  position: absolute;
  inset: 5px;
  background: #fff;
  border-radius: 50%;
}
.insp-bg-media__thumb { position: relative; }

/* Color row (swatch + slider + value + %) */
.insp-color-row { display: flex; align-items: center; gap: 8px; }
.insp-color-row__slider { flex: 1; height: 4px; -webkit-appearance: none; appearance: none; background: linear-gradient(to right, #e0e0e0, var(--editor-accent)); border-radius: 2px; outline: none; }
.insp-color-row__slider::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; border-radius: 50%; background: var(--editor-accent); cursor: pointer; }
.insp-color-row__dot { font-size: 10px; }
.insp-color-row__val { width: 32px; border: 1px solid var(--panel-border); border-radius: 3px; text-align: center; font-size: 12px; padding: 2px; color: var(--panel-text); background: var(--panel-bg); }
.insp-color-row__pct { font-size: 11px; color: var(--panel-text-muted); }

/* Media placeholder */
.insp-media-placeholder { border: 1px dashed var(--panel-border); border-radius: 8px; padding: 28px; text-align: center; cursor: pointer; transition: border-color 0.15s; background: var(--panel-surface); }
.insp-media-placeholder:hover { border-color: var(--editor-accent); }
.insp-media-placeholder__icon { color: var(--editor-accent); margin-bottom: 4px; }
.insp-media-placeholder__text { font-size: 12px; color: var(--editor-accent); }

/* .insp-section* removed — fully migrated to .insp-major* (see above) */

/* Page inspector */
/* .pg-insp-title removed — use .insp-header > .insp-header__name */
.pg-label { font-size: 13px; color: var(--panel-text-secondary); margin-bottom: 10px; font-weight: 400; }
.pg-label-row { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.pg-info-icon { display: inline-flex; align-items: center; color: var(--panel-text-muted); cursor: help; flex-shrink: 0; }
.pg-info-icon:hover { color: var(--panel-text); }
.pg-hint { font-size: 12px; color: var(--panel-text-muted); line-height: 1.5; margin-top: 16px; }
.pg-desc { font-size: 12px; color: var(--panel-text-secondary); line-height: 1.5; margin-bottom: 6px; }
.pg-text-btn { background: none; border: none; color: var(--editor-accent); font-size: 13px; font-weight: 400; cursor: pointer; padding: 0; font-family: var(--font-sans); white-space: nowrap; }
.pg-text-btn:hover { text-decoration: underline; }
.pg-divider--tight { margin: 16px -16px 12px; }
.pg-apply-row { display: flex; justify-content: center; }

/* Cursor block */
.pg-cursor-filled {
  width: 100%;
  height: 130px;
  background: #f4f5f8;
  border: 1px solid #e2e3ea;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #72ABF9;
  padding: 0;
  transition: border-color 0.15s, background 0.15s;
}
.pg-cursor-filled:hover { border-color: var(--editor-accent, #5B3DF5); }
.pg-text-link { background: none; border: none; color: var(--editor-accent); font-size: 13px; font-weight: 400; cursor: pointer; padding: 0; font-family: var(--font-sans); }
.pg-text-link:hover { opacity: 0.8; }
.pg-cursor-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
}
.pg-icon-btn {
  background: none;
  border: none;
  color: var(--panel-text-muted, #6b6b6b);
  cursor: pointer;
  padding: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background 0.15s, color 0.15s;
}
.pg-icon-btn:hover { background: #f3f4f6; color: #ef4444; }
.pg-link-btn { background: none; border: none; color: var(--editor-accent); font-size: 12px; font-weight: 400; cursor: pointer; padding: 0; font-family: var(--font-sans); }
.pg-link-btn:hover { opacity: 0.8; }
.pg-divider { border: none; border-top: 1px solid var(--panel-border); margin: 16px -16px; }

.pg-color-row { display: flex; align-items: center; gap: 14px; margin-top: 4px; }
.pg-slider-input { flex: 1; display: flex; align-items: center; gap: 14px; }
.pg-slider-track { flex: 1; position: relative; height: 24px; display: flex; align-items: center; }
.pg-color-slider { width: 100%; height: 4px; cursor: pointer; -webkit-appearance: none; appearance: none; background: var(--panel-border); border-radius: 2px; outline: none; }
.pg-color-slider::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(to right, var(--editor-accent) var(--val, 100%), var(--panel-border) var(--val, 100%)); }
.pg-color-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: var(--editor-accent); border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.2); margin-top: -5px; cursor: pointer; }
.pg-color-slider::-moz-range-track { height: 4px; border-radius: 2px; background: var(--panel-border); }
.pg-color-slider::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--editor-accent); }
.pg-color-slider::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--editor-accent); border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.2); cursor: pointer; }
.pg-color-swatch { width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--panel-border); cursor: pointer; flex-shrink: 0; transition: border-color 0.15s, box-shadow 0.15s; }
.pg-color-swatch:hover { border-color: var(--editor-accent); box-shadow: 0 0 0 1px var(--editor-accent); }
.pg-opacity-input { display: flex; align-items: center; gap: 0; flex-shrink: 0; border: 1px solid var(--panel-border); border-radius: 4px; padding: 0 6px 0 0; }
.pg-color-val { width: 34px; border: none; outline: none; text-align: center; font-size: 13px; padding: 5px 2px; color: var(--panel-text); background: transparent; font-family: var(--font-sans); }
.pg-color-val:focus { outline: none; }
.pg-opacity-input:focus-within { border-color: var(--editor-accent); }
.pg-color-unit { font-size: 11px; color: var(--panel-text-muted); }

.pg-maxwidth-preview { display: flex; justify-content: center; padding: 12px 0; }

.pg-padding-header { display: flex; align-items: center; justify-content: space-between; }
.pg-padding-actions { display: flex; align-items: center; gap: 12px; }
.pg-padding-actions .insp-unit-btn {
  padding: 0;
  font-size: 12px;
  gap: 2px;
}
.pg-padding-actions .insp-unit-btn:hover { background: none; }
.pg-unit-dropdown { display: flex; align-items: center; gap: 2px; cursor: pointer; }
.pg-unit-btn { border: none; background: none; font-size: 12px; color: var(--editor-accent); cursor: pointer; padding: 0; font-family: var(--font-sans); font-weight: 400; }
.pg-unit-dropdown svg { color: var(--editor-accent); width: 14px; height: 14px; }
.pg-edit-individually { display: flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 4px; border: 1px solid var(--panel-border); color: var(--panel-text-muted); cursor: pointer; background: #fff; }
.pg-edit-individually:hover { border-color: var(--editor-accent); color: var(--editor-accent); }
.pg-edit-individually.is-active { border-color: var(--editor-accent); color: var(--editor-accent); background: #F1EEFE; }

.pg-padding-fields.is-hidden { display: none; }
.pg-padding-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 8px; }

.pg-padding-input { display: flex; align-items: center; border: 1px solid #dfe1e5; border-radius: 6px; height: 30px; background: #fff; overflow: hidden; transition: border-color 0.15s, background 0.15s; }
.pg-padding-input:hover { background: #f3f4f6; }
.pg-padding-input:focus-within { border-color: var(--editor-accent); background: #fff; }
.pg-padding-input__icon { display: flex; align-items: center; justify-content: center; width: 30px; height: 100%; flex-shrink: 0; color: #868aa5; }
.pg-padding-input__icon svg { width: 20px; height: 20px; }
.pg-padding-input__value { flex: 1; border: none; outline: none; font-size: 14px; color: #162d3d; background: transparent; padding: 0 4px; width: 100%; min-width: 0; font-family: var(--font-sans); text-align: left; }
.pg-padding-input__value::placeholder { color: #b6c1cd; }
.pg-padding-input__suffix { display: flex; align-items: center; flex-shrink: 0; padding-right: 4px; }
.pg-padding-input__unit-btn { border: none; background: none; font-size: 11px; color: var(--editor-accent); cursor: pointer; padding: 2px 4px; font-family: var(--font-sans); font-weight: 400; white-space: nowrap; }

.pg-select {
  width: 100%;
  height: 30px;
  padding: 0 10px;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 400;
  color: var(--panel-text-secondary);
  background: #fff;
  outline: none;
  cursor: pointer;
  font-family: var(--font-sans);
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 18 18' fill='%23000624' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m9 10.473 3-3L11.527 7 9 9.527 6.473 7 6 7.473l3 3Z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 18px;
  padding-right: 32px;
}
.pg-select:focus { border-color: var(--editor-accent); }

.pg-cursor-placeholder { border: 1px dashed var(--panel-border); border-radius: 8px; padding: 20px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--editor-accent); }


/* Toggle switch */
.insp-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
}
/* Variant: keep checkbox + label flush-left with a small gap (used by "Element auto docks") */
.insp-toggle-row--start {
  justify-content: flex-start;
  gap: 8px;
}
.insp-toggle-row__label {
  font-size: 13px;
  color: var(--panel-text-secondary);
}
.insp-toggle {
  position: relative;
  display: inline-block;
  width: 28px;
  height: 16px;
  cursor: pointer;
}
.insp-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.insp-toggle__track {
  position: absolute;
  inset: 0;
  background: #ccc;
  border-radius: 16px;
  transition: background 0.2s;
}
.insp-toggle__track::after {
  content: '';
  position: absolute;
  width: 12px;
  height: 12px;
  left: 2px;
  top: 2px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.insp-toggle input:checked + .insp-toggle__track {
  background: var(--editor-accent);
}
.insp-toggle input:checked + .insp-toggle__track::after {
  transform: translateX(12px);
}

/* Inspector field row */
.insp-field {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.insp-field__label {
  font-size: 11px;
  color: var(--panel-text-secondary);
  width: 60px;
  flex-shrink: 0;
}
.insp-field__input {
  flex: 1;
  height: 28px;
  padding: 0 8px;
  border: 1px solid var(--panel-border);
  border-radius: 4px;
  font-size: 12px;
  color: var(--panel-text);
  background: var(--panel-bg);
  outline: none;
  transition: border-color 0.12s;
}
.insp-field__input:focus {
  border-color: var(--editor-accent);
}
.insp-field__input--sm {
  width: 60px;
  flex: none;
}
.insp-field__unit {
  font-size: 11px;
  color: var(--panel-text-muted);
}

/* Inspector row with two inputs */
.insp-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.insp-row .insp-field {
  flex: 1;
  margin-bottom: 0;
}

/* Inspector color input */
.insp-color {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.insp-color__swatch {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  border: 1px solid var(--panel-border);
  cursor: pointer;
  flex-shrink: 0;
}
.insp-color__value {
  flex: 1;
  height: 28px;
  padding: 0 8px;
  border: 1px solid var(--panel-border);
  border-radius: 4px;
  font-size: 12px;
  color: var(--panel-text);
  background: var(--panel-bg);
  font-family: var(--font-mono);
}
.insp-color__opacity {
  width: 50px;
  height: 28px;
  padding: 0 8px;
  border: 1px solid var(--panel-border);
  border-radius: 4px;
  font-size: 12px;
  color: var(--panel-text);
  background: var(--panel-bg);
  text-align: center;
}

/* Inspector select */
.insp-select {
  width: 100%;
  height: 30px;
  padding: 0 10px;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 400;
  color: var(--panel-text-secondary);
  background: #fff;
  outline: none;
  cursor: pointer;
  margin-bottom: 4px;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 18 18' fill='%23000624' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m9 10.473 3-3L11.527 7 9 9.527 6.473 7 6 7.473l3 3Z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 18px;
  padding-right: 32px;
}
.insp-select:focus { border-color: var(--editor-accent); }

/* All selects inside inspector get same Wix arrow */
.inspector-panel select {
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 18 18' fill='%23000624' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m9 10.473 3-3L11.527 7 9 9.527 6.473 7 6 7.473l3 3Z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 18px;
  padding-right: 32px;
  font-family: var(--font-sans);
}

/* Inspector textarea */
.insp-textarea {
  width: 100%;
  min-height: 60px;
  padding: 6px 8px;
  border: 1px solid var(--panel-border);
  border-radius: 4px;
  font-size: 12px;
  color: var(--panel-text);
  background: var(--panel-bg);
  outline: none;
  resize: vertical;
  margin-bottom: 8px;
  font-family: var(--font-sans);
}
.insp-textarea:focus {
  border-color: var(--editor-accent);
}

/* Inspector design items (like Wix) */
.insp-design-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 12px;
  color: var(--panel-text);
  cursor: pointer;
  transition: color 0.12s;
}
.insp-design-item:hover {
  color: var(--editor-accent);
}
.insp-design-item__icon {
  width: 16px;
  height: 16px;
  color: var(--panel-text-muted);
  margin-right: 8px;
}
.insp-design-item__label {
  flex: 1;
}
.insp-design-item__value {
  font-size: 11px;
  color: var(--panel-text-muted);
}
.insp-design-item__arrow {
  width: 12px;
  height: 12px;
  color: var(--panel-text-muted);
  margin-left: 4px;
}

/* Inspector padding/margin controls */
.insp-spacing {
  display: grid;
  grid-template-areas:
    ". top ."
    "left center right"
    ". bottom .";
  grid-template-columns: 1fr 1fr 1fr;
  gap: 4px;
  margin-bottom: 8px;
}
.insp-spacing__input {
  width: 100%;
  height: 26px;
  text-align: center;
  border: 1px solid var(--panel-border);
  border-radius: 3px;
  font-size: 11px;
  color: var(--panel-text);
  background: var(--panel-bg);
  outline: none;
}
.insp-spacing__input:focus {
  border-color: var(--editor-accent);
}
.insp-spacing__top { grid-area: top; }
.insp-spacing__right { grid-area: right; }
.insp-spacing__bottom { grid-area: bottom; }
.insp-spacing__left { grid-area: left; }
.insp-spacing__center {
  grid-area: center;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: var(--panel-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Anchor name field (hidden when toggle off) */
.insp-anchor-name.is-hidden { display: none; }

/* Layout grid chooser */
.insp-layout-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.insp-layout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 1.25;
  border: 1.5px solid var(--panel-border);
  border-radius: 6px;
  background: #fff;
  color: #9ca3af;
  cursor: pointer;
  transition: all 0.15s;
  padding: 4px;
}
.insp-layout-btn:hover {
  border-color: var(--editor-accent);
  color: var(--editor-accent);
  background: #f0f6ff;
}
.insp-layout-btn.is-active {
  border-color: var(--editor-accent);
  color: var(--editor-accent);
  background: #eff6ff;
}

/* Padding row (Wix style) */
.insp-pad-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}
.insp-pad-unit {
  font-size: 11px;
  color: var(--editor-accent);
  cursor: pointer;
  margin-left: auto;
}
.insp-pad-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: none;
  background: none;
  color: var(--panel-text-muted);
  cursor: pointer;
  border-radius: 4px;
}
.insp-pad-link:hover { background: var(--panel-hover); }
.insp-pad-link.is-linked { color: var(--editor-accent); }

.insp-pad-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.insp-pad-field {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  border: 1px solid var(--panel-border);
  border-radius: 4px;
  padding: 4px 6px;
  background: #fff;
}
.insp-pad-field__icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--panel-text-muted);
}
.insp-pad-field__input {
  width: 100%;
  border: none;
  outline: none;
  font-size: 12px;
  color: var(--panel-text);
  background: transparent;
  text-align: center;
}
.insp-pad-field__unit {
  font-size: 10px;
  color: var(--editor-accent);
  flex-shrink: 0;
}

/* Advanced grid row */
.insp-adv-grid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--panel-border);
}
.insp-adv-grid__apply {
  border: none;
  background: none;
  color: var(--editor-accent);
  font-size: 12px;
  font-weight: 400;
  cursor: pointer;
}
.insp-adv-grid__apply:hover {
  text-decoration: underline;
}

/* Layout thumbnails (Wix style, 9 squares in grid) */
.insp-layout-thumbs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 10px 0 6px;
}
.insp-layout-thumb {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  border: 1px solid #e4e6ee;
  border-radius: 10px;
  background: #fff;
  color: #000624;
  cursor: pointer;
  padding: 0;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.insp-layout-thumb svg { width: 44px; height: 44px; }
.insp-layout-thumb:hover { border-color: #c4c8d2; }
.insp-layout-thumb.is-active { border-color: var(--editor-accent); box-shadow: 0 0 0 1px var(--editor-accent); }

/* Padding header row: label | unit btn | individual toggle */
.insp-pad-header-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  margin-bottom: 10px;
}
.insp-pad-unit-btn {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  border: none;
  background: none;
  color: var(--editor-accent);
  font-size: 12px;
  font-weight: 400;
  font-family: var(--font-sans);
  cursor: pointer;
  padding: 2px 4px;
}
.insp-pad-unit-btn:hover { color: #4A2BE6; }
.insp-pad-individual {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  background: #fff;
  color: var(--panel-text);
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s, color 0.12s;
}
.insp-pad-individual:hover { border-color: var(--editor-accent); color: var(--editor-accent); }
.insp-pad-individual.is-active { border-color: var(--editor-accent); background: #F1EEFE; color: var(--editor-accent); }

/* Padding input row — 2 inputs side by side with icon prefix */
.insp-pad-row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}
.insp-pad-input {
  display: flex;
  align-items: center;
  gap: 2px;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  padding: 0 8px;
  height: 30px;
  background: #fff;
  transition: border-color 0.12s;
}
.insp-pad-input:focus-within { border-color: var(--editor-accent); }
.insp-pad-input__icon { display: inline-flex; align-items: center; justify-content: center; color: #868aa5; flex-shrink: 0; }
.insp-pad-input__value {
  width: 100%;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-size: 13px;
  color: var(--panel-text);
  font-family: var(--font-sans);
  padding: 0 4px;
}
.insp-pad-input__unit { font-size: 11px; color: var(--editor-accent); font-weight: 400; flex-shrink: 0; }

/* Advanced CSS grid row */
/* Grid layout block — Adjust / Columns / Rows / Gaps (Wix style) */
.insp-grid-adjust { display: flex; gap: 2px; margin: 6px 0 14px; }
.insp-grid-adjust__btn {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  border: none;
  background: none;
  color: #131720;
  cursor: pointer;
  padding: 0;
  border-radius: 4px;
  transition: background 0.12s;
}
.insp-grid-adjust__btn:hover { background: var(--panel-surface, #f5f5f5); }
.insp-grid-adjust__btn.is-active {
  color: var(--editor-accent, #5B3DF5);
}
.insp-grid-counter {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 0;
  font-size: 13px; color: #131720;
  cursor: pointer;
}
/* Divider only at the BOTTOM of the expanded tracks list — separates one
 * open axis (Columns) from the next (Rows / Gaps). When the counter is
 * collapsed the tracks list isn't rendered at all so no divider shows. */
.insp-grid-tracks {
  border-bottom: 1px solid #f0f1f5;
  padding-bottom: 8px;
  margin-bottom: 4px;
}
.insp-grid-counter:first-of-type { border-top: none; }
.insp-grid-counter__label { font-weight: 400; }
.insp-grid-counter__actions { display: inline-flex; gap: 4px; }
.insp-grid-counter__btn {
  background: none; border: none; cursor: pointer;
  padding: 4px;
  color: var(--panel-text-muted, #6b6b6b);
  display: inline-flex; align-items: center; justify-content: center;
}

/* Columns/Rows track rows — Wix-style: index number, value field, and a
 * per-track type picker (fr / px / % / Auto / Min/max). Minmax rows carry
 * a Min/max pill plus two value+unit sub-fields. */
.insp-grid-tracks { padding: 0 0 8px; }
.insp-grid-track-row {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 6px;
  margin: 0 -6px;
  border-radius: 4px;
  font-size: 13px; color: #131720;
  transition: background-color 0.12s ease;
}
.insp-grid-track-row:hover { background: var(--panel-surface, #f5f6f8); }
.insp-grid-track-row__num {
  flex: 0 0 14px;
  text-align: center;
  font-size: 12px; color: var(--panel-text-muted, #888);
}
.insp-grid-track-row__field {
  position: relative;
  flex: 0 0 auto;
  width: 96px; height: 28px;
  border: 1px solid #e2e3ea; border-radius: 4px;
  display: flex; align-items: center;
  background: #fff;
  box-sizing: border-box;
}
.insp-grid-track-row__field:focus-within { border-color: var(--editor-accent, #5B3DF5); }
.insp-grid-track-row__field.is-auto { justify-content: space-between; }
.insp-grid-track-row__input {
  flex: 1 1 0; min-width: 0; width: 100%;
  border: none; outline: none; background: transparent;
  padding: 0 2px 0 8px;
  font-size: 13px; color: #131720;
  font-family: inherit;
  text-align: left;
}
.insp-grid-track-row__autoval {
  flex: 1 1 0; min-width: 0;
  padding-left: 8px;
  font-size: 13px; color: var(--panel-text-muted, #888);
}
/* Type / unit picker button — blue, borderless, no hover bg/underline. */
.insp-grid-track-row__type {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; gap: 1px;
  background: none; border: none; cursor: pointer;
  padding: 0 6px 0 3px;
  font-size: 11px; font-family: inherit;
  color: var(--editor-accent, #5B3DF5);
  white-space: nowrap;
}
.insp-grid-track-row__type:hover { color: #4A2BE6; }
.insp-grid-track-row__type svg { flex: 0 0 auto; }
/* Minmax main selector sits as a bordered pill right after the index. */
.insp-grid-track-row--minmax > .insp-grid-track-row__type {
  border: 1px solid #e2e3ea; border-radius: 4px;
  height: 24px; padding: 0 6px;
}
/* Wrap the two min/max fields to a second line so they get real width.
 * First line keeps num + type-picker + kebab; second line hosts the
 * two inputs at generous width (user 2026-07-01 "chọn min/max thì 2 ô
 * input cho xuống dưới cho rộng"). */
.insp-grid-track-row--minmax {
  flex-wrap: wrap;
  row-gap: 6px;
}
.insp-grid-track-row--minmax > .insp-grid-track-row__num  { order: 0; }
.insp-grid-track-row--minmax > .insp-grid-track-row__type { order: 1; }
.insp-grid-track-row--minmax > .insp-grid-track-row__menu { order: 2; }
.insp-grid-track-row--minmax > .insp-grid-track-row__mm   {
  order: 3;
  flex: 1 1 100%;
  min-width: 0;
  justify-content: flex-start;
  padding-left: 20px;
}
.insp-grid-track-row__mm {
  display: flex; gap: 4px;
  flex: 1 1 auto; min-width: 0;
  justify-content: flex-end;
}
/* "⋯" per-track menu — sits at the far right of every track row. */
.insp-grid-track-row__menu {
  margin-left: auto;
  flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px;
  background: none; border: none; cursor: pointer;
  border-radius: 4px;
  color: var(--panel-text-muted, #888);
}
.insp-grid-track-row__menu:hover {
  background: var(--panel-surface, #eef0f4);
  color: var(--panel-text, #131720);
}
.insp-grid-track-row__field--mm {
  margin-left: 0;
  flex: 1 1 0; min-width: 0;
  width: auto; max-width: none;
}
.insp-grid-track-row__field--mm .insp-grid-track-row__input { padding: 0 1px 0 6px; }
.insp-grid-track-row__field--mm .insp-grid-track-row__type { padding: 0 4px 0 2px; }
.insp-grid-track-row__field--mm .insp-grid-track-row__autoval { padding-left: 6px; }

/* Gaps — header on its own row, fields below */
.insp-grid-gaps-header { display: flex; align-items: center; justify-content: space-between; margin: 12px 0 6px; }
.insp-grid-gaps-header .insp-unit-btn {
  background: none; border: none; cursor: pointer;
  color: var(--editor-accent, #5B3DF5);
  font-size: 12px;
  display: inline-flex; align-items: center; gap: 2px;
  padding: 0;
}
.insp-grid-gaps {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 14px;
}
.insp-grid-gap-input {
  display: flex; align-items: center;
  min-width: 0;
  height: 32px;
  border: 1px solid #e2e3ea; border-radius: 4px;
  background: #fff;
  padding: 0 6px;
  gap: 4px;
  box-sizing: border-box;
  transition: background 0.15s, border-color 0.15s;
}
.insp-grid-gap-input:hover { background: #f3f4f6; }
.insp-grid-gap-input:focus-within { border-color: var(--editor-accent, #5B3DF5); background: #fff; }
.insp-grid-gap-input__icon {
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--panel-text-muted, #888);
  flex: 0 0 14px;
}
.insp-grid-gap-input__input {
  flex: 1 1 0;
  min-width: 0;
  width: 100%;
  border: none; outline: none; background: transparent;
  font-size: 13px; color: #131720;
  font-family: inherit;
  padding: 0;
}
.insp-grid-gap-input__unit {
  font-size: 11px;
  color: var(--editor-accent, #5B3DF5);
  flex: 0 0 auto;
  white-space: nowrap;
  background: none;
  border: none;
  padding: 0 2px;
  cursor: pointer;
  font-family: inherit;
}

.insp-adv-grid-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  margin-top: 14px;
}
.insp-adv-grid-row__label { font-size: 13px; color: var(--panel-text-secondary); }
.insp-adv-grid-row__apply {
  border: none;
  background: none;
  color: var(--editor-accent);
  font-size: 13px;
  font-weight: 400;
  font-family: var(--font-sans);
  cursor: pointer;
  padding: 2px 4px;
}
.insp-adv-grid-row__apply:hover { text-decoration: underline; }

/* ===== Breadcrumb Bar (Bottom) ===== */
.breadcrumb-bar {
  height: 28px;
  background: var(--editor-surface);
  border-top: 1px solid var(--editor-border);
  display: flex;
  align-items: center;
  padding: 0 12px;
  flex-shrink: 0;
  z-index: 10;
  overflow: hidden;
  color: #000624;
}

.breadcrumb-bar__inner {
  display: flex;
  align-items: center;
  gap: 0;
  font-size: 11px;
  color: #000624;
  white-space: nowrap;
  overflow: hidden;
}

.breadcrumb-item {
  display: flex;
  align-items: center;
  gap: 0;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 3px;
  transition: color 0.12s, background 0.12s;
  flex-shrink: 0;
}
.breadcrumb-item:hover {
  color: var(--editor-text);
  background: var(--editor-surface-hover);
}
.breadcrumb-item.is-active {
  color: var(--editor-accent);
  font-weight: 400;
}

.breadcrumb-sep {
  color: var(--editor-text-muted);
  margin: 0 2px;
  font-size: 10px;
  flex-shrink: 0;
}

/* === AI Bar (sits above breadcrumb-bar) === */
.ai-bar {
  /* Soft blue/violet wash — kept very light so it just hints at the AI
   * zone without competing with the composer card or canvas content. */
  background:
    radial-gradient(140% 70% at 0% 0%, rgba(178, 199, 255, 0.16) 0%, transparent 55%),
    radial-gradient(120% 60% at 100% 100%, rgba(220, 205, 255, 0.14) 0%, transparent 55%),
    linear-gradient(180deg, #fbfcff 0%, #fcfaff 100%);
  border-top: 1px solid #e8ebf3;
  flex-shrink: 0;
  z-index: 11;
  position: relative;
}
.ai-bar__inner { background: transparent; }
.ai-bar__expand { background: transparent; }
.ai-bar__messages { background: transparent; }
/* Drag handle on the top edge — only active when the bar is open. */
.ai-bar__resize {
  position: absolute;
  top: -3px; left: 0; right: 0;
  height: 6px;
  cursor: ns-resize;
  z-index: 12;
  display: none;
}
.ai-bar.is-open .ai-bar__resize { display: block; }
.ai-bar__resize::before {
  content: '';
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 36px; height: 3px;
  border-radius: 2px;
  background: transparent;
  transition: background 0.12s;
}
.ai-bar__resize:hover::before { background: #c5cad2; }
.ai-bar.is-resizing { user-select: none; }
.ai-bar__inner { display: flex; flex-direction: column; }
.ai-bar__head { display: flex; align-items: center; }
.ai-bar__toggle {
  display: flex; align-items: center; gap: 8px;
  background: transparent; border: 0; cursor: pointer;
  padding: 8px 14px; flex: 1; text-align: left;
  font-size: 13px; font-weight: 400; color: #131720;
  font-family: inherit;
}
.ai-bar__head { transition: background 0.12s; }
.ai-bar__head:hover { background: rgba(17, 109, 255, 0.06); }
.ai-bar__toggle svg:first-child { color: #5B3DF5; }
.ai-bar__clear {
  background: transparent; border: 0; cursor: pointer;
  padding: 6px 10px; margin-right: 6px;
  color: #868aa5; border-radius: 4px;
  display: none; align-items: center;
  transition: all 0.12s;
}
.ai-bar.is-open .ai-bar__clear { display: flex; }
.ai-bar__clear:hover { color: #df3131; background: rgba(223, 49, 49, 0.08); }
.ai-bar__design {
  background: transparent; border: 0; cursor: pointer;
  padding: 6px 10px; margin-right: 4px;
  color: #5B3DF5; font-weight: 500; font-size: 12px;
  display: none; align-items: center; gap: 6px;
  transition: all 0.12s;
}
.ai-bar.is-open .ai-bar__design { display: flex; }
.ai-bar__design:hover { background: rgba(91, 61, 245, 0.08); }
.ai-bar__design svg { flex-shrink: 0; }

/* ── Claude Design modal ─────────────────────────────────────────── */
.cd-modal { position: fixed; inset: 0; z-index: 2147483600; }
.cd-modal__backdrop { position: absolute; inset: 0; background: rgba(15,15,25,0.55); }
.cd-modal__panel {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 560px; max-width: 92vw; max-height: 88vh; background: #fff;
  display: flex; flex-direction: column; overflow: hidden;
}
.cd-modal__head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid #ececec; }
.cd-modal__title { font-size: 15px; font-weight: 500; color: #1a1a2e; }
.cd-modal__close { background: transparent; border: 0; cursor: pointer; font-size: 22px; color: #868aa5; padding: 0 6px; line-height: 1; }
.cd-modal__close:hover { color: #1a1a2e; }
.cd-modal__body { padding: 16px 18px; overflow-y: auto; flex: 1; }
.cd-modal__label { display: block; font-size: 12px; font-weight: 500; color: #4a4e6b; margin: 12px 0 6px; }
.cd-modal__label:first-child { margin-top: 0; }
.cd-modal__ta {
  width: 100%; min-height: 90px; resize: vertical;
  border: 1px solid #d8dbe6; padding: 10px 12px; font-family: inherit; font-size: 14px;
  color: #1a1a2e; outline: none;
}
.cd-modal__ta:focus { border-color: #5B3DF5; }
.cd-modal__row { display: flex; gap: 12px; }
.cd-modal__col { flex: 1; }
.cd-modal__input {
  width: 100%; border: 1px solid #d8dbe6; padding: 8px 10px; font-family: inherit; font-size: 14px;
  color: #1a1a2e; outline: none;
}
.cd-modal__input:focus { border-color: #5B3DF5; }
.cd-modal__vibes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.cd-vibe {
  background: #fff; border: 1px solid #d8dbe6; padding: 10px 8px; cursor: pointer;
  display: flex; flex-direction: column; gap: 2px; align-items: flex-start; text-align: left;
  font-family: inherit;
}
.cd-vibe b { font-size: 13px; font-weight: 500; color: #1a1a2e; }
.cd-vibe small { font-size: 11px; color: #868aa5; }
.cd-vibe:hover { border-color: #b8bcd0; }
.cd-vibe.is-active { border-color: #5B3DF5; background: #f3f0ff; }
.cd-vibe.is-active b { color: #5B3DF5; }
.cd-modal__warn { margin-top: 14px; font-size: 12px; color: #b94e00; background: #fff7ec; padding: 8px 10px; line-height: 1.5; }
.cd-modal__actions { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid #ececec; background: #fafbfc; }
.cd-modal__btn { border: 0; padding: 9px 18px; font-family: inherit; font-size: 14px; cursor: pointer; font-weight: 500; }
.cd-modal__btn--ghost { background: #fff; border: 1px solid #d8dbe6; color: #1a1a2e; }
.cd-modal__btn--ghost:hover { background: #f3f4f7; }
.cd-modal__btn--primary { background: #5B3DF5; color: #fff; }
.cd-modal__btn--primary:hover:not(:disabled) { background: #4a30d4; }
.cd-modal__btn:disabled { opacity: 0.6; cursor: not-allowed; }
.ai-msg__hint {
  font-size: 12px; color: #868aa5; padding: 12px;
  background: #fafbfc; border-radius: 6px; line-height: 1.5;
}
.ai-msg-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  position: relative;
}
.ai-msg-wrap--user { align-items: flex-end; }
.ai-msg-wrap--assistant { align-items: flex-start; }
.ai-msg-wrap .ai-msg { max-width: 80%; }
/* Legacy delete button (now unused — replaced by ai-msg-action--danger) */
.ai-msg__del { display: none; }

/* Action row beneath each message (copy / audio / show-progress / delete) */
.ai-msg-actions {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  opacity: 0;
  transition: opacity 0.12s;
  margin: 0 4px;
}
.ai-msg-wrap:hover .ai-msg-actions,
.ai-msg-wrap.is-progress-open .ai-msg-actions { opacity: 1; }

.ai-msg-action {
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  color: #6b7280;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-family: inherit;
  font-size: 12px;
  transition: background 0.12s, color 0.12s;
}
.ai-msg-action:hover { background: rgba(17, 24, 39, 0.06); color: #131720; }
.ai-msg-action.is-copied { color: #10b981; }
.ai-msg-action--text { padding: 4px 6px; }
.ai-msg-action--danger:hover { color: #df3131; background: rgba(223, 49, 49, 0.08); }

/* Show-progress collapsible panel — hidden until the chevron is clicked */
.ai-msg-progress {
  display: none;
  font-size: 12px;
  color: #6b7280;
  background: rgba(17, 24, 39, 0.03);
  border: 1px solid rgba(17, 24, 39, 0.05);
  border-radius: 8px;
  padding: 8px 10px;
  margin: 4px 0 0;
  max-width: 100%;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.ai-msg-wrap.is-progress-open .ai-msg-progress { display: block; }
.ai-msg-wrap.is-progress-open .ai-msg-action--text svg { transform: rotate(180deg); }
.ai-msg-action--text svg { transition: transform 0.15s; }
.ai-bar__chev {
  margin-left: auto;
  color: #868aa5;
  transition: transform 0.15s;
}
.ai-bar.is-open .ai-bar__chev { transform: rotate(180deg); }
.ai-bar__expand {
  display: none;
  position: relative;
  border-top: 1px solid var(--editor-border, #e5e7eb);
  padding: 12px 14px;
  flex-direction: column;
  gap: 10px;
  height: var(--ai-bar-h, 320px);
  max-height: 80vh;
  min-height: 180px;
}
.ai-bar.is-open .ai-bar__expand { display: flex; }
/* When there's no chat history yet, collapse to just the input area —
   no big white blank above it, and the top resize handle is hidden too. */
.ai-bar.is-empty .ai-bar__expand {
  height: auto;
  min-height: 0;
}
.ai-bar.is-empty .ai-bar__messages { display: none; }
.ai-bar.is-empty .ai-bar__resize { display: none; }
.ai-bar__messages {
  flex: 1;
  overflow-y: scroll;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  /* Hide the native scrollbar entirely — a custom JS-driven thumb is
     overlaid via .ai-bar__scrollthumb. */
  scrollbar-width: none;
}
.ai-bar__messages::-webkit-scrollbar { width: 0; height: 0; display: none; }
/* Custom overlay thumb. Positioned by JS to track scrollTop. */
.ai-bar__scrollthumb {
  position: absolute;
  right: 2px;
  width: 4px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 2px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}
.ai-bar__expand:hover .ai-bar__scrollthumb,
.ai-bar__messages:hover ~ .ai-bar__scrollthumb,
.ai-bar.is-scrolling .ai-bar__scrollthumb { opacity: 1; }
.ai-msg {
  font-size: 13px;
  line-height: 1.5;
  padding: 8px 12px;
  border-radius: 10px;
  max-width: 80%;
  word-wrap: break-word;
  white-space: pre-wrap;
}
.ai-msg--user {
  background: #ffffff;
  color: #131720;
  align-self: flex-end;
  border-bottom-right-radius: 2px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
}
.ai-msg--assistant {
  background: transparent;
  color: #131720;
  align-self: flex-start;
  padding-left: 0;
  padding-right: 0;
}

/* ── Animations ──────────────────────────────────────────────────────
 * Every freshly-rendered message wrapper slides up + fades in. The
 * `is-pending` bubble swaps its body for 3 bouncing dots until the real
 * response replaces it. */
@keyframes ai-msg-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.ai-msg-wrap {
  animation: ai-msg-in 0.22s ease-out;
}

@keyframes ai-typing-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40%           { transform: translateY(-4px); opacity: 1; }
}
.ai-msg--pending {
  /* No bg — just the 3 bouncing dots indicate waiting. */
  background: transparent;
  animation: ai-msg-in 0.22s ease-out;
}
@keyframes ai-pending-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.ai-typing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 0;
}
.ai-typing-text {
  margin-left: 10px;
  font-size: 13px;
  color: #6b7280;
}
.ai-msg-progress__step {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 4px 0;
  font-size: 12px;
  line-height: 1.5;
}
.ai-msg-progress__dot {
  color: #5B3DF5;
  font-weight: 400;
  min-width: 12px;
}
.ai-msg-progress__when {
  color: #9aa0ac;
  font-family: 'Aeonik Mono', monospace;
  font-size: 11px;
  min-width: 64px;
}
.ai-msg-progress__text {
  color: #131720;
  flex: 1;
}
.ai-typing i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #6b7280;
  display: inline-block;
  animation: ai-typing-bounce 1.2s infinite ease-in-out;
}
.ai-typing i:nth-child(1) { animation-delay: 0s; }
.ai-typing i:nth-child(2) { animation-delay: 0.15s; }
.ai-typing i:nth-child(3) { animation-delay: 0.3s; }

/* Send button gets a soft pulse halo while we wait on AI */
.ai-composer__send:disabled {
  position: relative;
  animation: ai-send-pulse 1.6s ease-in-out infinite;
}
@keyframes ai-send-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(17, 109, 255, 0.0); }
  50%      { box-shadow: 0 0 0 6px rgba(17, 109, 255, 0.12); }
}
/* ──────────────────────────────────────────────────────────────────────
 * AI Composer (Wix Studio style) — single rounded card containing:
 *   1. Attachments chips (when any images are attached)
 *   2. Textarea
 *   3. Bottom toolbar: paperclip on the left, send button on the right
 *
 * The whole composer is wrapped in a single border that lights up on
 * focus-within (blue ring + halo). No separate input-row + buttons.
 * ─────────────────────────────────────────────────────────────────── */
/* AI composer (v2) — gradient blue/violet card with avatar pill outside,
 * context chips + Suggestions header, white input pill, toolbar with
 * plus / mic / send. Visual reference: Wix Studio AI panel. */
.ai-composer {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  /* Slightly more saturated than the bar around it so the card pops, but
   * still gentle. The white input pill provides the real contrast.
   * Shadow lifts the card off the gradient bar so it's always easy to
   * find at a glance — a soft blue-tinted drop plus a tight close shadow. */
  background:
    radial-gradient(120% 80% at 0% 0%, rgba(178, 199, 255, 0.28) 0%, transparent 60%),
    radial-gradient(120% 80% at 100% 100%, rgba(220, 205, 255, 0.22) 0%, transparent 60%),
    linear-gradient(180deg, #f5f7ff 0%, #f9f6ff 100%);
  border: 1px solid #e4e8f2;
  border-radius: 18px;
  padding: 12px;
  box-shadow:
    0 1px 2px rgba(17, 24, 39, 0.04),
    0 8px 20px rgba(60, 80, 160, 0.10),
    0 16px 40px rgba(60, 80, 160, 0.08);
}
.ai-composer:focus-within {
  box-shadow:
    0 1px 2px rgba(17, 24, 39, 0.05),
    0 10px 24px rgba(60, 80, 160, 0.14),
    0 20px 48px rgba(60, 80, 160, 0.10);
}

/* Header row: context chip(s) left, Suggestions right */
.ai-composer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 22px;
}
.ai-composer__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.ai-context-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #5B3DF5;
  color: #fff;
  font-size: 12px;
  font-weight: 400;
  padding: 3px 8px;
  border-radius: 6px;
}
.ai-context-chip__remove {
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.ai-context-chip__remove:hover { color: #fff; }

.ai-composer__suggest {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: none;
  color: #1a1a2e;
  font-size: 13px;
  font-weight: 400;
  font-family: inherit;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  transition: background 0.12s;
}
.ai-composer__suggest:hover { background: rgba(17, 109, 255, 0.08); }

/* Input pill — white background, soft border, subtle shadow so it lifts
 * off the composer's gradient and reads as the focal element. */
.ai-composer__input {
  width: 100%;
  background: #fff;
  border: 1px solid #d6dceb;
  border-radius: 12px;
  outline: none;
  font-family: inherit;
  font-size: 14px;
  line-height: 20px;
  color: #131720;
  resize: none;
  padding: 10px 14px;
  min-height: 40px;
  max-height: 200px;
  box-shadow:
    0 1px 2px rgba(17, 24, 39, 0.04),
    0 4px 12px rgba(60, 80, 160, 0.06);
  transition: border-color 0.12s, box-shadow 0.12s;
}
.ai-composer__input::placeholder { color: #9ca3b5; }
.ai-composer__input:focus {
  border-color: #5B3DF5;
  box-shadow:
    0 0 0 3px rgba(17, 109, 255, 0.18),
    0 4px 12px rgba(17, 109, 255, 0.10);
}

/* Bottom toolbar — flush with the input pill */
.ai-composer__toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
}
.ai-composer__spacer { flex: 1 1 auto; }

/* Plus / mic style — transparent text buttons */
.ai-composer__icon-btn {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: #4a5165;
  border-radius: 8px;
  cursor: pointer;
  padding: 0;
  transition: background 0.12s, color 0.12s;
}
.ai-composer__icon-btn:hover {
  background: rgba(17, 109, 255, 0.1);
  color: #5B3DF5;
}

/* Model picker — small label-pill button + popup menu */
.ai-composer__model { position: relative; display: inline-flex; }
.ai-composer__model-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(91, 61, 245, 0.18);
  background: rgba(91, 61, 245, 0.06);
  color: #5B3DF5;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 400;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s, border-color 0.12s;
}
.ai-composer__model-btn:hover { background: rgba(91, 61, 245, 0.12); border-color: rgba(91, 61, 245, 0.3); }
.ai-composer__model-menu {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  min-width: 220px;
  background: #fff;
  border: 1px solid #e6e8ef;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.12);
  padding: 4px;
  /* `display: flex` would override the [hidden] attribute (which is just
   * UA-level `display: none`). Re-assert none for hidden so the menu can
   * actually close. */
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ai-composer__model-menu[hidden] { display: none; }
.ai-composer__model-item {
  text-align: left;
  border: none;
  background: transparent;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 13px;
  color: #1a2235;
  cursor: pointer;
  white-space: nowrap;
}
.ai-composer__model-item:hover { background: rgba(91, 61, 245, 0.08); }
.ai-composer__model-item.is-active { background: #5B3DF5; color: #fff; }

/* Send — small filled blue square (rounded) */
.ai-composer__send {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: #5B3DF5;
  color: #fff;
  border-radius: 8px;
  cursor: pointer;
  padding: 0;
  transition: background 0.12s, transform 0.08s;
  flex-shrink: 0;
}
.ai-composer__send:hover  { background: #0f62e6; }
.ai-composer__send:active { background: #084ebd; transform: scale(0.96); }
.ai-composer__send:disabled {
  background: #b6c5e8;
  cursor: default;
  transform: none;
}

/* Attachment chips row — kept compact like the context chip but neutral grey */
.ai-composer__attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ai-bar__attachment {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid #dde2f0;
  border-radius: 999px;
  padding: 3px 8px 3px 4px;
  max-width: 200px;
}
.ai-bar__attachment img {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.ai-bar__attachment-name {
  font-size: 12px;
  color: #1a1a2e;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}
.ai-bar__attachment-remove {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: #4a5165;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.ai-bar__attachment-remove:hover { color: #d11919; }

/* === Canvas area (canvas + ai-bar + breadcrumb stacked beside sidebar) === */
.canvas-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

/* Browser-style address bar sitting between the mainbar and the canvas.
 * Shows the live preview URL (centered) with a Connect Domain shortcut
 * pinned to the right. White on a light grey baseline so it visually
 * separates from the canvas's blue/violet wash below.
 *
 * align-self:center + width set by JS (syncEditorViewportCSSVars) so the
 * urlbar matches the viewport's W exactly — they read as one continuous
 * "address bar + page" stack instead of the urlbar floating wide above
 * a narrower canvas. */
.canvas-urlbar {
  flex-shrink: 0;
  align-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  /* H = 42 content + 2 border = 44 total (user 2026-07-09). box-sizing is
     border-box so height:44 includes the 2px bottom border. */
  height: 44px;
  background: #ffffff;
  border-bottom: 2px solid var(--editor-border, #e5e5e8);
  padding: 0 16px;
  font-family: var(--font-sans, system-ui);
  box-sizing: border-box;
}
.canvas-urlbar__url {
  font-size: 13px;
  font-weight: 500;
  color: #1f2937;
  text-decoration: none;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  max-width: 70%;
  user-select: text;
  cursor: pointer;
}
.canvas-urlbar__url:hover { text-decoration: underline; }
/* Sits inline immediately after the URL — small gap, no right pinning,
 * so the [URL · Connect Domain] pair reads as one centered cluster. */
.canvas-urlbar__connect {
  margin-left: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--editor-accent, #5B3DF5);
  text-decoration: none;
  white-space: nowrap;
}
.canvas-urlbar__connect:hover { text-decoration: underline; }
.canvas-area .editor-canvas {
  flex: 1;
  min-height: 0;
}

/* Preview/published runtime: section wrapper provides positioning context
   without any editor chrome (no hover borders, no selection outlines). */
.vendr-section {
  position: relative;
}

/* Button on the published page: mirror the canvas behaviour so the .cs-btn
   visually fills the user-set width/height of the .vendr-section wrapper. */
.vendr-section[data-section-type="button"] { display: inline-block; }
/* Preview image wrapper: same behaviour as canvas — block-level, overflow
   hidden so object-fit crop applies, baseline gap killed via line-height:0. */
.vendr-section[data-section-type="image"] {
  display: block;
  overflow: hidden;
  line-height: 0;
  font-size: 0;
}
.vendr-section[data-section-type="image"] .cs-image { width: 100%; height: 100%; }
.vendr-section[data-section-type="image"] .cs-image img { width: 100%; height: 100%; object-fit: cover; display: block; vertical-align: top; }
.vendr-section[data-section-type="button"] .cs-button {
  padding: 0;
  display: block;
  width: 100%;
  height: 100%;
}

/* Stack: flex container with inspector-driven layout. The inner .cs-stack
   fills 100% of the wrapper so the user-set width/height in the inspector
   matches the visible box (and the canvas hitbox / selection outline
   follows the same rectangle). */
.canvas-section[data-section-type="stack"] { display: inline-block; }
.canvas-section[data-section-type="stack"] > .canvas-section__content {
  width: 100%;
  height: 100%;
}
/* Preview: mirror canvas's inline-block behavior so the wrapper hugs
   the stack's content width instead of filling the absolute-positioned
   parent (which made text-align:center compute against the wrong box). */
.vendr-section[data-section-type="stack"] { display: inline-block; }
.cs-stack { box-sizing: border-box; }

/* AI brief preview card (shown in chat for the user to confirm before
   generation actually happens) */
.ai-msg-wrap--brief { width: 100%; }
.ai-brief-card {
  background: #fff;
  border: 1px solid #e2e3ea;
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.5;
  color: #131720;
  margin: 6px 0;
}
.ai-brief-card__header {
  font-weight: 400;
  font-size: 14px;
  margin-bottom: 8px;
  color: #000624;
}
.ai-brief-card__summary {
  background: #f6f7fa;
  padding: 8px 10px;
  border-radius: 6px;
  margin-bottom: 12px;
  color: #2b2e36;
}
.ai-brief-card__row { display: flex; gap: 8px; margin-bottom: 6px; align-items: flex-start; }
.ai-brief-card__label { width: 80px; flex-shrink: 0; color: #6b7280; font-size: 12px; }
.ai-brief-card__value { flex: 1; color: #131720; }
.ai-brief-card__palette { display: flex; gap: 4px; }
.ai-brief-card__swatch {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  border: 1px solid rgba(0,0,0,0.1);
  display: inline-block;
}
.ai-brief-card__sections { margin-top: 12px; padding-top: 10px; border-top: 1px solid #ececec; }
.ai-brief-card__sections-title { font-weight: 400; margin-bottom: 6px; font-size: 12px; color: #6b7280; }
.ai-brief-card__sections-list { padding-left: 20px; margin: 0; }
.ai-brief-card__sections-list li { margin-bottom: 4px; }
.ai-brief-card__sections-list li em { color: #6b7280; font-style: normal; font-size: 12px; }
.ai-brief-card__actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; }
.ai-brief-card__btn {
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
  border: 1px solid transparent;
}
.ai-brief-card__btn--cancel { background: #fff; border-color: #e2e3ea; color: #2b2e36; }
.ai-brief-card__btn--cancel:hover { background: #f4f5f8; }
.ai-brief-card__btn--confirm { background: #5B3DF5; color: #fff; }
.ai-brief-card__btn--confirm:hover { background: #0f62e6; }
.ai-brief-card__btn:disabled { opacity: 0.6; cursor: default; }
.ai-brief-card__badge {
  display: inline-block;
  margin-top: 10px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 400;
}
.ai-brief-card__badge--confirmed { background: #e6f4ea; color: #137333; }
.ai-brief-card__badge--cancelled { background: #fce8e6; color: #c5221f; }
.ai-brief-card__badge--pending { background: #fef7e0; color: #b06000; }

/* Container: free-positioned box (children use absolute x/y like Section).
   Drop the dashed default look that .cs-container ships with — Wix-style
   container has its own background/border from the inspector. */
.canvas-section[data-section-type="container"] { display: inline-block; }
.canvas-section[data-section-type="container"] > .canvas-section__content {
  width: 100%;
  height: 100%;
}
/* Preview wrapper — width:100% only; NO height:100%. The wrapper is
   position:absolute (compileSection emits left/top/width). A height:100%
   would resolve against the containing block (the parent root's
   .cs-section__inner) — but that inner is sized to the parent's intrinsic
   min-height (e.g. 58 for a Header), NOT the .cs-container's actual
   grown height (e.g. 253). Result: wrapper stays at 58 even when its
   .cs-container child has grown to 253 to fit content, and the parent
   Header's runtime measures the wrapper at 58 → never grows. Letting
   height default to auto makes the wrapper hug .cs-container's actual
   height, which the runtime then reads correctly. */
.vendr-section[data-section-type="container"] {
  width: 100%;
}
.canvas-section[data-section-type="container"] .cs-container,
.vendr-section[data-section-type="container"] .cs-container {
  border: 0;
  margin: 0;
  padding: 0;
  min-height: 0;
}

/* Stack Layout inspector: Wix-style controls */
.insp-row-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.insp-row-inline__label { font-size: 13px; color: #131720; }
.insp-num-input {
  display: inline-flex;
  align-items: center;
  border: 1px solid #e2e3ea;
  border-radius: 4px;
  padding: 0 8px;
  height: 32px;
  background: #fff;
  min-width: 92px;
}
.insp-num-input:hover { border-color: #868aa5; }
.insp-num-input:focus-within { border-color: #5B3DF5; }
.insp-num-input input {
  border: 0;
  outline: 0;
  width: 100%;
  font-size: 13px;
  background: transparent;
  color: #131720;
  text-align: left;
}
.insp-num-input__unit {
  font-size: 11px;
  color: #5B3DF5;
  font-weight: 400;
  margin-left: 6px;
  white-space: nowrap;
}
.insp-align-items-bar {
  display: flex;
  gap: 4px;
}
.insp-align-items-btn {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  color: #42454c;
  cursor: pointer;
  padding: 0;
}
.insp-align-items-btn.is-active {
  color: #5B3DF5;
}

/* Icon dropdown (Stack layout: Vertical / Horizontal). A custom select —
 * trigger shows the current icon + label, opens a 2-option list. Sized to
 * match .insp-select (30px) per the inspector style guide. */
.insp-icon-select {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 30px;
  margin-top: 6px;
  padding: 0 8px 0 10px;
  border: 1px solid var(--panel-border);
  border-radius: 0;
  background: #fff;
  color: var(--panel-text-secondary);
  font-size: 13px;
  font-family: var(--font-sans);
  cursor: pointer;
}
.insp-icon-select__cur {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.insp-icon-select__cur svg,
.insp-icon-select__chev { flex-shrink: 0; }
.insp-icon-select-dropdown {
  background: #fff;
  border: 1px solid var(--panel-border);
  border-radius: 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.insp-icon-select-dropdown__item {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border: none;
  border-radius: 0;
  background: none;
  color: var(--panel-text-secondary);
  font-size: 13px;
  font-family: var(--font-sans);
  cursor: pointer;
  text-align: left;
}
.insp-icon-select-dropdown__item:hover { background: var(--panel-surface); }
.insp-icon-select-dropdown__item.is-selected {
  background: #F1EEFE;
  color: #5B3DF5;
  font-weight: 400;
}
.insp-icon-select-dropdown__item.is-selected:hover { background: #E8E2FD; }
.insp-icon-select-dropdown__item svg { flex-shrink: 0; }
.insp-padding-block { }
.insp-padding-block__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.insp-padding-block__actions {
  display: flex;
  align-items: center;
  gap: 4px;
}
.insp-padding-unit {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 11px;
  color: #5B3DF5;
  font-weight: 400;
  background: transparent;
  border: 0;
  padding: 4px 6px;
  border-radius: 4px;
  cursor: pointer;
}
.insp-padding-unit:hover { background: #f4f5f8; }
.insp-padding-individually {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #42454c;
  cursor: pointer;
  padding: 0;
}
.insp-padding-individually:hover { background: #f4f5f8; }
.insp-padding-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.insp-padding-field {
  display: flex;
  align-items: center;
  border: 1px solid #e2e3ea;
  border-radius: 4px;
  padding: 0 8px;
  height: 32px;
  background: #fff;
  gap: 6px;
}
.insp-padding-field:hover { border-color: #868aa5; }
.insp-padding-field:focus-within { border-color: #5B3DF5; }
.insp-padding-field__icon { display: inline-flex; color: #42454c; flex-shrink: 0; }
.insp-padding-field input {
  border: 0;
  outline: 0;
  width: 100%;
  font-size: 13px;
  background: transparent;
  color: #131720;
  min-width: 0;
}
.insp-padding-field__unit {
  font-size: 11px;
  color: #5B3DF5;
  font-weight: 400;
  white-space: nowrap;
  flex-shrink: 0;
}

/* === Add Section Chooser popup === */
.add-sec-chooser {
  position: fixed;
  z-index: 1000;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 24px rgba(0, 6, 36, 0.18), 0 0 0 1px rgba(0, 6, 36, 0.06);
  padding: 16px 20px 18px;
  min-width: 360px;
  font-family: var(--font-sans);
}
.add-sec-chooser__title {
  font-size: 12px;
  font-weight: 400;
  color: #131720;
  margin-bottom: 12px;
  text-align: left;
}
.add-sec-chooser__actions {
  display: flex;
  gap: 12px;
  justify-content: space-between;
}
.add-sec-chooser__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 8px 6px 10px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.12s, border-color 0.12s;
}
.add-sec-chooser__item:hover {
  background: rgba(17, 109, 255, 0.04);
  border-color: rgba(17, 109, 255, 0.2);
}
.add-sec-chooser__thumb {
  width: 100%;
  aspect-ratio: 54 / 35;
  background: #f5f5f5;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.add-sec-chooser__item svg { width: 60%; height: auto; }
.add-sec-chooser__item span {
  font-size: 12px;
  color: #131720;
  font-weight: 400;
}

/* "+ Add Section" divider menu. Square corners + tight chrome to
 * match the rest of the editor; z-index above all canvas overlays
 * so the menu is never covered. */
.add-sec-menu {
  background: #fff;
  border: 1px solid rgba(0, 6, 36, 0.12);
  box-shadow: 0 8px 24px rgba(0, 6, 36, 0.16);
  width: 280px;
  font-family: var(--font-sans);
  z-index: 2147483600;
}
.add-sec-menu__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 12px;
  background: transparent;
  border: 0;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  color: #131720;
}
.add-sec-menu__item:hover { background: rgba(17, 109, 255, 0.08); }
.add-sec-menu__icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  color: #5f6571;
  display: inline-flex;
}
.add-sec-menu__icon svg { width: 18px; height: 18px; display: block; }
.add-sec-menu__item:hover .add-sec-menu__icon { color: #116DFF; }
.add-sec-menu__lbl { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.add-sec-menu__lbl b { font-size: 13px; font-weight: 400; color: #131720; }
.add-sec-menu__lbl small { font-size: 11px; color: #5f6571; }

/* Group caption between blocks of related items. */
.add-sec-menu__sep {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px 4px;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: #8b909c;
}
.add-sec-menu__sep::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(0, 6, 36, 0.08);
}

/* Paste-code modal — square corners, no extra padding, white panel
 * matches the rest of the editor's modal style. */
.add-sec-paste-modal {
  position: fixed;
  inset: 0;
  z-index: 2147483601;
  display: grid;
  place-items: center;
  font-family: var(--font-sans);
}
.add-sec-paste-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 6, 36, 0.42);
}
.add-sec-paste-modal__panel {
  position: relative;
  background: #fff;
  border: 1px solid rgba(0, 6, 36, 0.12);
  box-shadow: 0 16px 48px rgba(0, 6, 36, 0.24);
  width: min(720px, calc(100vw - 32px));
  max-height: calc(100vh - 64px);
  display: flex;
  flex-direction: column;
}
.add-sec-paste-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(0, 6, 36, 0.08);
}
.add-sec-paste-modal__title { font-size: 13px; font-weight: 400; color: #131720; }
.add-sec-paste-modal__close {
  background: transparent; border: 0; cursor: pointer;
  font-size: 20px; line-height: 1; color: #5f6571;
  width: 24px; height: 24px;
}
.add-sec-paste-modal__close:hover { color: #131720; }
.add-sec-paste-modal__ta {
  flex: 1 1 auto;
  min-height: 320px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid rgba(0, 6, 36, 0.08);
  background: #fff;
  color: #131720;
  outline: none;
  white-space: pre;
}
.add-sec-paste-modal__ta:focus {
  background: #fafbfd;
}
.add-sec-paste-modal__hint {
  font-size: 11px;
  color: #5f6571;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(0, 6, 36, 0.08);
}
.add-sec-paste-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 12px;
}
.add-sec-paste-modal__btn {
  border: 1px solid rgba(0, 6, 36, 0.16);
  background: #fff;
  color: #131720;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
  font-family: inherit;
}
.add-sec-paste-modal__btn:hover { background: rgba(0, 6, 36, 0.04); }
.add-sec-paste-modal__btn--primary {
  background: #116DFF;
  color: #fff;
  border-color: #116DFF;
}
.add-sec-paste-modal__btn--primary:hover { background: #0a5ce0; }

/* === Animations & Effects tab panel ===
 * Replaces the Design body when the user clicks the lightning-bolt
 * icon-tab in the Button (and future element) inspector. Five fixed
 * rows — one per trigger (Entrance / Hover / Click / Scroll / Loop).
 * Each row collapses to a chevron header; the body shows a short
 * one-line description + an "Add" button (or a chip naming the
 * chosen animation when one is set). */
.insp-anim-panel {
  padding: 18px 16px 24px;
}
.insp-anim-panel__title {
  font-size: 18px;
  font-weight: 700;
  color: #000000;
  margin-bottom: 4px;
}
.insp-anim-panel__sub {
  font-size: 13px;
  color: #000000;
  margin-bottom: 16px;
}
/* Animation triggers use the standard .insp-sub markup (header / body /
 * arrow / border / hover bg all inherited). The .insp-anim-row class is
 * just a marker for trigger-row specific tweaks. */
.insp-anim-row:last-child { border-bottom: 1px solid var(--panel-border); }
.insp-anim-row > .insp-sub__body { padding-bottom: 6px; }
.insp-anim-row__title {
  font-size: 14px;
  font-weight: 600;
  color: #000000;
}
.insp-anim-row__desc {
  font-size: 13px;
  color: #000000;
  margin-bottom: 8px;
  line-height: 1.45;
}
.insp-anim-row__add {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: 0;
  color: #116DFF;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 0;
}
.insp-anim-row__add:hover { color: #0a52cc; }
.insp-anim-row__chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px 4px 12px;
  background: #F1EEFE;
  border: 1px solid var(--editor-accent);
  border-radius: 999px;
  font-size: 13px;
  color: #000000;
}
.insp-anim-row__chip-x {
  width: 20px; height: 20px;
  border: 0;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.insp-anim-row__chip-x:hover { background: rgba(0,0,0,0.85); }
.insp-anim-row__chip-name {
  background: transparent;
  border: 0;
  padding: 0;
  font-size: 13px;
  color: #000000;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
}
.insp-anim-row__chip-name:hover { text-decoration: underline; }

/* Populated row summary — "<Name> on Self" + 3-dot menu trigger.
 * Mirrors .layer-item from the Layers panel: full-width (escapes the
 * insp-sub__body 16px gutter via negative margin), 36px tall, hover bg.
 * The "…" stays hidden unless the row is hovered (or its menu is open). */
.insp-anim-row__summary {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin: 0 -16px;
  padding: 4px 16px;
  height: 36px;
  cursor: pointer;
  transition: background 0.12s;
}
.insp-anim-row__summary:hover { background: var(--panel-surface-hover); }
.insp-anim-row__summary-text {
  font-size: 14px;
  color: #000000;
  line-height: 1.4;
}
.insp-anim-row__name {
  color: #116DFF;
  font-weight: 500;
}
.insp-anim-row__on { color: #6b6b76; }
/* Identical model to .layer-item__more: 22x22, hidden until the parent row
 * (insp-anim-row__summary) is hovered, hover changes color only (no bg). */
.insp-anim-row__menu-btn {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  cursor: pointer;
  color: #000624;
  padding: 0;
  flex-shrink: 0;
  border-radius: 3px;
  opacity: 0;
  transition: opacity 0.12s;
}
.insp-anim-row__summary:hover .insp-anim-row__menu-btn,
.insp-anim-row__menu-btn:focus,
.insp-anim-row.is-menu-open .insp-anim-row__menu-btn {
  opacity: 1;
}
.insp-anim-row__menu-btn:hover {
  color: var(--editor-accent);
  background: transparent;
}
/* Pop-up menu anchored to the row's right edge. Position absolute against
 * .insp-anim-row__summary (relative). z-index high enough to overlap the
 * next row's border. */
.insp-anim-row__menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 160px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  padding: 4px 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
}
.insp-anim-row__menu-item {
  background: transparent;
  border: 0;
  text-align: left;
  padding: 8px 14px;
  font: inherit;
  font-size: 13px;
  color: #000;
  cursor: pointer;
}
.insp-anim-row__menu-item:hover { background: #f4f4f6; }

/* === Animation picker grid (3-column tile picker) ===
 * Replaces the trigger-row list when the user clicks "Add" or the chip
 * name. Click a tile → sets `anim_<trigger>` and returns to the list;
 * the "< Setup" header sends the user back without choosing.
 * Each tile holds a static SVG glyph; hovering replays the movement via
 * CSS keyframes (see `.insp-anim-mover` rules below) — equivalent to the
 * Wix hover-gif behaviour without bundling 20 binary assets. */
.insp-anim-picker {
  padding: 12px 16px 24px;
}
.insp-anim-picker__back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 0;
  padding: 0;
  color: #000000;
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
  margin-bottom: 14px;
  font-family: inherit;
}
.insp-anim-picker__back:hover { color: #116DFF; }
.insp-anim-picker__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.insp-anim-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
}
.insp-anim-card__tile {
  position: relative; /* anchor for the two absolute-positioned <img>s */
  width: 100%;
  aspect-ratio: 1;
  background: #fff;
  border: 1px solid #e2e3ea;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s, border-color 0.12s, box-shadow 0.12s;
  overflow: hidden;
}
.insp-anim-card:hover .insp-anim-card__tile {
  background: #f4f5f8;
  border-color: #f4f5f8;
}
.insp-anim-card.is-selected .insp-anim-card__tile {
  background: #EAF2FF;
  border-color: #116DFF;
  box-shadow: inset 0 0 0 1px #116DFF;
}
/* Two GIFs stacked in the tile: _static visible at rest, _animated
 * cross-fades in on :hover. Both are 120×120 source — we scale to
 * 100% of the tile (CSS aspect-ratio 1:1) so they look crisp. */
.insp-anim-card__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  transition: opacity 0.12s ease;
}
.insp-anim-card__img--animated { opacity: 0; }
.insp-anim-card:hover .insp-anim-card__img--static   { opacity: 0; }
.insp-anim-card:hover .insp-anim-card__img--animated { opacity: 1; }
.insp-anim-card__label {
  margin-top: 8px;
  font-size: 11px;
  font-weight: 400;
  color: #000000;
  line-height: 16px;
  text-align: center;
}
.insp-anim-card.is-selected .insp-anim-card__label {
  color: #116DFF;
  font-weight: 500;
}

/* === Picker footer (Adjust Animation / Preview link) ===
 * Full-width band with gạch ngang TRÊN + DƯỚI (kiểu một item/nút). The
 * negative margin escapes the panel's 16px gutter so the borders run
 * edge-to-edge of the inspector body. */
.insp-anim-picker__footer {
  margin: 24px -16px 0;
  padding: 14px 16px;
  border-top: 1px solid var(--panel-border);
  border-bottom: 1px solid var(--panel-border);
  text-align: center;
}
.insp-anim-picker__adjust {
  background: transparent;
  border: 0;
  padding: 0;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  color: #116DFF;
  cursor: pointer;
}
.insp-anim-picker__adjust:hover { color: #0a52cc; }

/* === Adjust panel (Direction / Distance / Duration / Delay / Easing) === */
.insp-anim-adjust {
  padding: 12px 16px 24px;
}
.insp-anim-adjust__row { margin-top: 18px; }
.insp-anim-adjust__row:first-of-type { margin-top: 18px; }
.insp-anim-adjust__label {
  font-size: 13px;
  color: #131720;
  margin-bottom: 8px;
  user-select: text;
}
/* Compact, equal-width numeric inputs across all adjust rows (Distance,
 * Duration, Delay, Direction). Slider stretches; the box stays a fixed
 * narrow column so every row aligns. */
.insp-anim-adjust .insp-num-input {
  min-width: 0;
  width: 64px;
  flex: 0 0 64px;
}
.insp-anim-adjust .insp-num-input input { text-align: right; padding-right: 0; }
.insp-anim-adjust .insp-slider-row { gap: 12px; }
.insp-anim-adjust .insp-slider-row .insp-opacity-slider { flex: 1; min-width: 0; }
.insp-anim-adjust__dir {
  display: flex;
  align-items: center;
  gap: 18px;
}
/* Direction wheel — a 64px circle with a small handle pinned to the edge
 * pointing in the `--dir` direction. Drag the wheel to rotate. */
.insp-anim-dir-wheel {
  --dir: 0deg;
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 1px solid #e2e3ea;
  cursor: grab;
  flex: 0 0 auto;
}
.insp-anim-dir-wheel:active { cursor: grabbing; }
.insp-anim-dir-wheel::before {
  /* Centre dot. */
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #c6cad6;
  transform: translate(-50%, -50%);
}
.insp-anim-dir-wheel__handle {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #116DFF;
  /* Rotate from centre by --dir, then translate outwards along that radius. */
  transform: translate(-50%, -50%) rotate(var(--dir)) translateX(26px);
  pointer-events: none;
}
/* Off-screen checkbox row — uses shared .insp-checkbox box; we only
 * add the row layout + label text styling here. Label text stays
 * selectable so the user can copy it. */
.insp-anim-adjust__check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  cursor: pointer;
}
.insp-anim-adjust__check-label {
  font-size: 13px;
  color: #131720;
  user-select: text;
}

/* Hover playback is handled by the `.insp-anim-card__img--{static,animated}`
 * opacity swap above. SVG keyframes removed 2026-06-22 — replaced by real
 * GIFs in /static/images/animations/. */

/* === Background fills: image upload area ===
 * Empty state — dashed rectangle with `+` glyph centred. Click anywhere
 * inside opens the file picker. Lives in the Button inspector's
 * "Background fills" sub-section, directly under the color swatch row.
 * Populated state — square thumbnail showing the image; a small × in
 * the top-right corner removes it (click on thumb itself = replace). */
.insp-bg-image {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 80px;
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
  position: relative;
}
.insp-bg-image--empty {
  background: #f6f7fb;
  border: 1px dashed #b1b6c2;
  color: #2563eb;
  padding: 0;
}
.insp-bg-image--empty:hover {
  background: #eef0f7;
  border-color: #2563eb;
}
.insp-bg-image--filled {
  background-color: #f0f1f5;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border: 1px solid #e0e2e8;
  /* Use the button itself as the click-to-replace surface. */
}
.insp-bg-image__thumb {
  position: absolute;
  inset: 0;
  border: 0;
  background: inherit;
  cursor: pointer;
  border-radius: 5px;
}
.insp-bg-image__remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.12s;
  z-index: 2;
}
.insp-bg-image__remove:hover { background: rgba(0, 0, 0, 0.85); }

/* === Button inspector: Regular / Hover state tabs ===
 * Underline-style tabs with a separator above (matches the panel mockup
 * the user supplied). Container has:
 *   • 1 px top border — separator from the "Scale properties" toggle
 *     row above. Sits flush, no margin gap.
 *   • 1 px bottom border — gray track that the active tab's 2 px blue
 *     bar visually replaces in its own slot.
 * Container has NO padding because the tabs themselves span full width
 * (flex:1 each) — any wrapper padding would shrink the divider lines
 * inward. */
.btn-state-tabs {
  display: flex;
  gap: 0;
  /* Negative L/R margin cancels .insp-major__body's 16 px horizontal
   * padding so tabs span the FULL panel width. No bottom margin: the
   * next `.insp-sub` (Fill color & opacity) carries its own
   * `border-top: 1px solid panel-border`, and we let THAT line act as
   * the divider below the tabs — no dedicated `border-bottom` here, no
   * double line, single shared edge. */
  margin: 0 -16px;
  background: transparent;
  border-radius: 0;
  padding: 0;
  border-top: 1px solid #e5e7eb;
}
.btn-state-tab {
  flex: 1;
  padding: 10px 12px;
  border: none;
  background: transparent;
  border-radius: 0;
  font-size: 14px;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
  transition: color 0.12s, border-color 0.12s;
  /* position:relative + z-index lifts the tab above the next sibling's
   * border-top so the active tab's 2 px blue underline paints OVER the
   * insp-sub's gray border-top instead of stacking next to it. */
  position: relative;
  z-index: 1;
  /* Overlap the next sibling (.insp-sub) by 1 px so the 2 px blue bar
   * sits flush on the shared edge. Inactive tabs use `transparent` so
   * the gray line still shows through their slot. */
  margin-bottom: -1px;
  border-bottom: 2px solid transparent;
}
.btn-state-tab:hover { color: #000624; }
.btn-state-tab.is-active {
  background: transparent;
  color: #116DFF;
  box-shadow: none;
  border-bottom-color: #116DFF;
}

/* === Add custom CSS row (button + text inspector) === */
.insp-custom-css-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  margin: 0 -16px;
  border-top: 1px solid var(--panel-border);
}
.insp-custom-css-row__label {
  font-size: 13px;
  color: #000624;
  font-weight: 400;
}
.insp-custom-css-row__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--panel-border);
  background: #ffffff;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 400;
  color: #000624;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
.insp-custom-css-row__btn:hover {
  background: #f6f7fa;
  border-color: #c9ccd3;
}
.insp-custom-css-row__btn svg { color: var(--editor-accent); }

/* ─── Button inspector: Text sub-section ─── */

/* Inline label + control row (label left, control right) */
.insp-row-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 30px;
}
.insp-row-inline__label {
  font-size: 12px;
  color: #2b2e36;
}

/* Compact select used for Theme / Font / Weight */
.insp-select-compact {
  flex: 1;
  max-width: 180px;
  height: 30px;
  padding: 0 24px 0 10px;
  border: 1px solid #dde1e6;
  border-radius: 6px;
  background: #fff
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path fill='%23000624' d='M0 0l5 6 5-6z'/></svg>")
    no-repeat right 8px center;
  background-size: 8px 5px;
  font-size: 12px;
  color: #000624;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}
.insp-select-compact:hover { border-color: #b6c1cd; }
.insp-select-compact:focus { outline: none; border-color: var(--editor-accent); }

/* `--full` modifier: drop the 180 px cap so the select spans the full
 * panel-body width. Used by Theme/Font in the Button inspector where
 * the label sits ABOVE the control (no inline label competing for
 * horizontal space). */
.insp-select-compact--full {
  max-width: none;
  width: 100%;
  height: 36px;
  font-size: 13px;
  margin-top: 4px;
}
.insp-font-trigger--full {
  height: 36px;
  font-size: 13px;
  margin-top: 4px;
}

/* Inline text-style link button (e.g. "Save to Theme") */
.insp-text-btn {
  border: 0;
  background: none;
  padding: 0;
  margin-top: 6px;
  font-size: 12px;
  color: var(--editor-accent);
  cursor: pointer;
}
.insp-text-btn:hover { text-decoration: underline; }

/* Bold/Italic icon toggle row */
.insp-text-fmt { display: flex; gap: 4px; }
/* Wix-style single-row wrapping toolbar (B / I / U / S / Aa / colors /
 * align). Wraps to a second row on narrow inspectors. */
.insp-text-fmt--toolbar {
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
/* Color icon buttons in the toolbar (Text / Outline / Highlight). Same
 * footprint as the B/I/U/S buttons; the SVG inside carries a color band
 * fill that mirrors the current setting so the user sees the active
 * color at a glance. */
.insp-text-fmt__color {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #dde1e6;
  border-radius: 6px;
  background: #fff;
  color: #131720;
  cursor: pointer;
  padding: 0;
  transition: background 0.12s, border-color 0.12s;
}
.insp-text-fmt__color:hover  { background: #f4f5f8; border-color: #868aa5; }
.insp-text-fmt__color svg    { display: block; }

/* Toolbar dropdown (letter case + text align). Icon/text trigger with a
 * chevron on the right; click opens a small floating menu with the four
 * options. Same 32 px height as the neighbouring buttons. */
.insp-fmt-dd { position: relative; display: inline-flex; }
.insp-fmt-dd__trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  height: 32px;
  padding: 0 4px 0 8px;
  min-width: 48px;
  border: 1px solid #dde1e6;
  border-radius: 6px;
  background: #f4f5f8;
  color: #131720;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
.insp-fmt-dd__trigger:hover      { background: #eaebef; border-color: #b6c1cd; }
.insp-fmt-dd.is-open .insp-fmt-dd__trigger { border-color: var(--editor-accent, #116dff); }
.insp-fmt-dd__label { line-height: 1; }
.insp-fmt-dd__chev  { flex-shrink: 0; opacity: 0.7; }
.insp-fmt-dd__menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  min-width: 48px;
  padding: 4px;
  background: #fff;
  border: 1px solid #dfe2eb;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(15, 20, 40, 0.12);
}
.insp-fmt-dd__menu[hidden] { display: none; }
.insp-fmt-dd__opt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 32px;
  padding: 0 8px;
  border: none;
  background: transparent;
  color: #131720;
  font-family: var(--font-sans);
  font-size: 13px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.insp-fmt-dd__opt:hover       { background: #f4f5f8; }
.insp-fmt-dd__opt.is-active   { color: var(--editor-accent, #116dff); background: #eaf1ff; }
.insp-text-fmt__btn {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #dde1e6;
  border-radius: 6px;
  background: #fff;
  color: #000624;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
.insp-text-fmt__btn:hover { background: #f6f7fa; border-color: #b6c1cd; }
.insp-text-fmt__btn.is-active {
  background: #F1EEFE;
  border-color: var(--editor-accent);
  color: var(--editor-accent);
}

/* Letter case picker — looks like the format buttons next to it, but
 * is actually a native <select> so the menu pops the OS picker for
 * accessibility + zero JS overhead. Padding-right makes room for a
 * chevron-style fake glyph painted via background-image. */
.insp-text-fmt__case {
  height: 32px;
  min-width: 56px;
  padding: 0 22px 0 10px;
  border: 1px solid #dde1e6;
  border-radius: 6px;
  background: #fff
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path fill='%23000000' d='M0 0l5 6 5-6z'/></svg>")
    no-repeat right 8px center;
  background-size: 8px 5px;
  font-size: 14px;
  font-weight: 500;
  color: #000000;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: background-color 0.12s, border-color 0.12s;
}
.insp-text-fmt__case:hover { border-color: #b6c1cd; }
.insp-text-fmt__case:focus { outline: none; border-color: var(--editor-accent); }
/* Toolbar variant — narrower footprint that matches the 32 px icon
 * buttons next to it (B/I/U/S). User 2026-07-02 "Aa dài thế?". */
.insp-text-fmt__case--tight {
  min-width: 44px;
  padding: 0 18px 0 6px;
  font-size: 12px;
  background-position: right 5px center;
}

/* Radio rows used in Line spacing (Automatic / Custom). Matches the
 * generic insp-toggle-row spacing so vertical rhythm stays consistent
 * with the toggle switches above/below. */
.insp-radio-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 13px;
  color: #000000;
  cursor: pointer;
}
.insp-radio-row input[type="radio"] {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--editor-accent);
  cursor: pointer;
}

/* ──────────────────────────────────────────────────────────────────────
 * Borders block — Wix-style 4-side editor (Customize borders)
 *
 * Header:  "Customize borders"  [swatch] [ style ▾ ]  (i)
 * Grid (3×3, inputs in 4 corners, lock in centre, edges between):
 *
 *   ┌─────┐  ────────  ┌─────┐
 *   │ 0px │            │ 0px │
 *   └─────┘            └─────┘
 *      │                   │
 *      │       ┌──┐        │
 *      │       │🔒│        │
 *      │       └──┘        │
 *      │                   │
 *   ┌─────┐  ────────  ┌─────┐
 *   │ 0px │            │ 0px │
 *   └─────┘            └─────┘
 *
 * Each edge is a thin rounded "stripe" rendered with ::before so the
 * line attaches to the inner side of the corner inputs (matching Wix).
 * ─────────────────────────────────────────────────────────────────── */
.insp-borders__head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 14px;
}
.insp-borders__label {
  font-size: 13px;
  color: #000624;
  font-weight: 400;
  flex: 1 1 auto;
}
.insp-borders__head-controls {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.insp-borders__info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #868aa5;
  cursor: help;
}
.insp-borders__info:hover { color: #5B3DF5; }

/* Color swatch */
.insp-borders__color-swatch {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  border: 1px solid #dfe2eb;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
}
.insp-borders__color-swatch:hover {
  border-color: #5B3DF5;
  box-shadow: 0 0 0 1px rgba(17, 109, 255, 0.18);
}

/* Line-style dropdown */
.insp-borders__style-select { position: relative; }
.insp-borders__style-select select {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid #dfe2eb;
  border-radius: 6px;
  background: #fff url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 18 18' fill='%23000624'><path d='M12.853 7.85 9 11.71 5.147 7.846a.496.496 0 0 1 .7-.7l3.154 3.148 3.153-3.15a.494.494 0 0 1 .699 0 .499.499 0 0 1 0 .706Z'/></svg>") no-repeat right 6px center;
  background-size: 12px 12px;
  padding: 0 22px 0 8px;
  height: 26px;
  font-size: 12px;
  color: #000624;
  font-family: var(--font-sans);
  cursor: pointer;
  outline: none;
  min-width: 70px;
  transition: background-color 0.12s, border-color 0.12s, box-shadow 0.12s;
}
.insp-borders__style-select select:hover {
  background-color: #d3edff;
  border-color: #868aa5;
  color: #2b5672;
}
.insp-borders__style-select select:focus {
  border-color: #5B3DF5;
  box-shadow: inset 0 0 3px 0 rgba(0, 90, 132, 0.25);
  background-color: #fff;
  color: #000624;
}

/* 3×3 grid: corners hold the inputs, edges hold visualization lines, centre holds the lock. */
.insp-borders__grid {
  display: grid;
  grid-template-columns: 64px 1fr 64px;
  grid-template-rows: 32px 32px 32px;
  align-items: center;
  justify-items: center;
  gap: 6px 8px;
  padding: 4px 0 6px;
}

/* Numeric input — sits at each corner of the grid */
.insp-borders__num {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  border: 1px solid #dfe2eb;
  border-radius: 6px;
  padding: 0 6px;
  height: 32px;
  background: #fff;
  width: 64px;
  box-sizing: border-box;
  transition: background 0.12s, border-color 0.12s, box-shadow 0.12s, color 0.12s;
}
.insp-borders__num:hover {
  background: #d3edff;
  border-color: #868aa5;
  color: #2b5672;
}
.insp-borders__num:focus-within {
  background: #fff;
  border-color: #5B3DF5;
  box-shadow: inset 0 0 3px 0 rgba(0, 90, 132, 0.25);
  color: #000624;
}
.insp-borders__num input {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  font-size: 13px;
  color: inherit;
  font-family: var(--font-sans);
  text-align: left;
  padding: 0;
  min-width: 0;
}
.insp-borders__num span {
  font-size: 11px;
  color: #868aa5;
  flex-shrink: 0;
}
.insp-borders__num:focus-within span { color: #5B3DF5; }

/* Place the inputs in the 4 corner cells */
.insp-borders__num--tl { grid-column: 1; grid-row: 1; }
.insp-borders__num--tr { grid-column: 3; grid-row: 1; }
.insp-borders__num--bl { grid-column: 1; grid-row: 3; }
.insp-borders__num--br { grid-column: 3; grid-row: 3; }

/* Edges: the "frame" stripes that show the user which side they're editing.
 * Each edge cell holds an empty container; ::before paints the actual line
 * at the cell's inner side so it visually butts against the corner inputs. */
.insp-borders__edge {
  position: relative;
  width: 100%;
  height: 100%;
}
.insp-borders__edge::before {
  content: "";
  position: absolute;
  background: var(--bcolor, #000);
  border-radius: 2px;
  opacity: 0.9;
}
/* Top edge: between the two top inputs — horizontal line near the bottom of cell */
.insp-borders__edge--top { grid-column: 2; grid-row: 1; }
.insp-borders__edge--top::before {
  left: 0; right: 0; bottom: 4px; height: 2px;
}
/* Bottom edge: between the two bottom inputs */
.insp-borders__edge--bottom { grid-column: 2; grid-row: 3; }
.insp-borders__edge--bottom::before {
  left: 0; right: 0; top: 4px; height: 2px;
}
/* Left edge: between top-left and bottom-left inputs */
.insp-borders__edge--left { grid-column: 1; grid-row: 2; }
.insp-borders__edge--left::before {
  top: 0; bottom: 0; right: 4px; width: 2px;
}
/* Right edge: between top-right and bottom-right inputs */
.insp-borders__edge--right { grid-column: 3; grid-row: 2; }
.insp-borders__edge--right::before {
  top: 0; bottom: 0; left: 4px; width: 2px;
}

/* Lock toggle button — centre cell of the grid */
.insp-borders__lock {
  grid-column: 2;
  grid-row: 2;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #dfe2eb;
  border-radius: 6px;
  background: #fff;
  color: #868aa5;
  cursor: pointer;
  padding: 0;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.insp-borders__lock:hover {
  background: #d3edff;
  border-color: #868aa5;
  color: #2b5672;
}
.insp-borders__lock.is-locked {
  background: #5B3DF5;
  border-color: #5B3DF5;
  color: #fff;
}
.insp-borders__lock.is-locked:hover {
  background: #0e5dd6;
  border-color: #0e5dd6;
  color: #fff;
}

/* ──────────────────────────────────────────────────────────────────────
 * Cell element — Wix-style split section grid.
 * The grid container is `.cs-section-grid` (flex), each child is a
 * `.canvas-section[data-section-type="cell"]` whose inner is `.cs-cell`.
 * Cells have a subtle solid outline so empty cells stay visible.
 * ─────────────────────────────────────────────────────────────────── */
.cs-section-grid,
.cs-cell-grid {
  box-sizing: border-box;
}
.canvas-section[data-section-type="cell"] {
  box-sizing: border-box;
  min-height: 60px;
}
/* The cell holding the current selection floats above its sibling cells —
 * otherwise an element's toolbar (which overhangs above the element, often
 * into a neighbouring cell) gets covered: clicks land on that cell and
 * hovering it lights the wrong ring. */
.canvas-section[data-section-type="cell"].is-section-active {
  z-index: 6;
}
/* Cell outlines surface only while the user is editing AT THE GRID
 * LEVEL — selection on the Section itself or one of its Cells. Once the
 * user drills deeper (into a Stack / element inside a Cell), the noise
 * of every sibling cell goes away; only the containing cell keeps a
 * faint outline (via `.is-containing-cell`) so the user can still see
 * which cell they're inside. */
.canvas-section.is-grid-edit-active .canvas-section[data-section-type="cell"]:not(.is-selected)::after {
  border: 1px solid rgba(17, 109, 255, 0.18);
}
/* Cell hover tint — painted via a class toggle (see the mouseover handler in
 * 04-canvas-events.js) instead of an overlay div, so it never flickers. Same
 * translucent brand-purple the old .cs-grid-track-hi overlay used. */
.canvas-section.is-grid-edit-active .canvas-section[data-section-type="cell"].is-cell-hover:not(.is-selected)::after {
  border-color: rgba(91, 61, 245, 0.5);
  background: rgba(91, 61, 245, 0.14);
}
.canvas-section.is-grid-edit-active .canvas-section[data-section-type="cell"]:hover:not(.is-selected):not(:has(.canvas-section__toolbar:hover))::after {
  /* User 2026-07-04: hover viền mỏng xanh đậm — 1 px + full-opacity blue,
   * matches the standard hover-target rule used elsewhere in the canvas
   * (rgba(37, 99, 235, 0.9)). Previous 2 px + 0.5 opacity felt fat/muted. */
  border: 1px solid rgba(37, 99, 235, 0.9);
}
.canvas-section[data-section-type="cell"].is-selected::after {
  border: 2px solid #5B3DF5;
}
/* Containing-cell hint when selection is deeper than Cell — only THIS
 * cell shows a faint outline; siblings stay quiet. */
.canvas-section[data-section-type="cell"].is-containing-cell:not(.is-selected)::after {
  border: 1px solid rgba(17, 109, 255, 0.22);
}
.cs-cell {
  box-sizing: border-box;
}

/* ──────────────────────────────────────────────────────────────────────
 * Cell gutter — sits between two adjacent cells in a section grid.
 * Default: invisible (just a 4px hit-target). Hover: surfaces a thin
 * blue line plus a "+" button at the centre. Drag the line to resize.
 * ─────────────────────────────────────────────────────────────────── */
/* Gutter takes zero space in the flow so adjacent cells sit flush. The
 * hit-target is widened to 8px via a pseudo-element that overflows into
 * the neighbouring cells — Wix does the same trick. */
.cs-cell-gutter {
  position: relative;
  flex: 0 0 0px;
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
}
.cs-cell-gutter--row { width: 0; cursor: col-resize; }
.cs-cell-gutter--col { height: 0; cursor: row-resize; width: 100%; }
.cs-cell-gutter::before {
  content: "";
  position: absolute;
  z-index: 0;
}
.cs-cell-gutter--row::before {
  top: 0; bottom: 0;
  left: -8px; right: -8px;
}
.cs-cell-gutter--col::before {
  left: 0; right: 0;
  top: -8px; bottom: -8px;
}

.cs-cell-gutter__line {
  position: absolute;
  background: transparent;
  transition: background 0.12s;
}
.cs-cell-gutter--row .cs-cell-gutter__line {
  top: 0; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 2px;
}
.cs-cell-gutter--col .cs-cell-gutter__line {
  left: 0; right: 0; top: 50%; transform: translateY(-50%);
  height: 2px;
}
.cs-cell-gutter:hover .cs-cell-gutter__line,
body.is-cell-resizing .cs-cell-gutter__line {
  background: #5B3DF5;
}

/* "+" button — shown only on gutter hover. Wix-style: white circle with
 * a thin blue border and a centred + glyph. */
.cs-cell-gutter__add {
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid #5B3DF5;
  background: #fff;
  color: #5B3DF5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  z-index: 6;
  opacity: 0;
  transition: opacity 0.12s, background 0.12s, transform 0.12s;
  pointer-events: none;
}
.cs-cell-gutter:hover .cs-cell-gutter__add {
  opacity: 1;
  pointer-events: auto;
}
.cs-cell-gutter__add:hover {
  background: #5B3DF5;
  color: #fff;
  transform: scale(1.08);
}
/* Hide while actively dragging the gutter so the user can keep moving */
body.is-cell-resizing .cs-cell-gutter__add {
  opacity: 0;
  pointer-events: none;
}

/* Cell inspector: top alignment row.
 *
 * Wix-exact: 7 icon-only buttons in a row, no border, hover = subtle grey.
 * Disabled state (no cell content yet): icons greyed, no pointer-events. */
.insp-align-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 6px 0 14px;
  border-bottom: 1px solid #e8e9ee;
  margin: -2px 0 14px;
}
.insp-align-btn {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  border-radius: 4px;
  color: #131720;
  cursor: pointer;
  padding: 0;
  transition: background 0.12s, color 0.12s;
}
.insp-align-btn:hover { background: #f4f5f8; }
.insp-align-btn.is-active { color: #5B3DF5; background: #F1EEFE; }
.insp-align-bar.is-disabled .insp-align-btn,
.insp-align-bar .insp-align-btn[disabled] {
  color: #c1c4cc;
  cursor: default;
  pointer-events: none;
}
.insp-align-bar.is-disabled .insp-align-btn:hover { background: transparent; }
/* V-axis Align content row reuses the same H-axis glyphs rotated 90° */
.insp-cell-aligncontent-bar__v svg { transform: rotate(90deg); }

/* Multi-element inspector — count badge + align bar only */
.insp-multi-count {
  font-size: 12px;
  color: var(--panel-text-secondary, #6b7280);
  padding: 4px 14px 12px;
  border-bottom: 1px solid #e8e9ee;
  margin-bottom: 8px;
}
.insp-multi-align {
  /* Same look as the cell top-row align bar but no bottom border + no
   * negative margin (it's the only block in this inspector). */
  border-bottom: 0;
  margin: 0;
  padding: 12px 0;
}

/* Thumbnail picker (Overlap None / Next section in Header settings) —
 * 2 large cards side-by-side, each with an icon thumbnail + label. */
.insp-thumb-pair {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}
.insp-thumb-pair__item {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.insp-thumb-card {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 8px;
  background: #fff;
  border: 1px solid #e0e2e8;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
.insp-thumb-card:hover { background: #f5f5f7; border-color: #c5cad2; }
.insp-thumb-card.is-active {
  border-color: #5B3DF5;
  background: #F1EEFE;
}
.insp-thumb-pair__label {
  font-family: inherit;
  font-size: 12px;
  color: #5f6377;
  text-align: center;
}
.insp-thumb-pair__label.is-active { color: #5B3DF5; }

/* Stepper input — text field with up/down chevron buttons stacked on
 * the right edge. Mirrors the look of `.insp-adjust-input` so the row
 * stays visually consistent next to non-stepper fields. */
.insp-stepper {
  /* Match the width / height of `.insp-adjust-input` so all rows in a
   * column line up perfectly (Distance / Delay / Duration etc.). */
  display: inline-flex;
  align-items: stretch;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  background: #fff;
  height: 30px;
  width: 100px;
  flex: 0 0 auto;
  overflow: hidden;
  transition: background 0.12s, border-color 0.12s, box-shadow 0.12s;
}
.insp-stepper:hover { background: #f3f4f6; }
.insp-stepper:focus-within {
  border-color: #5B3DF5;
  background: #fff;
  box-shadow: inset 0 0 3px 0 rgba(0, 90, 132, 0.25);
}
.insp-stepper__input {
  flex: 1 1 auto;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font-sans);
  font-size: 13px;
  color: #000624;
  padding: 0 0 0 8px;
  text-align: left;
}
.insp-stepper__btns {
  display: flex;
  flex-direction: column;
  border-left: 1px solid #e8eaf0;
  flex-shrink: 0;
}
.insp-stepper__btn {
  flex: 1 1 0;
  width: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: #868aa5;
  cursor: pointer;
  padding: 0;
  transition: background 0.12s, color 0.12s;
}
.insp-stepper__btn:hover { background: #f0f1f5; color: #5B3DF5; }
.insp-stepper__btn--up { border-bottom: 1px solid #e8eaf0; }

/* Direction arrow buttons (Header settings) — 4 square icon buttons */
.insp-dir-row {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}
.insp-dir-btn {
  flex: 1 1 0;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid #e0e2e8;
  border-radius: 6px;
  cursor: pointer;
  color: #131720;
  padding: 0;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.insp-dir-btn:hover {
  background: #f5f5f7;
  border-color: #c5cad2;
}
.insp-dir-btn.is-active {
  border-color: #5B3DF5;
  background: #F1EEFE;
  color: #5B3DF5;
}

/* ──────────────────────────────────────────────────────────────────────
 * Header scroll effects — applied by toggling `.cs-header[data-scrolled="true"]`
 * on the live <cs-header> when the editor canvas scrolls past a small
 * threshold. The effect kind reads from `data-scroll-effect`, animation
 * params come from inline CSS variables emitted by the canvas renderer.
 * ─────────────────────────────────────────────────────────────────── */
.cs-header {
  transition:
    transform        var(--header-duration, .3s) var(--header-ease, linear) var(--header-delay, 0s),
    opacity          var(--header-duration, .3s) var(--header-ease, linear) var(--header-delay, 0s),
    background-color var(--header-duration, .3s) var(--header-ease, linear) var(--header-delay, 0s);
}

/* === Disable header scroll effects INSIDE the editor canvas ===
 *
 * Scroll effects (disappear / fade-in/out / freeze) make editing
 * painful — the user scrolls down to edit a section and the header
 * disappears, or freezes over content they're trying to click. Per
 * user 2026-06-27: "tạm thời tắt ở bên canvas đi". The compiled /
 * preview page still gets the effects (those rules use
 * .vendr-section--header which doesn't sit inside .editor-canvas).
 *
 * Override every effect-related transform / opacity / position to
 * neutral when the header is anywhere inside .editor-canvas. */
/* Scope to the BUILDER only — `body:not(.vendr-preview-runtime)`. The preview
 * iframe reuses the `.editor-canvas` skeleton, so an unscoped
 * `.editor-canvas .cs-header` rule ALSO killed scroll effects in preview
 * (user 2026-07-09 "preview Header chưa có scroll effect"). Excluding the
 * preview body lets the preview header animate while the builder canvas stays
 * neutral. */
body:not(.vendr-preview-runtime) .editor-canvas .cs-header[data-scroll-effect] {
  transform: none !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  transition: none !important;
}
body:not(.vendr-preview-runtime) .editor-canvas .canvas-section[data-section-type="header"] {
  /* Strip sticky / pin behaviour inside the editor — header flows with
   * the rest of the canvas like a normal section. */
  position: relative !important;
  top: auto !important;
  bottom: auto !important;
  z-index: auto !important;
  order: 0 !important;
  margin-top: 0 !important;
}

/* Preview iframe: pin the header so scroll-effect transforms animate from a
 * fixed top:0. Preview uses `.canvas-section[data-section-type="header"]`
 * (NOT `.vendr-section--header`, which is the published-site markup), so the
 * enable rules below (scoped to .vendr-section--header) never matched in
 * preview. Mirror them for the preview header element. */
body.vendr-preview-runtime .canvas-section[data-section-type="header"]:has(.cs-header[data-scroll-effect="freeze"]),
body.vendr-preview-runtime .canvas-section[data-section-type="header"]:has(.cs-header[data-scroll-effect="disappear"]),
body.vendr-preview-runtime .canvas-section[data-section-type="header"]:has(.cs-header[data-scroll-effect="fade-out"]),
body.vendr-preview-runtime .canvas-section[data-section-type="header"]:has(.cs-header[data-scroll-effect="fade-in"]),
body.vendr-preview-runtime .canvas-section[data-section-type="header"]:has(.cs-header[data-scroll-effect="scroll-with-site"]) {
  position: sticky;
  top: 0;
  z-index: 100;
}
body.vendr-preview-runtime .cs-header[data-scroll-effect] {
  transition: transform 0.3s ease, opacity 0.3s ease;
}
/* Overlap = "next": the header floats OVER the section below it. Its full-
 * width box (with a solid bg) otherwise covers that section and swallows every
 * hover/click there — the whole page felt dead (user 2026-07-10 "cả hover
 * cũng không có"). Let clicks pass THROUGH the header's empty area and re-arm
 * only its real interactive content (logo / menu / cart / buttons / links).
 * The header's own background still paints; it just doesn't eat pointer events
 * where there's nothing to click. Only in preview + only for overlap:next. */
body.vendr-preview-runtime .canvas-section[data-section-type="header"]:has(.cs-header[data-overlap="next"]),
body.vendr-preview-runtime .cs-header[data-overlap="next"],
body.vendr-preview-runtime .cs-header[data-overlap="next"] .cs-section__inner {
  pointer-events: none;
}
body.vendr-preview-runtime .cs-header[data-overlap="next"] a,
body.vendr-preview-runtime .cs-header[data-overlap="next"] button,
body.vendr-preview-runtime .cs-header[data-overlap="next"] .cs-menu,
body.vendr-preview-runtime .cs-header[data-overlap="next"] .cs-menu a,
body.vendr-preview-runtime .cs-header[data-overlap="next"] nav,
body.vendr-preview-runtime .cs-header[data-overlap="next"] nav a,
body.vendr-preview-runtime .cs-header[data-overlap="next"] .cs-btn,
body.vendr-preview-runtime .cs-header[data-overlap="next"] .cs-cart,
body.vendr-preview-runtime .cs-header[data-overlap="next"] .cs-image,
body.vendr-preview-runtime .cs-header[data-overlap="next"] .canvas-section {
  pointer-events: auto;
}

/* Preview / published page: pin the header section so the scroll-effect
 * transforms (translateY(-100%) etc.) animate from a fixed top:0 position
 * rather than wherever the header happens to scroll to in normal flow.
 *
 * These rules used to live in compileHeaderRuntime's inline <style> block
 * but pentest vòng 4 added <style> to SanitizeBuilderHTML's blocklist,
 * stripping them silently from compiled_html. Without sticky, the header
 * scrolled with content — user-reported 2026-06-27: "phát kéo xuống đầu
 * tiên header bị lệch xuống dưới" — and the disappear transform fired
 * from a half-off-screen position, looking like the header dipped down.
 *
 * NOT scoped under .editor-canvas — preview uses .vendr-section--header
 * which never sits inside .editor-canvas, so the canvas is untouched.
 * The canvas's own header positioning is handled by the .canvas-section
 * rules earlier in this file. */
.vendr-section--header:has(.cs-header[data-scroll-effect="freeze"]),
.vendr-section--header:has(.cs-header[data-scroll-effect="disappear"]),
.vendr-section--header:has(.cs-header[data-scroll-effect="fade-out"]),
.vendr-section--header:has(.cs-header[data-scroll-effect="fade-in"]) {
  position: sticky;
  top: 0;
  z-index: 4;
}
.vendr-section--header:has(.cs-header[data-scroll-effect="freeze"]) { z-index: 5; }
/* Overlap=next: header section gets margin-top:-Hpx on the next section
 * (applied by vendr-runtime.js applyOverlap), so the next section sits
 * UNDER the header. Without a stacking context the section's content
 * paints OVER the header — including for the default scroll-with-site
 * effect which has no sticky rule above. Bump z-order.
 *
 * CRITICAL: `position:relative` here MUST NOT clobber the `position:sticky`
 * the scroll-effect rule above sets — a fade-out/disappear/freeze header that
 * ALSO has overlap=next needs to STAY sticky (else it scrolls away and the
 * effect never shows; user 2026-07-13 "mất scroll effect của header" — header
 * had overlap=next + fade-out, and this same-specificity relative rule won by
 * source order). So gate the relative on headers WITHOUT a sticky effect. A
 * sticky header already establishes its own stacking context, so it only needs
 * the z-index bump. */
.vendr-section--header:has(.cs-header[data-overlap="next"]):not(:has(.cs-header[data-scroll-effect="freeze"])):not(:has(.cs-header[data-scroll-effect="disappear"])):not(:has(.cs-header[data-scroll-effect="fade-out"])):not(:has(.cs-header[data-scroll-effect="fade-in"])) {
  position: relative;
  z-index: 3;
}
/* Sticky header with overlap=next: keep sticky, just bump z-index. */
.vendr-section--header:has(.cs-header[data-overlap="next"]):has(.cs-header[data-scroll-effect]) {
  z-index: 3;
}
/* Overlap=next on the PUBLISHED / proxied site (category, product, …): the
 * header sits OVER the next section (margin-top:-H). Its full-width solid-bg
 * box covered that section and ate every hover/click there, and with a
 * translucent header bg it also tinted the page darker (user 2026-07-10 "giao
 * diện chả bấm được gì, mọi thứ đậm đậm hơn"). This runs on the SiteHandler
 * markup (.vendr-section--header) — the preview-only rules above use
 * body.vendr-preview-runtime and don't reach a proxied ?raw=1 page. Let clicks
 * fall through the header's empty area; re-arm only its interactive content. */
.vendr-section--header:has(.cs-header[data-overlap="next"]),
.vendr-section--header:has(.cs-header[data-overlap="next"]) .cs-header,
.vendr-section--header:has(.cs-header[data-overlap="next"]) .cs-section__inner {
  pointer-events: none;
}
.vendr-section--header:has(.cs-header[data-overlap="next"]) a,
.vendr-section--header:has(.cs-header[data-overlap="next"]) button,
.vendr-section--header:has(.cs-header[data-overlap="next"]) .cs-menu,
.vendr-section--header:has(.cs-header[data-overlap="next"]) .cs-menu a,
.vendr-section--header:has(.cs-header[data-overlap="next"]) nav,
.vendr-section--header:has(.cs-header[data-overlap="next"]) nav a,
.vendr-section--header:has(.cs-header[data-overlap="next"]) .cs-btn,
.vendr-section--header:has(.cs-header[data-overlap="next"]) .cs-cart,
.vendr-section--header:has(.cs-header[data-overlap="next"]) .cs-image,
.vendr-section--header:has(.cs-header[data-overlap="next"]) .canvas-section {
  pointer-events: auto;
}
/* Pin to bottom — full-width fixed strip. */
.vendr-section--header:has(.cs-header[data-pin="bottom"]) {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  top: auto;
  z-index: 50;
}

/* Disappear — slide out in the chosen direction, scaled by distance. */
.cs-header[data-scroll-effect="disappear"][data-scrolled="true"] {
  transform: var(--header-disappear-tx, translateY(calc(var(--header-distance, 100%) * -1)));
}
.cs-header[data-scroll-effect="disappear"][style*="--header-dir:left"][data-scrolled="true"]  { transform: translateX(calc(var(--header-distance, 100%) * -1)); }
.cs-header[data-scroll-effect="disappear"][style*="--header-dir:right"][data-scrolled="true"] { transform: translateX(var(--header-distance, 100%)); }
.cs-header[data-scroll-effect="disappear"][style*="--header-dir:up"][data-scrolled="true"]    { transform: translateY(calc(var(--header-distance, 100%) * -1)); }
.cs-header[data-scroll-effect="disappear"][style*="--header-dir:down"][data-scrolled="true"]  { transform: translateY(var(--header-distance, 100%)); }

/* Fade out — drops opacity to 0 on scroll. */
.cs-header[data-scroll-effect="fade-out"][data-scrolled="true"] {
  opacity: 0;
  pointer-events: none;
}
/* Fade in — starts at 0 opacity, fades up on scroll. */
.cs-header[data-scroll-effect="fade-in"] {
  opacity: 0;
}
.cs-header[data-scroll-effect="fade-in"][data-scrolled="true"] {
  opacity: 1;
}

/* Freeze: header pinned to top of the viewport. No animation params.
 * Positioning is now handled at the .canvas-section level below (see "Header
 * sticky/dock positioning" block) so the sticky element's containing block is
 * the full page, not just the header's own section. We keep the transition
 * here so background-color animates when CWS engages. */
.cs-header[data-scroll-effect="freeze"] {
  transition: background-color var(--header-duration, .3s) var(--header-ease, linear);
}

/* Color while scrolling — swap header background to --header-cws-bg once
 * the user has scrolled past the top, regardless of scroll direction.
 *
 * Keyed off data-past-top (absolute scrollTop) and NOT data-scrolled
 * (direction-based) — otherwise the CWS colour would flip back to the
 * default every time the user scrolled up to bring a disappeared header
 * back, never letting the CWS hue actually settle.
 *
 * !important needed because .cs-header always carries an inline
 * `background-color:` style from buildSectionStyle, which external CSS
 * can't override without !important. */
.cs-header[data-cws="on"][data-past-top="true"] {
  background-color: var(--header-cws-bg) !important;
}

/* Background pattern overlay. Mirrors Wix's <wix-bg-image fittingType="tile">
 * behaviour: the source PNG (6×6 etc.) is tiled at its INTRINSIC size, never
 * stretched. Implemented as a ::before pseudo-element sitting between the
 * header bg color and the header's children.
 *
 * background-size: auto is critical — without it, a parent rule could
 * stretch a 6×6 pattern to fill the whole header (one giant blur instead of
 * a tiled grain). pointer-events: none keeps clicks routing to children. */
.cs-header[data-pattern="on"],
.cs-section[data-pattern="on"],
.cs-footer[data-pattern="on"] {
  position: relative;
  /* isolation:isolate forces a self-contained stacking context so the
   * pattern ::before (z-index:0) and the children (z-index:1) always layer
   * correctly relative to the element's own background — regardless of
   * whether a scroll-effect transform happens to be present. Without it, a
   * header set to "Scroll with site" (no transform → no stacking context)
   * resolves those z-indexes in a distant ancestor context and the pattern
   * can drop behind the background. */
  isolation: isolate;
}
.cs-header[data-pattern="on"]::before,
.cs-section[data-pattern="on"]::before,
.cs-footer[data-pattern="on"]::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--header-pattern-url);
  background-repeat: repeat;
  background-size: auto;
  background-position: 0 0;
  pointer-events: none;
  z-index: 0;
}
.cs-header[data-pattern="on"] > *,
.cs-section[data-pattern="on"] > *,
.cs-footer[data-pattern="on"] > * {
  position: relative;
  z-index: 1;
}

/* === Header sticky positioning ===
 *
 * Per docs/header-scroll-effects.md, PINNING is controlled by Scroll effect,
 * not Overlap. Every non-default scroll effect pins the header to the top of
 * the viewport (freeze stays pinned, disappear/fade-out animate from pinned
 * position, fade-in fades in at pinned position).
 *
 * Overlap controls LAYOUT (whether next section starts at y=0 under header,
 * or below header) — handled in JS via applyHeaderOverlap() by setting
 * negative margin on the first sibling section.
 *
 * Applied at the .canvas-section level (not the inner .cs-header) so the
 * sticky containing block is .editor-canvas__page (full scrollable page),
 * not .canvas-section__content (just one section tall).
 *
 * Pin-bottom case (rule further below) overrides via source order. */
.canvas-section[data-section-type="header"]:has(.cs-header[data-scroll-effect="freeze"]),
.canvas-section[data-section-type="header"]:has(.cs-header[data-scroll-effect="disappear"]),
.canvas-section[data-section-type="header"]:has(.cs-header[data-scroll-effect="fade-out"]),
.canvas-section[data-section-type="header"]:has(.cs-header[data-scroll-effect="fade-in"]),
/* Mirror rules for the live preview / published site, which uses .vendr-section
 * wrappers (emitted by compileSection) instead of .canvas-section. Preview
 * loads editor.css too, so adding these here means published pages get the
 * sticky behaviour even when compiled_html doesn't carry the inline runtime
 * <style> block (older compiled HTML or pages rendered through a different
 * code path). */
.vendr-section--header:has(.cs-header[data-scroll-effect="freeze"]),
.vendr-section--header:has(.cs-header[data-scroll-effect="disappear"]),
.vendr-section--header:has(.cs-header[data-scroll-effect="fade-out"]),
.vendr-section--header:has(.cs-header[data-scroll-effect="fade-in"]) {
  position: sticky;
  top: 0;
  z-index: 4;
}
/* Freeze sits above other sticky chrome */
.canvas-section[data-section-type="header"]:has(.cs-header[data-scroll-effect="freeze"]),
.vendr-section--header:has(.cs-header[data-scroll-effect="freeze"]) {
  z-index: 5;
}
/* Pin to bottom: dock the header section to the bottom of the canvas
 * viewport frame.
 *
 * Strategy: with .editor-canvas__page as a flex column, give the pinned
 * header `order: 999` so it renders visually LAST (after all other
 * sections), and `margin-top: auto` to push it to flex-end when content
 * is shorter than the viewport. Then `position: sticky; bottom: 0` makes
 * it stick to the bottom of the scroll port (the viewport frame) once
 * content gets tall enough to scroll — exactly the "header at bottom of
 * screen" behavior the user wants.
 *
 * Sticky works here (unlike when the header was rendered at the top of
 * the page) because rendering last places the element below the scroll
 * port, which is the condition sticky-bottom is designed for. */
.canvas-section[data-section-type="header"]:has(.cs-header[data-pin="bottom"]) {
  order: 999;
  margin-top: auto;
  position: sticky;
  bottom: 0;
  top: auto;
  z-index: 4;
}
/* Preview / live-site equivalent: dock to bottom of browser viewport. The
 * live site has no transformed ancestor between header and viewport, so
 * position:fixed correctly resolves against the actual window. */
.vendr-section--header:has(.cs-header[data-pin="bottom"]) {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  top: auto;
  z-index: 50;
}

/* Cell inspector: Size row — 2-column grid using shared insp-size-field */
.insp-cell-size-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 6px;
}
/* Cell inspector: Align content bar separator (matches Wix) */
.insp-cell-aligncontent-bar { gap: 4px; align-items: center; }
.insp-cell-aligncontent-bar__sep {
  display: inline-block;
  width: 1px;
  height: 18px;
  background: #e8e9ee;
  margin: 0 4px;
}

/* Cell inspector: Split cell row */
.insp-cell-split-row {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}
.insp-cell-split-btn {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #dfe2eb;
  border-radius: 6px;
  background: #fff;
  color: #000624;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.insp-cell-split-btn:hover {
  background: #d3edff;
  border-color: #868aa5;
  color: #2b5672;
}

/* Cell Layout: Align content row */
.insp-cell-aligncontent {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 6px 0 0;
}
.insp-cell-aligncontent__btn {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  border-radius: 4px;
  color: #000624;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.insp-cell-aligncontent__btn:hover {
  background: #d3edff;
  color: #2b5672;
}
.insp-cell-aligncontent__btn.is-active {
  background: #F1EEFE;
  color: var(--editor-accent);
}
/* (No separator — align content row is a single flat row of 6 buttons.) */

/* Padding grid (X / Y inputs) */
.insp-pad-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 6px;
}
.insp-pad-cell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #dfe2eb;
  border-radius: 6px;
  padding: 0 8px;
  height: 32px;
  background: #fff;
  transition: background 0.12s, border-color 0.12s, box-shadow 0.12s, color 0.12s;
}
.insp-pad-cell:hover {
  background: #d3edff;
  border-color: #868aa5;
  color: #2b5672;
}
.insp-pad-cell:focus-within {
  border-color: #5B3DF5;
  box-shadow: inset 0 0 3px 0 rgba(0, 90, 132, 0.25);
  background: #fff;
  color: #000624;
}
.insp-pad-cell__icon {
  display: inline-flex;
  color: #868aa5;
  flex-shrink: 0;
}
.insp-pad-cell input {
  flex: 1 1 auto;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-size: 13px;
  color: inherit;
  font-family: var(--font-sans);
  padding: 0;
}
.insp-pad-cell__unit {
  font-size: 11px;
  color: #868aa5;
  flex-shrink: 0;
}
.insp-pad-lock {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #dfe2eb;
  border-radius: 4px;
  background: #fff;
  color: #868aa5;
  cursor: pointer;
  padding: 0;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.insp-pad-lock:hover {
  background: #d3edff;
  border-color: #868aa5;
  color: #2b5672;
}
.insp-pad-lock.is-locked {
  background: var(--editor-accent);
  border-color: var(--editor-accent);
  color: #fff;
}

/* (Visual Padding trap experiment removed 2026-07-02 — button now uses
 * the standard pg-padding-* layout shared with Container / Stack /
 * Section.) */

/* Corner cell — used by Container / Stack / Cell corners */
.insp-corner-cell {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  border: 1px solid #dfe2eb;
  border-radius: 6px;
  padding: 0 8px;
  height: 32px;
  background: #fff;
  transition: background 0.12s, border-color 0.12s, box-shadow 0.12s, color 0.12s;
}
.insp-corner-cell:hover {
  background: #d3edff;
  border-color: #868aa5;
  color: #2b5672;
}
.insp-corner-cell:focus-within {
  border-color: #5B3DF5;
  box-shadow: inset 0 0 3px 0 rgba(0, 90, 132, 0.25);
  background: #fff;
  color: #000624;
}
.insp-corner-cell input {
  flex: 1 1 auto;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-size: 13px;
  color: inherit;
  font-family: var(--font-sans);
  text-align: left;
  padding: 0;
}
.insp-corner-cell span {
  font-size: 11px;
  color: #868aa5;
  flex-shrink: 0;
}
/* The corners grid needs to be 2x2 with a lock floating in the centre */
.insp-corners-grid { position: relative; }

/* ========================================================================
   Vendr custom tooltip — replaces the browser's native title bubble.
   Suppressed at the DOM level (title moved to data-orig-title on hover).
   ======================================================================== */
.vendr-tip {
  position: fixed;
  z-index: 99999;
  pointer-events: none;
  background: #131720;
  color: #fff;
  font-family: var(--font-sans, system-ui);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.35;
  padding: 6px 10px;
  border-radius: 4px;
  max-width: 260px;
  white-space: normal;
  box-shadow: 0 4px 14px rgba(0,0,0,0.18);
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity 0.1s ease, transform 0.1s ease;
}
.vendr-tip.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.vendr-tip::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 0;
  height: 0;
  margin-left: -5px;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
}
.vendr-tip[data-placement="bottom"]::after {
  top: -5px;
  border-bottom: 5px solid #131720;
}
.vendr-tip[data-placement="top"]::after {
  bottom: -5px;
  border-top: 5px solid #131720;
}

/* ========================================================================
   Vendr custom select — replaces native <select> via upgradeSelectsToCustomDropdowns.
   Trigger mimics resp-behavior-trigger; dropdown reuses .resp-behavior-dropdown.
   ======================================================================== */
.vendr-select-wrap { position: relative; display: block; width: 100%; }
.vendr-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  width: 100%;
  min-height: 32px;
  padding: 6px 8px 6px 10px;
  background: #fff;
  border: 1px solid var(--panel-border, #e0e0e0);
  border-radius: 0;
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--panel-text);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.12s;
}
.vendr-select-trigger:hover { border-color: #b8bcc8; }
.vendr-select-trigger:focus { outline: none; border-color: var(--editor-accent); }
.vendr-select-trigger__label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.vendr-select-trigger__chev {
  flex-shrink: 0;
  color: var(--panel-text-secondary);
}
.vendr-select-dropdown { min-width: 160px; }
/* Selected option in a select-style dropdown reads as a row highlight
   (blue text on light-blue bg) instead of a checkmark suffix. Other
   options stay plain with subtle hover bg. */
.vendr-select-dropdown .resp-behavior-dropdown__item {
  padding-left: 14px;
  padding-right: 14px;
}
.vendr-select-dropdown .resp-behavior-dropdown__item.is-selected {
  background: #F1EEFE;
  color: #5B3DF5;
  font-weight: 400;
}
.vendr-select-dropdown .resp-behavior-dropdown__item.is-selected:hover {
  background: #E8E2FD;
}

/* ========================================================================
   Dropdown panel flattening — panels aren't buttons, no rounded corners.
   Items inside (rows the user clicks) can keep their own radius if any.
   ======================================================================== */
.mainbar-page-nav__dropdown,
.mainbar-preview-menu,
.insp-style-dropdown,
.mm-item__ctx-menu,
.mm-add-dropdown,
.add-section-menu,
.layer-context-menu,
.canvas-context-menu,
.resp-behavior-dropdown,
.insp-unit-dropdown,
.cs-layout-dropdown,
.unit-dropdown,
.sp-global-menu,
.insp-size-menu,
.pg-unit-dropdown,
.ai-composer__model-menu,
.insp-icon-select-dropdown {
  border-radius: 0 !important;
}

/* Auto-docks checkbox — tight against the margins grid above (no extra
   vertical air). Also collapses the grid's own padding-bottom so the
   spacing is consistent. */
.insp-margins-grid:has(+ .insp-auto-docks) { padding-bottom: 4px !important; }
.insp-auto-docks {
  margin-top: 0;
  padding-top: 8px;
  padding-bottom: 4px;
}

/* ========================================================================
   Change Image / Upload Media modal (cm-*)
   ======================================================================== */
.cm-overlay {
  position: fixed; inset: 0;
  background: rgba(15, 18, 26, 0.45);
  /* Above .canvas-section__toolbar (z-index: 2147482000) — otherwise the
     floating element-toolbar painted over the canvas bleeds across the
     media-picker dialog. User 2026-06-30: "cửa sổ upload media đang bị
     toolbar đè lên". */
  z-index: 2147483640;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-sans, system-ui);
}
.cm-modal {
  width: min(1200px, 92vw);
  height: min(760px, 90vh);
  background: #fff;
  display: grid;
  grid-template-columns: 240px 1fr;
  overflow: hidden;
}
.cm-nav {
  background: #fff;
  border-right: 1px solid #e5e7eb;
  display: flex; flex-direction: column;
  padding: 18px 0;
}
.cm-upload-btn {
  margin: 0 18px 18px;
  background: var(--editor-accent, #116dff);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-family: inherit;
}
.cm-upload-btn:hover { background: #0f62e6; }
.cm-nav__sections { flex: 1; overflow: auto; padding: 0 8px; }
.cm-nav__group {
  font-size: 11px; font-weight: 400; letter-spacing: 0.6px;
  color: #6b6f7a;
  padding: 14px 12px 6px;
}
.cm-nav__item {
  width: 100%;
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  background: none; border: none; cursor: pointer;
  text-align: left;
  font-family: inherit; font-size: 13px; color: #131720;
  border-radius: 0;
}
.cm-nav__item:hover { background: #f4f5f8; }
.cm-nav__item.is-active { background: #F1EEFE; color: #5B3DF5; font-weight: 400; }
.cm-nav__icon { display: inline-flex; }
.cm-nav__footer {
  border-top: 1px solid #e5e7eb;
  padding: 14px 18px;
  font-size: 12px; color: #6b6f7a;
}
.cm-quota { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.cm-quota__info { cursor: help; color: #b0b3bd; }
.cm-upgrade-link {
  background: none; border: none; color: #9c50d6;
  cursor: pointer; padding: 0; font-size: 12px; font-family: inherit;
}
.cm-upgrade-link:hover { text-decoration: underline; }

.cm-main {
  display: flex; flex-direction: column;
  min-width: 0;
  /* min-height: 0 is REQUIRED on a flex column whose child (.cm-content)
     uses flex:1 + overflow:auto — without it the column expands to fit
     the grid's intrinsic height and pushes the footer (.cm-footer with
     the Update button) off-screen once enough thumbnails load. User
     2026-06-30: "up nhiều quá, nó không sang trang mới mà bị chèn đè
     lên nút Update". */
  min-height: 0;
  height: 100%;
}
.cm-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px 14px;
  border-bottom: 1px solid #e5e7eb;
}
.cm-title { margin: 0; font-size: 18px; font-weight: 400; color: #131720; letter-spacing: -0.2px; }
.cm-header-actions { display: flex; gap: 8px; }
.cm-icon-btn {
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  border: none; background: none; cursor: pointer;
  color: #131720; border-radius: 4px;
}
.cm-icon-btn:hover { background: #f4f5f8; }

.cm-toolbar { padding: 14px 24px 0; }
.cm-search {
  position: relative;
  display: flex; align-items: center;
  border: 1px solid #e5e7eb; border-radius: 999px;
  padding: 0 14px;
  background: #fff;
}
.cm-search > svg { color: var(--editor-accent, #116dff); flex-shrink: 0; }
.cm-search__input {
  flex: 1; border: none; outline: none;
  padding: 10px 12px;
  font-family: inherit; font-size: 13px; color: #131720;
  background: transparent;
}
.cm-content {
  flex: 1; overflow: auto;
  min-height: 0;
  padding: 18px 24px 4px;
  position: relative;
}
.cm-footer { flex-shrink: 0; }
.cm-breadcrumb { font-size: 13px; color: #131720; margin-bottom: 12px; }
.cm-folder-action { position: absolute; top: 14px; right: 24px; }
.cm-new-folder { color: #6b6f7a; }

.cm-grid-wrap { min-height: 360px; }
.cm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  padding-bottom: 16px;
}
.cm-tile {
  position: relative;
  aspect-ratio: 1 / 1;
  background: #f4f5f8;
  border: 2px solid transparent;
  overflow: hidden;
  cursor: pointer;
  padding: 0;
  border-radius: 0;
}
.cm-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cm-tile:hover { border-color: #b6cffb; }
.cm-tile.is-selected { border-color: var(--editor-accent, #116dff); }
.cm-tile__check {
  position: absolute; top: 8px; right: 8px;
  width: 22px; height: 22px;
  background: var(--editor-accent, #116dff);
  color: #fff;
  border-radius: 50%;
  display: none; align-items: center; justify-content: center;
}
.cm-tile.is-selected .cm-tile__check { display: inline-flex; }
.cm-tile__menu {
  position: absolute; bottom: 8px; right: 8px;
  width: 24px; height: 24px;
  background: rgba(255,255,255,0.9);
  border-radius: 50%;
  display: none; align-items: center; justify-content: center;
  font-size: 14px; color: #131720;
}
.cm-tile:hover .cm-tile__menu { display: inline-flex; }
.cm-tile-menu {
  background: #fff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  min-width: 160px;
  padding: 4px 0;
}
.cm-tile-menu button {
  width: 100%; text-align: left;
  padding: 8px 14px;
  background: none; border: none; cursor: pointer;
  font-family: inherit; font-size: 13px; color: #131720;
}
.cm-tile-menu button:hover { background: #f4f5f8; }

.cm-loading, .cm-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 360px;
  color: #6b6f7a;
  border: 1px dashed #b6cffb;
  background: #f7faff;
}
.cm-empty__illu { margin-bottom: 14px; }
.cm-empty__title { font-size: 15px; font-weight: 400; color: #131720; margin-bottom: 6px; }
.cm-empty__sub { font-size: 13px; color: #6b6f7a; margin-bottom: 16px; max-width: 320px; text-align: center; }
.cm-empty__upload {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: none;
  color: var(--editor-accent, #116dff);
  cursor: pointer; font-family: inherit; font-size: 13px; font-weight: 400;
}

.cm-footer {
  border-top: 1px solid #e5e7eb;
  padding: 14px 24px;
  display: flex; justify-content: flex-end;
}
.cm-update-btn {
  background: var(--editor-accent, #116dff);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 9px 22px;
  font-family: inherit; font-size: 13px; font-weight: 400;
  cursor: pointer;
}
.cm-update-btn:disabled { background: #c5d4f7; cursor: not-allowed; }
.cm-update-btn:hover:not(:disabled) { background: #0f62e6; }

/* ===== Upload Media sub-modal ===== */
.cm-upload-overlay {
  position: fixed; inset: 0;
  background: rgba(15, 18, 26, 0.5);
  /* Sub-modal must sit ABOVE the parent .cm-overlay (2147483640) — and
     therefore also above the floating canvas toolbar. */
  z-index: 2147483641;
  display: flex; align-items: center; justify-content: center;
}
.cm-upload-modal {
  width: min(900px, 88vw);
  height: min(620px, 80vh);
  background: #fff;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.cm-upload-body { flex: 1; display: grid; grid-template-columns: 64px 1fr; min-height: 0; }
.cm-upload-sources {
  border-right: 1px solid #e5e7eb;
  display: flex; flex-direction: column; align-items: center;
  padding: 12px 0; gap: 8px;
}
.cm-source {
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  background: none; border: 1px solid transparent; cursor: pointer; color: #131720;
}
.cm-source:hover { background: #f4f5f8; }
.cm-source.is-active { border-color: var(--editor-accent, #116dff); color: var(--editor-accent, #116dff); }
.cm-upload-area { padding: 20px; min-height: 0; display: flex; flex-direction: column; }
.cm-drop {
  flex: 1;
  border: 1.5px dashed #b6cffb;
  background: #f7faff;
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.cm-drop.is-drag { border-color: var(--editor-accent, #116dff); background: #eaf1ff; }
.cm-drop__inner { text-align: center; padding: 30px; }
.cm-drop__text { font-size: 16px; color: #131720; margin-bottom: 12px; }
.cm-drop__or { font-size: 14px; color: #6b6f7a; margin-bottom: 16px; }
.cm-drop__btn {
  background: var(--editor-accent, #116dff);
  color: #fff; border: none;
  padding: 12px 28px;
  border-radius: 999px;
  font-family: inherit; font-size: 14px; font-weight: 400; cursor: pointer;
}
.cm-drop__btn:hover { background: #0f62e6; }
.cm-drop__footnote {
  position: absolute; bottom: 18px; left: 0; right: 0;
  text-align: center; font-size: 12px; color: #6b6f7a;
}
.cm-drop__link { color: var(--editor-accent, #116dff); }
.cm-url-pane { padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.cm-url-label { font-size: 13px; color: #131720; font-weight: 400; }
.cm-url-input {
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 0;
  font-family: inherit; font-size: 13px;
  outline: none;
}
.cm-url-input:focus { border-color: var(--editor-accent, #116dff); }
.cm-url-submit {
  align-self: flex-start;
  background: var(--editor-accent, #116dff); color: #fff;
  border: none; padding: 10px 22px;
  font-family: inherit; font-size: 13px; font-weight: 400; cursor: pointer;
}
.cm-upload-progress {
  margin-top: 12px;
  padding: 10px 14px;
  background: #f4f5f8;
  font-size: 13px;
  color: #131720;
}

/* === Animation Preview keyframes ===
 * Plays once on the canvas element when the user clicks "Preview" in the
 * Animations inspector. JS adds `.is-anim-preview-<slug>` (e.g. fade,
 * slide, bounce) for ~1.5s then removes it. Slug = animation label
 * lower-cased, non-alphanum → hyphen (see anim-preview handler).
 *
 * We override no other styles; each rule sets `animation:` only so the
 * preview class is purely additive and reverts cleanly when removed. */
@keyframes vdr-anim-fade   { from { opacity: 0; } to { opacity: 1; } }
/* Translate-based keyframes use --anim-tx / --anim-ty so the Adjust panel's
 * Direction / Distance / "Start from off screen" settings can override the
 * starting position from JS (playAnimPreview). Defaults match the picker
 * preview tiles. */
@keyframes vdr-anim-slide  { from { transform: translate(var(--anim-tx, -30px), var(--anim-ty, 0)); opacity: 0; } to { transform: translate(0, 0); opacity: 1; } }
@keyframes vdr-anim-glide  { from { transform: translate(var(--anim-tx, -40px), var(--anim-ty, 0)); opacity: 0; } to { transform: translate(0, 0); opacity: 1; } }
@keyframes vdr-anim-reveal { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes vdr-anim-bounce { 0% { transform: translateY(-40px); opacity: 0; } 60% { transform: translateY(8px); opacity: 1; } 80% { transform: translateY(-4px); } 100% { transform: translateY(0); } }
@keyframes vdr-anim-blur   { from { filter: blur(12px); opacity: 0; } to { filter: blur(0); opacity: 1; } }
@keyframes vdr-anim-flip   { from { transform: perspective(800px) rotateX(90deg); opacity: 0; } to { transform: perspective(800px) rotateX(0); opacity: 1; } }
@keyframes vdr-anim-flap   { from { transform: perspective(800px) rotateY(90deg); opacity: 0; } to { transform: perspective(800px) rotateY(0); opacity: 1; } }
@keyframes vdr-anim-spin   { from { transform: rotate(-180deg); opacity: 0; } to { transform: rotate(0); opacity: 1; } }
@keyframes vdr-anim-turn   { from { transform: rotate(90deg); opacity: 0; } to { transform: rotate(0); opacity: 1; } }
@keyframes vdr-anim-arc    { from { transform: translateY(-40px) rotate(-20deg); opacity: 0; } to { transform: translateY(0) rotate(0); opacity: 1; } }
@keyframes vdr-anim-expand { from { transform: scale(0.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes vdr-anim-grow   { from { transform: scale(1.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes vdr-anim-shrink { from { transform: scale(1.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes vdr-anim-wink   { 0% { transform: scaleY(0); opacity: 0; } 60% { transform: scaleY(1.1); opacity: 1; } 100% { transform: scaleY(1); } }
@keyframes vdr-anim-shape  { from { transform: skewX(20deg); opacity: 0; } to { transform: skewX(0); opacity: 1; } }
@keyframes vdr-anim-tilt   { from { transform: rotate(-12deg) scale(0.9); opacity: 0; } to { transform: rotate(0) scale(1); opacity: 1; } }
@keyframes vdr-anim-float  { 0% { transform: translateY(0); } 50% { transform: translateY(-12px); } 100% { transform: translateY(0); } }
@keyframes vdr-anim-shutters { from { transform: scaleY(0); transform-origin: top; opacity: 0; } to { transform: scaleY(1); opacity: 1; } }

.canvas-section.is-anim-preview-fade     { animation: vdr-anim-fade 0.9s ease-out both; }
.canvas-section.is-anim-preview-slide    { animation: vdr-anim-slide 0.9s ease-out both; }
.canvas-section.is-anim-preview-glide    { animation: vdr-anim-glide 0.9s ease-out both; }
.canvas-section.is-anim-preview-reveal   { animation: vdr-anim-reveal 0.9s ease-out both; }
.canvas-section.is-anim-preview-shutters { animation: vdr-anim-shutters 0.9s ease-out both; }
.canvas-section.is-anim-preview-bounce   { animation: vdr-anim-bounce 1.1s ease-out both; }
.canvas-section.is-anim-preview-blur     { animation: vdr-anim-blur 0.9s ease-out both; }
.canvas-section.is-anim-preview-flip     { animation: vdr-anim-flip 1.0s ease-out both; }
.canvas-section.is-anim-preview-flap     { animation: vdr-anim-flap 1.0s ease-out both; }
.canvas-section.is-anim-preview-spin     { animation: vdr-anim-spin 1.0s ease-out both; }
.canvas-section.is-anim-preview-turn     { animation: vdr-anim-turn 0.9s ease-out both; }
.canvas-section.is-anim-preview-arc      { animation: vdr-anim-arc 1.0s ease-out both; }
.canvas-section.is-anim-preview-expand   { animation: vdr-anim-expand 0.9s ease-out both; }
.canvas-section.is-anim-preview-grow     { animation: vdr-anim-grow 0.9s ease-out both; }
.canvas-section.is-anim-preview-shrink   { animation: vdr-anim-shrink 0.9s ease-out both; }
.canvas-section.is-anim-preview-wink     { animation: vdr-anim-wink 0.9s ease-out both; }
.canvas-section.is-anim-preview-shape    { animation: vdr-anim-shape 0.9s ease-out both; }
.canvas-section.is-anim-preview-tilt     { animation: vdr-anim-tilt 0.9s ease-out both; }
.canvas-section.is-anim-preview-float    { animation: vdr-anim-float 1.2s ease-in-out both; }

/* === Global header/footer bands === Wix-style global sections — fully
 * editable from any page. Edit propagates to every page via DB routing
 * (afterMutation splits the canvas into top global / page / bottom global
 * and POSTs each to its own page_key). No visual chip — the layer-tree
 * green colouring is the identifier (user request). */
.canvas-global-band { position: relative; }
