/* ──────────────────────────────────────────────────────────────
   BCISM — Inline visual editor (loaded only when ?edit=1).
   Click-to-edit overlay for any [data-cms*] element. Scoped to
   .bce- classes so it never collides with the site's own styles.
   ──────────────────────────────────────────────────────────── */

/* keep room for the toolbar */
body.bce-on { padding-bottom: 80px; }

/* editable affordance */
.bce-editable {
  outline: 1.5px dashed rgba(37,99,235,.45);
  outline-offset: 3px;
  border-radius: 4px;
  cursor: text;
  transition: outline-color .12s ease, background .12s ease;
}
.bce-editable:hover { outline-color: rgba(37,99,235,.9); background: rgba(37,99,235,.06); }
.bce-editable:focus {
  outline: 2px solid #2563EB;
  background: rgba(37,99,235,.08);
}
.bce-img-wrap { position: relative; display: inline-block; }
.bce-img-wrap.bce-editable { cursor: pointer; }

/* floating label chip shown on hover */
.bce-chip {
  position: fixed;
  z-index: 2147483600;
  pointer-events: none;
  background: #0b1220;
  color: #cdd7ee;
  border: 1px solid rgba(37,99,235,.55);
  font: 600 11px/1 'Plus Jakarta Sans', system-ui, sans-serif;
  letter-spacing: .02em;
  padding: 5px 8px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(2px);
  transition: opacity .1s ease;
  box-shadow: 0 6px 20px rgba(0,0,0,.4);
}
.bce-chip.show { opacity: 1; transform: none; }

