/* ============================================================
   Booklet Maker Pro — v3.0.0
   Studio-lit 3D stage · two-column designer · step cards
   ============================================================ */

#bmp-wrap, #bmp-wrap *, #bmp-wrap *::before, #bmp-wrap *::after,
.bmp-editor-overlay, .bmp-editor-overlay *, .bmp-editor-overlay *::before, .bmp-editor-overlay *::after {
  box-sizing: border-box;
}

#bmp-wrap {
  /* ── design tokens ── */
  --bmp-ink:      #0b1220;
  --bmp-navy:     #0f172a;
  --bmp-slate-7:  #334155;
  --bmp-slate-5:  #64748b;
  --bmp-slate-4:  #94a3b8;
  --bmp-slate-2:  #e2e8f0;
  --bmp-slate-1:  #eef2f7;
  --bmp-line:     #e3e9f2;
  --bmp-blue:     #2563eb;
  --bmp-blue-d:   #1d4ed8;
  --bmp-blue-t:   #eff6ff;
  --bmp-amber:    #f59e0b;
  --bmp-amber-d:  #d97706;
  --bmp-green:    #10b981;
  --bmp-r-lg:     16px;
  --bmp-r-md:     11px;
  --bmp-r-sm:     8px;
  --bmp-shadow-card: 0 1px 2px rgba(15,23,42,.05), 0 10px 28px -12px rgba(15,23,42,.12);
  --bmp-shadow-pop:  0 4px 14px -4px rgba(37,99,235,.45);

  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  font-size: 14px;
  color: var(--bmp-ink);
  max-width: 1080px;
  margin: 0 auto;
  -webkit-font-smoothing: antialiased;
}

#bmp-wrap button { font-family: inherit; }

/* ── Restore Banner ────────────────────────────────────────── */
.bmp-restore-banner {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: #fffbeb; border: 1px solid #fde68a; border-radius: var(--bmp-r-md);
  padding: 11px 16px; margin-bottom: 16px; font-size: 13px; color: #92400e;
  box-shadow: var(--bmp-shadow-card);
}
.bmp-restore-icon { font-size: 16px; flex-shrink: 0; }
.bmp-restore-banner span { flex: 1; min-width: 0; }
.bmp-restore-btns { display: flex; gap: 6px; flex-shrink: 0; }
.bmp-restore-yes {
  background: var(--bmp-blue); color: #fff; border: none; border-radius: var(--bmp-r-sm);
  padding: 6px 14px; font-size: 12px; font-weight: 700; cursor: pointer;
  transition: transform .12s, box-shadow .12s;
}
.bmp-restore-yes:hover { transform: translateY(-1px); box-shadow: var(--bmp-shadow-pop); }
.bmp-restore-no {
  background: none; color: #92400e; border: 1px solid #fde68a;
  border-radius: var(--bmp-r-sm); padding: 6px 12px; font-size: 12px; cursor: pointer;
}
.bmp-restore-no:hover { background: rgba(0,0,0,.045); }

/* ── Two-column layout ─────────────────────────────────────── */
.bmp-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, 1fr);
  gap: 20px;
  align-items: start;
  margin-bottom: 20px;
}
.bmp-stage-col { position: sticky; top: 18px; min-width: 0; }
.bmp-panel-col { min-width: 0; }

/* ── Step cards ────────────────────────────────────────────── */
.bmp-step-card {
  background: #fff;
  border: 1px solid var(--bmp-line);
  border-radius: var(--bmp-r-lg);
  box-shadow: var(--bmp-shadow-card);
  padding: 20px;
}
.bmp-step-head {
  display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px;
}
.bmp-step-num {
  flex: none; width: 27px; height: 27px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--bmp-blue), #4f46e5);
  color: #fff; font-size: 13px; font-weight: 800;
  box-shadow: var(--bmp-shadow-pop);
}
.bmp-step-title { font-size: 15px; font-weight: 800; letter-spacing: -.01em; }
.bmp-step-sub   { font-size: 12.5px; color: var(--bmp-slate-5); margin-top: 2px; }

/* ── View Tabs (segmented) ─────────────────────────────────── */
.bmp-tabs {
  display: inline-flex; gap: 4px; margin-bottom: 12px;
  background: var(--bmp-slate-1); border-radius: 12px; padding: 4px;
}
.bmp-tab {
  padding: 8px 18px; border: none; border-radius: 9px;
  background: transparent; font-size: 13px; font-weight: 700; color: var(--bmp-slate-5);
  cursor: pointer; transition: all .16s;
}
.bmp-tab:hover  { color: var(--bmp-blue-d); }
.bmp-tab.active {
  background: #fff; color: var(--bmp-blue-d);
  box-shadow: 0 1px 3px rgba(15,23,42,.14);
}

