/* ══ Canva-style editor: bbox overlay, hover outline, snap guides ══ */

/* Bounding-box overlay — SVG absolute on top of .sbox.
   pointer-events: none on the root so hover/click on the canvas keeps working;
   handles re-enable pointer-events individually. */
#bbox-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 9000;
  display: none;
  overflow: visible;
}
#bbox-overlay.is-active { display: block; }
#bbox-overlay rect.bbox-frame {
  /* `transparent` (not `none`) so the interior of the rect is "painted" with
     fully transparent pixels — SVG default `pointer-events: visiblePainted`
     then catches mousedown anywhere inside the bbox, not just on the stroke. */
  fill: transparent;
  stroke: var(--n-primary, #0170b9);
  stroke-width: 1.5;
  pointer-events: auto;
  cursor: move;
  shape-rendering: crispEdges;
}
#bbox-overlay rect.bbox-handle {
  fill: #fff;
  stroke: var(--n-primary, #0170b9);
  stroke-width: 1.5;
  pointer-events: auto;
  shape-rendering: crispEdges;
}
#bbox-overlay rect.bbox-handle[data-handle="nw"],
#bbox-overlay rect.bbox-handle[data-handle="se"] { cursor: nwse-resize; }
#bbox-overlay rect.bbox-handle[data-handle="ne"],
#bbox-overlay rect.bbox-handle[data-handle="sw"] { cursor: nesw-resize; }
#bbox-overlay rect.bbox-handle[data-handle="n"],
#bbox-overlay rect.bbox-handle[data-handle="s"] { cursor: ns-resize; }
#bbox-overlay rect.bbox-handle[data-handle="e"],
#bbox-overlay rect.bbox-handle[data-handle="w"] { cursor: ew-resize; }
#bbox-overlay circle.bbox-rotate {
  fill: #fff;
  stroke: var(--n-primary, #0170b9);
  stroke-width: 1.5;
  pointer-events: auto;
  cursor: grab;
}
#bbox-overlay circle.bbox-rotate:active { cursor: grabbing; }

/* Hover outline — dashed rectangle that follows the cursor.
   Hidden by default; canvas-events.js positions and shows on mousemove. */
#hover-outline {
  position: absolute;
  pointer-events: none;
  z-index: 8500;
  border: 1.5px dashed rgba(1, 112, 185, 0.6);
  box-sizing: border-box;
  display: none;
  border-radius: 1px;
}
#hover-outline.is-visible { display: block; }

/* Snap guides — placeholder for Sesión 5; declared now so export.js can hide it. */
#snap-guides {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 9100;
  display: none;
}

/* Canvas topbar — contextual toolbar pinned ~20 px under the 1:1 / 9:16
   format toggle (.fmt-float lives at top:72px inside .prev). Hidden by
   default; topbar.js sets display:flex when there's a single-layer
   selection of a supported type (text/bullets in this iteration). Floats
   above the canvas — same containing block as .fmt-float / .zoom-bar so
   pan/zoom of the canvas doesn't move it. */
.canvas-topbar {
  position: absolute;
  top: 78px;              /* 10 (.fmt-float top) + ~46 (its height) + 22 (gap) */
  left: 50%;
  transform: translateX(-50%);
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: var(--n-bg);
  border: 1px solid var(--n-border);
  border-radius: var(--n-radius);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  max-width: calc(100% - 32px);
  /* Canva-style: everything on one row. If the topbar would overflow the
     viewport the chrome scrolls horizontally inside its container instead
     of wrapping to a second line. */
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: visible;
  scrollbar-width: thin;
  z-index: 65;
  transition: opacity .15s ease, transform .2s ease, top .2s ease;
}
/* When the canvas grows/pans into the .fmt-float (which gets .hidden-by-canvas),
   the now-hidden toggle frees its slot — slide the topbar up to occupy it.
   .canvas-topbar is inserted by topbar.js immediately after .fmt-float, so the
   adjacent-sibling selector below works without extra JS. */
.fmt-float.hidden-by-canvas + .canvas-topbar { top: 10px; }
.canvas-topbar::-webkit-scrollbar { height: 4px; }
.canvas-topbar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.18); border-radius: 2px; }
.canvas-topbar > * { flex-shrink: 0; }
.canvas-topbar .tb-group { display: inline-flex; align-items: center; gap: 4px; }
/* Font name chip — read-only display of the selected layer's font.family.
   Editable picker comes in Phase 2.2 (font-picker.js). For now it's a visual
   hint so the user can confirm Brand Kit/Inter was applied correctly. */
