.jr-bc-builder{
  --bg:#070b12;
  --panel:#0c1220;
  --muted:#94a3b8;
  --text:#e5e7eb;
  --border:rgba(148,163,184,.18);
  --shadow: 0 12px 40px rgba(0,0,0,.35);
  --radius:16px;
  --radius-sm:12px;
  --accent:#7c3aed;
  --focus: 0 0 0 3px rgba(124,58,237,.35);

  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  color:var(--text);
}

.jr-bc-builder *{box-sizing:border-box}

/* Give the builder its own "page" background without touching body/html. */
.jr-bc-builder{
  background:
    radial-gradient(1200px 700px at 10% 0%, rgba(124,58,237,.22), transparent 60%),
    radial-gradient(1000px 600px at 90% 10%, rgba(14,165,233,.18), transparent 55%),
    var(--bg);
  border-radius: 14px;
  overflow: hidden;
}

.jr-bc-builder .app{
  display:flex;
  flex-direction:column;
}

/* Disable sticky header inside WP pages. */
.jr-bc-builder .topbar{
  /* Force horizontal toolbar even if theme defines `.topbar` globally. */
  display:flex !important;
  flex-direction: row !important;
  justify-content:flex-end !important;
  align-items:center !important;
  gap:16px;
  padding:18px 20px;
  border-bottom:1px solid var(--border);
  background: rgba(7,11,18,.6);
  backdrop-filter: blur(10px);
  position: relative !important;
  top: auto !important;
  right: auto !important;
  bottom: auto !important;
  left: auto !important;
  width: 100% !important;
  height: auto !important;
  z-index: 10;
}

.jr-bc-builder .topbar__actions{
  display:flex !important;
  flex-direction: row !important;
  gap:10px;
  flex-wrap:wrap;
  justify-content:flex-end;
  width: 100%;
}

/* In-place text editor (caret inside the card text). */
.jr-bc-liveEditor{
  position: absolute;
  z-index: 1000000;
  display: none;
  min-width: 120px;
  max-width: min(720px, calc(100vw - 40px));
  padding: 0;
  margin: 0;
  border: 0;
  outline: 0;
  background: transparent;
  white-space: pre;
  line-height: 1;
  caret-color: currentColor;
  /* Prevent theme styles from affecting it */
  box-shadow: none;
}

.jr-bc-liveEditor:focus{
  outline: 0;
}

.jr-bc-builder .segmented{
  display:flex;
  border-radius: 12px;
  border:1px solid rgba(148,163,184,.22);
  background: rgba(2,6,23,.35);
  overflow:hidden;
}
.jr-bc-builder .segmented__btn{
  height:42px;
  padding:0 14px;
  border:0;
  background: transparent;
  color: rgba(229,231,235,.9);
  cursor:pointer;
}
.jr-bc-builder .segmented__btn:hover{background: rgba(2,6,23,.45)}
.jr-bc-builder .segmented__btn.isActive{
  background: linear-gradient(135deg, rgba(124,58,237,.85), rgba(14,165,233,.55));
  color: #fff;
}
.jr-bc-builder .segmented__btn:focus{outline:none; box-shadow: var(--focus)}

.jr-bc-builder .jr-bc-alignBar{
  display:flex;
  align-items:center;
  gap:8px;
}

.jr-bc-builder .jr-bc-alignLabel{
  font-size: 12px;
  color: rgba(148,163,184,.9);
  letter-spacing: .02em;
  white-space: nowrap;
}

.jr-bc-builder .jr-bc-alignGroup{
  display:flex;
  border-radius: 12px;
  border:1px solid rgba(148,163,184,.22);
  background: rgba(2,6,23,.35);
  overflow:hidden;
}

.jr-bc-builder .jr-bc-alignBtn{
  height:42px;
  padding:0 10px;
  border:0;
  background: transparent;
  color: rgba(229,231,235,.9);
  cursor:pointer;
  user-select: none;
}

.jr-bc-builder .jr-bc-alignBtn:hover{
  background: rgba(2,6,23,.45);
}

.jr-bc-builder .jr-bc-alignBtn:focus{
  outline:none;
  box-shadow: var(--focus);
}

.jr-bc-builder .jr-bc-alignBtn:disabled,
.jr-bc-builder .jr-bc-alignBtn.isDisabled{
  opacity: .45;
  cursor: not-allowed;
}