/* ── 3D Stage ──────────────────────────────────────────────── */
.bmp-canvas-wrap {
  position: relative;
  border-radius: var(--bmp-r-lg);
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 50% 22%, rgba(96,165,250,.16) 0%, rgba(96,165,250,0) 55%),
    linear-gradient(165deg, #14203a 0%, #0b1220 52%, #101b32 100%);
  box-shadow: 0 2px 6px rgba(2,6,23,.4), 0 22px 48px -18px rgba(2,6,23,.55);
}
.bmp-canvas-wrap::after { /* vignette */
  content: ''; position: absolute; inset: 0; pointer-events: none;
  box-shadow: inset 0 0 90px rgba(2,6,23,.55);
  border-radius: inherit;
}
.bmp-3d-scene {
  position: relative;
  height: 420px;
  display: flex; align-items: center; justify-content: center;
  perspective: 1000px;
  touch-action: none;
}

/* Floor contact shadow (injected by viewer) */
.bmp-floor-shadow {
  position: absolute; left: 50%; bottom: 8%;
  width: 250px; height: 46px;
  background: radial-gradient(ellipse at center, rgba(1,4,12,.66) 0%, rgba(1,4,12,.30) 46%, transparent 72%);
  filter: blur(9px);
  transform: translateX(-50%);
  pointer-events: none;
}

/* Closed book */
.bmp-book-closed {
  position: relative;
  transform-style: preserve-3d;
  will-change: transform;
}
.bmp-bf {
  position: absolute; top: 0; left: 0;
  background-repeat: no-repeat;
  overflow: hidden;
}
#bmp-bf-front  { border-radius: 0 3px 3px 0; box-shadow: inset 0 1px 0 rgba(255,255,255,.16), inset -1px 0 0 rgba(255,255,255,.06); }
#bmp-bf-back   { border-radius: 0 3px 3px 0; box-shadow: inset 0 1px 0 rgba(255,255,255,.10); }
#bmp-bf-pages  { border-radius: 0 2px 2px 0; box-shadow: inset 0 2px 3px rgba(0,0,0,.18), inset 0 -2px 3px rgba(0,0,0,.18); }
#bmp-bf-spine  { box-shadow: inset 1px 0 2px rgba(255,255,255,.08), inset -1px 0 2px rgba(0,0,0,.25); }

/* Specular gloss sweep (injected by viewer) */
.bmp-gloss {
  position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(100deg,
    rgba(255,255,255,0)   32%,
    rgba(255,255,255,.60) 46%,
    rgba(255,255,255,.20) 54%,
    rgba(255,255,255,0)   68%);
  background-size: 260% 100%;
  background-repeat: no-repeat;
  opacity: 0;
  border-radius: inherit;
  z-index: 3;
}

/* Saddle staples — only with saddle binding */
.bmp-staple {
  display: none;
  position: absolute; left: 50%;
  width: 2px; height: 11px;
  transform: translateX(-50%);
  border-radius: 1px;
  background: linear-gradient(180deg, #f4f6f8, #98a2ae 55%, #ccd3db);
  box-shadow: 0 0 1px rgba(0,0,0,.55);
  z-index: 4;
}
.bmp-binding-saddle .bmp-staple { display: block; }

/* Perfect-bound hinge grooves on the covers */
.bmp-binding-perfect #bmp-bf-front::before,
.bmp-binding-perfect #bmp-bf-back::before {
  content: ''; position: absolute; top: 0; bottom: 0; width: 2px;
  background: linear-gradient(180deg, rgba(0,0,0,.30), rgba(0,0,0,.14) 50%, rgba(0,0,0,.30));
  z-index: 2;
}
.bmp-binding-perfect #bmp-bf-front::before { left: 6px; }
.bmp-binding-perfect #bmp-bf-back::before  { right: 6px; }

/* Cover logo overlay */
#bmp-bf-logo {
  position: absolute; inset: 0; display: none; z-index: 1;
}

/* Cover placeholder */
.bmp-bf-ph {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  color: rgba(255,255,255,.5);
  text-align: center; padding: 10px;
}
.bmp-bf-ph strong { font-size: 10px; letter-spacing: .14em; font-weight: 800; }
.bmp-bf-ph small  { font-size: 8.5px; letter-spacing: .04em; }