.canvas-topbar .tb-font-chip {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  color: var(--n-text, #e6e8ee);
  font-size: 12px;
  font-weight: 500;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.canvas-topbar .tb-sep {
  width: 1px;
  height: 18px;
  background: var(--n-border, rgba(255, 255, 255, 0.1));
  margin: 0 2px;
}
.canvas-topbar .tb-input {
  background: var(--n-bg-input, rgba(0, 0, 0, 0.3));
  border: 1px solid var(--n-border, rgba(255, 255, 255, 0.1));
  color: var(--n-text, #fff);
  font-size: 12px;
  padding: 4px 6px;
  border-radius: 3px;
  text-align: center;
}
.canvas-topbar .tb-size-num,
.canvas-topbar .tb-opacity-num { width: 48px; }
.canvas-topbar .tb-range {
  -webkit-appearance: none;
  appearance: none;
  width: 96px;
  height: 4px;
  background: var(--n-bg-input, rgba(0, 0, 0, 0.3));
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
.canvas-topbar .tb-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--n-primary, #0170b9);
  cursor: grab;
  border: 2px solid var(--n-bg, #0e1322);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}
.canvas-topbar .tb-range::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--n-primary, #0170b9);
  cursor: grab;
  border: 2px solid var(--n-bg, #0e1322);
}
.canvas-topbar .tb-range:active::-webkit-slider-thumb { cursor: grabbing; }
.canvas-topbar .tb-unit { font-size: 11px; color: var(--n-text-muted, #888); margin-left: 2px; }
.canvas-topbar .tb-btn {
  background: var(--n-bg-input, rgba(0, 0, 0, 0.3));
  border: 1px solid var(--n-border, rgba(255, 255, 255, 0.1));
  color: var(--n-text, #fff);
  padding: 4px 8px;
  border-radius: 3px;
  font-size: 13px;
  min-width: 32px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.canvas-topbar .tb-btn:hover { background: rgba(255, 255, 255, 0.08); }
.canvas-topbar .tb-btn.active {
  background: var(--n-primary, #0170b9);
  color: #fff;
  border-color: var(--n-primary, #0170b9);
}
.canvas-topbar .tb-btn b, .canvas-topbar .tb-btn i { font-size: 13px; }
.canvas-topbar .tb-color-chip {
  position: relative;
  width: 28px;
  height: 22px;
  display: inline-block;
  cursor: pointer;
}
.canvas-topbar .tb-color-chip input[type="color"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.canvas-topbar .tb-color-swatch {
  display: block;
  width: 100%;
  height: 100%;
  border: 1px solid var(--n-border, rgba(255, 255, 255, 0.15));
  border-radius: 3px;
}
.canvas-topbar .tb-label {
  font-size: 12px;
  color: var(--n-text-muted, #888);
  padding: 0 4px;
}

/* ── Topbar chip (Hito 1 foundation, used by Hito 2+ for Font/Color/Position).
   A chip is a clickable Canva-style button that opens a sub-panel. When the
   chip's sub-panel is open the chip stays highlighted so the user can tell
   which control is "owning" the panel. */
.canvas-topbar .tb-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: var(--n-text, #e6e8ee);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}
.canvas-topbar .tb-chip:hover { background: rgba(255, 255, 255, 0.12); }
.canvas-topbar .tb-chip.is-active {
  background: rgba(123, 97, 255, 0.18);
  border-color: rgba(123, 97, 255, 0.6);
  color: #fff;
}
.canvas-topbar .tb-chip .tb-chip-caret {
  opacity: 0.6;
  display: inline-flex;
}

/* Font chip (Hito 2) — shows the active font name in its own typography. */
.canvas-topbar .tb-chip-font {
  max-width: 160px;
}
.canvas-topbar .tb-chip-font > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Color chip (Hito 2 — Canva style "A" with coloured underline bar).
   For Hito 2 the chip wraps a native <input type="color"> as fallback;
   Hito 3 will swap to opening the Color sub-panel. */
.canvas-topbar .tb-chip-color {
  position: relative;
  width: 36px;
  padding: 0;
  height: 28px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
}
.canvas-topbar .tb-chip-color > span:nth-child(2) {
  line-height: 1;
}
.canvas-topbar .tb-chip-color-bar {
  display: block;
  width: 18px;
  height: 4px;
  border-radius: 1px;
}
.canvas-topbar .tb-chip-color-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

/* Size step buttons (− / +) — discrete adjustments. Match Canva: pill grouped
   around a centered number input, ~−/+ buttons on the sides. */
.canvas-topbar .tb-size-group {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 0 2px;
  gap: 0;
}
.canvas-topbar .tb-size-step {
  background: transparent;
  border: none;
  min-width: 22px;
  height: 24px;
  padding: 0 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--n-text, #e6e8ee);
}
.canvas-topbar .tb-size-step:hover { background: rgba(255, 255, 255, 0.08); border-radius: 4px; }
.canvas-topbar .tb-size-group .tb-size-num {
  background: transparent;
  border: none;
  width: 52px;
  padding: 2px;
  text-align: center;
  -moz-appearance: textfield;
}
.canvas-topbar .tb-size-group .tb-size-num::-webkit-outer-spin-button,
.canvas-topbar .tb-size-group .tb-size-num::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Position chip — text-only, Canva-style trailing right side of TEXT topbar. */
.canvas-topbar .tb-chip-position { font-weight: 500; }

/* Opacity trigger — Canva-style icon button, opens .tb-opacity-popover. */
.canvas-topbar .tb-opacity-trigger {
  padding: 4px;
  min-width: 30px;
}

/* Opacity popover — Canva "Transparencia" widget. Floats below the trigger.
   Slider + numeric value side-by-side, matching Canva visual treatment. */
.tb-opacity-popover {
  position: fixed;
  z-index: 70;
  width: 260px;
  padding: 12px 14px;
  background: var(--n-panel, #1f242c);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  color: var(--n-text, #e6e8ee);
  user-select: none;
}
.tb-opacity-popover-head { margin-bottom: 8px; }
.tb-opacity-popover-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--n-text, #e6e8ee);
}
.tb-opacity-popover-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.tb-opacity-popover-range {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
.tb-opacity-popover-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--n-primary, #7b61ff);
  cursor: grab;
  border: 2px solid var(--n-panel, #1f242c);
}
.tb-opacity-popover-range::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--n-primary, #7b61ff);
  cursor: grab;
  border: 2px solid var(--n-panel, #1f242c);
}
.tb-opacity-popover-num {
  width: 44px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  color: var(--n-text, #e6e8ee);
  font-size: 13px;
  padding: 4px 6px;
  text-align: center;
  -moz-appearance: textfield;
}
.tb-opacity-popover-num::-webkit-outer-spin-button,
.tb-opacity-popover-num::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Flip menu — dropdown anchored under the Girar button. Two items with
   icons; .is-active marks the axes currently flipped. */
.tb-flip-menu {
  position: fixed;
  z-index: 70;
  min-width: 220px;
  padding: 4px;
  background: var(--n-panel, #1f242c);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  color: var(--n-text, #e6e8ee);
  user-select: none;
}
.tb-flip-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  background: transparent;
  border: none;
  border-radius: 5px;
  color: var(--n-text, #e6e8ee);
  font-size: 13px;
  cursor: pointer;
  text-align: left;
}
.tb-flip-item:hover { background: rgba(255, 255, 255, 0.08); }
.tb-flip-item.is-active {
  background: rgba(123, 97, 255, 0.18);
  color: #fff;
}

/* Quitafondos / Crop / button with text + icon. Inline label, slightly wider. */
.canvas-topbar .tb-btn-text {
  padding: 4px 10px;
  font-size: 12px;
}

/* Crop popover (Hito 3a MVP) — 4 sliders + reset. Wider than the opacity
   popover to fit labels comfortably. */
.tb-crop-popover {
  width: 300px;
  padding: 12px 14px;
}
.tb-crop-popover .tb-opacity-popover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.tb-crop-reset {
  background: transparent;
  border: none;
  color: var(--n-primary, #7b61ff);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}
.tb-crop-reset:hover { text-decoration: underline; }
.tb-crop-row {
  display: grid;
  grid-template-columns: 64px 1fr 44px;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}
.tb-crop-label {
  font-size: 11px;
  color: var(--n-text-muted, #aaa);
}
.tb-crop-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
.tb-crop-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--n-primary, #7b61ff);
  cursor: grab;
  border: 2px solid var(--n-panel, #1f242c);
}
.tb-crop-range::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--n-primary, #7b61ff);
  cursor: grab;
  border: 2px solid var(--n-panel, #1f242c);
}
.tb-crop-num {
  width: 44px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  color: var(--n-text, #e6e8ee);
  font-size: 13px;
  padding: 4px 6px;
  text-align: center;
  -moz-appearance: textfield;
}
.tb-crop-num::-webkit-outer-spin-button,
.tb-crop-num::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* ── Image crop mode (Hito 3 v2 — Canva-style visual crop with sub-panel).
   Activated by body.vg-cropping. Hides the normal bbox-overlay and floating
   actions while the user is shaping the crop region. */
body.vg-cropping #bbox-overlay,
body.vg-cropping .floating-actions { display: none !important; }

.image-crop-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 30;
}
.image-crop-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}
.image-crop-svg .crop-dim {
  fill: rgba(0, 0, 0, 0.55);
  pointer-events: none;
}
.image-crop-svg .crop-frame {
  fill: none;
  stroke: var(--n-primary, #7b61ff);
  stroke-width: 2;
  pointer-events: none;
}
.image-crop-svg .crop-handle {
  fill: #fff;
  stroke: var(--n-primary, #7b61ff);
  stroke-width: 2;
  cursor: nwse-resize;
  pointer-events: auto;
}
.image-crop-svg .crop-handle[data-pos="n"],
.image-crop-svg .crop-handle[data-pos="s"] { cursor: ns-resize; }
.image-crop-svg .crop-handle[data-pos="w"],
.image-crop-svg .crop-handle[data-pos="e"] { cursor: ew-resize; }
.image-crop-svg .crop-handle[data-pos="ne"],
.image-crop-svg .crop-handle[data-pos="sw"] { cursor: nesw-resize; }

/* ── Crop sub-panel ── */
.crop-body { display: flex; flex-direction: column; gap: 14px; padding: 0 4px; }
.crop-section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--n-text-muted, #888);
  padding: 0 4px;
  margin-top: 4px;
}
.crop-aspect-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.crop-aspect-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 8px 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: var(--n-text, #e6e8ee);
  cursor: pointer;
  transition: background .12s ease, border-color .12s ease;
}
.crop-aspect-btn:hover { background: rgba(255, 255, 255, 0.08); }
.crop-aspect-btn.is-active {
  background: rgba(123, 97, 255, 0.18);
  border-color: rgba(123, 97, 255, 0.6);
}
.crop-aspect-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  color: var(--n-text, #e6e8ee);
}
.crop-aspect-label {
  font-size: 11px;
  color: var(--n-text-muted, #aaa);
}
.crop-aspect-btn.is-active .crop-aspect-label { color: #fff; }

.crop-rotate-row {
  display: grid;
  grid-template-columns: 1fr auto 56px;
  align-items: center;
  gap: 8px;
}
.crop-rotate-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
.crop-rotate-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--n-primary, #7b61ff);
  cursor: grab;
  border: 2px solid var(--n-panel, #1f242c);
}
.crop-rotate-range::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--n-primary, #7b61ff);
  cursor: grab;
  border: 2px solid var(--n-panel, #1f242c);
}
.crop-rotate-reset {
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 5px;
  color: var(--n-text, #e6e8ee);
  font-size: 12px;
  cursor: pointer;
}
.crop-rotate-reset:hover { background: rgba(255, 255, 255, 0.12); }
.crop-rotate-num {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 5px;
  color: var(--n-text, #e6e8ee);
  font-size: 13px;
  padding: 4px 6px;
  text-align: center;
  -moz-appearance: textfield;
}
.crop-rotate-num::-webkit-outer-spin-button,
.crop-rotate-num::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.crop-footer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 8px;
}
.crop-btn-cancel,
.crop-btn-done {
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.crop-btn-cancel {
  background: rgba(255, 255, 255, 0.04);
  color: var(--n-text, #e6e8ee);
}
.crop-btn-cancel:hover { background: rgba(255, 255, 255, 0.1); }
.crop-btn-done {
  background: var(--n-primary, #7b61ff);
  color: #fff;
  border-color: var(--n-primary, #7b61ff);
}
.crop-btn-done:hover { background: #6a52e6; }

/* ── Weight popover (Hito 3 extension) — dropdown listing the weights
   available for the current font. Active weight highlighted + checkmark. */
.tb-weight-popover {
  position: fixed;
  z-index: 71;
  min-width: 180px;
  max-height: 360px;
  overflow-y: auto;
  padding: 4px;
  background: var(--n-panel, #1f242c);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  color: var(--n-text, #e6e8ee);
  user-select: none;
}
.tb-weight-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 12px;
  background: transparent;
  border: none;
  border-radius: 5px;
  color: var(--n-text, #e6e8ee);
  font-size: 14px;
  cursor: pointer;
  text-align: left;
}
.tb-weight-item:hover { background: rgba(255, 255, 255, 0.08); }
.tb-weight-item.is-active {
  background: rgba(123, 97, 255, 0.18);
  color: #fff;
}
.tb-weight-check { color: #b9a8ff; font-size: 13px; }

/* ── Bullet style chip + popover (F2.4) — reuses .tb-weight-popover/item. */
.tb-chip-bullet { gap: 4px; }
.tb-chip-bullet .tb-bullet-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
}
.tb-bullet-item { gap: 10px; }
.tb-bullet-item-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--n-text, #e6e8ee);
}
.tb-bullet-item-label { flex: 1; }
.tb-bullet-item.is-active .tb-bullet-item-ico { color: #fff; }

/* ── Shadow popover (Hito 3 extension) — toggle + sliders + color picker. */
.tb-shadow-popover {
  width: 300px;
  padding: 14px;
}
.tb-shadow-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.tb-shadow-toggle {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  cursor: pointer;
}
.tb-shadow-toggle-inp {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.tb-shadow-toggle-track {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  transition: background .12s ease;
}
.tb-shadow-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: transform .12s ease;
}
.tb-shadow-toggle-inp:checked + .tb-shadow-toggle-track {
  background: var(--n-primary, #7b61ff);
}
.tb-shadow-toggle-inp:checked + .tb-shadow-toggle-track .tb-shadow-toggle-thumb {
  transform: translateX(16px);
}
.tb-shadow-body { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.tb-shadow-body.is-disabled {
  opacity: 0.4;
  pointer-events: none;
}
.tb-shadow-row {
  display: grid;
  grid-template-columns: 70px 1fr 50px;
  align-items: center;
  gap: 8px;
}
/* Color row: label + flexible spacer + swatch + hex (right-aligned group)
   so the hex input's right edge lines up with the number inputs above
   instead of stretching to the popover edge. */
.tb-shadow-row-color {
  display: flex;
  align-items: center;
  gap: 8px;
}
.tb-shadow-row-color > .tb-shadow-label {
  width: 70px;
  flex-shrink: 0;
}
.tb-shadow-row-color > .tb-shadow-color-chip {
  margin-left: auto;
  flex-shrink: 0;
}
.tb-shadow-row-color > .tb-shadow-color-hex {
  width: 100px;
  flex-shrink: 0;
}
.tb-shadow-label {
  font-size: 11px;
  color: var(--n-text-muted, #aaa);
}
.tb-shadow-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
.tb-shadow-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--n-primary, #7b61ff);
  cursor: grab;
  border: 2px solid var(--n-panel, #1f242c);
}
.tb-shadow-range::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--n-primary, #7b61ff);
  cursor: grab;
  border: 2px solid var(--n-panel, #1f242c);
}
.tb-shadow-num,
.tb-shadow-color-hex {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  color: var(--n-text, #e6e8ee);
  font-size: 12px;
  padding: 4px 6px;
  text-align: center;
  -moz-appearance: textfield;
}
.tb-shadow-num::-webkit-outer-spin-button,
.tb-shadow-num::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.tb-shadow-color-chip {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 28px;
  cursor: pointer;
}
.tb-shadow-color-swatch {
  display: block;
  width: 100%;
  height: 100%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}
.tb-shadow-color-inp {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

/* ── Toast stack — bottom-left notifications for long-running ops. */
.toast-stack {
  position: fixed;
  bottom: 16px;
  right: 16px;
  align-items: flex-end;   /* stack toasts flush to the right edge */
  z-index: 11000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--n-panel, #1f242c);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: var(--n-text, #e6e8ee);
  font-size: 13px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  min-width: 220px;
  max-width: 360px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .2s ease, transform .2s ease;
}
.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.toast-message {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.toast-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--n-primary, #7b61ff);
  border-radius: 50%;
  animation: toast-spin .8s linear infinite;
  flex-shrink: 0;
}
@keyframes toast-spin { to { transform: rotate(360deg); } }
.toast--success { border-color: rgba(1, 112, 185, 0.55); }   /* Needles brand blue #0170B9 */
.toast--error { border-color: rgba(255, 92, 92, 0.45); color: #ffb3b3; }

/* Live-sync "just appeared" highlight — a brief brand-blue ring + glow that
   fades out, applied to rows/cards that show up via an AUTOMATIC refresh (a
   new client, config, or campaign synced from Airtable). box-shadow only, so
   it never shifts layout. */
@keyframes ls-flash {
  0%   { box-shadow: 0 0 0 2px rgba(1,112,185,0.6), 0 0 16px 3px rgba(1,112,185,0.4); opacity: 0.55; }
  30%  { opacity: 1; }
  100% { box-shadow: 0 0 0 0 rgba(1,112,185,0); opacity: 1; }
}
/* Gentle entrance so a new/moved card eases in instead of snapping ("seco"). */
.ls-flash { animation: ls-flash 1.3s ease-out; border-radius: inherit; }

/* Soft crossfade for a thumbnail/cover that updates in place (e.g. while
   editing a config, its overview cover refreshes after autosave). */
@keyframes ls-thumb-in { from { opacity: 0.3; } to { opacity: 1; } }
.ls-thumb-in { animation: ls-thumb-in 0.4s ease-out; }

/* ── Live-sync banner: shown when the OPEN campaign's canvas/visuals changed
   out-of-band (regeneration / external Airtable edit). Top-center, above the
   canvas chrome; the user chooses to reload (live-sync.js). ── */
.live-sync-banner {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 11500;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px 10px 16px;
  background: var(--n-panel, #1f242c);
  border: 1px solid rgba(1, 112, 185, 0.6);   /* Needles brand blue */
  border-radius: 10px;
  color: var(--n-text, #e6e8ee);
  font-size: 13px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
  max-width: min(92vw, 560px);
}
.live-sync-banner .lsb-msg { flex: 1; }
.live-sync-banner .lsb-reload {
  border: none;
  background: #0170b9;
  color: #fff;
  font-weight: 600;
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}
.live-sync-banner .lsb-reload:hover { background: #0a86d6; }
.live-sync-banner .lsb-dismiss {
  border: none;
  background: transparent;
  color: var(--n-text-dim, #9aa3b2);
  font-size: 15px;
  line-height: 1;
  padding: 4px 6px;
  cursor: pointer;
}
.live-sync-banner .lsb-dismiss:hover { color: var(--n-text, #e6e8ee); }

/* ── Floating actions toolbar (Hito 1).
   Pinned ~12px above the selection bbox in viewport coords. Position is
   computed and set inline by floating-actions.js — these styles only define
   the visual treatment. */
.floating-actions {
  position: fixed;
  z-index: 70;
  display: none;
  align-items: center;
  gap: 2px;
  padding: 4px;
  background: var(--n-bg, #1f242c);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  user-select: none;
}
.floating-actions-btn {
  width: 30px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 5px;
  color: var(--n-text, #e6e8ee);
  cursor: pointer;
  transition: background .12s ease, color .12s ease;
}
.floating-actions-btn:hover { background: rgba(255, 255, 255, 0.1); }
.floating-actions-btn.is-active {
  background: rgba(123, 97, 255, 0.2);
  color: #b9a8ff;
}
.floating-actions-btn:focus-visible {
  outline: 2px solid var(--n-primary, #7b61ff);
  outline-offset: 1px;
}

/* More button (⋯) opens the shared right-click context menu (`.ctx-menu` in
   context-menu.js). Styles for that menu live in base.css; no extra CSS
   needed here. */

/* ── Sub-panel header (Hito 1 foundation, used by Hito 2+ Font/Color/Pos).
   Lives inside #subPanelSection. Back arrow returns to the previously
   active tab (closeSubPanel() in sub-panel.js). */
.sub-panel-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 4px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 10px;
}
.sub-panel-back,
.sub-panel-close {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 5px;
  color: var(--n-text, #e6e8ee);
  cursor: pointer;
  font-size: 14px;
}
.sub-panel-back:hover,
.sub-panel-close:hover { background: rgba(255, 255, 255, 0.08); }
.sub-panel-title {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  color: var(--n-text, #e6e8ee);
}

/* ── Font picker sub-panel (Hito 2) ── */
.fp-body { display: flex; flex-direction: column; gap: 12px; padding: 0 4px; }
.fp-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  color: var(--n-text-muted, #888);
}
.fp-search-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--n-text, #e6e8ee);
  font-size: 13px;
  outline: none;
}
.fp-section { display: flex; flex-direction: column; gap: 4px; }
.fp-section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--n-text-muted, #888);
  padding: 4px 4px 2px;
}
.fp-list { display: flex; flex-direction: column; gap: 2px; }
.fp-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 8px 10px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--n-text, #e6e8ee);
  font-size: 13px;
  cursor: pointer;
  text-align: left;
}
.fp-row:hover { background: rgba(255, 255, 255, 0.06); }
.fp-row.is-active {
  background: rgba(123, 97, 255, 0.18);
  border-color: rgba(123, 97, 255, 0.6);
}
.fp-row-name { flex: 1; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fp-row-preview {
  font-size: 14px;
  color: var(--n-text-muted, #aaa);
  white-space: nowrap;
}
.fp-row-check { color: #b9a8ff; font-size: 13px; }
.fp-empty {
  padding: 10px;
  color: var(--n-text-muted, #888);
  font-size: 12px;
  text-align: center;
}

/* ── Color picker sub-panel (Hito 3 partial — anticipated for TEXT topbar) ── */
.cp-body { display: flex; flex-direction: column; gap: 14px; padding: 0 4px; }
.cp-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  color: var(--n-text-muted, #888);
}
.cp-search-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--n-text, #e6e8ee);
  font-size: 13px;
  outline: none;
}
.cp-section { display: flex; flex-direction: column; gap: 6px; }
.cp-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--n-text-muted, #888);
  padding: 2px 4px;
}
.cp-section-edit {
  background: transparent;
  border: none;
  color: var(--n-primary, #7b61ff);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0;
}
.cp-section-edit:hover { text-decoration: underline; }
.cp-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  padding: 2px;
}
/* Multi-color SVG editor: tappable list of the element's colors. Each opens
   the full picker scoped to that color. */
.cp-svgcolors { display: flex; flex-direction: column; gap: 6px; }
.cp-svgcolor-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; background: var(--n-bg-input, rgba(255,255,255,0.04)); border: 1px solid var(--n-border, rgba(255,255,255,0.1)); border-radius: 8px; cursor: pointer; color: var(--n-text, #ddd); }
.cp-svgcolor-item:hover { background: rgba(255,255,255,0.08); }
.cp-svgcolor-sw { width: 26px; height: 26px; border-radius: 6px; border: 1px solid rgba(255,255,255,0.2); flex: 0 0 auto; }
.cp-svgcolor-label { font-size: 13px; flex: 1 1 auto; text-align: left; }
.cp-svgcolor-cur { font-size: 11px; color: var(--n-text-dim, rgba(255,255,255,0.5)); font-family: 'SF Mono', Consolas, monospace; text-transform: uppercase; }
.cp-back-colors { background: none; border: none; color: var(--n-accent, #3b82f6); font-size: 12px; cursor: pointer; padding: 2px 0 6px; text-align: left; }
.cp-back-colors:hover { text-decoration: underline; }
.cp-swatch {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  cursor: pointer;
  padding: 0;
  transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease;
}
.cp-swatch:hover {
  transform: scale(1.05);
  border-color: rgba(255, 255, 255, 0.3);
}
.cp-swatch.is-active {
  border-color: var(--n-primary, #7b61ff);
  box-shadow: 0 0 0 2px rgba(123, 97, 255, 0.4);
}
.cp-swatch-white { border-color: rgba(255, 255, 255, 0.2); }

/* Hex input row — sticky-ish at the bottom of the panel. */
.cp-hex-section { margin-top: 4px; }
.cp-hex-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
}
.cp-hex-hash {
  color: var(--n-text-muted, #888);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
}
.cp-hex-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--n-text, #e6e8ee);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  outline: none;
  text-transform: lowercase;
}
.cp-hex-pick {
  -webkit-appearance: none;
  appearance: none;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
}
.cp-hex-pick::-webkit-color-swatch-wrapper { padding: 0; border-radius: 5px; }
.cp-hex-pick::-webkit-color-swatch { border: none; border-radius: 5px; }

/* Context menu — right-click on a layer (canvas or Layers panel).
   pointer-events:auto (default) since items must be clickable; the body-level
   mousedown listener closes the menu when clicked outside. z-index sits
   above the bbox overlay so the menu always wins. */
.ctx-menu {
  position: fixed;
  z-index: 12000;
  min-width: 220px;
  max-width: 320px;
  padding: 4px 0;
  margin: 0;
  list-style: none;
  background: var(--n-panel, #1f242c);
  color: var(--n-text, #eaeaea);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  font-size: 13px;
  user-select: none;
}
.ctx-menu .ctx-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  cursor: pointer;
  gap: 16px;
}
.ctx-menu .ctx-item:hover,
.ctx-menu .ctx-item:focus { background: rgba(1, 112, 185, 0.22); }
.ctx-menu .ctx-item.is-disabled {
  opacity: 0.45;
  cursor: default;
}
.ctx-menu .ctx-item.is-disabled:hover { background: transparent; }
.ctx-menu .ctx-label { flex: 1 1 auto; }
.ctx-menu .ctx-shortcut {
  flex: 0 0 auto;
  color: var(--n-text-muted, #888);
  font-size: 11px;
  letter-spacing: 0.02em;
}
.ctx-menu .ctx-separator {
  height: 1px;
  margin: 4px 0;
  background: rgba(255, 255, 255, 0.08);
  list-style: none;
  pointer-events: none;
}
/* Submenu trigger + caret. The submenu itself is the same .ctx-menu element
   re-used as a free-floating panel anchored next to the trigger. */
.ctx-menu .ctx-item.has-submenu .ctx-submenu-caret {
  flex: 0 0 auto;
  color: var(--n-text-muted, #888);
  font-size: 12px;
  margin-left: 8px;
}
.ctx-menu .ctx-item.has-submenu.is-open {
  background: rgba(1, 112, 185, 0.22);
}
.ctx-menu.ctx-submenu {
  z-index: 12001;
}

/* Marquee select rectangle — drawn by canvas-events.js while the user is
   dragging on a background layer. pointer-events:none so it never intercepts
   the mouseup that ends the gesture. z-index sits below the bbox overlay
   (9000) but above any layer content. */
.select-rect {
  position: absolute;
  pointer-events: none;
  z-index: 8800;
  background: rgba(1, 112, 185, 0.12);
  border: 1px solid rgba(1, 112, 185, 0.7);
  box-sizing: border-box;
  border-radius: 1px;
}

/* While marqueeing, suppress hover outline so the dashed rectangle doesn't
   compete with the marquee rect. */
.sbox.is-marqueeing #hover-outline { display: none !important; }
.sbox.is-marqueeing { cursor: crosshair; }

/* While the editor is dragging, suppress hover outline + cursor flicker. */
.sbox.is-dragging #hover-outline { display: none !important; }

/* While inline-editing a text layer, hide bbox + hover so the user sees only
   the editing outline drawn on the inner div. */
.sbox.is-editing-text #bbox-overlay,
.sbox.is-editing-text #hover-outline { display: none !important; }

/* Bbox rotation handle (used by bbox-overlay.js, not the dead Inspector). */
.bbox-rotate { cursor: grab; }
.is-rotating .bbox-rotate, .bbox-rotate:active { cursor: grabbing; }

/* Inspector legacy → kept ONLY because gradient-editor.js still renders these
   classes (.ins-color, .ins-hex, .ins-zbtn, .ins-field, .ins-field-wide,
   .ins-rangeval, .ins-toggle). All other .ins-* / #inspectorRoot rules were
   removed in Hito 6 cleanup. */
.ins-color { width: 32px; height: 26px; padding: 0; border: 1px solid var(--n-border, rgba(255,255,255,0.15)); border-radius: 3px; background: transparent; cursor: pointer; flex: 0 0 auto; }
.ins-color-label { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--n-text-dim, rgba(255,255,255,0.6)); margin-bottom: 3px; }
.ins-color-sw { width: 12px; height: 12px; border-radius: 3px; border: 1px solid rgba(255,255,255,0.25); flex: 0 0 auto; }
.ins-hex { background: var(--n-bg-input, rgba(0,0,0,0.3)); border: 1px solid var(--n-border, rgba(255,255,255,0.1)); color: var(--n-text, #fff); padding: 4px 6px; border-radius: 3px; font-size: 11px; font-family: 'SF Mono', Consolas, monospace; flex: 1; min-width: 0; }
.ins-zbtn {
  background: var(--n-bg-input, rgba(0,0,0,0.3));
  border: 1px solid var(--n-border, rgba(255,255,255,0.1));
  color: var(--n-text, #ddd);
  padding: 4px 8px;
  border-radius: 3px;
  font-size: 12px;
  cursor: pointer;
  text-align: center;
  font-family: inherit;
}
.ins-zbtn:hover { background: rgba(255,255,255,0.08); }
.ins-field { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ins-field-wide { flex: 1 1 100%; }
.ins-field > span { font-size: 10px; color: var(--n-text-muted, #888); text-transform: uppercase; letter-spacing: 0.3px; }
.ins-field input, .ins-field select {
  background: var(--n-bg-input, rgba(0,0,0,0.3));
  border: 1px solid var(--n-border, rgba(255,255,255,0.1));
  color: var(--n-text, #fff);
  padding: 4px 6px;
  border-radius: 3px;
  font-size: 12px;
  width: 100%;
  box-sizing: border-box;
  font-family: inherit;
}
.ins-field input[type="range"] { padding: 0; }
.ins-rangeval { font-size: 11px; color: var(--n-text-muted, #aaa); margin-left: 6px; min-width: 30px; display: inline-block; }
.ins-toggle { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--n-text, #ccc); cursor: pointer; }
.ins-toggle input[type="checkbox"] { margin: 0; }

/* ── Gradient editor ── */
.grad-editor { display: flex; flex-direction: column; gap: 8px; padding: 4px 0; }
.grad-bar {
  position: relative;
  width: 100%;
  height: 28px;
  border-radius: 3px;
  border: 1px solid var(--n-border, rgba(255,255,255,0.15));
  background-color: #888;
  cursor: copy;
}
.grad-stop {
  position: absolute;
  top: 100%;
  margin-top: 4px;
  transform: translateX(-50%);
  width: 14px;
  height: 14px;
  border: 2px solid #fff;
  outline: 1px solid rgba(0,0,0,0.4);
  border-radius: 50%;
  cursor: grab;
  padding: 0;
}
.grad-stop:active { cursor: grabbing; }
.grad-stop.active { box-shadow: 0 0 0 2px var(--n-primary, #0170b9); }
.grad-row { display: flex; align-items: center; gap: 6px; margin-top: 14px; }
.grad-row-2 > * { flex: 1; min-width: 0; }
.grad-row .ins-color, .grad-row .ins-hex { flex: 1; min-width: 0; }
.grad-row .ins-zbtn { flex: 0 0 auto; padding: 4px 8px; }
.grad-kind-row { gap: 12px; margin-top: 6px; }

/* ══ Layers panel ══ */
/* Layers panel — Canva-style cards with real-content previews.
   Each row: drag handle (left) · preview (center, cloned DOM) · chevron (right).
   Eye / lock / name overlay slides in on hover, kept off-card by default. */
.layers-list {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.layer-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--n-bg-input, #1a2230);
  border: 1px solid transparent;
  cursor: pointer;
  user-select: none;
  font-size: 12px;
  min-height: 64px;
  transition: background .12s ease, border-color .12s ease, box-shadow .12s ease;
}
.layer-row:hover { background: var(--n-bg-input-hover, #232c3c); }
.layer-row.is-selected {
  border-color: var(--n-primary, #0170b9);
  background: rgba(1, 112, 185, 0.14);
  box-shadow: 0 0 0 1px rgba(1, 112, 185, 0.35);
}
/* Hidden layer: keep the preview readable (we render the layer DOM with
   visibility:hidden, the cloned thumb shows the actual content) and tint
   the background so the row reads as "off" at a glance. */
.layer-row.is-hidden { background: rgba(255,255,255,0.02); }
.layer-row.is-hidden .layer-row-preview { opacity: 0.55; }
/* Eye / lock indicators float OUTSIDE the row on the right edge — eye
   above, lock below, vertically aligned with the row's top/bottom. They
   only appear when the corresponding state is active; a "normal" row
   shows neither. Click to toggle off. */
.layer-row-eye, .layer-row-lock-btn {
  position: absolute;
  right: -26px;
  width: 22px; height: 22px; padding: 0;
  background: rgba(13,19,32,0.92);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--n-primary, #0170b9);
  cursor: pointer; border-radius: 4px;
  display: none;
  align-items: center; justify-content: center;
  z-index: 2;
}
.layer-row-eye { top: 4px; }
.layer-row-lock-btn { bottom: 4px; }
.layer-row-eye:hover, .layer-row-lock-btn:hover {
  background: rgba(20,30,48,0.96);
  border-color: rgba(255,255,255,0.18);
}
.layer-row.is-hidden .layer-row-eye { display: inline-flex; }
.layer-row.is-locked .layer-row-lock-btn { display: inline-flex; }
/* Ensure the row container can position the outer icons relative to it. */
.layer-row { position: relative; }
.layer-row.is-dragging { opacity: 0.4; }
.layer-row.drop-before { box-shadow: inset 0 2px 0 var(--n-primary, #0170b9); }
.layer-row.drop-after  { box-shadow: inset 0 -2px 0 var(--n-primary, #0170b9); }
.layer-row.is-indent-1 { margin-left: 22px; }
.layer-row.is-indent-2 { margin-left: 44px; }
.layer-row.is-nested {
  background: var(--n-bg-input, #1a2230);
  min-height: 52px;
}
.layer-row.is-bullet-item { min-height: 44px; }

.layer-row-drag {
  flex: 0 0 auto;
  color: var(--n-text-muted, #6a7a90);
  cursor: grab;
  font-size: 14px;
  line-height: 1;
  letter-spacing: -2px;
  width: 12px;
  text-align: center;
}
.layer-row.is-dragging .layer-row-drag { cursor: grabbing; }
.layer-row-drag-spacer { flex: 0 0 12px; }

/* Preview area — clipped frame where the cloned DOM node lives. */
.layer-row-preview {
  flex: 1 1 auto;
  position: relative;
  height: 48px;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.32);
  overflow: hidden;
  pointer-events: none; /* clicks pass through to the row */
}
.layer-row.is-nested .layer-row-preview { height: 40px; }
.layer-row.is-bullet-item .layer-row-preview { height: 32px; }
.layer-row-preview-stage {
  position: absolute;
  pointer-events: none;
}
.layer-row-preview-fallback {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--n-text-muted, #6a7a90);
}
.layer-row-preview-fallback svg { width: 22px; height: 22px; }

/* Chevron on the right — only on expandable layers (group / bullets-with-items). */
.layer-row-caret {
  flex: 0 0 auto;
  width: 22px; height: 22px;
  padding: 0;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 4px;
  cursor: pointer;
  color: var(--n-text-muted, #6a7a90);
  font-size: 10px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
}
.layer-row-caret:hover { color: var(--n-text, #ddd); border-color: var(--n-border-hover, #2a3650); }

/* Rename input: shown in place of the preview thumb when rename starts. */
.layer-row-name-input {
  flex: 1 1 auto;
  min-width: 0;
  background: var(--n-bg, #0d1320);
  border: 1px solid var(--n-primary, #0170b9);
  border-radius: 4px;
  color: var(--n-text, #e3e8f0);
  padding: 2px 6px;
  font-size: 12px;
  font-family: inherit;
}

/* 3-dots menu trigger on each row, right side. */
.layer-row-menu {
  flex: 0 0 auto;
  width: 24px; height: 24px; padding: 0;
  background: none; border: none;
  color: var(--n-text-muted, #6a7a90);
  font-size: 18px; line-height: 1;
  cursor: pointer; border-radius: 4px;
  display: inline-flex; align-items: center; justify-content: center;
}
.layer-row-menu:hover { color: var(--n-text, #ddd); background: rgba(255,255,255,0.06); }

/* Dropdown menu (lives in document.body). */
.layer-row-menu-dropdown {
  position: fixed; z-index: 95000;
  min-width: 220px;
  background: var(--n-bg-card, #11192a);
  border: 1px solid var(--n-border, #24304a);
  border-radius: 8px;
  padding: 6px;
  box-shadow: 0 18px 50px rgba(0,0,0,0.55), 0 0 0 1px rgba(255,255,255,0.02);
  font-family: inherit; font-size: 12px;
  user-select: none;
}
.layer-menu-item {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 7px 10px;
  background: none; border: none; border-radius: 4px;
  color: var(--n-text, #e3e8f0); font-family: inherit; font-size: 12px;
  cursor: pointer;
  gap: 12px;
}
.layer-menu-item:hover { background: rgba(255,255,255,0.06); }
.layer-menu-label { flex: 1 1 auto; text-align: left; }
.layer-menu-shortcut {
  flex: 0 0 auto;
  color: var(--n-text-muted, #6a7a90);
  font-size: 10px;
  font-family: 'SF Mono', SFMono-Regular, Consolas, monospace;
}
.layer-menu-sep {
  height: 1px;
  margin: 4px 6px;
  background: var(--n-border, #24304a);
}

/* Filter tabs at top of the panel. */
.layers-filter-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  margin: 8px 0 8px;
  border-radius: 6px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--n-border, #24304a);
}
.layers-filter-tab {
  flex: 1 1 0;
  padding: 6px 10px;
  background: none; border: none; border-radius: 4px;
  color: var(--n-text-muted, #6a7a90);
  font-family: inherit; font-size: 11px;
  cursor: pointer;
  transition: background .12s ease, color .12s ease;
}
.layers-filter-tab:hover { color: var(--n-text, #ddd); background: rgba(255,255,255,0.04); }
.layers-filter-tab.is-active {
  background: var(--n-bg-input, #1a2230);
  color: var(--n-text, #e3e8f0);
  box-shadow: 0 1px 0 rgba(255,255,255,0.06);
}

/* Children of an expanded group: indented + thin accent border on the left
   so they read as "belonging to" the parent without a heavy container. */
.layer-row.is-nested {
  margin-left: 22px;
  border-left: 2px solid rgba(1, 112, 185, 0.4);
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}
.layer-row.is-nested.is-bullet-item {
  border-left-color: rgba(255, 255, 255, 0.08);
}

/* Stack-of-cards effect on expandable rows (groups and bullets-with-items).
   Two box-shadows at increasing offsets simulate cards peeking out from
   behind, signalling "this layer contains multiple items" at a glance.
   No layout impact — purely visual. */
.layer-row.is-expandable {
  box-shadow:
    3px 3px 0 0 rgba(255, 255, 255, 0.04),
    3px 3px 0 1px rgba(255, 255, 255, 0.06),
    6px 6px 0 0 rgba(255, 255, 255, 0.025),
    6px 6px 0 1px rgba(255, 255, 255, 0.04);
}
.layer-row.is-expandable:hover {
  box-shadow:
    3px 3px 0 0 rgba(255, 255, 255, 0.06),
    3px 3px 0 1px rgba(255, 255, 255, 0.08),
    6px 6px 0 0 rgba(255, 255, 255, 0.035),
    6px 6px 0 1px rgba(255, 255, 255, 0.06);
}
.layer-row.is-expandable.is-selected {
  box-shadow:
    3px 3px 0 0 rgba(1, 112, 185, 0.16),
    3px 3px 0 1px rgba(1, 112, 185, 0.30),
    6px 6px 0 0 rgba(1, 112, 185, 0.08),
    6px 6px 0 1px rgba(1, 112, 185, 0.20),
    0 0 0 1px rgba(1, 112, 185, 0.35);
}
.layers-list { padding-right: 8px; padding-bottom: 8px; } /* room for the stack */

/* Sesión 3 — Elements panel (catalog) */
.el-search {
  width: 100%; box-sizing: border-box;
  padding: 6px 10px; border-radius: 4px;
  background: var(--n-bg-input, #1b1f28);
  border: 1px solid var(--n-border, #2a2f3a);
  color: var(--n-text, #ddd); font-size: 12px;
  margin-bottom: 8px;
}
.el-tabs {
  display: flex; flex-wrap: wrap; gap: 4px;
  margin-bottom: 8px;
}
.el-tab {
  flex: 0 0 auto; padding: 4px 8px;
  background: var(--n-bg-input, #1b1f28);
  border: 1px solid var(--n-border, #2a2f3a);
  color: var(--n-text-muted, #888); font-size: 11px;
  border-radius: 12px; cursor: pointer; font-family: inherit;
  transition: all .15s;
}
.el-tab:hover { color: var(--n-text, #ddd); border-color: var(--n-border-hover, #404756); }
.el-tab.active { background: var(--n-primary, #0170b9); color: #fff; border-color: var(--n-primary, #0170b9); }
.el-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 6px;
}
.el-thumb {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 4px; border: 1px solid transparent; border-radius: 6px;
  background: rgba(255,255,255,0.02); cursor: pointer; user-select: none;
  transition: all .15s;
}
.el-thumb:hover { border-color: var(--n-primary, #0170b9); background: rgba(1,112,185,0.06); }
.el-thumb-img { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; }
.el-thumb-img img { max-width: 100%; max-height: 100%; display: block; filter: invert(0.85); }
.el-thumb-name {
  font-size: 9px; color: var(--n-text-muted, #888); text-align: center;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  width: 100%; line-height: 1.2;
}

/* Lines / Backgrounds / CTA sub-tabs */
.el-section { padding: 4px; }
.el-line-tools, .el-bg-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.el-line-tool, .el-bg-clear {
  padding: 6px 10px; background: var(--n-bg-input, #1b1f28);
  border: 1px solid var(--n-border, #2a2f3a); color: var(--n-text, #ddd);
  border-radius: 4px; cursor: pointer; font-size: 12px; font-family: inherit;
}
.el-line-tool:hover, .el-bg-clear:hover { border-color: var(--n-primary, #0170b9); }
.el-bg-color input[type="color"] { width: 30px; height: 30px; border: none; cursor: pointer; padding: 0; }
.el-bg-patterns { display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 6px; margin-top: 6px; }
.el-cta-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 6px; }
.el-cta-preset {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 10px 6px; background: rgba(255,255,255,0.02);
  border: 1px solid var(--n-border, #2a2f3a); border-radius: 6px;
  cursor: pointer; font-family: inherit; transition: all .15s;
}
.el-cta-preset:hover { border-color: var(--n-primary, #0170b9); }
.el-cta-sample {
  background: var(--n-primary, #0170b9); color: #fff;
  font-size: 11px; font-weight: 700; padding: 6px 14px;
}
.el-cta-sample.is-ghost { background: transparent; border: 1px solid var(--n-primary, #0170b9); color: var(--n-primary, #0170b9); }
.el-cta-label { font-size: 9px; color: var(--n-text-muted, #888); }
#sbox.is-dropping { outline: 2px dashed var(--n-primary, #0170b9); outline-offset: -8px; }

/* ═══ Step 32 — Client config modal ═══ */
.cfg-modal{position:fixed;inset:0;z-index:90000;background:rgba(4,8,20,.7);display:flex;align-items:center;justify-content:center;opacity:0;pointer-events:none;transition:opacity .2s;backdrop-filter:blur(8px)}
.cfg-modal.open{opacity:1;pointer-events:auto}
.cfg-modal-inner{background:var(--n-bg-card);border:1px solid var(--n-border);border-radius:var(--n-radius-lg);width:min(560px,92vw);max-height:86vh;display:flex;flex-direction:column;box-shadow:0 24px 80px rgba(0,0,0,.5),0 0 60px rgba(1,112,185,.06);overflow:hidden}
.cfg-modal-head{display:flex;align-items:center;justify-content:space-between;padding:16px 22px;border-bottom:1px solid var(--n-border);font-family:'Josefin Sans',sans-serif;font-size:15px;font-weight:600;color:var(--n-text-bright)}
.cfg-modal-close{background:none;border:none;color:var(--n-text-dim);font-size:18px;cursor:pointer;font-family:inherit;padding:4px 8px;border-radius:4px;transition:all .15s}
.cfg-modal-close:hover{color:var(--n-text);background:var(--n-bg-hover)}
.cfg-modal-body{padding:18px 22px;overflow:auto;flex:1}
.cfg-modal-body h4{font-family:'Josefin Sans',sans-serif;font-size:12px;font-weight:600;color:var(--n-text-bright);text-transform:uppercase;letter-spacing:.6px;margin:0 0 4px 0}
.cfg-modal-body .hint{font-size:11px;color:var(--n-text-dim);margin:0 0 10px 0;line-height:1.45}
.cfg-modal-foot{display:flex;justify-content:flex-end;gap:8px;padding:14px 22px;border-top:1px solid var(--n-border);background:rgba(0,0,0,.12)}
.cfg-modal-foot .erst{padding:8px 16px;background:none;border:1px solid var(--n-border);color:var(--n-text-dim);border-radius:var(--n-radius);cursor:pointer;font-family:inherit;font-size:12px;transition:all .15s}
.cfg-modal-foot .erst:hover{color:var(--n-text);border-color:var(--n-border-hover)}
.cfg-modal-foot .badd{padding:8px 18px;background:var(--n-primary);border:1px solid var(--n-primary);color:#fff;border-radius:var(--n-radius);cursor:pointer;font-family:inherit;font-size:12px;font-weight:500;transition:all .2s}
.cfg-modal-foot .badd:hover:not(:disabled){background:var(--n-primary-hover);box-shadow:0 0 16px var(--n-primary-glow)}
.cfg-modal-foot .badd:disabled{opacity:.6;cursor:not-allowed}

/* Client config summary (Branding overrides preview) */
.cfg-summary{display:flex;flex-direction:column;gap:8px;border:1px solid var(--n-border);border-radius:var(--n-radius);padding:10px 12px;background:var(--n-bg-input)}
.cfg-summary-row{display:flex;align-items:center;gap:10px;font-size:11px;color:var(--n-text)}
.cfg-summary-label{flex:0 0 110px;color:var(--n-text-muted);text-transform:uppercase;letter-spacing:.4px;font-size:10px}
.cfg-summary-val{color:var(--n-text);word-break:break-word;flex:1;min-width:0}
.cfg-summary-val.muted{color:var(--n-text-dim);font-style:italic}
.cfg-summary-chip{display:inline-block;width:14px;height:14px;border-radius:3px;border:1px solid rgba(255,255,255,.15);vertical-align:middle;margin-right:6px;flex-shrink:0}
.cfg-summary-usps{display:flex;flex-direction:column;gap:2px}
.cfg-summary-usps li{list-style:disc;margin-left:18px;font-size:11px}

/* Approved templates list (moved from base.css for modal scope) */
.approved-tpls-list{display:flex;flex-direction:column;gap:4px;margin-top:6px;margin-bottom:6px}
.atpl-row{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:6px 8px;border:1px solid var(--n-border);border-radius:5px;background:var(--n-bg-input);transition:border-color .15s,background .15s}
.atpl-row.is-on{border-color:var(--n-primary);background:rgba(1,112,185,.06)}
.atpl-row:hover{border-color:var(--n-border-hover)}
.atpl-check{display:inline-flex;align-items:center;gap:8px;cursor:pointer;flex:1;min-width:0;font-size:11px;color:var(--n-text)}
.atpl-check input{accent-color:var(--n-primary);flex-shrink:0}
.atpl-slug{font-family:'SF Mono',SFMono-Regular,Consolas,monospace;font-size:10px;color:var(--n-text-muted);background:var(--n-bg-hover);padding:2px 6px;border-radius:3px;flex-shrink:0}
.atpl-name{color:var(--n-text-dim);font-size:11px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
.atpl-arrows{display:inline-flex;gap:2px;flex-shrink:0}
.atpl-arrow{background:none;border:1px solid var(--n-border);color:var(--n-text-muted);width:20px;height:20px;border-radius:3px;cursor:pointer;font-size:10px;line-height:1;display:inline-flex;align-items:center;justify-content:center;font-family:inherit;transition:all .15s}
.atpl-arrow:hover{border-color:var(--n-border-hover);color:var(--n-text)}
.atpl-arrow:active{background:var(--n-bg-hover)}

/* ══ Elements panel v2 (Canva-style hub) ══ */
.el2-root {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  font-size: 12px;
}
.el2-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 6px 0 10px 0;
  flex: 0 0 auto;
}
.el2-back {
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  color: var(--n-text, #eaeaea);
  cursor: pointer;
  font-size: 12px;
  padding: 4px 0;
  text-align: left;
  font-family: inherit;
}
.el2-back:hover { color: var(--n-primary, #0170b9); }
.el2-search-row { display: flex; }
.el2-search {
  flex: 1 1 auto;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--n-text);
  border-radius: 18px;
  padding: 8px 14px;
  outline: none;
  font-size: 12px;
  font-family: inherit;
}
.el2-search:focus { border-color: var(--n-primary, #0170b9); }
.el2-cta-row { display: flex; gap: 8px; }
.el2-btn-generate, .el2-btn-search {
  flex: 1 1 0;
  border: none;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
}
.el2-btn-generate {
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  color: white;
}
.el2-btn-generate:hover { filter: brightness(1.1); }
.el2-btn-search {
  background: rgba(255,255,255,0.08);
  color: var(--n-text);
}
.el2-btn-search:hover { background: rgba(255,255,255,0.14); }
.el2-body {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
}
.el2-section { margin-bottom: 18px; }
.el2-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.el2-section-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--n-text);
}
.el2-see-all {
  background: none;
  border: none;
  color: var(--n-text-muted, #888);
  cursor: pointer;
  font-size: 11px;
  padding: 2px 4px;
  font-family: inherit;
}
.el2-see-all:hover { color: var(--n-primary, #0170b9); }

/* Hub: category cards grid */
.el2-cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 8px;
}
.el2-cat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: linear-gradient(135deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  padding: 14px 6px;
  color: var(--n-text);
  cursor: pointer;
  transition: transform .15s, background .15s, border-color .15s;
  font-family: inherit;
  text-align: center;
  min-height: 90px;
}
.el2-cat-card:hover {
  background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.04));
  border-color: rgba(255,255,255,0.15);
  transform: translateY(-2px);
}
.el2-cat-emoji { font-size: 26px; line-height: 1; }
.el2-cat-label { font-size: 11px; font-weight: 600; }

/* Section grid (thumbs).
   auto-fill + minmax: when the panel is wider, the grid adds MORE columns
   instead of stretching each thumb. Min column width 64px = a thumb that
   stays readable (image ~50px + 9px label) without losing the name. */
.el2-section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 6px;
}
.el2-thumb {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 6px;
  padding: 8px 4px;
  cursor: pointer;
  transition: background .15s, border-color .15s;
  position: relative;
}
.el2-thumb:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.15);
}
.el2-thumb-img {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
}
.el2-thumb-img img, .el2-thumb-img svg {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: invert(0.9);
}
/* Colored stickers/badges already paint with real colors — the invert hack
   (meant to surface monochrome black art on the dark panel) would mangle them. */
.el2-thumb-img.is-colored img, .el2-thumb-img.is-colored svg {
  filter: none;
}
/* Lines category — compact preview cards (small selector → ghost zooms up to
   the real insert size, matching the shapes behaviour). */
.el2-line-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.el2-line-card {
  display: flex; align-items: center; justify-content: center;
  height: 38px; padding: 0 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 6px; cursor: pointer; color: #e6edf3;
  transition: background .15s, border-color .15s;
}
.el2-line-card:hover { background: rgba(255,255,255,0.09); border-color: rgba(255,255,255,0.16); }
.el2-line-card.is-active { background: rgba(1,112,185,0.18); border-color: var(--n-primary); }
.el2-line-card svg { width: 100%; height: 22px; display: block; }
.el2-thumb-name {
  font-size: 9px;
  color: var(--n-text-muted, #888);
  text-align: center;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Horizontal scroll (recents) */
.el2-hscroll {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 4px;
}
.el2-hscroll .el2-thumb {
  flex: 0 0 60px;
}

/* Lines tab */
.el2-line-tools {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.el2-line-tool {
  flex: 1 1 0;
  padding: 10px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  color: var(--n-text);
  cursor: pointer;
  font-family: inherit;
}
.el2-line-tool:hover { background: rgba(255,255,255,0.12); }

/* Backgrounds tab */
.el2-bg-row { display: flex; align-items: center; gap: 8px; }
.el2-bg-color { cursor: pointer; }
.el2-bg-color input[type="color"] {
  width: 44px; height: 32px; border: none; padding: 0;
  background: transparent; cursor: pointer; border-radius: 4px;
}
.el2-bg-clear {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--n-text);
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
  font-size: 11px;
}
.el2-bg-clear:hover { background: rgba(255,255,255,0.14); }

/* Text panel — replaces legacy Typography tab. Canva-style add box +
   Brand Kit presets + Default text styles. Rendered by js/text-panel.js
   into #textRoot inside .panel-section[data-section="text"]. */
.tp-add-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  background: linear-gradient(135deg, #8B5CF6, #7C3AED);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 12px 16px;
  font-weight: 600;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  margin: 0 0 14px;
  transition: filter 0.12s ease-out, transform 0.12s ease-out;
}
.tp-add-box:hover { filter: brightness(1.08); }
.tp-add-box:active { transform: translateY(1px); }
.tp-add-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background: rgba(255,255,255,0.18);
  border-radius: 4px;
  font-weight: 800;
  font-size: 13px;
  line-height: 1;
}
.tp-section { margin-bottom: 16px; }
.tp-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.tp-section-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--n-text-muted, #9aa0aa);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.tp-presets {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tp-preset {
  display: flex;
  align-items: center;
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 12px 14px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.12s, border-color 0.12s;
  min-height: 44px;
}
.tp-preset:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.16);
}
.tp-preset-sample {
  color: #fff;
  line-height: 1.15;
  display: block;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Transient drag-image for Text presets — kept off-screen at -9999 so the
   browser can still snapshot it for the drag preview. Visual style matches
   what the final text will look like on the canvas. */
.tp-drag-ghost {
  position: absolute;
  top: -9999px;
  left: -9999px;
  color: #0A2540;
  background: rgba(255,255,255,0.96);
  padding: 2px 6px;
  border-radius: 3px;
  border: 1px solid rgba(0,0,0,0.12);
  white-space: nowrap;
  line-height: 1.1;
  pointer-events: none;
}

/* CTA tab */
.el2-cta-grid-inner {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 10px;
}
.el2-cta-preset {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 12px 8px;
  cursor: pointer;
  font-family: inherit;
}
.el2-cta-preset:hover { background: rgba(255,255,255,0.1); }
.el2-cta-sample {
  background: var(--n-primary, #0170b9);
  color: white;
  padding: 6px 16px;
  font-size: 11px;
  font-weight: 600;
}
.el2-cta-sample.is-ghost {
  background: transparent;
  border: 2px solid var(--n-primary);
  color: var(--n-primary);
}
/* Per-preset preview modifiers so each CTA card looks distinct. */
.el2-cta-sample.is-gradient { background: linear-gradient(90deg, #2b8fff, #15539b); }
.el2-cta-sample.is-shadow { box-shadow: 0 4px 10px rgba(0,0,0,0.55); }
.el2-cta-sample.is-wide { padding-left: 30px; padding-right: 30px; }
.el2-cta-sample.is-compact { padding-left: 8px; padding-right: 8px; font-size: 10px; }
.el2-cta-sample.is-link {
  background: transparent;
  color: var(--n-primary, #2b8fff);
  padding: 6px 4px;
  text-decoration: underline;
}
/* "Text + arrow" preview: brand-color label next to a round arrow button. */
.el2-cta-sample.is-arrowcircle {
  background: transparent;
  padding: 4px 2px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.is-arrowcircle .cta-ac-label { color: var(--n-primary, #2b8fff); font-weight: 800; }
.is-arrowcircle .cta-ac-circle {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--n-primary, #2b8fff);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  line-height: 1;
}
.el2-cta-name { font-size: 10px; color: var(--n-text-muted); }

/* Bullet points tab — curated marker icons. Preview sits on a light card so
   the white-filled icons are visible against the dark panel. */
.el2-bullet-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 10px;
}
.el2-bullet-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 10px 6px;
  cursor: pointer;
  font-family: inherit;
}
.el2-bullet-card:hover { background: rgba(255,255,255,0.1); }
.el2-bullet-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: #2b3240;
}
.el2-bullet-preview svg { width: 26px; height: 26px; display: block; }
.el2-bullet-name { font-size: 10px; color: var(--n-text-muted); }

/* Gradients tab */
.el2-tone-chips {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.el2-tone-chip {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--n-text);
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 10px;
  cursor: pointer;
  font-family: inherit;
}
.el2-tone-chip:hover { background: rgba(255,255,255,0.1); }
.el2-tone-chip.is-active {
  background: var(--n-primary, #0170b9);
  border-color: var(--n-primary, #0170b9);
}
.el2-grad-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 6px;
}
.el2-grad-thumb {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 6px;
  padding: 4px;
  cursor: pointer;
  font-family: inherit;
}
.el2-grad-thumb:hover { border-color: rgba(255,255,255,0.2); }
.el2-grad-swatch {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 4px;
}
.el2-grad-name {
  font-size: 9px;
  color: var(--n-text-muted);
  width: 100%;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* AI tab */
.el2-ai-cta {
  text-align: center;
  padding: 20px 10px;
}
.el2-ai-launch { max-width: 200px; margin: 12px auto 0; display: block; }

/* My elements */
.el2-my-thumb { position: relative; }
.el2-my-svg svg {
  width: 100%; height: 100%; object-fit: contain; filter: invert(0.9);
}
.el2-my-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 16px;
  height: 16px;
  border: none;
  background: rgba(0,0,0,0.6);
  color: white;
  border-radius: 50%;
  cursor: pointer;
  font-size: 11px;
  line-height: 14px;
  padding: 0;
  display: none;
}
.el2-my-thumb:hover .el2-my-remove { display: block; }

/* Hints + empty states */
.el2-hint {
  font-size: 11px;
  color: var(--n-text-muted, #888);
  margin: 6px 0;
}
.el2-empty {
  padding: 30px 20px;
  text-align: center;
  color: var(--n-text-muted, #888);
  font-size: 12px;
}

/* AI modal */
.el2-ai-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 13000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.el2-ai-modal {
  background: var(--n-panel, #1f242c);
  color: var(--n-text);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 22px;
  max-width: 520px;
  width: 90vw;
  max-height: 80vh;
  overflow-y: auto;
  font-family: inherit;
}
.el2-ai-modal h2 { margin: 0 0 10px 0; font-size: 18px; }
.el2-ai-modal p { font-size: 12px; color: var(--n-text-muted); margin: 6px 0 14px 0; }
.el2-ai-modal label {
  display: block;
  font-size: 11px;
  margin: 10px 0 4px 0;
  color: var(--n-text-muted);
}
.el2-ai-modal input[type="text"],
.el2-ai-modal textarea,
.el2-ai-modal select {
  width: 100%;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--n-text);
  padding: 8px 10px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 12px;
  box-sizing: border-box;
}
.el2-ai-modal textarea { min-height: 60px; resize: vertical; }
.el2-ai-modal-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  justify-content: flex-end;
}
.el2-ai-modal-actions button {
  padding: 8px 14px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
}
.el2-ai-modal-cancel {
  background: rgba(255,255,255,0.08);
  color: var(--n-text);
}
.el2-ai-modal-primary {
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  color: white;
}
.el2-ai-modal-results {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}
.el2-ai-result {
  position: relative;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 14px;
  cursor: pointer;
  aspect-ratio: 1;
}
.el2-ai-result:hover { background: rgba(255,255,255,0.08); }
.el2-ai-result svg {
  width: 100%; height: 100%; filter: invert(0.9);
}
.el2-ai-result-star {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(0,0,0,0.55);
  border: none;
  color: gold;
  font-size: 16px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  line-height: 22px;
  padding: 0;
}
.el2-ai-busy {
  text-align: center;
  padding: 20px;
  color: var(--n-text-muted);
}

/* Upload zone (Mis elementos) */
.el2-upload-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 2px dashed rgba(255,255,255,0.15);
  border-radius: 10px;
  padding: 16px 12px;
  background: rgba(255,255,255,0.03);
  transition: border-color .15s, background .15s;
  text-align: center;
}
.el2-upload-zone.is-hover {
  border-color: var(--n-primary, #0170b9);
  background: rgba(1,112,185,0.08);
}
.el2-upload-icon {
  font-size: 22px;
  color: var(--n-text-muted);
}
.el2-upload-text { font-size: 12px; color: var(--n-text); }
.el2-upload-hint { font-size: 10px; color: var(--n-text-muted); }
.el2-upload-pick {
  background: none;
  border: none;
  color: var(--n-primary, #0170b9);
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  font-size: 12px;
  text-decoration: underline;
}
.el2-upload-progress {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
}
.el2-upload-row {
  font-size: 11px;
  color: var(--n-text-muted);
  padding: 4px 8px;
  background: rgba(255,255,255,0.04);
  border-radius: 4px;
}
.el2-upload-row.is-error {
  color: #ff6b6b;
  background: rgba(255,107,107,0.08);
}
.el2-upload-cat-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-bottom: 6px;
}
.el2-upload-cat-label {
  font-size: 11px;
  color: var(--n-text-muted);
  flex: 0 0 auto;
}
.el2-upload-cat-dropdown {
  flex: 1 1 auto;
  min-width: 140px;
}
.el2-upload-cat-dropdown .camp-trigger { padding: 5px 10px; font-size: 11px; }
.el2-upload-cat-dropdown .camp-trigger-arrow { width: 12px; height: 12px; }
/* The list is teleported to body via JS to escape overflow clipping from
   the scrollable panel. Override its absolute positioning + z-index so it
   stacks above everything (panel section, sidebar, etc). */
.camp-list.el2-upload-cat-list {
  position: fixed !important;
  z-index: 12000;
  border-top: 1px solid var(--n-primary);
  border-radius: 0 0 var(--n-radius) var(--n-radius);
}
.el2-upload-cat-list .camp-item { padding: 6px 10px; font-size: 11px; }
/* Custom dropdowns inside the AI modal — use the same teleport-to-body
   trick so they escape the modal overlay's stacking + overflow. */
.el2-ai-q-row { margin-bottom: 10px; }
.el2-ai-q-dropdown {
  display: block;
  width: 100%;
}
.el2-ai-q-dropdown .camp-trigger {
  width: 100%;
  padding: 8px 12px;
  font-size: 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
}
.el2-ai-q-dropdown .camp-trigger:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.2);
}
.camp-list.el2-ai-q-list {
  position: fixed !important;
  z-index: 13500;
  border-top: 1px solid var(--n-primary);
  border-radius: 0 0 var(--n-radius) var(--n-radius);
}
.el2-ai-q-list .camp-item { padding: 8px 12px; font-size: 12px; }

/* Reference image zone (inside the clarifying-questions modal). Same look
   as the "Upload your own" dropzone in the hub but with a preview state
   when an image is loaded. */
.el2-ai-q-optional {
  font-weight: normal;
  color: var(--n-text-muted, #888);
  font-size: 10px;
  margin-left: 6px;
}
.el2-ai-ref {
  margin-bottom: 10px;
}
.el2-ai-ref-zone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 2px dashed rgba(255,255,255,0.15);
  border-radius: 8px;
  padding: 14px 12px;
  background: rgba(255,255,255,0.03);
  transition: border-color .15s, background .15s;
  text-align: center;
  min-height: 110px;
}
.el2-ai-ref-zone.is-hover {
  border-color: var(--n-primary, #0170b9);
  background: rgba(1,112,185,0.08);
}
.el2-ai-ref-icon { font-size: 22px; color: var(--n-text-muted); }
.el2-ai-ref-text { font-size: 12px; color: var(--n-text); }
.el2-ai-ref-hint { font-size: 10px; color: var(--n-text-muted); }
.el2-ai-ref-pick {
  background: none;
  border: none;
  color: var(--n-primary, #0170b9);
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  font-size: 12px;
  text-decoration: underline;
}
.el2-ai-ref-preview {
  max-width: 100%;
  max-height: 200px;
  border-radius: 4px;
  display: block;
}
.el2-ai-ref-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border: none;
  background: rgba(0,0,0,0.6);
  color: white;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  line-height: 18px;
  padding: 0;
}
.el2-ai-ref-remove:hover { background: rgba(0,0,0,0.8); }
.el2-mine-inline {
  /* Subtle accent so the "My X" section reads as user-content vs the
     curated catalog rows. */
  border-color: rgba(139, 92, 246, 0.35);
  background: rgba(139, 92, 246, 0.06);
}
.el2-mine-inline:hover {
  border-color: rgba(139, 92, 246, 0.65);
}
.el2-my-img {
  background: #f0f0f3;
  border-radius: 6px;
}
.el2-my-img img,
.el2-my-img svg {
  width: 100%;
  height: 100%;
  object-fit: contain;
  /* No invert: user SVGs can be multi-color (invert would distort them, e.g.
     orange→blue). A light backdrop keeps mono/black icons visible too. */
  filter: none;
}

/* ══ Position sub-panel (Hito 4) ══ */
.pp-body { padding: 12px; display: flex; flex-direction: column; gap: 18px; }
.pp-section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(255,255,255,0.5);
  margin-bottom: 8px;
}
.pp-grid { display: grid; gap: 6px; }
.pp-grid-3 { grid-template-columns: repeat(3, 1fr); }
.pp-grid-2 { grid-template-columns: repeat(2, 1fr); }
.pp-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 6px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  color: var(--n-text, #e6e8ee);
  font-size: 11px;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
.pp-btn:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.18); }
.pp-btn-icon { display: flex; align-items: center; justify-content: center; height: 18px; }
.pp-btn-label { font-size: 11px; line-height: 1.2; text-align: center; }

.pp-coord-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.pp-coord {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: rgba(255,255,255,0.7);
}
.pp-coord input {
  flex: 1;
  padding: 6px 8px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 4px;
  color: var(--n-text, #e6e8ee);
  font-size: 12px;
  font-family: inherit;
  min-width: 0;
}
.pp-coord input:focus { outline: none; border-color: rgba(123, 97, 255, 0.6); }

.pp-rot-row {
  display: grid;
  grid-template-columns: auto 1fr 60px;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
}
.pp-rot-label { font-size: 12px; color: rgba(255,255,255,0.7); }
.pp-rot-row input[type="range"] { width: 100%; }
.pp-rot-row input[type="number"] {
  padding: 6px 8px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 4px;
  color: var(--n-text, #e6e8ee);
  font-size: 12px;
  font-family: inherit;
}

/* ══ Hito 3b refresh — Canva-style Fill/Stroke swatches + stroke popover ══ */
.tb-swatch-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  background: rgba(255,255,255,0.04);
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
.tb-swatch-chip:hover { background: rgba(255,255,255,0.10); }
.tb-swatch-chip.is-active { background: rgba(123,97,255,0.15); border-color: rgba(123,97,255,0.5); }
.tb-swatch {
  display: inline-block;
  width: 22px;
  height: 22px;
  border-radius: 5px;
}
.tb-swatch-solid { box-shadow: 0 0 0 1px rgba(0,0,0,0.35); }
.tb-swatch-ring {
  /* Hollow square — the stroke color paints the inner ring (3px wide),
     interior stays transparent so empty squares read as "no stroke". */
  background: transparent;
  border-radius: 5px;
  box-shadow: inset 0 0 0 3px var(--ring-color, #fff), 0 0 0 1px rgba(0,0,0,0.35);
}

/* Stroke style popover (Canva-style) */
.tb-stroke-style-menu {
  position: fixed;
  z-index: 70;
  min-width: 260px;
  padding: 8px 10px 12px;
  background: var(--n-panel, #1f242c);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  color: var(--n-text, #e6e8ee);
  user-select: none;
}
.tb-stroke-style-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  margin-bottom: 10px;
}
.tb-stroke-style-opt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  background: transparent;
  border: 1.5px solid transparent;
  border-radius: 6px;
  color: var(--n-text, #e6e8ee);
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}
.tb-stroke-style-opt:hover { background: rgba(255,255,255,0.06); }
.tb-stroke-style-opt.is-active { border-color: rgba(123,97,255,0.7); }
.tb-stroke-style-label {
  font-size: 12px;
  color: rgba(255,255,255,0.7);
  margin-bottom: 6px;
}
.tb-stroke-style-width-row {
  display: grid;
  grid-template-columns: 1fr 56px;
  gap: 8px;
  align-items: center;
}
.tb-stroke-width-range { width: 100%; accent-color: var(--n-accent, #7b61ff); }
.tb-stroke-width-num {
  padding: 6px 8px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 4px;
  color: var(--n-text, #e6e8ee);
  font-size: 12px;
  font-family: inherit;
  text-align: center;
}
.tb-stroke-style-btn {
  /* Triple-line chip used as trigger for the combined popover. */
  padding: 6px 8px;
}

/* ══ Position panel inner tabs (Hito 4) ══ */
.pos-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  padding: 0 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  margin-bottom: 12px;
}
.pos-tab {
  padding: 10px 0;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: rgba(255,255,255,0.6);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.12s, border-color 0.12s;
}
.pos-tab:hover { color: rgba(255,255,255,0.85); }
.pos-tab.is-active {
  color: var(--n-text, #e6e8ee);
  border-bottom-color: var(--n-accent, #7b61ff);
}
.pos-pane { display: none; padding: 0 12px 12px; }
.pos-pane.is-active { display: block; }

.pp-section { margin-bottom: 16px; }
.pp-section + .pp-section { margin-top: 16px; }
.pp-adv-grid {
  display: grid;
  gap: 6px 8px;
  align-items: end;
}
.pp-adv-grid + .pp-adv-grid { margin-top: 10px; }
.pp-adv-grid-wh { grid-template-columns: 1fr 1fr 40px; }
.pp-adv-grid-xyr { grid-template-columns: 1fr 1fr 1fr; }
.pp-adv-grid .pp-coord {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.pp-adv-grid .pp-coord span {
  font-size: 11px;
  color: rgba(255,255,255,0.55);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.pp-adv-grid .pp-coord input {
  width: 100%;
  padding: 6px 8px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 4px;
  color: var(--n-text, #e6e8ee);
  font-size: 12px;
  font-family: inherit;
  min-width: 0;
  box-sizing: border-box;
}
.pp-adv-grid .pp-coord input:focus {
  outline: none;
  border-color: rgba(123,97,255,0.6);
}
.pp-ratio-btn {
  align-self: end;
  width: 40px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 4px;
  color: var(--n-text, #e6e8ee);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
.pp-ratio-btn:hover { background: rgba(255,255,255,0.10); }
.pp-ratio-btn.is-active {
  background: rgba(123,97,255,0.18);
  border-color: rgba(123,97,255,0.6);
}

/* ══ Content panel — rediseñado 2026-05-19 (cards style, matches .pp-*) ══ */
.panel-section[data-section="content"] .ct-card {
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 10px;
}
.panel-section[data-section="content"] .ct-card:last-child { margin-bottom: 0; }

.ct-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.ct-card-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #ffffff;
}
.ct-card-badge {
  font-size: 9.5px;
  font-weight: 600;
  background: rgba(1,112,185,0.16);
  color: var(--n-primary, #0170b9);
  padding: 2px 7px;
  border-radius: 4px;
  text-transform: none;
  letter-spacing: 0;
}
.ct-counter {
  font-size: 10px;
  font-weight: 600;
  color: rgba(255,255,255,0.55);
  background: rgba(255,255,255,0.06);
  padding: 2px 8px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
  line-height: 1.4;
}

/* Fields */
.ct-field { margin-bottom: 10px; }
.ct-field:last-child { margin-bottom: 0; }
.ct-field label {
  display: block;
  font-size: 10.5px;
  color: rgba(255,255,255,0.6);
  margin-bottom: 5px;
  font-weight: 500;
  letter-spacing: 0.2px;
}
.ct-field input[type="text"],
.ct-field textarea {
  width: 100%;
  background: rgba(0,0,0,0.28);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--n-text, #e6e8ee);
  font-family: inherit;
  font-size: 12px;
  outline: none;
  box-sizing: border-box;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.ct-field input[type="text"]:hover,
.ct-field textarea:hover { border-color: rgba(255,255,255,0.14); }
.ct-field input[type="text"]:focus,
.ct-field textarea:focus {
  border-color: var(--n-primary, #0170b9);
  background: rgba(0,0,0,0.38);
  box-shadow: 0 0 0 3px rgba(1,112,185,0.16);
}
.ct-field textarea { resize: vertical; min-height: 40px; line-height: 1.45; }
.ct-field input::placeholder,
.ct-field textarea::placeholder { color: rgba(255,255,255,0.25); }

/* Benefits list */
.ct-blist {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0;
  margin: 0 0 8px 0;
}
.ct-brow {
  display: flex;
  position: relative;
  border-radius: 6px;
}
.ct-brow textarea {
  flex: 1;
  min-width: 0;
  background: rgba(0,0,0,0.28);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 6px;
  padding: 8px 32px 8px 10px;
  color: var(--n-text, #e6e8ee);
  font-family: inherit;
  font-size: 12px;
  line-height: 1.45;
  resize: none;
  outline: none;
  min-height: 36px;
  box-sizing: border-box;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.ct-brow textarea:hover { border-color: rgba(255,255,255,0.14); }
.ct-brow textarea:focus {
  border-color: var(--n-primary, #0170b9);
  background: rgba(0,0,0,0.38);
  box-shadow: 0 0 0 3px rgba(1,112,185,0.16);
}
.ct-brow textarea::placeholder { color: rgba(255,255,255,0.25); }
.ct-brm {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.35);
  cursor: pointer;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .15s, color .15s, background .15s;
  padding: 0;
}
.ct-brow:hover .ct-brm,
.ct-brow:focus-within .ct-brm { opacity: 1; }
.ct-brm:hover {
  color: #f87171;
  background: rgba(248,113,113,0.14);
}

/* Add benefit button */
.ct-add {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 9px 10px;
  background: rgba(255,255,255,0.025);
  border: 1px dashed rgba(255,255,255,0.13);
  color: rgba(255,255,255,0.55);
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 500;
  transition: all .15s;
}
.ct-add:hover {
  border-color: var(--n-primary, #0170b9);
  background: rgba(1,112,185,0.10);
  color: var(--n-primary, #0170b9);
}
.ct-add svg { stroke-width: 2.5; }

/* CTA live preview */
.ct-cta-preview-wrap {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ct-cta-preview-label {
  font-size: 10px;
  font-weight: 500;
  color: rgba(255,255,255,0.45);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.ct-cta-preview {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--ccta, var(--n-primary, #0170b9));
  color: #fff;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  pointer-events: none;
  user-select: none;
  max-width: 100%;
  box-shadow: 0 1px 0 rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.08);
}
.ct-cta-preview-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 200px;
}

/* ══ Adjust sub-panel — Hito 6 follow-up (2026-05-19) ══
   Reuses .adj-slider / .adj-group-title / .tab / .adj-reset-btn from the
   legacy panel-section CSS (still in base.css). This block only adds spacing
   for the sub-panel host + a chip style for the IMAGE topbar Edit button. */
.adj-sub-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.adj-sub-body .adj-target-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 6px;
}
.adj-sub-body .adj-target-tabs .tab {
  flex: 1;
}

/* Edit chip on the IMAGE topbar — same visual language as .tb-chip-position. */
.canvas-topbar .tb-chip-edit {
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  height: 28px;
  font-size: 11.5px;
  font-weight: 500;
}

/* Gradient chip — square swatch showing the live linear preview of the
   layer's gradient fill. Same footprint as fill/stroke chips. */
.canvas-topbar .tb-grad-chip .tb-swatch-grad {
  width: 18px;
  height: 18px;
  border-radius: 3px;
  border: 1px solid rgba(255,255,255,0.18);
  display: inline-block;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.18);
}

/* Gradient sub-panel host — modest padding so the editor breathes. The
   .grad-editor / .grad-bar / .grad-stop styles already exist (defined for
   the legacy inspector path) and apply unchanged. */
.grad-sub-body {
  padding: 12px;
}

/* Dedicated inline gradient topbar — replaces the standard topbar when a
   layer has fill.type === 'gradient'. All editor controls live inline; no
   sub-panel involved. */
.canvas-topbar .tb-grad-label {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,0.65);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 0 6px;
}

/* Stops bar — compact horizontal preview with absolute-positioned stop dots. */
.canvas-topbar .tb-grad-bar-wrap {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 4px;
}
.canvas-topbar .tb-grad-bar {
  position: relative;
  width: 160px;
  height: 18px;
  border-radius: 3px;
  border: 1px solid rgba(255,255,255,0.18);
  cursor: copy;
}
.canvas-topbar .tb-grad-stop {
  position: absolute;
  top: 100%;
  margin-top: 3px;
  transform: translateX(-50%);
  width: 12px;
  height: 12px;
  border: 2px solid #fff;
  outline: 1px solid rgba(0,0,0,0.5);
  border-radius: 50%;
  cursor: grab;
  padding: 0;
}
.canvas-topbar .tb-grad-stop:active { cursor: grabbing; }
.canvas-topbar .tb-grad-stop.active { box-shadow: 0 0 0 2px var(--n-primary, #0170b9); }

/* Icon buttons (Opacity, Offset, Angle, Pos, Delete) — same footprint as
   the standard tb-btn icons in the text/image topbars. */
.canvas-topbar .tb-grad-icon {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.7);
  border-radius: 4px;
  cursor: pointer;
}
.canvas-topbar .tb-grad-icon:not(:disabled):hover {
  background: rgba(255,255,255,0.08);
  color: var(--n-text, #e6e8ee);
}
.canvas-topbar .tb-grad-icon:disabled { opacity: 0.4; cursor: not-allowed; }
.canvas-topbar .tb-grad-del:not(:disabled):hover {
  color: #f87171;
  border-color: rgba(248,113,113,0.4);
  background: rgba(248,113,113,0.08);
}

/* Type chip + Edit chip — pill with current label and a caret. */
.canvas-topbar .tb-grad-type,
.canvas-topbar .tb-grad-edit-chip {
  height: 28px;
  padding: 0 10px;
  font-size: 11.5px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--n-text, #e6e8ee);
  border-radius: 4px;
  cursor: pointer;
}
.canvas-topbar .tb-grad-type:hover,
.canvas-topbar .tb-grad-edit-chip:hover {
  background: rgba(255,255,255,0.08);
}
.canvas-topbar .tb-grad-edit-swatch {
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 3px;
  border: 1px solid rgba(255,255,255,0.18);
}

/* Unified gradient Edit popover — bar with stops + active-stop controls. */
.tb-grad-edit-popover {
  min-width: 320px;
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tb-grad-edit-bar-wrap {
  padding: 4px 0 14px;
}
.tb-grad-edit-bar {
  position: relative;
  width: 100%;
  height: 22px;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.18);
  cursor: copy;
}
.tb-grad-edit-stop {
  position: absolute;
  top: 100%;
  margin-top: 4px;
  transform: translateX(-50%);
  width: 14px;
  height: 14px;
  border: 2px solid #fff;
  outline: 1px solid rgba(0,0,0,0.5);
  border-radius: 50%;
  cursor: grab;
  padding: 0;
}
.tb-grad-edit-stop:active { cursor: grabbing; }
.tb-grad-edit-stop.active { box-shadow: 0 0 0 2px var(--n-primary, #0170b9); }

.tb-grad-edit-row {
  display: grid;
  grid-template-columns: 60px 1fr 56px;
  align-items: center;
  gap: 8px;
}
.tb-grad-edit-label {
  font-size: 11px;
  color: rgba(255,255,255,0.6);
  font-weight: 500;
}
.tb-grad-edit-row input[type="range"] {
  width: 100%;
  accent-color: var(--n-primary, #0170b9);
}
.tb-grad-edit-color {
  grid-column: 2 / span 2;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  background: rgba(0,0,0,0.28);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 5px;
  cursor: pointer;
  font-family: inherit;
  transition: border-color .15s, background .15s;
}
.tb-grad-edit-color:hover {
  border-color: var(--n-primary, #0170b9);
  background: rgba(0,0,0,0.38);
}
.tb-grad-edit-color-swatch {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.2);
  display: inline-block;
  flex: 0 0 auto;
}
.tb-grad-edit-color-hex {
  font-family: 'SF Mono', Consolas, monospace;
  font-size: 11px;
  color: rgba(255,255,255,0.85);
  text-transform: lowercase;
}
.tb-grad-edit-del {
  margin-top: 4px;
  padding: 8px 12px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.65);
  font-size: 11.5px;
  font-weight: 500;
  border-radius: 5px;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color .15s, color .15s, background .15s;
}
.tb-grad-edit-del:hover:not(:disabled) {
  color: #f87171;
  border-color: rgba(248,113,113,0.4);
  background: rgba(248,113,113,0.08);
}
.tb-grad-edit-del:disabled { opacity: 0.4; cursor: not-allowed; }

/* Gradient kind dropdown menu */
.tb-grad-kind-menu {
  min-width: 140px;
}

/* Position popover body */
.tb-grad-pos-popover {
  min-width: 180px;
  padding: 10px 12px 12px;
}
.tb-grad-pos-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}
.tb-grad-pos-row .tb-grad-mini-label {
  min-width: 14px;
  font-size: 11px;
  color: rgba(255,255,255,0.6);
  font-weight: 500;
}
.tb-grad-pos-row .tb-input {
  flex: 1;
}
.tb-grad-mini-label {
  font-size: 10px;
  color: rgba(255,255,255,0.55);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  min-width: 14px;
  text-align: center;
}

/* Convert-back-to-solid X button */
.canvas-topbar .tb-grad-solid {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.55);
  border-radius: 4px;
  cursor: pointer;
}
.canvas-topbar .tb-grad-solid:hover {
  color: #f87171;
  border-color: rgba(248,113,113,0.5);
  background: rgba(248,113,113,0.10);
}

/* ══ Spacing popover (Letter spacing + Line height) — pending-3 2026-05-19 ══
   Reuses .tb-opacity-popover wrapper for borders/bg; adds 2-input rows. */
.tb-spacing-popover { min-width: 280px; padding: 10px 12px 12px; }
.tb-spacing-row {
  display: grid;
  grid-template-columns: 46px 1fr 56px;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}
.tb-spacing-label {
  font-size: 11px;
  color: rgba(255,255,255,0.6);
  font-weight: 500;
}
.tb-spacing-row input[type="range"] {
  width: 100%;
  accent-color: var(--n-primary, #0170b9);
}
.tb-spacing-reset {
  margin-top: 10px;
  width: 100%;
  padding: 6px 10px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.65);
  font-size: 11px;
  font-weight: 500;
  border-radius: 5px;
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.tb-spacing-reset:hover {
  border-color: var(--n-primary, #0170b9);
  color: var(--n-primary, #0170b9);
  background: rgba(1,112,185,0.08);
}

