/* === Editor-specific styles (moved from dashboard.css) === */

/* ---------- Editor layout ---------- */

.editor-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 1.5rem;
}
@media (max-width: 900px) { .editor-grid { grid-template-columns: 1fr; } }

.editor-section { margin-bottom: 1.5rem; }
.editor-section h2 { font-size: 1.4rem; font-weight: 800; margin-bottom: 0.2rem; }

.theme-strip { display: flex; gap: 0.55rem; overflow-x: auto; padding: 0.5rem 0 0.25rem; }
.theme-pill {
  flex-shrink: 0;
  border: 1.5px solid var(--warm);
  border-radius: 10px;
  padding: 0.5rem 0.85rem;
  background: var(--card);
  font-size: 0.78rem;
  color: var(--ink);
  display: flex; align-items: center; gap: 0.45rem;
  cursor: pointer; white-space: nowrap;
}
.theme-pill .swatch { width: 12px; height: 12px; border-radius: 50%; background: var(--copper); }
.theme-pill.active { border-color: var(--copper); background: #FDF2EA; }
.theme-pill input { display: none; }

.block-list { list-style: none; display: flex; flex-direction: column; gap: 0; }
.blk {
  position: relative;
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 0.4rem;
  padding: 0.45rem 0.5rem;
  border-radius: 8px;
  align-items: start;
  transition: background 0.15s;
}
.blk:hover { background: var(--soft); }
.blk.sortable-ghost {
  opacity: 0.3;
  background: var(--soft);
}
.blk.sortable-drag {
  background: var(--card);
  box-shadow: 0 8px 24px rgba(45, 38, 32, 0.18);
  border-radius: 8px;
}
.handle { touch-action: none; }
.blk:hover .handle, .blk:hover .blk-actions { opacity: 1; }
.blk.invalid { background: #fff5f5; box-shadow: inset 0 0 0 1px var(--danger); }

.handle {
  opacity: 0.15;
  transition: opacity 0.15s;
  cursor: grab;
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}
.handle-svg { width: 12px; height: 16px; fill: currentColor; }

.blk-icon {
  color: var(--muted);
  align-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: 6px;
  background: var(--warm);
  font-size: 0.85rem;
}

.blk-body { min-width: 0; padding-top: 0.15rem; display: grid; gap: 0.3rem; }

.blk-input {
  width: 100%; border: 0; background: transparent; outline: none;
  font-family: var(--font-body); color: var(--ink); font-size: 0.95rem;
  padding: 0.3rem 0.4rem; border-radius: 4px; line-height: 1.4;
}
.blk-input:focus { background: var(--card); box-shadow: inset 0 0 0 1px var(--warm); }
.blk-input.display { font-family: var(--font-display); font-weight: 800; font-size: 1.4rem; letter-spacing: -0.02em; line-height: 1.1; }

.blk-actions {
  opacity: 0;
  transition: opacity 0.15s;
  position: absolute;
  top: 0.4rem; right: 0.5rem;
  display: flex; gap: 0.1rem;
  background: var(--card);
  border: 1px solid var(--warm);
  border-radius: 6px;
  padding: 0.1rem;
}
.blk-act {
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: 0; border-radius: 4px;
  color: var(--muted); cursor: pointer; font-size: 0.85rem;
}
.blk-act:hover { background: var(--warm); color: var(--ink); }

.facts-grid { display: grid; grid-template-columns: 1fr 1.4fr auto; gap: 0.25rem; align-items: center; }
.facts-grid .blk-input { font-size: 0.85rem; padding: 0.3rem 0.45rem; background: var(--soft); }
.facts-grid .blk-input:focus { background: var(--card); }

.sched-grid { display: grid; grid-template-columns: 5rem 1fr 1.4fr auto; gap: 0.25rem; align-items: center; margin-top: 0.4rem; }
.sched-grid .blk-input { font-size: 0.85rem; padding: 0.3rem 0.45rem; background: var(--soft); }
.sched-grid .blk-input:focus { background: var(--card); }

.picker {
  margin-top: 0.75rem;
  background: var(--card);
  border: 1px solid var(--warm);
  border-radius: 10px;
  padding: 0.7rem;
}
.picker-title { font-size: 0.7rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-bottom: 0.6rem; }
.picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 0.4rem;
}
.picker-btn {
  background: var(--soft);
  border: 1px solid var(--warm);
  border-radius: 12px;
  padding: 0.9rem 0.4rem 0.65rem;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  gap: 4px;
  cursor: pointer;
  font-family: var(--font-body);
  color: var(--ink);
  text-align: center;
  transition: border-color 120ms ease-out, background 120ms ease-out, transform 100ms ease-out;
}
.picker-btn:hover { border-color: var(--copper); background: #FDF6EE; }
.picker-btn:hover .pb-icon { background: var(--copper); color: var(--bg); transition: background 120ms ease-out, color 120ms ease-out; }
.picker-btn:active { transform: scale(0.97); }
.picker-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.picker-btn:disabled:hover { border-color: var(--warm); background: var(--soft); transform: none; }
.picker-btn:disabled:hover .pb-icon { background: var(--warm); color: var(--ink); }
.picker-btn .pb-icon {
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--warm); display: flex; align-items: center; justify-content: center;
  color: var(--ink); margin-bottom: 4px; flex-shrink: 0;
  transition: background 120ms ease-out, color 120ms ease-out;
}
.picker-btn .pb-label { font-size: 0.74rem; font-weight: 600; color: var(--ink); line-height: 1.2; }
.picker-btn .pb-sub { font-size: 0.65rem; color: var(--muted); line-height: 1.2; }

.editor-preview {
  position: sticky;
  top: 5rem;
  align-self: start;
  height: 540px;
  display: flex;
  flex-direction: column;
}
.editor-preview iframe {
  flex: 1;
  width: 100%;
  border: 1px solid var(--warm);
  border-radius: 12px;
  background: var(--bg);
}

/* ---------- Editor — Connect button in toolbar ---------- */

.ed-connect-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.75rem;
  border-radius: 100px;
  font-size: 0.80rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid;
  text-decoration: none;
  transition: all 0.12s;
}
.ed-connect-btn svg { width: 14px; height: 14px; }
.ed-connect-btn.unlinked {
  background: rgba(176, 56, 42, 0.08);
  border-color: rgba(176, 56, 42, 0.3);
  color: var(--danger);
}
.ed-connect-btn.unlinked:hover { background: rgba(176, 56, 42, 0.12); border-color: var(--danger); }
.ed-connect-btn.linked {
  background: rgba(217, 160, 102, 0.1);
  border-color: rgba(217, 160, 102, 0.4);
  color: #A05F0F;
}
.ed-connect-btn.linked:hover { background: rgba(217, 160, 102, 0.15); border-color: #A05F0F; }
.ed-connect-dot { width: 7px; height: 7px; border-radius: 50%; }
.ed-connect-btn.unlinked .ed-connect-dot {
  background: var(--danger);
  animation: link-pill-pulse 1.6s ease-in-out infinite;
}
.ed-connect-btn.linked .ed-connect-dot { background: var(--ok); }

/* === Onboarding guidance banner === */
.ob-guide-bar {
  background: color-mix(in srgb, var(--copper) 8%, var(--bg));
  border-bottom: 1px solid color-mix(in srgb, var(--copper) 20%, var(--warm));
  padding: 0.7rem 1.5rem;
}
.ob-guide-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.ob-guide-step {
  flex-shrink: 0;
  background: var(--copper);
  color: #fff;
  border-radius: 999px;
  padding: 0.15rem 0.65rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.ob-guide-title {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--ink);
  flex-shrink: 0;
}
.ob-guide-hint {
  font-size: 0.85rem;
  color: var(--muted);
  flex: 1;
  min-width: 0;
}
.ob-guide-dismiss {
  flex-shrink: 0;
  background: transparent;
  border: 1px solid var(--warm);
  border-radius: 6px;
  padding: 0.25rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  font-family: var(--font-body);
  transition: border-color 0.15s, color 0.15s;
}
.ob-guide-dismiss:hover { border-color: var(--copper); color: var(--ink); }
@media (max-width: 640px) {
  .ob-guide-bar { padding: 0.65rem 1rem; }
  .ob-guide-hint { display: none; }
}

/* === New Phase 2 editor shell rules === */

.ed-shell {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--card);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--warm);
  padding: 0 1.5rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ed-shell-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.ed-shell-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  user-select: none;
}
.ed-shell-right button, .ed-shell-right a, .ed-shell-right summary {
  cursor: pointer;
}
.ed-shell-sep {
  color: var(--muted);
  font-size: 0.9rem;
}
.ed-shortid-pill {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem;
  background: var(--soft);
  border-radius: 4px;
  padding: 0.15rem 0.4rem;
  color: var(--ink);
}
.ed-shortid-paren {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem;
  color: var(--muted);
  cursor: default;
}