/* Open book (inside view) */
.bmp-book-open {
  position: relative;
  width: 360px; max-width: 86%;
  height: 240px;
  display: flex;
  transform-style: preserve-3d;
  will-change: transform;
  filter: drop-shadow(0 26px 22px rgba(1,4,12,.5));
}
.bmp-bo-page {
  flex: 1; position: relative;
  background: #fff;
  background-size: cover; background-position: center;
  overflow: hidden;
}
.bmp-bo-page:first-child { border-radius: 4px 0 0 4px; }
.bmp-bo-page:last-child  { border-radius: 0 4px 4px 0; }
/* gutter shading pulls the spread into the spine */
#bmp-bo-left::after, #bmp-bo-right::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
}
#bmp-bo-left::after  { background: linear-gradient(to right, rgba(255,255,255,0) 78%, rgba(15,23,42,.14)); }
#bmp-bo-right::after { background: linear-gradient(to left,  rgba(255,255,255,0) 78%, rgba(15,23,42,.18)); }
#bmp-bo-spine { width: 10px; flex: none; }
.bmp-bo-lines {
  position: absolute; inset: 14% 12%;
  background: repeating-linear-gradient(180deg, transparent 0 9px, rgba(148,163,184,.35) 9px 10px);
  opacity: .5;
}
.bmp-bo-label {
  position: absolute; bottom: 7px; left: 0; right: 0;
  text-align: center; font-size: 8.5px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--bmp-slate-4);
}

/* Spread label pill inside stage */
.bmp-spread-label-css {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
  font-size: 11px; font-weight: 600; letter-spacing: .04em;
  color: rgba(226,232,240,.85);
  background: rgba(15,23,42,.5);
  border: 1px solid rgba(255,255,255,.09);
  padding: 4px 12px; border-radius: 999px;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  pointer-events: none;
}
.bmp-spread-label-css:empty { display: none; }