/* "replace image" / "edit link" buttons */
.bce-act {
  position: absolute;
  z-index: 2147483600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #2563EB;
  color: #fff;
  border: none;
  font: 600 11px/1 'Plus Jakarta Sans', system-ui, sans-serif;
  padding: 6px 9px;
  border-radius: 7px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,.4);
}
.bce-act:hover { background: #1d4ed8; }
.bce-act svg { width: 13px; height: 13px; }

/* link popover */
.bce-pop {
  position: fixed;
  z-index: 2147483640;
  background: #0b1220;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 12px;
  padding: 12px;
  width: 320px;
  box-shadow: 0 18px 50px rgba(0,0,0,.55);
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
}
.bce-pop label { display:block; font:600 11px/1 inherit; color:#9fb0d0; margin-bottom:6px; }
.bce-pop input {
  width:100%; box-sizing:border-box; background:#070b16; color:#eaf0ff;
  border:1px solid rgba(255,255,255,.16); border-radius:8px; padding:9px 10px;
  font:500 13px/1.2 inherit; margin-bottom:10px;
}
.bce-pop input:focus { outline:none; border-color:#2563EB; }
.bce-pop .bce-pop-row { display:flex; gap:8px; justify-content:flex-end; }

/* toolbar */
.bce-bar {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 2147483630;
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(10,14,24,.92);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 14px;
  padding: 8px;
  box-shadow: 0 20px 60px rgba(0,0,0,.55);
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
}
.bce-bar .bce-brand {
  display:flex; align-items:center; gap:7px; padding:0 8px 0 4px;
  color:#cdd7ee; font:700 12px/1 inherit; border-right:1px solid rgba(255,255,255,.1); margin-right:4px;
}
.bce-bar .bce-brand .bce-dot { width:7px; height:7px; border-radius:50%; background:#22c55e; box-shadow:0 0 8px #22c55e; }
.bce-btn {
  display:inline-flex; align-items:center; gap:6px;
  background:rgba(255,255,255,.06); color:#dbe4f7; border:1px solid rgba(255,255,255,.1);
  font:600 12px/1 inherit; padding:9px 12px; border-radius:9px; cursor:pointer; white-space:nowrap;
}
.bce-btn:hover { background:rgba(255,255,255,.12); }
.bce-btn:disabled { opacity:.45; cursor:default; }
.bce-btn svg { width:14px; height:14px; }
.bce-btn.bce-primary { background:#2563EB; border-color:#2563EB; color:#fff; }
.bce-btn.bce-primary:hover { background:#1d4ed8; }
.bce-btn.bce-ghost { background:transparent; }
.bce-seg { display:flex; gap:2px; background:rgba(255,255,255,.06); border-radius:9px; padding:3px; }
.bce-seg button {
  background:transparent; border:none; color:#9fb0d0; cursor:pointer; border-radius:6px;
  padding:6px 8px; font:600 12px/1 inherit; display:inline-flex;
}
.bce-seg button svg { width:14px; height:14px; }
.bce-seg button.active { background:#2563EB; color:#fff; }

.bce-status { font:600 11px/1 inherit; color:#9fb0d0; padding:0 6px; min-width:64px; text-align:center; }
.bce-status.dirty { color:#f59e0b; }
.bce-status.saved { color:#22c55e; }

/* device preview framing */
html.bce-device-tablet body, html.bce-device-mobile body {
  margin: 0 auto;
  box-shadow: 0 0 0 100vmax rgba(2,4,10,.82);
  transition: max-width .25s ease;
}
html.bce-device-tablet body { max-width: 820px; }
html.bce-device-mobile body { max-width: 412px; }

/* toast */
.bce-toast {
  position: fixed; left:50%; bottom:78px; transform:translateX(-50%);
  z-index:2147483645; background:#0b1220; color:#eaf0ff;
  border:1px solid rgba(255,255,255,.14); border-radius:10px; padding:10px 16px;
  font:600 13px/1 'Plus Jakarta Sans', system-ui, sans-serif;
  box-shadow:0 12px 40px rgba(0,0,0,.5); opacity:0; transition:opacity .15s, transform .15s;
}
.bce-toast.show { opacity:1; transform:translateX(-50%) translateY(-4px); }
.bce-toast.err { border-color:#ef4444; color:#fecaca; }

@media (max-width: 640px){
  .bce-bar { flex-wrap:wrap; max-width:calc(100vw - 24px); justify-content:center; }
  .bce-btn span:not([data-lucide]) { display:none; }
}

/* ── repeatable cards: add / remove / reorder ─────────────── */
.bce-item { position: relative; }
.bce-item.bce-item-hot { outline: 1.5px dashed rgba(34,197,94,.55); outline-offset: 4px; border-radius: 8px; }

/* per-card floating toolbar (top-right of the hovered card) */
.bce-item-tools {
  position: absolute; z-index: 2147483610;
  display: flex; gap: 4px; padding: 4px;
  background: rgba(10,14,24,.96);
  border: 1px solid rgba(255,255,255,.14); border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.5);
  opacity: 0; transform: translateY(-4px); transition: opacity .1s ease, transform .1s ease; pointer-events: none;
}
.bce-item:hover > .bce-item-tools,
.bce-item-tools:hover { opacity: 1; transform: none; pointer-events: auto; }
.bce-item-tools button {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; padding: 0;
  background: rgba(255,255,255,.06); color: #dbe4f7;
  border: 1px solid rgba(255,255,255,.1); border-radius: 7px; cursor: pointer;
}
.bce-item-tools button:hover { background: rgba(255,255,255,.16); color: #fff; }
.bce-item-tools button[disabled] { opacity: .35; cursor: default; }
.bce-item-tools button.bce-add { background: #2563EB; border-color: #2563EB; color: #fff; }
.bce-item-tools button.bce-add:hover { background: #1d4ed8; }
.bce-item-tools button.bce-del:hover { background: #b91c1c; border-color: #b91c1c; color: #fff; }
.bce-item-tools button svg { width: 14px; height: 14px; }

/* "add the first card" button shown when a group is emptied */
.bce-empty-add {
  display: inline-flex; align-items: center; gap: 6px;
  background: #2563EB; color: #fff; border: none; cursor: pointer;
  font: 600 12px/1 'Plus Jakarta Sans', system-ui, sans-serif;
  padding: 10px 14px; border-radius: 9px; margin: 8px 0;
}
.bce-empty-add:hover { background: #1d4ed8; }
.bce-empty-add svg { width: 14px; height: 14px; }