/* Hero band */
.ed-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.ed-hero {
  display: flex;
  gap: 1.5rem;
  align-items: stretch;
}
.ed-name-card {
  flex: 1;
  background: var(--card);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.ed-status-row {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.ed-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2.2rem;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--ink);
  border: none;
  outline: none;
  min-height: 2.5rem;
  cursor: text;
}
.ed-name[contenteditable]:hover {
  text-decoration-line: underline;
  text-decoration-style: dashed;
  text-decoration-color: var(--muted);
  text-underline-offset: 4px;
}
.ed-name[contenteditable="false"] {
  cursor: default;
}
.ed-name[contenteditable]:focus-visible {
  outline: 2px solid var(--copper);
  border-radius: 4px;
}
.ed-name:empty::before {
  content: attr(data-empty-placeholder);
  color: var(--muted);
  font-weight: 400;
}
.ed-meta-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}
.ed-scan-link {
  font-size: 0.85rem;
  color: var(--muted);
  text-decoration: none;
}
.ed-scan-link:hover { color: var(--copper); }

/* Theme card */
.ed-theme-card {
  width: 280px;
  flex-shrink: 0;
  background: var(--card);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.ed-theme-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.ed-theme-change {
  background: none;
  border: 1px solid var(--warm);
  border-radius: 999px;
  font: inherit;
  font-size: 0.78rem;
  padding: 0.2rem 0.6rem;
  cursor: pointer;
  color: var(--ink);
}
.ed-theme-change:hover { border-color: var(--copper); color: var(--copper); }
.ed-theme-body {
  display: flex;
  align-items: center;
  justify-content: center;
}
.ed-mini-phone-frame {
  width: 90px;
  height: 145px;
  border: 3px solid var(--ink);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
  cursor: pointer;
}
.ed-mini-phone-frame:hover { border-color: var(--copper); }
.ed-mini-phone {
  position: absolute;
  top: 0;
  left: 0;
  width: 417%;
  height: 420%;
  transform: scale(0.24);
  transform-origin: top left;
  border: 0;
  pointer-events: none;
  background: var(--bg);
}

/* Two-column grid */
.ed-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 900px) {
  .ed-hero { flex-direction: column; }
  .ed-theme-card { width: 100%; }
  .ed-grid { grid-template-columns: 1fr; }
}
.ed-blocks-card {
  background: var(--card);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.ed-blocks-header {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.03em;
  margin: 0;
}
.ed-picker {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.ed-preview {
  position: sticky;
  top: 4.7rem;
}
.ed-preview iframe {
  width: 100%;
  min-height: 600px;
  border: 6px solid var(--ink);
  border-radius: 20px;
  background: var(--soft);
  display: block;
}

/* Theme picker modal */
.theme-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
}
.theme-modal[hidden] { display: none; }
.theme-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}
.theme-modal-panel {
  position: relative;
  z-index: 1;
  background: var(--card);
  border-radius: 16px;
  padding: 1.5rem;
  width: fit-content;
  max-width: min(900px, calc(100vw - 2rem));
  max-height: 85vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.theme-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.theme-modal-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--ink);
}
.theme-modal-close {
  background: none;
  border: 1px solid var(--warm);
  border-radius: 6px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--muted);
}
.theme-modal-close:hover { border-color: var(--copper); color: var(--copper); }
.theme-modal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 260px));
  justify-content: start;
  gap: 1rem;
}
.theme-modal-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem;
  border-radius: 12px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}
.theme-modal-card:hover { border-color: var(--warm); background: var(--soft); }
.theme-modal-card.active { border-color: var(--copper); background: #FDF2EA; }
.theme-modal-thumb {
  width: 200px;
  height: 347px;
  border: 3px solid var(--ink);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
}
.theme-modal-thumb iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 250%;
  height: 250%;
  transform: scale(0.4);
  transform-origin: top left;
  pointer-events: none;
  border: 0;
  background: var(--bg);
}
.theme-modal-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
  text-align: center;
}

