/* ── VARIABLES EDITOR ── */
:root {
  --ed-bg: #0c0c0c;
  --ed-surface: #161616;
  --ed-border: rgba(255,255,255,0.07);
  --ed-text: #c0c0c0;
  --ed-muted: #555;
  --ed-gold: #c9a84c;
  --ed-sidebar-w: 288px;
}

/* ── TOGGLE BTN ── */
#ed-fab {
  position: fixed; bottom: 28px; right: 28px; z-index: 8500;
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--ed-gold); color: #000;
  border: none; cursor: pointer; font-size: 20px;
  box-shadow: 0 4px 20px rgba(201,168,76,0.45);
  display: flex; align-items: center; justify-content: center;
  transition: transform .2s, background .2s, box-shadow .2s;
  font-family: 'Poppins', sans-serif;
}
#ed-fab:hover { transform: scale(1.08); background: #e8c96a; }
#ed-fab.active { background: #c0392b; box-shadow: 0 4px 20px rgba(192,57,43,.45); }

/* ── TOPBAR ── */
#ed-topbar {
  position: fixed; top: 0; left: var(--ed-sidebar-w); right: 0; z-index: 8400;
  height: 48px; background: rgba(12,12,12,.96); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--ed-border);
  display: none; align-items: center; justify-content: space-between;
  padding: 0 20px;
}
#ed-topbar.show { display: flex; }
.ed-top-left { font-size: 11px; color: var(--ed-muted); letter-spacing: .08em; font-family: 'Poppins',sans-serif; }
.ed-top-left strong { color: var(--ed-gold); font-weight: 500; }
.ed-top-right { display: flex; gap: 8px; }
.ed-top-btn {
  padding: 6px 14px; border-radius: 6px; font-size: 10px; letter-spacing: .1em;
  text-transform: uppercase; border: 1px solid var(--ed-border);
  background: transparent; color: var(--ed-text); cursor: pointer;
  font-family: 'Poppins',sans-serif; transition: all .2s;
}
.ed-top-btn:hover { border-color: #555; color: #fff; }
.ed-top-btn.primary { background: var(--ed-gold); color: #000; border-color: var(--ed-gold); font-weight: 600; }
.ed-top-btn.primary:hover { background: #e8c96a; }

/* ── SIDEBAR ── */
#ed-sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 8300;
  width: var(--ed-sidebar-w);
  background: var(--ed-bg); border-right: 1px solid var(--ed-border);
  display: none; flex-direction: column;
  box-shadow: 4px 0 24px rgba(0,0,0,.5);
  transition: transform .3s cubic-bezier(.4,0,.2,1);
}
#ed-sidebar.show { display: flex; }

/* Sidebar tab bar */
.ed-tabs {
  display: flex; border-bottom: 1px solid var(--ed-border); flex-shrink: 0;
  background: var(--ed-bg);
}
.ed-tab-btn {
  flex: 1; padding: 13px 4px; font-size: 9.5px; letter-spacing: .13em;
  text-transform: uppercase; color: var(--ed-muted); background: none;
  border: none; border-bottom: 2px solid transparent; cursor: pointer;
  font-family: 'Poppins',sans-serif; transition: color .2s, border-color .2s;
}
.ed-tab-btn.on { color: var(--ed-gold); border-bottom-color: var(--ed-gold); }
.ed-tab-btn:hover:not(.on) { color: #999; }

/* Sidebar scroll body */
.ed-body {
  flex: 1; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #2a2a2a transparent;
}
.ed-body::-webkit-scrollbar { width: 3px; }
.ed-body::-webkit-scrollbar-thumb { background: #2a2a2a; border-radius: 2px; }

/* Panels */
.ed-panel { display: none; }
.ed-panel.on { display: block; }

/* ── COLLAPSIBLE GROUPS ── */
.ed-grp { border-bottom: 1px solid var(--ed-border); }
.ed-grp-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 15px 18px; cursor: pointer;
  font-size: 10px; letter-spacing: .15em; text-transform: uppercase;
  color: #888; font-family: 'Poppins',sans-serif; font-weight: 500;
  transition: color .2s; user-select: none;
}
.ed-grp-head:hover { color: #ccc; }
.ed-grp-chevron { font-size: 9px; transition: transform .25s; }
.ed-grp.open .ed-grp-chevron { transform: rotate(180deg); }
.ed-grp-body { padding: 0 18px 18px; display: none; }
.ed-grp.open .ed-grp-body { display: block; }

/* ── MICRO LABEL ── */
.ed-lbl {
  font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ed-muted); font-family: 'Poppins',sans-serif; margin-bottom: 8px;
}

/* ── PALETTE GRID ── */
.pal-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 7px; margin-bottom: 14px; }
.pal-card {
  border-radius: 7px; overflow: hidden; cursor: pointer;
  border: 2px solid transparent; transition: border-color .2s; aspect-ratio: 2/1; position: relative;
}
.pal-card.on { border-color: var(--ed-gold); }
.pal-card:hover:not(.on) { border-color: rgba(201,168,76,.4); }
.pal-swatches { display: flex; height: 100%; }
.pal-swatches span { flex: 1; }
.pal-name {
  position: absolute; bottom: 0; left: 0; right: 0;
  font-size: 7.5px; text-align: center; padding: 2px 4px;
  background: rgba(0,0,0,.65); color: #fff; letter-spacing: .04em;
  font-family: 'Poppins',sans-serif;
}

/* ── FONT ROWS ── */
.ed-font-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 0; border-bottom: 1px solid rgba(255,255,255,.04);
}
.ed-font-row:last-child { border: none; }
.ed-font-role { font-size: 9.5px; color: var(--ed-muted); text-transform: uppercase; letter-spacing: .1em; font-family: 'Poppins',sans-serif; }
.ed-font-sel {
  background: var(--ed-surface); border: 1px solid var(--ed-border);
  color: #ccc; font-size: 10px; padding: 4px 7px; border-radius: 5px;
  cursor: pointer; outline: none; max-width: 136px; font-family: 'Poppins',sans-serif;
  transition: border-color .2s;
}
.ed-font-sel:focus { border-color: var(--ed-gold); }

/* ── ANIM CHIPS ── */
.ed-chips { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 14px; }
.ed-chip {
  padding: 4px 9px; border-radius: 20px; font-size: 9.5px; letter-spacing: .06em;
  border: 1px solid var(--ed-border); background: transparent;
  color: #777; cursor: pointer; font-family: 'Poppins',sans-serif; transition: all .2s;
}
.ed-chip.on { border-color: var(--ed-gold); color: var(--ed-gold); background: rgba(201,168,76,.08); }
.ed-chip:hover:not(.on) { border-color: #444; color: #bbb; }

/* ── SECTIONS LIST ── */
.ed-sec-list { padding: 10px; }
.ed-sec-item {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 11px; border-radius: 8px; margin-bottom: 5px;
  background: var(--ed-surface); border: 1px solid var(--ed-border);
  cursor: grab; transition: border-color .2s, background .2s;
  user-select: none;
}
.ed-sec-item:hover { border-color: rgba(201,168,76,.3); background: #1c1c1c; }
.ed-sec-item.is-dragging { opacity: .35; cursor: grabbing; }
.ed-sec-item.drop-target { border-color: var(--ed-gold); background: rgba(201,168,76,.06); }
.ed-si-handle { color: #3a3a3a; font-size: 13px; }
.ed-si-icon { font-size: 15px; width: 24px; text-align: center; flex-shrink: 0; }
.ed-si-info { flex: 1; min-width: 0; }
.ed-si-name { font-size: 11px; color: #ccc; font-family: 'Poppins',sans-serif; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ed-si-type { font-size: 9.5px; color: var(--ed-muted); font-family: 'Poppins',sans-serif; }
.ed-si-acts { display: flex; gap: 3px; flex-shrink: 0; }
.ed-si-btn {
  width: 24px; height: 24px; border-radius: 5px; border: 1px solid var(--ed-border);
  background: transparent; color: #555; font-size: 10px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: all .2s;
}
.ed-si-btn:hover { border-color: var(--ed-gold); color: var(--ed-gold); }
.ed-si-btn.danger:hover { border-color: #c0392b; color: #c0392b; }
.ed-add-sec-btn {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  width: 100%; padding: 11px; border-radius: 8px;
  border: 1px dashed rgba(201,168,76,.3); background: transparent;
  color: var(--ed-gold); font-size: 10px; letter-spacing: .1em; text-transform: uppercase;
  cursor: pointer; font-family: 'Poppins',sans-serif;
  transition: background .2s, border-color .2s; margin-top: 6px;
}
.ed-add-sec-btn:hover { background: rgba(201,168,76,.06); border-color: var(--ed-gold); }

/* ── AJUSTES PANEL ── */
.ed-ajuste-group { padding: 18px; border-bottom: 1px solid var(--ed-border); }
.ed-input {
  width: 100%; padding: 8px 10px; border-radius: 7px;
  background: var(--ed-surface); border: 1px solid var(--ed-border);
  color: #ccc; font-size: 12px; font-family: 'Poppins',sans-serif;
  outline: none; transition: border-color .2s; margin-bottom: 10px;
}
.ed-input:focus { border-color: var(--ed-gold); }
.ed-apply-btn {
  width: 100%; padding: 9px; border-radius: 7px; font-size: 10px; letter-spacing: .1em;
  text-transform: uppercase; border: 1px solid rgba(201,168,76,.3);
  background: rgba(201,168,76,.08); color: var(--ed-gold); cursor: pointer;
  font-family: 'Poppins',sans-serif; font-weight: 500; transition: all .2s;
}
.ed-apply-btn:hover { background: var(--ed-gold); color: #000; border-color: var(--ed-gold); }

/* ══ ELEMENT EDIT RING ══ */
body.ed-active [data-ed]:hover {
  outline: 2px dashed rgba(201,168,76,.5) !important;
  outline-offset: 3px;
  border-radius: 3px;
  cursor: text;
}
body.ed-active [data-ed-img]:hover { outline: 2px dashed rgba(74,124,255,.7) !important; outline-offset:3px; cursor: pointer; }
body.ed-active [data-ed-btn]:hover { outline: 2px dashed rgba(46,204,113,.7) !important; outline-offset:3px; cursor: pointer; }
body.ed-active [data-ed-color]:hover { outline: 2px dashed rgba(232,121,160,.7) !important; outline-offset:3px; cursor: pointer; }

/* Image overlay click target */
.ed-img-overlay {
  position: absolute; inset: 0; z-index: 10;
  display: none; align-items: center; justify-content: center;
  background: rgba(0,0,0,.5); backdrop-filter: blur(2px);
  cursor: pointer; transition: opacity .2s;
  border-radius: inherit;
}
body.ed-active .ed-img-overlay { display: flex; opacity: 0; }
body.ed-active *:hover > .ed-img-overlay { opacity: 1; }
.ed-img-overlay-icon {
  background: rgba(0,0,0,.8); border: 1px solid rgba(255,255,255,.2);
  color: #fff; padding: 8px 14px; border-radius: 6px;
  font-size: 11px; font-family: 'Poppins',sans-serif; letter-spacing: .08em;
  pointer-events: none;
}

/* ══ ELEMENT CONTEXT PANEL ══ */
#ed-ctx-panel {
  position: fixed; z-index: 9100;
  background: #111; border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px; width: 240px;
  box-shadow: 0 12px 40px rgba(0,0,0,.8);
  display: none; flex-direction: column; overflow: hidden;
  font-family: 'Poppins',sans-serif;
}
#ed-ctx-panel.show { display: flex; }
.ctx-hd {
  padding: 10px 14px; background: #161616;
  border-bottom: 1px solid rgba(255,255,255,.07);
  display: flex; align-items: center; justify-content: space-between;
}
.ctx-hd-title { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: #888; }
.ctx-hd-close { background:none;border:none;color:#555;cursor:pointer;font-size:14px;line-height:1; }
.ctx-hd-close:hover{color:#fff;}
.ctx-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.ctx-row { display: flex; flex-direction: column; gap: 4px; }
.ctx-lbl { font-size: 9px; letter-spacing: .1em; text-transform: uppercase; color: #666; }
.ctx-inp {
  background: #1a1a1a; border: 1px solid rgba(255,255,255,.1);
  color: #ccc; padding: 7px 9px; border-radius: 6px;
  font-size: 12px; font-family: 'Poppins',sans-serif;
  outline: none; width: 100%; transition: border-color .2s;
}
.ctx-inp:focus { border-color: var(--ed-gold); }
.ctx-color-row { display: flex; gap: 6px; align-items: center; }
.ctx-color-swatch {
  width: 24px; height: 24px; border-radius: 4px; cursor: pointer;
  border: 1px solid rgba(255,255,255,.15); flex-shrink: 0;
  transition: transform .15s;
}
.ctx-color-swatch:hover { transform: scale(1.15); }
.ctx-colors { display: flex; gap: 4px; flex-wrap: wrap; }
.ctx-btn {
  padding: 7px 10px; border-radius: 6px; font-size: 10px; letter-spacing: .08em;
  text-transform: uppercase; border: 1px solid rgba(201,168,76,.3);
  background: rgba(201,168,76,.08); color: var(--ed-gold); cursor: pointer;
  font-family: 'Poppins',sans-serif; transition: all .2s; width: 100%;
}
.ctx-btn:hover { background: var(--ed-gold); color: #000; }
.ctx-btn.secondary { border-color: rgba(255,255,255,.1); background: transparent; color: #888; }
.ctx-btn.secondary:hover { border-color:#555; color:#fff; background: transparent; }

/* ══ IMAGE PICKER MODAL ══ */
#ed-img-picker {
  position: fixed; inset: 0; z-index: 9300;
  background: rgba(0,0,0,.88); backdrop-filter: blur(8px);
  display: none; align-items: center; justify-content: center;
}
#ed-img-picker.show { display: flex; }
.img-picker-box {
  background: #111; border: 1px solid rgba(255,255,255,.1);
  border-radius: 16px; width: min(720px,92vw); max-height: 80vh;
  display: flex; flex-direction: column; overflow: hidden;
}
.img-picker-hd {
  padding: 18px 22px 14px; border-bottom: 1px solid rgba(255,255,255,.06);
  display: flex; align-items: center; justify-content: space-between; flex-shrink: 0;
}
.img-picker-title { font-family: 'Bebas Neue',sans-serif; font-size: 22px; color: #fff; letter-spacing: .04em; }
.img-picker-tabs { display: flex; gap: 0; border: 1px solid rgba(255,255,255,.08); border-radius: 7px; overflow: hidden; margin: 0 22px 14px; flex-shrink: 0; }
.img-picker-tab {
  flex:1; padding:8px; background:transparent; border:none; color:#666;
  font-size:11px; cursor:pointer; font-family:'Poppins',sans-serif; transition: all .2s;
}
.img-picker-tab.on { background: rgba(201,168,76,.12); color: var(--ed-gold); }
.img-picker-body { flex:1; overflow-y:auto; padding: 0 22px 22px; }
.img-picker-upload {
  border: 2px dashed rgba(255,255,255,.12); border-radius: 12px;
  padding: 32px; text-align: center; cursor: pointer; transition: border-color .2s;
  margin-bottom: 16px;
}
.img-picker-upload:hover { border-color: var(--ed-gold); }
.img-picker-upload input { display: none; }
.img-picker-upload-icon { font-size: 36px; margin-bottom: 8px; }
.img-picker-upload-text { font-size: 13px; color: #666; font-family:'Poppins',sans-serif; }
.img-picker-url-row { display: flex; gap: 8px; margin-bottom: 16px; }
.img-picker-url-inp {
  flex:1; background:#1a1a1a; border:1px solid rgba(255,255,255,.1);
  color:#ccc; padding:9px 12px; border-radius:7px; font-size:12px;
  font-family:'Poppins',sans-serif; outline:none;
}
.img-picker-url-inp:focus { border-color:var(--ed-gold); }
.img-picker-url-btn {
  padding:9px 16px; background:var(--ed-gold); color:#000; border:none;
  border-radius:7px; font-size:11px; font-weight:700; cursor:pointer;
  font-family:'Poppins',sans-serif; letter-spacing:.06em;
}
.img-picker-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; }
.img-picker-thumb {
  aspect-ratio:4/3; border-radius:8px; overflow:hidden; cursor:pointer;
  border:2px solid transparent; transition: border-color .15s, transform .15s;
}
.img-picker-thumb:hover { border-color:var(--ed-gold); transform:scale(1.03); }
.img-picker-thumb.selected { border-color:var(--ed-gold); }
.img-picker-thumb img { width:100%;height:100%;object-fit:cover; }
.img-picker-footer {
  padding: 14px 22px; border-top: 1px solid rgba(255,255,255,.06);
  display: flex; gap: 8px; flex-shrink: 0;
}
.img-picker-apply {
  flex:1; padding:10px; background:var(--ed-gold); color:#000; border:none;
  border-radius:7px; font-size:11px; font-weight:700; cursor:pointer;
  font-family:'Poppins',sans-serif; letter-spacing:.08em; text-transform:uppercase;
}
.img-picker-cancel {
  padding:10px 18px; background:transparent; border:1px solid rgba(255,255,255,.1);
  color:#777; border-radius:7px; font-size:11px; cursor:pointer;
  font-family:'Poppins',sans-serif;
}

/* ══ GLOBAL DESIGN PANEL ══ */
#ed-design-panel {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 8200;
  width: 300px; background: #0c0c0c; border-left: 1px solid rgba(255,255,255,.07);
  display: none; flex-direction: column;
  box-shadow: -4px 0 24px rgba(0,0,0,.6);
  font-family: 'Poppins',sans-serif;
  transition: transform .3s cubic-bezier(.4,0,.2,1);
}
#ed-design-panel.show { display: flex; }
.dp-hd {
  padding: 18px 20px 14px; border-bottom: 1px solid rgba(255,255,255,.07);
  display: flex; align-items: center; justify-content: space-between; flex-shrink: 0;
}
.dp-title { font-family: 'Bebas Neue',sans-serif; font-size: 20px; color: #fff; letter-spacing: .04em; }
.dp-close { background:none;border:1px solid rgba(255,255,255,.1);color:#666;cursor:pointer;width:28px;height:28px;border-radius:50%;font-size:13px;display:flex;align-items:center;justify-content:center;transition:all .2s; }
.dp-close:hover{border-color:var(--ed-gold);color:var(--ed-gold);}
.dp-body { flex:1; overflow-y:auto; scrollbar-width:thin; scrollbar-color:#222 transparent; }
.dp-section { padding:16px 20px; border-bottom:1px solid rgba(255,255,255,.06); }
.dp-section-title { font-size:9px; letter-spacing:.18em; text-transform:uppercase; color:#555; margin-bottom:14px; }
.dp-row { display:flex; flex-direction:column; gap:5px; margin-bottom:12px; }
.dp-lbl { font-size:9px; letter-spacing:.1em; text-transform:uppercase; color:#555; }
.dp-inp {
  background:#161616; border:1px solid rgba(255,255,255,.08);
  color:#ccc; padding:7px 10px; border-radius:6px; font-size:12px;
  font-family:'Poppins',sans-serif; outline:none; width:100%;
  transition: border-color .2s;
}
.dp-inp:focus{border-color:var(--ed-gold);}
.dp-select {
  background:#161616; border:1px solid rgba(255,255,255,.08);
  color:#ccc; padding:7px 10px; border-radius:6px; font-size:12px;
  font-family:'Poppins',sans-serif; outline:none; width:100%; cursor:pointer;
}
.dp-color-grid { display:grid; grid-template-columns:repeat(5,1fr); gap:6px; margin-bottom:8px; }
.dp-swatch {
  aspect-ratio:1; border-radius:5px; cursor:pointer;
  border:2px solid transparent; transition:all .15s;
}
.dp-swatch.on { border-color:var(--ed-gold); transform:scale(1.1); }
.dp-swatch:hover:not(.on) { border-color:rgba(255,255,255,.3); }
.dp-palette-grid { display:grid; grid-template-columns:1fr 1fr; gap:7px; margin-bottom:12px; }
.dp-pal {
  border-radius:8px; overflow:hidden; cursor:pointer;
  border:2px solid transparent; transition:border-color .2s;
  height:44px; position:relative;
}
.dp-pal.on{border-color:var(--ed-gold);}
.dp-pal:hover:not(.on){border-color:rgba(201,168,76,.4);}
.dp-pal-swatches{display:flex;height:100%;}
.dp-pal-swatches span{flex:1;}
.dp-pal-name{position:absolute;bottom:0;left:0;right:0;font-size:7px;text-align:center;padding:2px;background:rgba(0,0,0,.7);color:#fff;letter-spacing:.04em;}
.dp-slider { width:100%; accent-color:var(--ed-gold); cursor:pointer; }
.dp-apply { width:100%; padding:9px; border-radius:7px; font-size:10px; letter-spacing:.1em; text-transform:uppercase; border:1px solid rgba(201,168,76,.3); background:rgba(201,168,76,.08); color:var(--ed-gold); cursor:pointer; font-family:'Poppins',sans-serif; font-weight:500; transition:all .2s; }
.dp-apply:hover{background:var(--ed-gold);color:#000;}

/* Design panel toggle FAB */
#ed-design-fab {
  position: fixed; bottom: 88px; right: 28px; z-index: 8150;
  width: 44px; height: 44px; border-radius: 50%;
  background: #1a1a1a; border: 1px solid rgba(201,168,76,.4);
  color: var(--ed-gold); cursor: pointer; font-size: 18px;
  display: none; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,.5);
  transition: all .2s;
}
#ed-design-fab:hover { background: rgba(201,168,76,.12); border-color: var(--ed-gold); }
#ed-design-fab.show { display: flex; }
body.dp-open { padding-right: 300px; }
body.dp-open nav { right: 300px; }

/* ── SECTION FLOATING BAR ── */
.ed-sec-bar {
  position: absolute; top: 10px; right: 14px; z-index: 500;
  display: flex; gap: 5px;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
body.ed-active section:hover > .ed-sec-bar,
.ed-sec-bar.pinned { opacity: 1; pointer-events: all; }
.ed-sec-btn {
  display: flex; align-items: center; gap: 5px; padding: 5px 11px;
  border-radius: 5px; background: rgba(10,10,10,.93); backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.12); color: #ddd;
  font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase;
  cursor: pointer; font-family: 'Poppins',sans-serif; font-weight: 500;
  transition: all .2s; white-space: nowrap;
}
.ed-sec-btn:hover { border-color: var(--ed-gold); color: var(--ed-gold); }

/* ── POPOVERS ── */
.ed-pop {
  position: absolute; top: 44px; right: 14px; z-index: 600;
  background: #111; border: 1px solid rgba(255,255,255,.1);
  border-radius: 11px; width: 252px;
  box-shadow: 0 8px 32px rgba(0,0,0,.7);
  display: none;
}
.ed-pop.show { display: block; }
.ed-pop-hd {
  padding: 13px 16px; border-bottom: 1px solid var(--ed-border);
  font-size: 10px; letter-spacing: .15em; text-transform: uppercase;
  color: #888; font-family: 'Poppins',sans-serif;
}
.ed-pop-bd { padding: 14px 16px; }

/* Pop chips */
.pop-chips { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 13px; }
.pop-chip {
  padding: 4px 9px; border-radius: 5px; font-size: 10px;
  border: 1px solid var(--ed-border); background: transparent;
  color: #777; cursor: pointer; font-family: 'Poppins',sans-serif; transition: all .2s;
}
.pop-chip.on { border-color: var(--ed-gold); color: var(--ed-gold); background: rgba(201,168,76,.08); }
.pop-chip:hover:not(.on) { border-color: #444; color: #ccc; }

/* Align buttons */
.pop-align { display: flex; gap: 5px; margin-bottom: 13px; }
.pop-align-btn {
  flex: 1; padding: 7px; border-radius: 5px; text-align: center; font-size: 13px;
  border: 1px solid var(--ed-border); background: transparent; cursor: pointer;
  transition: all .2s; color: #777;
}
.pop-align-btn.on { border-color: var(--ed-gold); background: rgba(201,168,76,.08); }

/* Toggle */
.pop-tog-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 13px; }
.pop-tog-lbl { font-size: 11px; color: #ccc; font-family: 'Poppins',sans-serif; }
.pop-tog {
  width: 34px; height: 19px; border-radius: 10px; background: #2a2a2a;
  position: relative; cursor: pointer; border: none; transition: background .2s;
}
.pop-tog.on { background: var(--ed-gold); }
.pop-tog::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 13px; height: 13px; border-radius: 50%; background: #fff;
  transition: left .2s;
}
.pop-tog.on::after { left: 18px; }
.pop-reset-btn {
  width: 100%; padding: 7px; border-radius: 5px; font-size: 9.5px; letter-spacing: .1em;
  text-transform: uppercase; border: 1px solid var(--ed-border);
  background: transparent; color: #555; cursor: pointer;
  font-family: 'Poppins',sans-serif; transition: all .2s;
}
.pop-reset-btn:hover { border-color: #555; color: #aaa; }

/* BG popover */
.bg-tabs { display: flex; border-bottom: 1px solid var(--ed-border); }
.bg-tab-btn {
  flex: 1; padding: 9px 3px; font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase;
  color: #555; background: none; border: none; border-bottom: 2px solid transparent;
  cursor: pointer; font-family: 'Poppins',sans-serif; transition: all .2s;
}
.bg-tab-btn.on { color: var(--ed-gold); border-bottom-color: var(--ed-gold); }
.bg-tc { padding: 14px 16px; display: none; }
.bg-tc.on { display: block; }
.sw-grid { display: grid; grid-template-columns: repeat(5,1fr); gap: 5px; margin-bottom: 10px; }
.sw-item {
  aspect-ratio: 1; border-radius: 5px; cursor: pointer;
  border: 2px solid transparent; transition: border-color .2s; position: relative;
}
.sw-item.on { border-color: var(--ed-gold); }
.sw-item.on::after { content: '✓'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 10px; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.sw-item:hover { border-color: rgba(255,255,255,.35); }
.img-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 5px; margin-bottom: 10px; }
.img-thumb {
  aspect-ratio: 16/9; border-radius: 5px; overflow: hidden; cursor: pointer;
  border: 2px solid transparent; transition: border-color .2s;
}
.img-thumb.on { border-color: var(--ed-gold); }
.img-thumb img { width: 100%; height: 100%; object-fit: cover; }
.op-row { display: flex; gap: 5px; margin-bottom: 10px; }
.op-btn {
  flex: 1; padding: 5px; border-radius: 5px; font-size: 11px; text-align: center;
  border: 1px solid var(--ed-border); background: transparent; cursor: pointer; transition: all .2s;
}
.op-btn.on { border-color: var(--ed-gold); background: rgba(201,168,76,.08); }
.bg-footer { display: flex; gap: 6px; padding: 8px 16px 14px; border-top: 1px solid var(--ed-border); }
.bg-f-btn {
  flex: 1; padding: 6px; border-radius: 5px; font-size: 9.5px; letter-spacing: .08em;
  text-transform: uppercase; cursor: pointer; font-family: 'Poppins',sans-serif;
  border: 1px solid var(--ed-border); background: transparent; color: #777; transition: all .2s;
}
.bg-f-btn:hover { border-color: #555; color: #ccc; }
.bg-f-btn.save { border-color: rgba(201,168,76,.4); color: var(--ed-gold); }
.bg-f-btn.save:hover { background: var(--ed-gold); color: #000; }

/* ── ADD SECTION MODAL ── */
#ed-add-modal {
  position: fixed; inset: 0; z-index: 9200;
  background: rgba(0,0,0,.88); backdrop-filter: blur(10px);
  display: none; align-items: center; justify-content: center;
}
#ed-add-modal.show { display: flex; }
.ed-add-box {
  background: #111; border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px; width: min(700px, 95vw); max-height: 80vh;
  display: flex; flex-direction: column; overflow: hidden;
}
.ed-add-hd {
  padding: 22px 26px 14px; border-bottom: 1px solid var(--ed-border);
  display: flex; align-items: center; justify-content: space-between; flex-shrink: 0;
}
.ed-add-title { font-family: 'Bebas Neue',sans-serif; font-size: 26px; color: #fff; }
.ed-add-close {
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid rgba(255,255,255,.12);
  background: none; color: #777; cursor: pointer; font-size: 15px;
  display: flex; align-items: center; justify-content: center; transition: all .2s;
}
.ed-add-close:hover { border-color: var(--ed-gold); color: var(--ed-gold); }
.ed-add-cats { display: flex; gap: 5px; padding: 12px 26px; flex-wrap: wrap; flex-shrink: 0; border-bottom: 1px solid rgba(255,255,255,.04); }
.ed-cat-pill {
  padding: 4px 11px; border-radius: 20px; font-size: 9.5px; letter-spacing: .08em;
  text-transform: uppercase; border: 1px solid var(--ed-border);
  background: transparent; color: #666; cursor: pointer; font-family: 'Poppins',sans-serif;
  transition: all .2s;
}
.ed-cat-pill.on { border-color: var(--ed-gold); color: var(--ed-gold); background: rgba(201,168,76,.08); }
.ed-blocks-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; padding: 18px 26px; overflow-y: auto; }
.ed-block-card {
  border: 1px solid var(--ed-border); border-radius: 9px;
  background: var(--ed-surface); cursor: pointer; overflow: hidden;
  transition: border-color .2s, transform .15s;
}
.ed-block-card:hover { border-color: var(--ed-gold); transform: translateY(-2px); }
.ed-block-prev {
  height: 120px; overflow: hidden; position: relative; cursor: pointer;
  background: #0d0d0d; border-bottom: 1px solid rgba(255,255,255,.06);
  display: flex; align-items: stretch;
}
.ed-block-prev svg {
  width: 100%; height: 100%; display: block; flex-shrink: 0;
}
.ed-block-card:hover .ed-block-prev { filter: brightness(1.08); }
.ed-block-card.has-preview:hover .ed-block-expand {
  opacity: 1;
}
.ed-block-expand {
  position: absolute; inset: 0; z-index: 3;
  background: rgba(0,0,0,.6); opacity: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: #fff; letter-spacing: .08em;
  font-family: "Poppins",sans-serif; transition: opacity .2s;
  pointer-events: none;
}
.ed-block-card.has-preview:hover .ed-block-expand { pointer-events: all; }
.ed-block-info { padding: 9px 11px; }
.ed-block-name { font-size: 10.5px; color: #ccc; font-family: 'Poppins',sans-serif; font-weight: 500; }
.ed-block-cat { font-size: 8.5px; color: #555; font-family: 'Poppins',sans-serif; text-transform: uppercase; letter-spacing: .1em; margin-top: 2px; }
.ed-new-badge { display: inline-block; font-size: 7.5px; background: var(--ed-gold); color: #000; padding: 1px 5px; border-radius: 3px; margin-left: 4px; vertical-align: middle; font-weight: 700; }

/* ── TEMPLATE LIGHTBOX ── */
#tpl-lightbox {
  display: none; position: fixed; inset: 0; z-index: 9900;
  background: rgba(0,0,0,.92); backdrop-filter: blur(12px);
  align-items: center; justify-content: center; flex-direction: column; gap: 16px;
}
#tpl-lightbox.show { display: flex; }
#tpl-lightbox-inner {
  background: #111; border: 1px solid rgba(255,255,255,.1);
  border-radius: 16px; overflow: hidden;
  width: min(900px,90vw); height: min(540px,80vh);
  position: relative;
}
#tpl-lightbox-inner iframe {
  width: 100%; height: 100%; border: none;
}
#tpl-lightbox-title {
  font-family: 'Bebas Neue',sans-serif; font-size: 22px; color: #fff; letter-spacing: .06em;
}
#tpl-lightbox-actions { display: flex; gap: 10px; align-items: center; }
.tpl-lb-close {
  position: absolute; top: 12px; right: 12px; z-index: 10;
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(0,0,0,.7); border: 1px solid rgba(255,255,255,.2);
  color: #fff; font-size: 14px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.tpl-lb-close:hover { border-color: #c9a84c; color: #c9a84c; }
.tpl-lb-add {
  background: #c9a84c; color: #000; border: none;
  padding: 10px 26px; border-radius: 7px;
  font-family: 'Poppins',sans-serif; font-size: 12px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase; cursor: pointer;
  transition: background .2s;
}
.tpl-lb-add:hover { background: #e8c96a; }

/* ── INLINE EDITABLE ── */
body.ed-active [data-ed] {
  cursor: text; outline: 1px dashed transparent; border-radius: 3px; transition: outline-color .15s;
}
body.ed-active [data-ed]:hover { outline-color: rgba(201,168,76,.4); }
body.ed-active [data-ed]:focus { outline: 2px solid var(--ed-gold); outline-offset: 2px; }

/* Section hover border */
body.ed-active section { position: relative; }
body.ed-active section::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 90;
  border: 2px solid transparent; transition: border-color .2s;
}
body.ed-active section:hover::before { border-color: rgba(201,168,76,.18); }

/* ── TOAST ── */
#ed-toast {
  position: fixed; bottom: 88px; left: 50%; transform: translateX(-50%) translateY(10px);
  background: #1a1a1a; border: 1px solid rgba(201,168,76,.3); color: var(--ed-gold);
  padding: 8px 20px; border-radius: 7px; font-size: 11px; letter-spacing: .1em;
  text-transform: uppercase; font-family: 'Poppins',sans-serif; z-index: 9600;
  opacity: 0; transition: all .3s; pointer-events: none; white-space: nowrap;
}
#ed-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── SITE ADJUSTMENT when editor open ── */
body.ed-active { padding-left: var(--ed-sidebar-w); }
body.ed-active nav { left: var(--ed-sidebar-w); }
body.ed-active .admin-panel { left: var(--ed-sidebar-w); }