/* Snap chips */
.bmp-snap-chips {
  position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 6px; z-index: 5;
}
.bmp-snap-chip {
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(15,23,42,.55);
  color: #dbe4f0;
  font-size: 11.5px; font-weight: 700;
  padding: 6px 13px; border-radius: 999px; cursor: pointer;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transition: all .15s;
}
.bmp-snap-chip:hover  { background: rgba(37,99,235,.45); border-color: rgba(147,197,253,.4); }
.bmp-snap-chip.active { background: var(--bmp-blue); border-color: var(--bmp-blue); color: #fff; box-shadow: var(--bmp-shadow-pop); }

/* Inside-view nav overlay */
.bmp-inside-nav {
  position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px; z-index: 6;
  background: rgba(15,23,42,.55);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 999px; padding: 5px 8px;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.bmp-inside-arrow {
  width: 26px; height: 26px; border-radius: 50%;
  border: none; background: rgba(255,255,255,.12); color: #e2e8f0;
  font-size: 13px; cursor: pointer; transition: background .15s;
  display: inline-flex; align-items: center; justify-content: center;
}
.bmp-inside-arrow:hover:not(:disabled) { background: var(--bmp-blue); }
.bmp-inside-arrow:disabled { opacity: .35; cursor: default; }
.bmp-inside-label { font-size: 11.5px; font-weight: 600; color: #dbe4f0; white-space: nowrap; }

.bmp-3d-hint {
  text-align: center; font-size: 11.5px; color: var(--bmp-slate-4);
  margin: 10px 0 0;
}

/* ── Controls ──────────────────────────────────────────────── */
.bmp-control-row {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 11px 0;
  border-top: 1px solid var(--bmp-slate-1);
}
.bmp-control-label {
  flex: none; width: 88px; padding-top: 8px;
  font-size: 11px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase;
  color: var(--bmp-slate-5);
}

/* Segmented toggles */
.bmp-toggle {
  display: flex; gap: 4px; flex: 1;
  background: var(--bmp-slate-1); border-radius: 10px; padding: 3px;
}
.bmp-toggle-btn {
  flex: 1; padding: 8px 6px; border: none; border-radius: 8px;
  background: transparent; font-size: 12.5px; font-weight: 700; color: var(--bmp-slate-5);
  cursor: pointer; transition: all .15s; white-space: nowrap;
}
.bmp-toggle-btn:hover  { color: var(--bmp-blue-d); }
.bmp-toggle-btn.active { background: #fff; color: var(--bmp-blue-d); box-shadow: 0 1px 3px rgba(15,23,42,.14); }

/* Selects */
.bmp-select {
  flex: 1; width: 100%;
  appearance: none; -webkit-appearance: none;
  border: 1.5px solid var(--bmp-slate-2); border-radius: 10px;
  background: #fff url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 12px center;
  padding: 9px 34px 9px 12px;
  font-size: 13px; font-weight: 600; color: var(--bmp-ink);
  cursor: pointer; transition: border-color .15s, box-shadow .15s;
}
.bmp-select:hover { border-color: var(--bmp-slate-4); }
.bmp-select:focus { outline: none; border-color: var(--bmp-blue); box-shadow: 0 0 0 3px rgba(37,99,235,.14); }

/* Upload areas */
.bmp-upload-area {
  flex: 1;
  display: flex; align-items: center; gap: 9px;
  border: 1.5px dashed var(--bmp-slate-2); border-radius: 10px;
  background: #fbfcfe;
  padding: 11px 13px; cursor: pointer;
  font-size: 12.5px; color: var(--bmp-slate-5); font-weight: 600;
  transition: all .16s;
}
.bmp-upload-area:hover, .bmp-upload-area.bmp-drag-over {
  border-color: var(--bmp-blue); background: var(--bmp-blue-t); color: var(--bmp-blue-d);
}
.bmp-upload-area svg { flex: none; }
.bmp-remove-art {
  margin-top: 7px;
  background: none; border: none; color: #dc2626;
  font-size: 12px; font-weight: 700; cursor: pointer; padding: 2px 0;
}
.bmp-remove-art:hover { text-decoration: underline; }

/* Logo block */
.bmp-logo-section { flex: 1; min-width: 0; }
.bmp-logo-controls {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  border: 1.5px solid var(--bmp-slate-2); border-radius: 10px;
  padding: 10px 12px; background: #fbfcfe;
}
.bmp-logo-preview-wrap {
  width: 52px; height: 52px; flex: none;
  border-radius: 8px; border: 1px solid var(--bmp-slate-2);
  background:
    linear-gradient(45deg, #eef1f6 25%, transparent 25%, transparent 75%, #eef1f6 75%),
    linear-gradient(45deg, #eef1f6 25%, #fff 25%, #fff 75%, #eef1f6 75%);
  background-size: 12px 12px; background-position: 0 0, 6px 6px;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.bmp-logo-preview-wrap img { max-width: 100%; max-height: 100%; }
.bmp-logo-sliders { flex: 1; min-width: 130px; }
.bmp-slider-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 11.5px; font-weight: 700; color: var(--bmp-slate-5);
}
.bmp-slider-label input[type="range"] { flex: 1; accent-color: var(--bmp-blue); }

/* ── CMYK Section ──────────────────────────────────────────── */
.bmp-cmyk-section { padding-bottom: 13px; }
.bmp-cmyk-section-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase;
  color: var(--bmp-slate-5);
  margin-bottom: 10px;
}
.bmp-cmyk-only-tag {
  font-size: 9.5px; font-weight: 800; letter-spacing: .05em;
  color: var(--bmp-blue-d); background: var(--bmp-blue-t);
  border: 1px solid #bfdbfe;
  padding: 2px 8px; border-radius: 999px;
}
.bmp-cmyk-palette {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 7px;
  margin-bottom: 12px;
}
.bmp-cmyk-swatch {
  height: 30px; border: none; border-radius: 8px; cursor: pointer;
  transition: transform .12s, box-shadow .12s;
  box-shadow: inset 0 0 0 1px rgba(15,23,42,.08);
}
.bmp-cmyk-swatch:hover { transform: translateY(-2px) scale(1.05); }
.bmp-cmyk-swatch.active {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4.5px var(--bmp-blue);
  transform: scale(1.04);
}
.bmp-cmyk-bottom {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
}
.bmp-selected-color { display: flex; align-items: center; gap: 10px; }
.bmp-selected-swatch {
  width: 38px; height: 38px; border-radius: 10px;
  box-shadow: inset 0 0 0 1px rgba(15,23,42,.1), 0 2px 6px rgba(15,23,42,.14);
}
.bmp-selected-name   { font-size: 13px; font-weight: 800; }
.bmp-selected-values { font-size: 11px; color: var(--bmp-slate-5); font-variant-numeric: tabular-nums; }
.bmp-cmyk-inputs { display: flex; align-items: center; gap: 6px; }
.bmp-custom-label {
  font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  color: var(--bmp-slate-4); margin-right: 2px;
}
.bmp-ci { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.bmp-ci span { font-size: 9.5px; font-weight: 900; }
.bmp-ci-c span { color: #0891b2; }
.bmp-ci-m span { color: #db2777; }
.bmp-ci-y span { color: #ca8a04; }
.bmp-ci-k span { color: var(--bmp-slate-7); }
.bmp-ci input {
  width: 44px; padding: 6px 4px; text-align: center;
  border: 1.5px solid var(--bmp-slate-2); border-radius: 8px;
  font-size: 12.5px; font-weight: 700; color: var(--bmp-ink);
  -moz-appearance: textfield;
}
.bmp-ci input::-webkit-outer-spin-button, .bmp-ci input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.bmp-ci input:focus { outline: none; border-color: var(--bmp-blue); box-shadow: 0 0 0 3px rgba(37,99,235,.14); }

/* ── Live Price Box ────────────────────────────────────────── */
.bmp-price-box {
  margin-top: 16px;
  border-radius: 14px;
  padding: 16px 18px;
  background:
    radial-gradient(120% 140% at 85% 0%, rgba(37,99,235,.35) 0%, rgba(37,99,235,0) 55%),
    linear-gradient(160deg, #101b32, #0b1220);
  color: #fff;
  box-shadow: 0 2px 6px rgba(2,6,23,.3), 0 16px 34px -16px rgba(2,6,23,.5);
}
.bmp-price-top {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 6px;
}
.bmp-price-heading {
  font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  color: #93a6c4;
}
.bmp-price-live {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: #6ee7b7;
  background: rgba(16,185,129,.12);
  border: 1px solid rgba(16,185,129,.3);
  padding: 3px 9px; border-radius: 999px;
}
.bmp-live-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #34d399;
  animation: bmpPulse 1.6s ease-in-out infinite;
}
@keyframes bmpPulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(52,211,153,.5); }
  50%      { opacity: .6; box-shadow: 0 0 0 4px rgba(52,211,153,0); }
}
.bmp-price-total {
  font-size: 34px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.bmp-price-per {
  font-size: 13px; font-weight: 700; color: #7dd3fc;
  margin-top: 3px; font-variant-numeric: tabular-nums;
}
.bmp-price-note {
  font-size: 11px; color: #93a6c4; margin-top: 8px;
  padding-top: 9px; border-top: 1px solid rgba(255,255,255,.08);
}

/* ── Interior Section ──────────────────────────────────────── */
.bmp-interior-section { margin-bottom: 20px; }
.bmp-interior-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.bmp-autosave-ind { color: var(--bmp-green); font-weight: 700; }

.bmp-spreads {
  display: flex; gap: 12px;
  overflow-x: auto; padding: 4px 2px 12px;
  scroll-snap-type: x proximity;
  scrollbar-width: thin; scrollbar-color: var(--bmp-slate-2) transparent;
}
.bmp-no-spreads { color: var(--bmp-slate-5); font-size: 13px; padding: 8px 2px; }
.bmp-spread-thumb {
  flex: none; width: 174px;
  cursor: pointer; scroll-snap-align: start;
  border: 1.5px solid var(--bmp-line); border-radius: 12px;
  padding: 8px; background: #fff;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.bmp-spread-thumb:hover {
  transform: translateY(-3px);
  border-color: #bfdbfe;
  box-shadow: 0 10px 22px -10px rgba(15,23,42,.22);
}
.bmp-spread-thumb.bmp-thumb-active { border-color: var(--bmp-blue); box-shadow: 0 0 0 3px rgba(37,99,235,.14); }
.bmp-spread-thumb.bmp-has-content .bmp-thumb-label { color: var(--bmp-ink); }
.bmp-thumb-pages {
  display: flex; gap: 3px;
  background: var(--bmp-slate-1); border-radius: 8px; padding: 6px;
}
.bmp-thumb-gutter { width: 1px; background: var(--bmp-slate-2); }
.bmp-page-thumb {
  flex: 1; aspect-ratio: 8.5 / 11; position: relative;
  background: #fff; border-radius: 3px; overflow: hidden;
  box-shadow: 0 1px 2.5px rgba(15,23,42,.16);
}
.bmp-thumb-region  { position: absolute; overflow: hidden; }
.bmp-thumb-heading { font-size: 4.5px; font-weight: 800; color: #111; line-height: 1.25; }
.bmp-thumb-text    { font-size: 3.6px; color: #475569; line-height: 1.4; }
.bmp-thumb-img-empty {
  background: repeating-linear-gradient(45deg, #eef1f6 0 4px, #f7f9fc 4px 8px);
  border-radius: 1.5px;
}
.bmp-thumb-label {
  margin-top: 7px; text-align: center;
  font-size: 11px; font-weight: 700; color: var(--bmp-slate-5);
}
.bmp-edited-dot { color: var(--bmp-green); font-size: 8px; vertical-align: 1px; }

/* Bottom spread nav */
.bmp-snav {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding-top: 4px;
}
.bmp-snav-btn {
  width: 30px; height: 30px; border-radius: 50%;
  border: 1.5px solid var(--bmp-slate-2); background: #fff; color: var(--bmp-slate-7);
  font-size: 14px; cursor: pointer; transition: all .14s;
  display: inline-flex; align-items: center; justify-content: center;
}
.bmp-snav-btn:hover:not(:disabled) { border-color: var(--bmp-blue); color: var(--bmp-blue); background: var(--bmp-blue-t); }
.bmp-snav-btn:disabled { opacity: .35; cursor: default; }
.bmp-snav-label { font-size: 12px; font-weight: 700; color: var(--bmp-slate-5); font-variant-numeric: tabular-nums; }

/* ── Live Spread Preview ───────────────────────────────────── */
.bmp-preview-section {
  background: #fff;
  border: 1px solid var(--bmp-line);
  border-radius: var(--bmp-r-lg);
  box-shadow: var(--bmp-shadow-card);
  padding: 20px;
  margin-bottom: 20px;
}
.bmp-preview-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 14px;
}
.bmp-preview-title { font-size: 15px; font-weight: 800; letter-spacing: -.01em; }
.bmp-preview-nav { display: flex; align-items: center; gap: 10px; }
.bmp-flip-btn {
  width: 30px; height: 30px; border-radius: 50%;
  border: 1.5px solid var(--bmp-slate-2); background: #fff; color: var(--bmp-slate-7);
  font-size: 14px; cursor: pointer; transition: all .14s;
  display: inline-flex; align-items: center; justify-content: center;
}
.bmp-flip-btn:hover:not(:disabled) { border-color: var(--bmp-blue); color: var(--bmp-blue); background: var(--bmp-blue-t); }
.bmp-flip-btn:disabled { opacity: .35; cursor: default; }
.bmp-flip-label { font-size: 12px; font-weight: 700; color: var(--bmp-slate-5); font-variant-numeric: tabular-nums; }

.bmp-preview-stage {
  background: linear-gradient(170deg, var(--bmp-slate-1), #e6ebf3);
  border-radius: 12px; padding: 26px 18px;
  overflow: hidden;
}
.bmp-preview-spread {
  display: flex; justify-content: center; gap: 0;
  max-width: 560px; margin: 0 auto;
  transition: opacity .2s, transform .22s;
}
.bmp-preview-gutter { width: 1px; background: rgba(15,23,42,.14); flex: none; }
.bmp-preview-page {
  flex: 1; max-width: 265px; aspect-ratio: 8.5 / 11;
  background: #fff; position: relative;
  box-shadow: 0 2px 5px rgba(15,23,42,.12), 0 14px 30px -14px rgba(15,23,42,.28);
}
.bmp-preview-page:first-child { border-radius: 4px 0 0 4px; }
.bmp-preview-page:last-child  { border-radius: 0 4px 4px 0; }
.bmp-preview-inner { position: absolute; inset: 6.5%; }
.bmp-preview-region { position: absolute; overflow: hidden; }
.bmp-preview-text-r { color: #1f2937; word-break: break-word; }
.bmp-preview-img-ph { background: repeating-linear-gradient(45deg, #eef1f6 0 6px, #f7f9fc 6px 12px); border-radius: 3px; }
.bmp-preview-blank-hint {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--bmp-slate-4); font-size: 12px; text-align: center; line-height: 1.7;
}
.bmp-preview-pnum {
  position: absolute; bottom: 4.5%; left: 0; right: 0;
  text-align: center; font-size: 9px; color: var(--bmp-slate-4);
}

/* flip animations */
@keyframes bmpOutL { from { opacity: 1; transform: translateX(0); }    to { opacity: 0; transform: translateX(-26px); } }
@keyframes bmpOutR { from { opacity: 1; transform: translateX(0); }    to { opacity: 0; transform: translateX(26px); } }
@keyframes bmpInL  { from { opacity: 0; transform: translateX(-26px); } to { opacity: 1; transform: translateX(0); } }
@keyframes bmpInR  { from { opacity: 0; transform: translateX(26px); }  to { opacity: 1; transform: translateX(0); } }
.bmp-flip-out-left  { animation: bmpOutL .22s both; }
.bmp-flip-out-right { animation: bmpOutR .22s both; }
.bmp-flip-in-left   { animation: bmpInL  .3s both; }
.bmp-flip-in-right  { animation: bmpInR  .3s both; }

/* ── Export bar (Step 3) ───────────────────────────────────── */
.bmp-export-bar .bmp-step-head { margin-bottom: 14px; }
.bmp-header-actions {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
}
.bmp-load-btn, .bmp-save-btn, .bmp-cover-pdf-btn, .bmp-download-btn {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12.5px; font-weight: 800;
  border-radius: 10px; padding: 10px 16px; cursor: pointer;
  transition: all .15s;
}
.bmp-load-btn, .bmp-save-btn {
  background: #fff; color: var(--bmp-slate-7);
  border: 1.5px solid var(--bmp-slate-2);
}
.bmp-load-btn:hover, .bmp-save-btn:hover { border-color: var(--bmp-slate-4); background: var(--bmp-slate-1); }
.bmp-cover-pdf-btn {
  background: #fff; color: var(--bmp-blue-d);
  border: 1.5px solid #bfdbfe;
}
.bmp-cover-pdf-btn:hover { background: var(--bmp-blue-t); border-color: var(--bmp-blue); }
.bmp-download-btn {
  background: linear-gradient(135deg, var(--bmp-blue), #4f46e5);
  color: #fff; border: none;
  box-shadow: var(--bmp-shadow-pop);
}
.bmp-download-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 20px -6px rgba(37,99,235,.55); }
.bmp-download-btn:disabled, .bmp-cover-pdf-btn:disabled { opacity: .6; cursor: wait; transform: none; }

.bmp-quote-cta {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin-top: 16px; padding: 14px 16px;
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  border: 1px solid #fde68a; border-radius: 12px;
}
.bmp-quote-txt { font-size: 13.5px; font-weight: 700; color: #92400e; flex: 1; }
.bmp-quote-btn {
  display: inline-block;
  background: linear-gradient(135deg, var(--bmp-amber), var(--bmp-amber-d));
  color: #fff !important; text-decoration: none !important;
  font-size: 13px; font-weight: 800;
  padding: 10px 20px; border-radius: 10px;
  box-shadow: 0 4px 14px -4px rgba(217,119,6,.5);
  transition: transform .13s, box-shadow .13s;
}
.bmp-quote-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 20px -6px rgba(217,119,6,.6); }

/* ── Editor Modal ──────────────────────────────────────────── */
.bmp-editor-overlay {
  position: fixed; inset: 0; z-index: 99999;
  background: rgba(2,6,23,.64);
  backdrop-filter: blur(7px); -webkit-backdrop-filter: blur(7px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}
.bmp-editor-modal {
  background: #f6f8fb;
  width: 100%; max-width: 1060px; height: min(88vh, 780px);
  border-radius: 18px;
  box-shadow: 0 40px 90px -20px rgba(2,6,23,.6);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.bmp-editor-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: #fff; border-bottom: 1px solid #e3e9f2;
  padding: 13px 18px;
}
.bmp-editor-nav { display: flex; align-items: center; gap: 12px; }
.bmp-nav-btn {
  border: 1.5px solid #e2e8f0; background: #fff; color: #334155;
  font-size: 12.5px; font-weight: 700; border-radius: 9px;
  padding: 7px 13px; cursor: pointer; transition: all .14s;
}
.bmp-nav-btn:hover:not(:disabled) { border-color: #2563eb; color: #2563eb; background: #eff6ff; }
.bmp-nav-btn:disabled { opacity: .35; cursor: default; }
.bmp-editor-spread-label { font-size: 13.5px; font-weight: 800; color: #0b1220; }
.bmp-editor-done {
  border: none; border-radius: 10px;
  background: linear-gradient(135deg, #2563eb, #4f46e5); color: #fff;
  font-size: 13px; font-weight: 800; padding: 9px 20px; cursor: pointer;
  box-shadow: 0 4px 14px -4px rgba(37,99,235,.45);
  transition: transform .13s, box-shadow .13s;
}
.bmp-editor-done:hover { transform: translateY(-1px); }

.bmp-editor-body {
  flex: 1; min-height: 0;
  display: flex;
}
.bmp-editor-spread-area {
  flex: 1; min-width: 0;
  display: flex; align-items: center; justify-content: center; gap: 0;
  padding: 26px; overflow: auto;
}
.bmp-editor-col { flex: 1; max-width: 350px; }
.bmp-editor-gutter { width: 14px; flex: none; }
.bmp-editor-page {
  position: relative; width: 100%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(15,23,42,.12), 0 18px 40px -18px rgba(15,23,42,.3);
  border-radius: 4px;
}
.bmp-page-regions { position: absolute; inset: 6.5%; }
.bmp-page-num {
  position: absolute; bottom: 2.5%; left: 0; right: 0;
  text-align: center; font-size: 10px; color: #94a3b8;
}
.bmp-blank-hint {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  text-align: center; color: #94a3b8; font-size: 12.5px; padding: 20px;
}

/* Editable regions */
.bmp-region-text {
  background: transparent;
  border: 1.5px dashed rgba(37,99,235,.0);
  border-radius: 4px;
  resize: none; overflow: hidden;
  padding: 2px 4px;
  line-height: 1.5;
  transition: border-color .15s, background .15s;
}
.bmp-region-text:hover { border-color: rgba(37,99,235,.35); }
.bmp-region-text:focus {
  outline: none; border-color: #2563eb; background: rgba(239,246,255,.6);
}
.bmp-region-text::placeholder { color: #b6c2d4; }
.bmp-region-image {
  border-radius: 4px; overflow: hidden;
  background: #f1f5fb;
  border: 1.5px dashed #cbd5e1;
  transition: border-color .15s;
}
.bmp-region-image:hover { border-color: #2563eb; }
.bmp-img-placeholder {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px;
  color: #94a3b8; font-size: 11.5px; font-weight: 600;
}
.bmp-ri-hint {
  position: absolute; bottom: 6px; left: 50%; transform: translateX(-50%);
  background: rgba(15,23,42,.72); color: #e2e8f0;
  font-size: 9.5px; font-weight: 600; letter-spacing: .02em;
  padding: 3px 10px; border-radius: 999px;
  pointer-events: none; white-space: nowrap;
  display: none; align-items: center;
  z-index: 3;
}

/* Props panel */
.bmp-props-panel {
  flex: none; width: 264px;
  background: #fff; border-left: 1px solid #e3e9f2;
  padding: 16px; overflow-y: auto;
}
.bmp-page-tabs {
  display: flex; gap: 4px; margin-bottom: 16px;
  background: #eef2f7; border-radius: 10px; padding: 3px;
}
.bmp-page-tab {
  flex: 1; padding: 7px 4px; border: none; border-radius: 8px;
  background: transparent; font-size: 12px; font-weight: 700; color: #64748b;
  cursor: pointer; transition: all .15s;
}
.bmp-page-tab.active { background: #fff; color: #1d4ed8; box-shadow: 0 1px 3px rgba(15,23,42,.14); }
.bmp-props-label {
  font-size: 10.5px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase;
  color: #64748b; margin-bottom: 9px;
}
.bmp-props-layouts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; }
.bmp-layout-card {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  border: 1.5px solid #e2e8f0; border-radius: 10px;
  background: #fff; color: #64748b;
  padding: 10px 4px 8px; cursor: pointer;
  font-size: 10.5px; font-weight: 700;
  transition: all .14s;
}
.bmp-layout-card:hover  { border-color: #93c5fd; color: #1d4ed8; transform: translateY(-1px); }
.bmp-layout-card.active { border-color: #2563eb; background: #eff6ff; color: #1d4ed8; box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.bmp-props-divider { height: 1px; background: #e9eef6; margin: 16px 0; }
.bmp-prop-row {
  display: flex; align-items: center; gap: 9px;
  margin-bottom: 11px;
}
.bmp-prop-row-top { align-items: flex-start; }
.bmp-prop-label { flex: none; width: 40px; font-size: 11.5px; font-weight: 700; color: #64748b; }
.bmp-prop-select {
  flex: 1; appearance: none; -webkit-appearance: none;
  border: 1.5px solid #e2e8f0; border-radius: 8px;
  background: #fff url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 9px center;
  padding: 7px 26px 7px 9px;
  font-size: 12px; font-weight: 600; color: #0b1220; cursor: pointer;
}
.bmp-prop-num {
  width: 62px; border: 1.5px solid #e2e8f0; border-radius: 8px;
  padding: 7px 8px; font-size: 12px; font-weight: 700; color: #0b1220;
}
.bmp-prop-unit { font-size: 11px; color: #94a3b8; font-weight: 700; }
.bmp-tc-swatches { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }
.bmp-tc-swatch {
  width: 26px; height: 26px; border: none; border-radius: 7px; cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(15,23,42,.1);
  transition: transform .12s, box-shadow .12s;
}
.bmp-tc-swatch:hover  { transform: scale(1.12); }
.bmp-tc-swatch.active { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #2563eb; }
.bmp-props-empty {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  color: #94a3b8; text-align: center;
  font-size: 12px; line-height: 1.6;
  padding: 22px 10px;
}

/* ── Toast ─────────────────────────────────────────────────── */
.bmp-toast {
  position: fixed; bottom: 28px; left: 50%;
  transform: translateX(-50%) translateY(14px);
  background: #0b1220; color: #e2e8f0;
  font-size: 13px; font-weight: 600;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  padding: 12px 22px; border-radius: 12px;
  box-shadow: 0 14px 40px -8px rgba(2,6,23,.5);
  opacity: 0; transition: all .3s cubic-bezier(.2,.9,.3,1.2);
  z-index: 999999; pointer-events: none;
}
.bmp-toast-show  { opacity: 1; transform: translateX(-50%) translateY(0); }
.bmp-toast-error { background: #b91c1c; color: #fff; }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 1019px) {
  .bmp-layout { grid-template-columns: 1fr; }
  .bmp-stage-col { position: static; }
  .bmp-3d-scene { height: 360px; }
}
@media (max-width: 720px) {
  .bmp-3d-scene { height: 300px; }
  .bmp-control-row { flex-direction: column; gap: 7px; }
  .bmp-control-label { width: auto; padding-top: 0; }
  .bmp-cmyk-palette { grid-template-columns: repeat(7, 1fr); }
  .bmp-cmyk-bottom { flex-direction: column; align-items: flex-start; }
  .bmp-preview-stage { padding: 16px 10px; }
  .bmp-editor-overlay { padding: 0; }
  .bmp-editor-modal { height: 100vh; max-width: none; border-radius: 0; }
  .bmp-editor-body { flex-direction: column; overflow-y: auto; }
  .bmp-editor-spread-area { overflow: visible; padding: 18px; flex-wrap: wrap; }
  .bmp-props-panel { width: 100%; border-left: none; border-top: 1px solid #e3e9f2; }
  .bmp-props-layouts { grid-template-columns: repeat(4, 1fr); }
  .bmp-header-actions { justify-content: stretch; }
  .bmp-header-actions > * { flex: 1; justify-content: center; }
  .bmp-book-open { width: 300px; height: 200px; }
}