/* Block chip */
.blk-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.blk-chip-heading   { background: rgba(43,89,148,0.1);  color: #2B5994; }
.blk-chip-paragraph { background: rgba(94,80,138,0.1);  color: #5E508A; }
.blk-chip-image     { background: rgba(74,106,65,0.1);  color: #4A6A41; }
.blk-chip-gallery   { background: rgba(74,106,65,0.1);  color: #4A6A41; }
.blk-chip-facts     { background: rgba(182,108,69,0.1); color: #B66C45; }
.blk-chip-contact   { background: rgba(176,56,42,0.1);  color: #B0382A; }
.blk-chip-link      { background: rgba(31,110,97,0.1);  color: #1F6E61; }
.blk-chip-location  { background: rgba(160,95,15,0.1);  color: #A05F0F; }
.blk-chip-vcard     { background: rgba(67,84,116,0.1);  color: #435474; }
.blk-chip-schedule  { background: rgba(31,100,130,0.1); color: #1F6482; }
.blk-chip-socials   { background: rgba(100,60,140,0.1); color: #643C8C; }
.blk-chip-video     { background: rgba(180,40,40,0.1);  color: #B42828; }
.blk-chip-booking   { background: rgba(20,110,80,0.1);  color: #146E50; }
.blk-chip-payment   { background: rgba(15,100,55,0.1);  color: #0F6437; }
.blk-chip-button    { background: rgba(45,38,32,0.1);   color: #2D2620; }
.blk-chip-separator  { background: rgba(138,117,96,0.1); color: #8A7560; }
.blk-chip-countdown  { background: rgba(147,51,234,0.1); color: #7C2DA6; }
.blk-chip-accordion    { background: rgba(22,101,52,0.1);  color: #166534; }
.blk-chip-testimonial  { background: rgba(182,108,69,0.1); color: #7C3D1F; }
.blk-chip-banner       { background: rgba(182,108,69,0.15); color: #B66C45; }
.blk-chip-rating        { background: rgba(245,166,35,0.12); color: #B8860B; }
.blk-chip-applinks      { background: rgba(30,30,30,0.1);   color: #2D2620; }
.blk-chip-filedownload  { background: rgba(31,110,97,0.1);  color: #1F6E61; }
.blk-chip-highlight     { background: rgba(100,80,180,0.1); color: #5040A0; }
.blk-chip-progress      { background: rgba(182,108,69,0.1); color: #8B4513; }
.blk-chip-audio         { background: rgba(80,60,140,0.1);  color: #503C8C; }
.blk-char-counter {
  display: block;
  text-align: right;
  font-size: 0.72rem;
  color: var(--muted, #8A7560);
  margin-top: -0.25rem;
  margin-bottom: 0.1rem;
}

/* Guest photos visibility panel */
.gp-panel {
  border-top: 1px solid var(--warm);
  padding: 0.85rem 1rem;
}
.gp-panel-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  cursor: pointer;
}
.gp-panel-info { display: flex; flex-direction: column; gap: 0.2rem; }
.gp-panel-hint { font-size: 0.78rem; color: var(--muted); }

/* Background pattern picker panel */
.bg-panel {
  border-top: 1px solid var(--warm);
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.bg-panel-head { display: flex; align-items: center; }
.bg-swatches {
  display: flex;
  flex-direction: row;
  overflow-x: auto;
  gap: 0.35rem;
  padding-bottom: 0.4rem;
  scrollbar-width: thin;
  scrollbar-color: var(--warm) transparent;
}
.bg-swatch {
  background: var(--bg);
  border: 1.5px solid var(--warm);
  border-radius: 8px;
  padding: 0.35rem 0.55rem;
  display: flex; align-items: center; gap: 0.25rem;
  cursor: pointer;
  font: inherit; font-size: 0.72rem; color: var(--ink);
  transition: border-color 0.15s, background 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}
.bg-swatch:hover { border-color: var(--copper); background: var(--soft); }
.bg-swatch.active { border-color: var(--copper); background: #FDF2EA; font-weight: 600; }
.bgs-icon {
  display: block;
  width: 24px;
  height: 24px;
  border-radius: 5px;
  background: var(--warm);
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.bgs-icon::before {
  content: '';
  position: absolute;
  inset: 0;
  background-color: var(--copper, #B66C45);
  opacity: 0.5;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-mode: alpha;
  mask-mode: alpha;
}
.bg-swatch[data-bg="plain"] .bgs-icon::before { display: none; }

/* Preview strip */
.bg-prev {
  height: 160px;
  border-radius: 8px;
  border: 1px solid var(--warm);
  background: linear-gradient(to bottom, #F9F4EB, #F5EFE3);
  position: relative;
  overflow: hidden;
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  isolation: isolate;
}
.bg-prev::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-color: var(--copper, #B66C45);
  opacity: 0.12;
  -webkit-mask-repeat: repeat;
  mask-repeat: repeat;
  -webkit-mask-mode: alpha;
  mask-mode: alpha;
}
.bg-prev-label {
  font-size: 0.68rem;
  color: var(--muted);
  letter-spacing: 0.05em;
  background: rgba(253,248,238,0.75);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  z-index: 1;
  pointer-events: none;
}

.icon-btn {
  background: none;
  border: 1px solid var(--warm);
  border-radius: 100px;
  padding: 0.35rem 0.6rem;
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.iu-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  min-height: 4.5rem;
  padding: 0.8rem;
  border: 1.5px dashed var(--warm);
  border-radius: 8px;
  background: var(--soft);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  font-size: 0.85rem;
  color: var(--muted);
}
.iu-zone:hover {
  border-color: var(--copper);
  color: var(--ink);
}
.iu-zone--over {
  border-style: solid;
  border-color: var(--copper);
  background: rgba(182, 108, 69, 0.05);
  color: var(--ink);
}
.iu-cta {
  font-weight: 500;
}
.iu-status {
  font-size: 0.78rem;
}
.iu-status.err {
  color: var(--danger);
}
.icon-btn:hover { border-color: var(--copper); color: var(--copper); }

.gal-edit {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.gal-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  user-select: none;
}
.gal-thumb {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--soft);
}
.gal-thumb--cover {
  outline: 2px solid var(--copper);
  outline-offset: 1px;
}
.gal-thumb--add {
  border: 2px dashed var(--warm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-weight: 300;
  color: var(--muted);
  cursor: pointer;
}
.gal-thumb--add:hover { border-color: var(--copper); color: var(--copper); }
.gal-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  cursor: pointer;
}
.gal-thumb-badge {
  position: absolute;
  bottom: 3px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 1px 5px;
  border-radius: 3px;
  pointer-events: none;
  white-space: nowrap;
}
.gal-thumb-rm {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: rgba(0,0,0,0.65);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  z-index: 1;
}
.gal-counter {
  font-size: 0.78rem;
  color: var(--muted);
  user-select: none;
  cursor: default;
}
.loc-map-wrap {
  display: flex;
  align-items: stretch;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--warm);
}
.loc-map {
  flex: 1;
  height: 230px;
  cursor: crosshair;
  background: var(--soft);
}
.loc-map--failed {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: var(--muted);
  cursor: default;
}
.loc-search-btn {
  writing-mode: vertical-rl;
  background: var(--ink);
  color: var(--bg);
  border: none;
  padding: 0.8rem 0.4rem;
  font: inherit;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
}
.loc-search-btn:hover { background: var(--copper); }
.loc-meta {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.3rem;
}
.loc-search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.loc-search-panel {
  width: min(640px, calc(100vw - 2rem));
  max-height: 80vh;
  background: var(--card);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.loc-search-head {
  display: flex;
  padding: 1rem;
  border-bottom: 1px solid var(--warm);
}
.loc-search-input {
  flex: 1;
  font: inherit;
  font-size: 1rem;
  border: none;
  outline: none;
  background: transparent;
  color: var(--ink);
}
.loc-search-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--muted);
}
.loc-search-results {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
}
.loc-search-results li {
  padding: 0.8rem 1rem;
  cursor: pointer;
  border-bottom: 1px solid var(--warm);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.loc-search-results li:hover { background: var(--soft); }
.loc-search-results li strong { font-weight: 600; color: var(--ink); }
.loc-search-results li span { font-size: 0.85rem; color: var(--muted); }
.loc-search-empty { padding: 1.5rem; text-align: center; color: var(--muted); }

.cp-wrap {
  position: relative;
  display: inline-block;
}
.cp-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.4rem 0.6rem;
  background: var(--soft);
  border: 1px solid var(--warm);
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
  font-size: 0.88rem;
  white-space: nowrap;
  min-width: 90px;
}
.cp-trigger:hover { border-color: var(--copper); }
.cp-flag { font-size: 1.1rem; line-height: 1; }
.cp-dial { font-family: ui-monospace, monospace; font-size: 0.82rem; color: var(--ink); }
.cp-chevron { font-size: 0.65rem; color: var(--muted); }
.cp-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 200;
  background: var(--card);
  border: 1px solid var(--warm);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  width: 260px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.cp-search {
  padding: 0.5rem 0.75rem;
  border: none;
  border-bottom: 1px solid var(--warm);
  font: inherit;
  font-size: 0.88rem;
  background: transparent;
  outline: none;
  color: var(--ink);
}
.cp-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 200px;
  overflow-y: auto;
}
.cp-item {
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  font-size: 0.88rem;
}
.cp-item:hover { background: var(--soft); }
.cp-item--active { background: var(--soft); font-weight: 600; }

/* Contact block renderer */
.contact-channels {
  display: flex;
  gap: 0;
  border: 1px solid var(--warm);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 0.4rem;
}
.contact-channel-btn {
  flex: 1;
  padding: 0.4rem 0.5rem;
  border: none;
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: 0.85rem;
  color: var(--muted);
}
.contact-channel-btn.active {
  background: var(--ink);
  color: var(--bg);
  font-weight: 600;
}
.contact-channel-btn:hover:not(.active) { background: var(--soft); }
.contact-phone-row {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}
.contact-phone-row input {
  flex: 1;
}

/* Mobile responsive */
@media (max-width: 640px) {
  /* Topbar: hide Dashboard breadcrumb + locale switcher to avoid overflow */
  .ed-shell { padding: 0 0.75rem; height: 3rem; }
  .ed-shell-left .ed-shell-sep,
  .ed-shell-left a.link { display: none; }
  .topbar-locale { display: none; }

  /* Main layout */
  .ed-main { padding: 0.75rem; gap: 0.75rem; }

  /* Connect button: hide long text on mobile, keep dot + icon */
  .ed-connect-btn { padding: 0.45rem 0.6rem; }
  .ed-connect-btn > span:last-child { display: none; }
}

/* ---- Background pattern previews (editor .bg-prev) ---- */

.bg-prev.bg-paws::before {
  -webkit-mask-image: url('/img/bg/paws.svg');
  mask-image: url('/img/bg/paws.svg');
  -webkit-mask-size: 120px 118px;
  mask-size: 120px 118px;
}

.bg-prev.bg-hearts::before {
  -webkit-mask-image: url('/img/bg/heart.svg');
  mask-image: url('/img/bg/heart.svg');
  -webkit-mask-size: 120px 105px;
  mask-size: 120px 105px;
}

.bg-prev.bg-rings::before {
  -webkit-mask-image: url('/img/bg/rings.svg');
  mask-image: url('/img/bg/rings.svg');
  -webkit-mask-size: 120px 120px;
  mask-size: 120px 120px;
}

.bg-prev.bg-cross::before {
  -webkit-mask-image: url('/img/bg/cross.svg');
  mask-image: url('/img/bg/cross.svg');
  -webkit-mask-size: 90px 130px;
  mask-size: 90px 130px;
}

.bg-prev.bg-balloons::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='90'%3E%3Ccircle cx='30' cy='30' r='20' fill='black'/%3E%3Cpolygon points='30,50 27,57 33,57' fill='black'/%3E%3Cpath d='M30 57 Q38 70 26 82' stroke='black' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='90'%3E%3Ccircle cx='30' cy='30' r='20' fill='black'/%3E%3Cpolygon points='30,50 27,57 33,57' fill='black'/%3E%3Cpath d='M30 57 Q38 70 26 82' stroke='black' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  -webkit-mask-size: 90px 135px;
  mask-size: 90px 135px;
}

.bg-prev.bg-confetti::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100'%3E%3Ccircle cx='10' cy='12' r='4' fill='black'/%3E%3Crect x='38' y='6' width='6' height='6' transform='rotate(20 41 9)' fill='black'/%3E%3Ccircle cx='70' cy='22' r='4' fill='black'/%3E%3Crect x='6' y='55' width='5' height='5' transform='rotate(-15 9 58)' fill='black'/%3E%3Ccircle cx='52' cy='60' r='4' fill='black'/%3E%3Crect x='80' y='75' width='6' height='6' transform='rotate(30 83 78)' fill='black'/%3E%3Ccircle cx='22' cy='85' r='4' fill='black'/%3E%3Crect x='60' y='40' width='5' height='5' transform='rotate(45 63 43)' fill='black'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100'%3E%3Ccircle cx='10' cy='12' r='4' fill='black'/%3E%3Crect x='38' y='6' width='6' height='6' transform='rotate(20 41 9)' fill='black'/%3E%3Ccircle cx='70' cy='22' r='4' fill='black'/%3E%3Crect x='6' y='55' width='5' height='5' transform='rotate(-15 9 58)' fill='black'/%3E%3Ccircle cx='52' cy='60' r='4' fill='black'/%3E%3Crect x='80' y='75' width='6' height='6' transform='rotate(30 83 78)' fill='black'/%3E%3Ccircle cx='22' cy='85' r='4' fill='black'/%3E%3Crect x='60' y='40' width='5' height='5' transform='rotate(45 63 43)' fill='black'/%3E%3C/svg%3E");
  -webkit-mask-size: 150px 150px;
  mask-size: 150px 150px;
}

.bg-prev.bg-stars::before {
  -webkit-mask-image: url('/img/bg/star.svg');
  mask-image: url('/img/bg/star.svg');
  -webkit-mask-size: 120px 105px;
  mask-size: 120px 105px;
}

.bg-prev.bg-flowers::before {
  -webkit-mask-image: url('/img/bg/flower.svg');
  mask-image: url('/img/bg/flower.svg');
  -webkit-mask-size: 75px 120px;
  mask-size: 75px 120px;
}

.bg-prev.bg-champagne::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='52' height='92'%3E %3Cpath d='M6,6 L46,6 Q42,50 29,54 L29,72 L34,72 L34,78 L18,78 L18,72 L23,72 L23,54 Q10,50 6,6 Z' fill='black'/%3E %3Ccircle cx='18' cy='28' r='2.5' fill='white'/%3E %3Ccircle cx='30' cy='16' r='2' fill='white'/%3E %3Ccircle cx='26' cy='38' r='2' fill='white'/%3E %3Ccircle cx='36' cy='30' r='1.5' fill='white'/%3E %3Ccircle cx='20' cy='44' r='1.5' fill='white'/%3E %3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='52' height='92'%3E %3Cpath d='M6,6 L46,6 Q42,50 29,54 L29,72 L34,72 L34,78 L18,78 L18,72 L23,72 L23,54 Q10,50 6,6 Z' fill='black'/%3E %3Ccircle cx='18' cy='28' r='2.5' fill='white'/%3E %3Ccircle cx='30' cy='16' r='2' fill='white'/%3E %3Ccircle cx='26' cy='38' r='2' fill='white'/%3E %3Ccircle cx='36' cy='30' r='1.5' fill='white'/%3E %3Ccircle cx='20' cy='44' r='1.5' fill='white'/%3E %3C/svg%3E");
  -webkit-mask-size: 78px 138px;
  mask-size: 78px 138px;
}

.bg-prev.bg-cake::before {
  -webkit-mask-image: url('/img/bg/cake.svg');
  mask-image: url('/img/bg/cake.svg');
  -webkit-mask-size: 120px 108px;
  mask-size: 120px 108px;
}

.bg-prev.bg-baby::before {
  -webkit-mask-image: url('/img/bg/baby.svg');
  mask-image: url('/img/bg/baby.svg');
  -webkit-mask-size: 105px 136px;
  mask-size: 105px 136px;
}

.bg-prev.bg-ihs::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='70' height='70'%3E%3Ccircle cx='35' cy='35' r='9' fill='none' stroke='black' stroke-width='2.5'/%3E%3Crect x='33' y='4' width='4' height='16' rx='2' fill='black'/%3E%3Crect x='33' y='50' width='4' height='16' rx='2' fill='black'/%3E%3Crect x='4' y='33' width='16' height='4' rx='2' fill='black'/%3E%3Crect x='50' y='33' width='16' height='4' rx='2' fill='black'/%3E%3Crect x='49' y='9' width='4' height='13' rx='2' transform='rotate(45 51 15)' fill='black'/%3E%3Crect x='17' y='9' width='4' height='13' rx='2' transform='rotate(-45 19 15)' fill='black'/%3E%3Crect x='49' y='48' width='4' height='13' rx='2' transform='rotate(-45 51 55)' fill='black'/%3E%3Crect x='17' y='48' width='4' height='13' rx='2' transform='rotate(45 19 55)' fill='black'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='70' height='70'%3E%3Ccircle cx='35' cy='35' r='9' fill='none' stroke='black' stroke-width='2.5'/%3E%3Crect x='33' y='4' width='4' height='16' rx='2' fill='black'/%3E%3Crect x='33' y='50' width='4' height='16' rx='2' fill='black'/%3E%3Crect x='4' y='33' width='16' height='4' rx='2' fill='black'/%3E%3Crect x='50' y='33' width='16' height='4' rx='2' fill='black'/%3E%3Crect x='49' y='9' width='4' height='13' rx='2' transform='rotate(45 51 15)' fill='black'/%3E%3Crect x='17' y='9' width='4' height='13' rx='2' transform='rotate(-45 19 15)' fill='black'/%3E%3Crect x='49' y='48' width='4' height='13' rx='2' transform='rotate(-45 51 55)' fill='black'/%3E%3Crect x='17' y='48' width='4' height='13' rx='2' transform='rotate(45 19 55)' fill='black'/%3E%3C/svg%3E");
  -webkit-mask-size: 105px 105px;
  mask-size: 105px 105px;
}

.bg-prev.bg-penis::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='52' height='92'%3E %3Crect x='18' y='42' width='16' height='42' rx='8' fill='black'/%3E %3Cpath d='M12,44 Q11,18 26,14 Q41,18 40,44 Q34,50 26,50 Q18,50 12,44 Z' fill='black'/%3E %3Cellipse cx='26' cy='46' rx='13' ry='4' fill='white'/%3E %3Cellipse cx='12' cy='68' rx='10' ry='13' fill='black'/%3E %3Cellipse cx='40' cy='68' rx='10' ry='13' fill='black'/%3E %3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='52' height='92'%3E %3Crect x='18' y='42' width='16' height='42' rx='8' fill='black'/%3E %3Cpath d='M12,44 Q11,18 26,14 Q41,18 40,44 Q34,50 26,50 Q18,50 12,44 Z' fill='black'/%3E %3Cellipse cx='26' cy='46' rx='13' ry='4' fill='white'/%3E %3Cellipse cx='12' cy='68' rx='10' ry='13' fill='black'/%3E %3Cellipse cx='40' cy='68' rx='10' ry='13' fill='black'/%3E %3C/svg%3E");
  -webkit-mask-size: 78px 138px;
  mask-size: 78px 138px;
}

.bg-prev.bg-diamond::before {
  -webkit-mask-image: url('/img/bg/diamond.svg');
  mask-image: url('/img/bg/diamond.svg');
  -webkit-mask-size: 120px 94px;
  mask-size: 120px 94px;
}

.bg-prev.bg-crown::before {
  -webkit-mask-image: url('/img/bg/crown.svg');
  mask-image: url('/img/bg/crown.svg');
  -webkit-mask-size: 128px 90px;
  mask-size: 128px 90px;
}

.bg-prev.bg-notes::before {
  -webkit-mask-image: url('/img/bg/notes.svg');
  mask-image: url('/img/bg/notes.svg');
  -webkit-mask-size: 120px 105px;
  mask-size: 120px 105px;
}

.bg-prev.bg-kiss::before {
  -webkit-mask-image: url('/img/bg/kiss.svg');
  mask-image: url('/img/bg/kiss.svg');
  -webkit-mask-size: 135px 80px;
  mask-size: 135px 80px;
}

.bg-prev.bg-bow::before {
  -webkit-mask-image: url('/img/bg/bow.svg');
  mask-image: url('/img/bg/bow.svg');
  -webkit-mask-size: 120px 132px;
  mask-size: 120px 132px;
}

.bg-prev.bg-dove::before {
  -webkit-mask-image: url('/img/bg/dove.svg');
  mask-image: url('/img/bg/dove.svg');
  -webkit-mask-size: 112px 156px;
  mask-size: 112px 156px;
}

.bg-prev.bg-suitcase::before {
  -webkit-mask-image: url('/img/bg/suitcase.svg');
  mask-image: url('/img/bg/suitcase.svg');
  -webkit-mask-size: 105px 120px;
  mask-size: 105px 120px;
}

/* bg-swatch thumbnails + #lcBgIconSm picker: show mini pattern per data-bg.
   Both selectors needed: inside .bg-swatch (grid) and standalone .bgs-icon[data-bg] (picker btn). */
.bg-swatch[data-bg="hearts"] .bgs-icon::before, .bgs-icon[data-bg="hearts"]::before { -webkit-mask-image: url('/img/bg/heart.svg'); mask-image: url('/img/bg/heart.svg'); }
.bg-swatch[data-bg="stars"] .bgs-icon::before, .bgs-icon[data-bg="stars"]::before { -webkit-mask-image: url('/img/bg/star.svg'); mask-image: url('/img/bg/star.svg'); }
.bg-swatch[data-bg="flowers"] .bgs-icon::before, .bgs-icon[data-bg="flowers"]::before { -webkit-mask-image: url('/img/bg/flower.svg'); mask-image: url('/img/bg/flower.svg'); }
.bg-swatch[data-bg="paws"] .bgs-icon::before, .bgs-icon[data-bg="paws"]::before { -webkit-mask-image: url('/img/bg/paws.svg'); mask-image: url('/img/bg/paws.svg'); }
.bg-swatch[data-bg="rings"] .bgs-icon::before, .bgs-icon[data-bg="rings"]::before { -webkit-mask-image: url('/img/bg/rings.svg'); mask-image: url('/img/bg/rings.svg'); }
.bg-swatch[data-bg="cross"] .bgs-icon::before, .bgs-icon[data-bg="cross"]::before { -webkit-mask-image: url('/img/bg/cross.svg'); mask-image: url('/img/bg/cross.svg'); }
.bg-swatch[data-bg="cake"] .bgs-icon::before, .bgs-icon[data-bg="cake"]::before { -webkit-mask-image: url('/img/bg/cake.svg'); mask-image: url('/img/bg/cake.svg'); }
.bg-swatch[data-bg="diamond"] .bgs-icon::before, .bgs-icon[data-bg="diamond"]::before { -webkit-mask-image: url('/img/bg/diamond.svg'); mask-image: url('/img/bg/diamond.svg'); }
.bg-swatch[data-bg="crown"] .bgs-icon::before, .bgs-icon[data-bg="crown"]::before { -webkit-mask-image: url('/img/bg/crown.svg'); mask-image: url('/img/bg/crown.svg'); }
.bg-swatch[data-bg="notes"] .bgs-icon::before, .bgs-icon[data-bg="notes"]::before { -webkit-mask-image: url('/img/bg/notes.svg'); mask-image: url('/img/bg/notes.svg'); }
.bg-swatch[data-bg="kiss"] .bgs-icon::before, .bgs-icon[data-bg="kiss"]::before { -webkit-mask-image: url('/img/bg/kiss.svg'); mask-image: url('/img/bg/kiss.svg'); }
.bg-swatch[data-bg="bow"] .bgs-icon::before, .bgs-icon[data-bg="bow"]::before { -webkit-mask-image: url('/img/bg/bow.svg'); mask-image: url('/img/bg/bow.svg'); }
.bg-swatch[data-bg="dove"] .bgs-icon::before, .bgs-icon[data-bg="dove"]::before { -webkit-mask-image: url('/img/bg/dove.svg'); mask-image: url('/img/bg/dove.svg'); }
.bg-swatch[data-bg="suitcase"] .bgs-icon::before, .bgs-icon[data-bg="suitcase"]::before { -webkit-mask-image: url('/img/bg/suitcase.svg'); mask-image: url('/img/bg/suitcase.svg'); }
.bg-swatch[data-bg="baby"] .bgs-icon::before, .bgs-icon[data-bg="baby"]::before { -webkit-mask-image: url('/img/bg/baby.svg'); mask-image: url('/img/bg/baby.svg'); }
.bg-swatch[data-bg="balloons"] .bgs-icon::before, .bgs-icon[data-bg="balloons"]::before { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='90'%3E%3Ccircle cx='30' cy='30' r='20' fill='black'/%3E%3Cpolygon points='30,50 27,57 33,57' fill='black'/%3E%3Cpath d='M30 57 Q38 70 26 82' stroke='black' stroke-width='1.5' fill='none'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='90'%3E%3Ccircle cx='30' cy='30' r='20' fill='black'/%3E%3Cpolygon points='30,50 27,57 33,57' fill='black'/%3E%3Cpath d='M30 57 Q38 70 26 82' stroke='black' stroke-width='1.5' fill='none'/%3E%3C/svg%3E"); }
.bg-swatch[data-bg="confetti"] .bgs-icon::before, .bgs-icon[data-bg="confetti"]::before { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100'%3E%3Ccircle cx='10' cy='12' r='4' fill='black'/%3E%3Crect x='38' y='6' width='6' height='6' transform='rotate(20 41 9)' fill='black'/%3E%3Ccircle cx='70' cy='22' r='4' fill='black'/%3E%3Crect x='6' y='55' width='5' height='5' transform='rotate(-15 9 58)' fill='black'/%3E%3Ccircle cx='52' cy='60' r='4' fill='black'/%3E%3Crect x='80' y='75' width='6' height='6' transform='rotate(30 83 78)' fill='black'/%3E%3Ccircle cx='22' cy='85' r='4' fill='black'/%3E%3Crect x='60' y='40' width='5' height='5' transform='rotate(45 63 43)' fill='black'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100'%3E%3Ccircle cx='10' cy='12' r='4' fill='black'/%3E%3Crect x='38' y='6' width='6' height='6' transform='rotate(20 41 9)' fill='black'/%3E%3Ccircle cx='70' cy='22' r='4' fill='black'/%3E%3Crect x='6' y='55' width='5' height='5' transform='rotate(-15 9 58)' fill='black'/%3E%3Ccircle cx='52' cy='60' r='4' fill='black'/%3E%3Crect x='80' y='75' width='6' height='6' transform='rotate(30 83 78)' fill='black'/%3E%3Ccircle cx='22' cy='85' r='4' fill='black'/%3E%3Crect x='60' y='40' width='5' height='5' transform='rotate(45 63 43)' fill='black'/%3E%3C/svg%3E"); }
.bg-swatch[data-bg="champagne"] .bgs-icon::before, .bgs-icon[data-bg="champagne"]::before { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='52' height='92'%3E %3Cpath d='M6,6 L46,6 Q42,50 29,54 L29,72 L34,72 L34,78 L18,78 L18,72 L23,72 L23,54 Q10,50 6,6 Z' fill='black'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='52' height='92'%3E %3Cpath d='M6,6 L46,6 Q42,50 29,54 L29,72 L34,72 L34,78 L18,78 L18,72 L23,72 L23,54 Q10,50 6,6 Z' fill='black'/%3E%3C/svg%3E"); }
.bg-swatch[data-bg="ihs"] .bgs-icon::before, .bgs-icon[data-bg="ihs"]::before { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='70' height='70'%3E%3Ccircle cx='35' cy='35' r='9' fill='none' stroke='black' stroke-width='2.5'/%3E%3Crect x='33' y='4' width='4' height='16' rx='2' fill='black'/%3E%3Crect x='33' y='50' width='4' height='16' rx='2' fill='black'/%3E%3Crect x='4' y='33' width='16' height='4' rx='2' fill='black'/%3E%3Crect x='50' y='33' width='16' height='4' rx='2' fill='black'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='70' height='70'%3E%3Ccircle cx='35' cy='35' r='9' fill='none' stroke='black' stroke-width='2.5'/%3E%3Crect x='33' y='4' width='4' height='16' rx='2' fill='black'/%3E%3Crect x='33' y='50' width='4' height='16' rx='2' fill='black'/%3E%3Crect x='4' y='33' width='16' height='4' rx='2' fill='black'/%3E%3Crect x='50' y='33' width='16' height='4' rx='2' fill='black'/%3E%3C/svg%3E"); }
.bg-swatch[data-bg="penis"] .bgs-icon::before, .bgs-icon[data-bg="penis"]::before { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='52' height='92'%3E %3Crect x='18' y='42' width='16' height='42' rx='8' fill='black'/%3E %3Cpath d='M12,44 Q11,18 26,14 Q41,18 40,44 Q34,50 26,50 Q18,50 12,44 Z' fill='black'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='52' height='92'%3E %3Crect x='18' y='42' width='16' height='42' rx='8' fill='black'/%3E %3Cpath d='M12,44 Q11,18 26,14 Q41,18 40,44 Q34,50 26,50 Q18,50 12,44 Z' fill='black'/%3E%3C/svg%3E"); }

/* ═══════════════════════════════════════════
   LAYOUT C — editor redesign
   ═══════════════════════════════════════════ */

/* Topbar brand */
.ed-shell .brand {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
  font-size: 1.1rem;
  text-decoration: none;
  line-height: 1;
  user-select: none;
}
.ed-shell .brand:focus-visible {
  outline: 2px solid var(--copper);
  outline-offset: 2px;
  border-radius: 3px;
}

/* Topbar status/template pills */
.ed-shell-right .pill,
.ed-shell-right .pill-template {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  border-radius: 100px;
  font-size: 0.80rem;
  font-weight: 500;
  background: var(--soft);
  border: 1px solid var(--warm);
  color: var(--muted);
  white-space: nowrap;
  line-height: 1;
}

/* Save button — pill in topbar */
.ed-shell-right #save-btn {
  border-radius: 100px;
  padding: 0.35rem 1rem;
  font-size: 0.80rem;
}

/* Topbar: inline name (smaller than hero version) */
.ed-shell .ed-name {
  font-size: 0.92rem;
  font-weight: 700;
  min-height: unset;
  max-width: 22ch;
  letter-spacing: -0.01em;
  line-height: 1.3;
  /* no overflow:hidden or text-overflow on contenteditable — breaks editing */
}
.ed-shell .ed-name:not(:focus) {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* Main 2-column grid */
.lc-layout {
  display: grid;
  grid-template-columns: 520px 1fr;
  min-height: calc(100vh - 56px);
  align-items: stretch;
  cursor: default;
  user-select: none;
}
.lc-layout input,
.lc-layout textarea,
.lc-layout [contenteditable] {
  cursor: text;
  user-select: text;
}

/* ── LEFT: Phone zone ── */
.lc-phone-zone {
  background: #EDE8DF;
  background-image: radial-gradient(circle, rgba(45,38,32,0.1) 1px, transparent 1px);
  background-size: 22px 22px;
  border-right: 1px solid var(--warm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 20px 20px 16px;
  gap: 12px;
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
  align-self: start;
  overflow: hidden;
}

/* Phone wrap: clip container fills available height */
.lc-ph-wrap {
  flex: 1;
  min-height: 0;
  position: relative;
  width: min(460px, calc(100% - 40px));
  border-radius: 42px;
  overflow: hidden;
  /* clip-path ensures iframe is clipped even when border-radius+overflow:hidden doesn't */
  clip-path: inset(0 round 42px);
  box-shadow: 0 24px 64px rgba(45,38,32,0.40), 0 0 0 1px rgba(45,38,32,0.08);
}
/* Live preview iframe fills the wrap */
.lc-ph-screen {
  position: absolute;
  inset: 0;
  background: var(--bg);
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: none;
}
.lc-ph-screen::-webkit-scrollbar { display: none; }
.preview-loading {
  position: absolute;
  inset: 0;
  z-index: 10;
  background: var(--bg, #faf8f5);
  pointer-events: none;
  transition: opacity 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}
.preview-loading::after {
  content: '';
  width: 32px;
  height: 32px;
  border: 3px solid rgba(184, 115, 51, 0.2);
  border-top-color: var(--copper, #b87333);
  border-radius: 50%;
  animation: preview-spin 0.75s linear infinite;
}
@keyframes preview-spin {
  to { transform: rotate(360deg); }
}
.preview-loading.done {
  opacity: 0;
}
.lc-ph-screen iframe {
  width: 100%;
  min-height: 100%;
  border: 0;
  display: block;
  view-transition-name: preview-frame;
}
/* Phone chrome overlay: border + notch + home bar */
.lc-ph-chrome {
  position: absolute;
  inset: 0;
  border: 9px solid var(--ink);
  border-radius: 42px;
  pointer-events: none;
  z-index: 5;
}
.lc-ph-notch {
  position: absolute;
  top: 0; left: 50%; transform: translateX(-50%);
  width: 60px; height: 17px;
  background: var(--ink); border-radius: 0 0 12px 12px;
  display: flex; align-items: center; justify-content: center; gap: 5px;
}
.lc-ph-notch-spk { width: 16px; height: 3px; background: #111; border-radius: 2px; }
.lc-ph-notch-cam { width: 5px; height: 5px; border-radius: 50%; background: #111; border: 1px solid rgba(255,255,255,0.08); }
.lc-ph-home {
  position: absolute;
  bottom: 6px; left: 50%; transform: translateX(-50%);
  width: 52px; height: 4px;
  background: rgba(255,255,255,0.20); border-radius: 2px;
}

/* Pickers under phone */
.lc-pickers {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  max-width: 460px;
  flex-shrink: 0;
}
.lc-picker-btn {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.82); backdrop-filter: blur(6px);
  border: 1px solid var(--warm); border-radius: 9px;
  padding: 7px 11px; cursor: pointer; width: 100%;
  font: inherit; text-align: left;
  transition: border-color 150ms ease-out;
}
.lc-picker-btn:hover { border-color: var(--copper); }
.lc-picker-btn:active { transform: scale(0.98); }
.lc-theme-swatch {
  width: 26px; height: 26px; border-radius: 6px;
  background: linear-gradient(135deg, #B66C45, #7A3A18);
  border: 1px solid rgba(0,0,0,0.1); flex-shrink: 0;
}
.lc-bg-icon-sm {
  width: 26px; height: 26px; border-radius: 6px;
  border: 1px solid var(--warm); background: var(--soft);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; flex-shrink: 0;
}
.lc-picker-name {
  font-size: 12px; font-weight: 600; color: var(--ink);
  flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lc-picker-action {
  font-size: 11px; color: var(--copper); font-weight: 600; flex-shrink: 0;
}
.lc-bg-panel {
  background: var(--card);
  border: 1px solid var(--warm);
  border-radius: 10px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 460px;
}
.lc-bg-panel[hidden] { display: none !important; }

/* Background picker modal */
.bg-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
}
.bg-modal[hidden] { display: none; }
.bg-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}
.bg-modal-panel {
  position: relative;
  z-index: 1;
  background: var(--card);
  border-radius: 16px;
  padding: 1.5rem;
  width: min(560px, calc(100vw - 2rem));
  max-height: 85vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.bg-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.bg-modal-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--ink);
}
.bg-modal-close {
  background: none;
  border: 1px solid var(--warm);
  border-radius: 6px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--muted);
}
.bg-modal-close:hover { border-color: var(--copper); color: var(--copper); }
.bg-swatches-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

/* ── RIGHT: Editor panel ── */
.lc-editor-panel {
  display: flex;
  flex-direction: column;
  background: var(--card);
  position: relative;
  overflow: hidden;
}

/* View slide transitions */
.lc-view {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  transition: transform 260ms cubic-bezier(0.32,0.72,0,1), opacity 200ms ease-out;
  background: var(--card);
}
.lc-hidden-left  { transform: translateX(-100%); opacity: 0; pointer-events: none; }
.lc-hidden-right { transform: translateX(100%);  opacity: 0; pointer-events: none; }
.lc-visible      { transform: translateX(0);     opacity: 1; }

/* LIST VIEW */
.lc-list-head {
  display: flex; align-items: center; gap: 8px;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--warm);
  flex-shrink: 0;
}
.lc-list-title {
  font-family: var(--font-display); font-weight: 800;
  font-size: 1.05rem; color: var(--ink); flex: 1; margin: 0;
}
.lc-list-count {
  font-size: 0.72rem; color: var(--muted);
}
.lc-features-bar {
  display: flex; gap: 16px; align-items: center; flex-wrap: wrap;
  padding: 8px 20px;
  border-bottom: 1px solid var(--warm);
  flex-shrink: 0;
  background: var(--card);
}
@media (max-width: 480px) {
  .lc-features-bar { gap: 10px 16px; padding: 8px 14px; }
}
.lc-feat-toggle {
  display: flex; align-items: center; gap: 7px;
  cursor: pointer; user-select: none;
}
.lc-feat-input {
  position: absolute; opacity: 0; width: 0; height: 0;
}
.lc-feat-track {
  display: block; width: 32px; height: 18px; border-radius: 9px;
  background: #d9d0c7; transition: background 0.2s; position: relative; flex-shrink: 0;
}
.lc-feat-input:checked ~ .lc-feat-track { background: var(--copper); }
.lc-feat-thumb {
  display: block; position: absolute; top: 2px; left: 2px;
  width: 14px; height: 14px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,0.18);
  transition: transform 0.2s;
}
.lc-feat-input:checked ~ .lc-feat-track .lc-feat-thumb { transform: translateX(14px); }
.lc-feat-label {
  font-size: 0.73rem; color: var(--muted); font-family: var(--font-body);
}


.lc-webhook-row,
.lc-reward-row,
.lc-password-row {
  padding: 8px 16px 10px;
  border-bottom: 1px solid var(--warm);
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: var(--soft);
}
.lc-webhook-row[hidden],
.lc-reward-row[hidden],
.lc-password-row[hidden] { display: none; }
.lc-password-input-wrap { display: flex; gap: 6px; align-items: stretch; }
.lc-password-save-btn {
  flex-shrink: 0;
  padding: 0 14px;
  background: var(--ink);
  color: var(--bg);
  font-size: 0.8rem;
  font-weight: 700;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: opacity 0.15s;
}
.lc-password-save-btn:hover { opacity: 0.8; }
.lc-password-clear-btn {
  align-self: flex-start;
  font-size: 0.75rem;
  color: var(--copper);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
}
.lc-expand-label {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.lc-expand-input {
  width: 100%;
  font: inherit;
  font-size: 0.83rem;
  padding: 8px 11px;
  border: 1px solid var(--warm);
  border-radius: 8px;
  background: var(--card);
  color: var(--ink);
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.lc-expand-input:focus {
  border-color: var(--copper);
  box-shadow: 0 0 0 3px rgba(182,108,69,0.12);
}

.lc-list-scroll {
  flex: 1; overflow-y: auto; padding: 12px 14px;
  scrollbar-width: thin; scrollbar-color: var(--warm) transparent;
  max-width: 700px;
}
.lc-blk-list { list-style: none; display: flex; flex-direction: column; gap: 0; }

/* Compact block row */
.lc-blk-row {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 12px;
  background: var(--soft); border: 1px solid var(--warm);
  border-radius: 11px; margin-bottom: 8px;
  cursor: pointer;
  opacity: 0; transform: translateY(10px);
  animation: lc-row-in 280ms cubic-bezier(0.23,1,0.32,1) forwards;
  transition: border-color 150ms ease-out, box-shadow 150ms ease-out, transform 120ms ease-out;
}
@keyframes lc-row-in { to { opacity: 1; transform: translateY(0); } }
.lc-blk-row:nth-child(1) { animation-delay: 40ms; }
.lc-blk-row:nth-child(2) { animation-delay: 90ms; }
.lc-blk-row:nth-child(3) { animation-delay: 140ms; }
.lc-blk-row:nth-child(4) { animation-delay: 190ms; }
.lc-blk-row:nth-child(5) { animation-delay: 240ms; }
.lc-blk-row:nth-child(6) { animation-delay: 290ms; }
@media (hover: hover) and (pointer: fine) {
  .lc-blk-row:hover {
    border-color: #D4C3AE;
    box-shadow: 0 3px 12px rgba(45,38,32,0.08);
    transform: translateY(-1px);
  }
}
.lc-blk-row:active { transform: scale(0.98); }
.lc-blk-row.lc-active { border-color: var(--copper); background: rgba(182,108,69,0.04); }
.lc-blk-row.invalid { background: #fff5f5; border-color: var(--danger); }
.lc-blk-row.sortable-ghost { opacity: 0.3; }
.lc-blk-row.sortable-drag { box-shadow: 0 8px 24px rgba(45,38,32,0.18); border-radius: 11px; }

/* Compact row elements */
.lc-drag-h { cursor: grab; flex-shrink: 0; opacity: 0.25; transition: opacity 150ms; display: flex; align-items: center; }
.lc-blk-row:hover .lc-drag-h { opacity: 0.5; }
.lc-blk-chip { flex-shrink: 0; }
.lc-blk-prev {
  flex: 1; font-size: 0.82rem; color: var(--muted);
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis; min-width: 0;
}
.lc-blk-arrow {
  flex-shrink: 0; color: var(--warm);
  transition: color 150ms, transform 150ms;
}
.lc-blk-row:hover .lc-blk-arrow { color: var(--copper); transform: translateX(2px); }

/* Add-block button in list header */
.lc-btn-add-head {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--ink); color: var(--bg); border: none; border-radius: 8px;
  padding: 7px 11px; font-size: 0.75rem; font-weight: 600; cursor: pointer; font-family: var(--font-body);
  transition: background 150ms ease-out, transform 100ms ease-out;
  white-space: nowrap; flex-shrink: 0;
}
.lc-btn-add-head:hover { background: #3D342D; }
.lc-btn-add-head:active { transform: scale(0.98); }

/* EDIT VIEW */
.lc-edit-head {
  display: flex; align-items: center; gap: 9px;
  padding: 13px 18px 11px; border-bottom: 1px solid var(--warm); flex-shrink: 0;
}
.lc-back-btn {
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--soft); border: 1px solid var(--warm);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--muted); flex-shrink: 0;
  transition: background 150ms ease-out, transform 100ms ease-out;
}
.lc-back-btn:hover { background: var(--warm); }
.lc-back-btn:active { transform: scale(0.93); }
.lc-edit-badge {
  font-size: 0.62rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 999px;
  background: rgba(182,108,69,0.1); color: var(--copper); border: 1px solid rgba(182,108,69,0.25);
  flex-shrink: 0;
}
.lc-edit-title {
  font-family: var(--font-display); font-weight: 700; font-size: 0.92rem; color: var(--ink); flex: 1;
}
.lc-edit-body {
  flex: 1; overflow-y: auto; padding: 16px 18px;
  display: flex; flex-direction: column; gap: 4px;
  scrollbar-width: thin; scrollbar-color: var(--warm) transparent;
  max-width: 700px;
  cursor: default;
}
/* Override inline field styles inside edit view */
.lc-edit-body .blk-input {
  background: var(--soft);
  border: 1px solid var(--warm);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 0.85rem;
  width: 100%;
  display: block;
  margin-bottom: 6px;
}
.lc-edit-body .blk-input:focus {
  border-color: var(--copper);
  box-shadow: 0 0 0 3px rgba(182,108,69,0.12);
  background: var(--card);
}
.lc-edit-body .blk-input.display {
  font-family: var(--font-display);
  font-weight: 800; font-size: 1.15rem;
  letter-spacing: -0.02em; line-height: 1.1;
  padding: 10px 12px;
}
.lc-edit-body .facts-grid,
.lc-edit-body .sched-grid { gap: 6px; margin-top: 4px; }
.lc-edit-body .facts-grid .blk-input,
.lc-edit-body .sched-grid .blk-input { margin-bottom: 0; background: var(--soft); }
.lc-edit-body .contact-channels { margin-bottom: 8px; }
.lc-edit-body .link { margin-top: 6px; }

.lc-edit-footer {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 18px; border-top: 1px solid var(--warm); flex-shrink: 0;
}
.lc-btn-delete {
  display: flex; align-items: center; gap: 5px;
  padding: 7px 13px; border-radius: 8px; font-size: 0.78rem; font-weight: 600;
  background: rgba(176,56,42,0.06); border: 1px solid rgba(176,56,42,0.15); color: #B0382A;
  cursor: pointer; font-family: var(--font-body);
  transition: background 150ms, transform 100ms ease-out;
}
.lc-btn-delete:hover { background: rgba(176,56,42,0.1); }
.lc-btn-delete:active { transform: scale(0.97); }
.lc-btn-done {
  background: var(--ink); color: var(--bg); border: none; border-radius: 8px;
  padding: 8px 20px; font-size: 0.82rem; font-weight: 600; cursor: pointer;
  font-family: var(--font-body);
  transition: background 150ms ease-out, transform 100ms ease-out;
}
.lc-btn-done:hover { background: var(--copper); }
.lc-btn-done:active { transform: scale(0.97); }

/* Block picker modal */
.lc-picker-modal {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
.lc-picker-modal[hidden] { display: none; }
.lc-picker-modal-backdrop {
  position: absolute; inset: 0; background: rgba(0,0,0,0.4);
}
.lc-picker-modal-panel {
  position: relative; z-index: 1;
  background: var(--card); border-radius: 20px;
  width: 100%; max-width: 640px;
  padding: 1.25rem 1.5rem 1.5rem;
  display: flex; flex-direction: column; gap: 1rem;
  box-shadow: 0 16px 48px rgba(45,38,32,0.18);
  max-height: 85vh;
  overflow-y: auto;
}
.lc-picker-modal-head {
  display: flex; align-items: center; justify-content: space-between;
  font-family: var(--font-display); font-weight: 800; font-size: 1rem; color: var(--ink);
}
.lc-picker-modal-close {
  background: none; border: 1px solid var(--warm); border-radius: 6px;
  width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
  font-size: 1rem; cursor: pointer; color: var(--muted);
}
.lc-picker-modal-close:hover { border-color: var(--copper); color: var(--copper); }

/* Mobile Layout C */
@media (max-width: 720px) {
  /* Theme modal: bottom sheet, 2-column grid with fluid thumbs */
  .theme-modal { align-items: flex-end; }
  .theme-modal-panel {
    border-radius: 20px 20px 0 0;
    width: 100%;
    max-width: 100%;
    padding-bottom: calc(1.5rem + env(safe-area-inset-bottom));
  }
  .theme-modal-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    justify-content: unset;
    gap: 0.75rem;
  }
  .theme-modal-thumb {
    width: 100%;
    height: auto;
    aspect-ratio: 200 / 347;
  }
  .theme-modal-thumb iframe {
    width: 250%;
    height: 250%;
  }

  .lc-picker-modal { align-items: flex-end; padding: 0; }
  .lc-picker-modal-panel {
    border-radius: 20px 20px 0 0;
    max-width: 100%;
    max-height: 85svh;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-bottom: calc(1.5rem + env(safe-area-inset-bottom));
  }
  .ed-picker {
    grid-template-columns: repeat(3, 1fr);
  }

  .lc-layout {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto;
    min-height: calc(100vh - 56px);
  }
  .lc-editor-panel { order: 1; min-height: 460px; }
  .lc-phone-zone {
    order: 2;
    border-right: none; border-top: 1px solid var(--warm);
    padding: 0 0 24px;
    justify-content: flex-start;
    align-items: stretch;
    /* reset desktop sticky */
    position: static;
    height: auto;
    overflow: visible;
    align-self: auto;
  }
  .lc-ph-wrap {
    flex: none;
    width: 100%;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
  }
  .lc-ph-chrome { display: none; }
  .lc-ph-screen {
    position: static;
    height: auto; max-height: 380px;
    border-radius: 0;
    border-top: 1px solid var(--warm);
    border-bottom: 1px solid var(--warm);
  }
  .lc-ph-screen iframe { min-height: 380px; }
  .lc-pickers {
    max-width: 100%;
    padding: 0 16px;
  }
  .lc-bg-panel { max-width: 100%; }
  /* topbar: hide locale + status pills */
  .ed-shell .ed-name { max-width: 14ch; }
}
@media (max-width: 480px) {
  .lc-layout { grid-template-rows: 1fr auto; }

  /* Topbar mobile: tylko brand + nazwa + Zapisz */
  .ed-shell {
    height: auto;
    min-height: 50px;
    padding: 0.5rem 0.85rem;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem 0;
  }
  .ed-shell-left {
    flex: 1;
    min-width: 0;
    gap: 0.35rem;
    flex-wrap: nowrap;
    align-items: center;
  }
  /* Ukryj: shortId, save-status, locale, separatory, Dashboard */
  .ed-shortid-pill,
  .ed-shortid-paren,
  #save-status,
  .topbar-locale,
  .ed-shell-sep { display: none; }
  /* Ukryj z prawej: pille, connect, open-scan */
  .ed-shell-right .pill,
  .ed-shell-right .pill-template,
  .ed-connect-btn,
  .icon-btn { display: none; }
  /* Nazwa: wrap dozwolony */
  .ed-shell .ed-name {
    white-space: normal;
    overflow: visible;
    max-width: none;
    font-size: 0.88rem;
  }
  /* Zapisz: kompaktowy */
  #save-btn { padding: 0.5rem 0.9rem; font-size: 0.82rem; flex-shrink: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .lc-blk-row { animation: none; opacity: 1; transform: none; }
  .lc-view { transition: none; }
}

::view-transition-old(root), ::view-transition-new(root) { animation: none; }
::view-transition-old(preview-frame) { animation: 100ms ease-out both vt-fade-out; }
::view-transition-new(preview-frame) { animation: 140ms ease-in  both vt-fade-in; }
@keyframes vt-fade-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes vt-fade-in  { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(preview-frame), ::view-transition-new(preview-frame) { animation: none; }
}

/* === Health score widget === */
.lc-health-bar {
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.lc-health-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  user-select: none;
}

/* Circular ring */
.lc-health-ring-wrap {
  position: relative;
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}
.lc-health-ring {
  width: 48px;
  height: 48px;
  transform: rotate(-90deg);
}
.lc-health-ring-bg {
  stroke: var(--border);
  stroke-width: 3.5;
  fill: none;
}
.lc-health-ring-fill {
  stroke: #e74c3c;
  stroke-width: 3.5;
  fill: none;
  stroke-linecap: round;
  stroke-dasharray: 113.1;
  stroke-dashoffset: 113.1;
  transition: stroke-dashoffset 0.55s cubic-bezier(0.4,0,0.2,1), stroke 0.4s ease;
}
.lc-health-score {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text);
  transition: color 0.4s ease;
  line-height: 1;
}

/* Label column */
.lc-health-labels {
  flex: 1;
  min-width: 0;
}
.lc-health-label-text {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.4s ease;
}
.lc-health-hint {
  display: block;
  font-size: 0.6rem;
  color: var(--muted);
  margin-top: 0.1rem;
  transition: opacity 0.2s ease;
}

/* Tips panel — hidden by default, revealed on hover (desktop) or data-open (tap/keyboard) */
.lc-health-tip-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: max-height 0.28s ease, opacity 0.2s ease, padding-top 0.28s ease;
}
.lc-health-bar[data-open] .lc-health-tip-list {
  max-height: 280px;
  opacity: 1;
  pointer-events: auto;
  padding-top: 0.5rem;
}
.lc-health-bar[data-open] .lc-health-hint {
  opacity: 0;
}
@media (hover: hover) and (pointer: fine) {
  .lc-health-bar:not([data-no-tips]):hover .lc-health-tip-list {
    max-height: 280px;
    opacity: 1;
    pointer-events: auto;
    padding-top: 0.5rem;
  }
  .lc-health-bar:not([data-no-tips]):hover .lc-health-hint {
    opacity: 0;
  }
}

.lc-health-tip {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.73rem;
  color: var(--text-secondary, #666);
  line-height: 1.35;
  padding: 0.15rem 0;
}
.lc-health-tip::before {
  content: "→";
  font-size: 0.65rem;
  color: var(--muted);
  flex-shrink: 0;
}
.lc-health-tip-title {
  font-weight: 700;
  color: var(--text);
  font-size: 0.68rem;
  padding: 0.15rem 0 0.05rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.lc-health-tip-title::before { content: none; }
.lc-health-tip-pts {
  margin-left: auto;
  font-weight: 700;
  font-size: 0.65rem;
  background: var(--bg-2, #f0f0f0);
  border-radius: 4px;
  padding: 0.08rem 0.38rem;
  white-space: nowrap;
  flex-shrink: 0;
  color: var(--text);
}
@media (max-width: 480px) {
  .lc-health-ring-wrap { width: 40px; height: 40px; }
  .lc-health-ring { width: 40px; height: 40px; }
  .lc-health-head { gap: 0.6rem; cursor: pointer; }
}

/* ── Email signature action button ── */
.lc-email-sig-action {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border);
}
.lc-email-sig-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: transparent;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 0.55rem 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  width: 100%;
  justify-content: center;
}
.lc-email-sig-btn:hover { border-color: var(--copper); color: var(--copper); }

/* ── Email signature modal ── */
.esig-modal { position: fixed; inset: 0; z-index: 1200; display: flex; align-items: center; justify-content: center; }
.esig-modal[hidden] { display: none; }
.esig-modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.45); }
.esig-modal-panel {
  position: relative;
  background: var(--surface, #fff);
  border-radius: 14px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.22);
  width: min(560px, 96vw);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.esig-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.esig-modal-title { font-weight: 700; font-size: 1rem; }
.esig-modal-close {
  background: none; border: none; cursor: pointer; font-size: 1.4rem;
  color: var(--text-muted); line-height: 1; padding: 0;
}
.esig-modal-body { padding: 1.25rem; display: flex; flex-direction: column; gap: 1rem; overflow-y: auto; }
.esig-hint { font-size: 0.85rem; color: var(--text-muted); margin: 0; line-height: 1.5; }
.esig-preview-wrap {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  min-height: 120px;
}
.esig-preview-iframe { width: 100%; height: 130px; border: none; display: block; }
.esig-copy-wrap { display: flex; flex-direction: column; gap: 0.6rem; }
.esig-html-textarea {
  width: 100%;
  height: 100px;
  font-size: 0.75rem;
  font-family: monospace;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem;
  resize: vertical;
  box-sizing: border-box;
  background: var(--bg, #f8f8f8);
  color: var(--text);
}
.esig-copy-btn { align-self: flex-end; }

/* ── Appearance Panel ─────────────────────────────────────────── */
.lc-picker-btn--appearance { gap: 0.5rem; }
.lc-appearance-icon { flex-shrink: 0; color: var(--muted); }

.appearance-panel[hidden] { display: none; }
.appearance-panel {
  background: var(--lc-surface, #fff);
  border-top: 1px solid var(--lc-border, #e8e0d4);
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  position: relative;
}

.ap-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.ap-row--col {
  flex-direction: column;
  align-items: flex-start;
}

.ap-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--lc-muted, #8a7560);
  white-space: nowrap;
}

.ap-color-box {
  display: flex;
  align-items: stretch;
  border: 1.5px solid var(--lc-border, #e8e0d4);
  border-radius: 6px;
  overflow: hidden;
  background: var(--lc-surface, #fff);
  transition: border-color 0.15s;
}
.ap-color-box:focus-within { border-color: var(--lc-copper, #b66c45); }
.ap-color-picker {
  width: 2.2rem;
  height: 2.2rem;
  border: none;
  border-right: 1.5px solid var(--lc-border, #e8e0d4);
  border-radius: 0;
  padding: 3px;
  cursor: pointer;
  background: none;
  flex-shrink: 0;
}
.ap-hex-input {
  font: inherit;
  font-size: 0.82rem;
  width: 5.2rem;
  padding: 0.3rem 0.5rem;
  border: none;
  color: var(--lc-ink, #2d2620);
  background: transparent;
}
.ap-hex-input:focus { outline: none; }

.ap-select {
  font: inherit;
  font-size: 0.82rem;
  padding: 0.3rem 1.8rem 0.3rem 0.6rem;
  border: 1.5px solid var(--lc-border, #e8e0d4);
  border-radius: 6px;
  color: var(--lc-ink, #2d2620);
  background: var(--lc-surface, #fff) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%238a7560'/%3E%3C/svg%3E") no-repeat right 0.55rem center;
  appearance: none;
  cursor: pointer;
  transition: border-color 0.15s;
}
.ap-select:focus { outline: none; border-color: var(--lc-copper, #b66c45); }
.ap-font-opt {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.82rem;
  cursor: pointer;
  color: var(--lc-ink, #2d2620);
}
.ap-font-opt input[type="radio"] { accent-color: var(--lc-copper, #b66c45); }

.ap-radius-field {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.ap-range {
  flex: 1;
  accent-color: var(--lc-copper, #b66c45);
}
.ap-range-val {
  font-size: 0.78rem;
  color: var(--lc-muted, #8a7560);
  min-width: 2.5rem;
  text-align: right;
}

.ap-seg-ctrl {
  display: flex;
  border: 1.5px solid var(--lc-border, #e8e0d4);
  border-radius: 6px;
  overflow: hidden;
}
.ap-seg-opt {
  flex: 1;
  cursor: pointer;
}
.ap-seg-opt input[type="radio"] { display: none; }
.ap-seg-opt span {
  display: block;
  text-align: center;
  padding: 0.28rem 0.75rem;
  font-size: 0.82rem;
  color: var(--lc-muted, #8a7560);
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.ap-seg-opt:not(:last-child) { border-right: 1.5px solid var(--lc-border, #e8e0d4); }
.ap-seg-opt input[type="radio"]:checked + span {
  background: var(--lc-copper, #b66c45);
  color: #fff;
}

.ap-reset-btn {
  font: inherit;
  font-size: 0.78rem;
  color: var(--lc-muted, #8a7560);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  align-self: flex-start;
}

/* Avatar upload */
.ap-row--avatar .ap-avatar-wrap { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.ap-avatar-preview { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; border: 2px solid var(--lc-warm, #d4b896); }
.ap-avatar-upload-btn {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.4rem 0.85rem; border: 1px solid var(--lc-warm, #d4b896);
  border-radius: 99px; font-size: 0.8rem; font-weight: 600; cursor: pointer;
  color: var(--lc-copper, #b66c45); background: transparent;
  transition: background 0.15s;
}
.ap-avatar-upload-btn:hover { background: rgba(182,108,69,0.07); }
.ap-avatar-upload-btn[data-uploading] { opacity: 0.6; pointer-events: none; }
.ap-avatar-clear-btn {
  font: inherit; font-size: 0.78rem; color: var(--lc-muted, #8a7560);
  background: none; border: none; cursor: pointer; padding: 0; text-decoration: underline;
}

/* FREE plan lock overlay */
.appearance-lock[hidden] { display: none; }
.appearance-lock {
  position: absolute;
  inset: 0;
  background: rgba(249,244,235,0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  z-index: 10;
  border-radius: 0;
  text-align: center;
  padding: 1.5rem;
}
.appearance-lock-icon { color: var(--copper); display: block; margin: 0 auto 0.5rem; }
.appearance-lock-msg {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--lc-ink, #2d2620);
  margin: 0;
}
.appearance-lock-cta {
  display: inline-block;
  margin-top: 0.25rem;
  padding: 0.45rem 1rem;
  background: var(--lc-copper, #b66c45);
  color: #fff;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
}
.appearance-lock-cta:hover { opacity: 0.88; }