.jr-bc-builder .grid{
  display:grid;
  grid-template-columns: 1fr;
  gap:18px;
  padding:18px;
  width: 100%;
  margin: 0 auto;
}

.jr-bc-builder .panel{
  background: rgba(12,18,32,.7);
  border:1px solid var(--border);
  border-radius: var(--radius);
  padding:16px;
  box-shadow: var(--shadow);
}

.jr-bc-builder .input,.jr-bc-builder .select{
  height:42px;
  border-radius: 12px;
  border:1px solid rgba(148,163,184,.22);
  background: rgba(2,6,23,.55);
  color: var(--text);
  padding: 0 12px;
  outline:none;
}
.jr-bc-builder .input:focus,.jr-bc-builder .select:focus{
  box-shadow: var(--focus);
  border-color: rgba(124,58,237,.6);
}
.jr-bc-builder .input::placeholder{color: rgba(148,163,184,.55)}
.jr-bc-builder .input--color{padding: 0; height: 44px}
.jr-bc-builder .input--compact{height:42px; padding: 0 10px; width: 92px}
.jr-bc-builder .select--compact{height:42px; padding: 0 10px}
.jr-bc-builder .input--color.input--compact{width: 52px; padding: 0}

.jr-bc-builder .btn{
  height:42px;
  padding: 0 14px;
  border-radius: 12px;
  border:1px solid rgba(148,163,184,.22);
  background: rgba(2,6,23,.35);
  color: var(--text);
  cursor:pointer;
  transition: transform .08s ease, background .15s ease, border-color .15s ease;
}
.jr-bc-builder .btn:hover{
  background: rgba(2,6,23,.5);
  border-color: rgba(148,163,184,.35);
}
.jr-bc-builder .btn:active{transform: translateY(1px)}
.jr-bc-builder .btn:focus{outline:none; box-shadow: var(--focus)}
.jr-bc-builder .btn--primary{
  background: linear-gradient(135deg, rgba(124,58,237,.95), rgba(14,165,233,.75));
  border-color: rgba(124,58,237,.55);
}
.jr-bc-builder .btn--primary:hover{filter: brightness(1.02)}
.jr-bc-builder .btn--ghost{background: transparent}
.jr-bc-builder .btn--bold{
  width:42px;
  padding:0;
  font-size:16px;
  line-height:42px;
  text-align:center;
}
.jr-bc-builder .btn--bold.isActive{
  background: linear-gradient(135deg, rgba(124,58,237,.85), rgba(14,165,233,.55));
  border-color: rgba(124,58,237,.55);
  color: #fff;
}

.jr-bc-builder .preview{
  background: rgba(12,18,32,.35);
  border:1px solid var(--border);
  border-radius: var(--radius);
  padding:16px;
  box-shadow: var(--shadow);
  display:flex;
  flex-direction:column;
  gap:12px;
}
.jr-bc-builder .cardWrap{
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 18px;
  border-radius: var(--radius);
  border: 1px dashed rgba(148,163,184,.22);
  background:
    linear-gradient(transparent, transparent),
    radial-gradient(900px 450px at 50% 0%, rgba(124,58,237,.12), transparent 60%);
  min-height: 420px;
}

.jr-bc-builder .drawing{
  width: min(900px, 100%);
  aspect-ratio: 1050 / 600;
  position: relative;
}
.jr-bc-builder .drawing svg{
  width:100%;
  height:auto;
  display:block;
  border-radius: 0;
  box-shadow: 0 24px 60px rgba(0,0,0,.45);
}

/* Inline editor is appended to document.body, so must be globally styled. */
.jr-bc-inlineEditor{
  position: absolute;
  z-index: 9999;
  height: 38px;
  border-radius: 10px;
  border: 1px solid rgba(148,163,184,.35);
  background: rgba(2,6,23,.92);
  color: rgba(229,231,235,.95);
  padding: 0 10px;
  outline: none;
  box-shadow: 0 12px 40px rgba(0,0,0,.45), 0 0 0 3px rgba(124,58,237,.25);
}
.jr-bc-inlineEditor::selection{background: rgba(124,58,237,.35)}

.jr-bc-builder .drawing.isDropping svg{
  outline: 3px solid rgba(14,165,233,.5);
  outline-offset: 6px;
}

