/* ============================================================
Idea Decals Gang Sheet Builder — Front CSS  v3.3.1 (FIXED)
============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Geist:wght@300;400;500;600;700&family=Geist+Mono:wght@400;500&display=swap');

/* ── Global reset inside shell ───────────────────────────── */
.idgsb2-builder-shell,
.idgsb2-builder-shell * {
  box-sizing: border-box;
  font-family: 'Geist', system-ui, sans-serif;
}

/* ── CSS Ink palette (shared) ─────────────────────────────── */
.idgsb2-builder-shell {
  --ink-900: #0f172a;
  --ink-700: #334155;
  --ink-500: #64748b;
  --ink-400: #94a3b8;
  --ink-300: #cbd5e1;
  --ink-200: #e2e8f0;
  --ink-100: #f1f5f9;
}

/* ── Pastel scheme ────────────────────────────────────────── */
.idgsb2-builder-shell[data-theme="pastel"],
.idgsb2-builder-shell.scheme-pastel {
  --bg-base: #f4f5f9;
  --accent: #6366f1;
  --accent-deep: #4f46e5;
  --accent-rgb: 99,102,241;
  --grad-from: #6366f1;
  --grad-to: #8b5cf6;
  --price-bg-from: #ecfdf5;
  --price-bg-to: #d1fae5;
  --price-text: #065f46;
  --price-dot: #10b981;
  --glass-bg: rgba(255,255,255,0.62);
  --glass-bg-strong: rgba(255,255,255,0.78);
  --glass-border: rgba(255,255,255,0.7);
  --glass-line: rgba(15,23,42,0.06);
  --glass-shadow: 0 1px 2px rgba(15,23,42,0.05), 0 12px 32px rgba(15,23,42,0.10);
  --glass-shadow-lg: 0 1px 2px rgba(15,23,42,0.06), 0 24px 56px rgba(15,23,42,0.14);
}

/* ── Sage scheme ─────────────────────────────────────────── */
.idgsb2-builder-shell[data-theme="sage"],
.idgsb2-builder-shell.scheme-sage {
  --bg-base: #f4f6f1;
  --accent: #4d8a6f;
  --accent-deep: #3a6e58;
  --accent-rgb: 77,138,111;
  --grad-from: #5ba37e;
  --grad-to: #4d8a6f;
  --price-bg-from: #fef3c7;
  --price-bg-to: #fde68a;
  --price-text: #92400e;
  --price-dot: #f59e0b;
  --glass-bg: rgba(255,255,255,0.66);
  --glass-bg-strong: rgba(255,255,255,0.82);
  --glass-border: rgba(255,255,255,0.6);
  --glass-line: rgba(15,23,42,0.10);
  --glass-shadow: 0 1px 2px rgba(15,23,42,0.06), 0 14px 36px rgba(15,23,42,0.12);
  --glass-shadow-lg: 0 1px 2px rgba(15,23,42,0.06), 0 26px 60px rgba(15,23,42,0.16);
}

/* ── Canvas background gradients ─────────────────────────── */
.idgsb2-builder-shell[data-theme="pastel"] .idgsb2-canvas-bg,
.idgsb2-builder-shell.scheme-pastel .idgsb2-canvas-bg {
  background:
    radial-gradient(ellipse 60% 50% at 8% 10%, rgba(167,243,208,0.55) 0%, transparent 60%),
    radial-gradient(ellipse 50% 45% at 92% 12%, rgba(254,215,170,0.45) 0%, transparent 60%),
    radial-gradient(ellipse 55% 50% at 50% 95%, rgba(199,210,254,0.55) 0%, transparent 60%),
    radial-gradient(ellipse 40% 40% at 95% 85%, rgba(254,205,211,0.35) 0%, transparent 60%),
    #f4f5f9;
}
.idgsb2-builder-shell[data-theme="sage"] .idgsb2-canvas-bg,
.idgsb2-builder-shell.scheme-sage .idgsb2-canvas-bg {
  background:
    radial-gradient(ellipse 55% 50% at 8% 10%, rgba(184,213,196,0.60) 0%, transparent 58%),
    radial-gradient(ellipse 45% 40% at 92% 8%, rgba(244,226,196,0.55) 0%, transparent 58%),
    radial-gradient(ellipse 55% 50% at 50% 95%, rgba(186,208,220,0.50) 0%, transparent 58%),
    radial-gradient(ellipse 40% 40% at 95% 88%, rgba(214,207,192,0.50) 0%, transparent 58%),
    #f4f6f1;
}

/* ─ Shell ────────────────────────────────────────────────── */
.idgsb2-builder-shell {
  width: min(96vw, 1760px);
  max-width: calc(100vw - 24px);
  margin: 22px auto;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  overflow: visible;
  border-radius: 0;
  box-shadow: 0 24px 60px rgba(15,23,42,0.16), 0 6px 18px rgba(0,0,0,0.08);
}

/* ── Canvas background wrapper ───────────────────────────── */
.idgsb2-canvas-bg {
  min-height: 100vh;
  padding: 20px;
}

/* ── Glass utility classes ───────────────────────────────── */
.idgsb2-builder-shell .glass {
  background: var(--glass-bg);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid var(--glass-line);
  box-shadow: inset 0 1px 0 var(--glass-border), var(--glass-shadow);
}
.idgsb2-builder-shell .glass-strong {
  background: var(--glass-bg-strong);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  border: 1px solid var(--glass-line);
  box-shadow: inset 0 1px 0 var(--glass-border), var(--glass-shadow-lg);
}

/* ── Typography helpers ──────────────────────────────────── */
.idgsb2-builder-shell .fs-9 { font-size: 9px; line-height: 1.3; }
.idgsb2-builder-shell .fs-10 { font-size: 10px; line-height: 1.3; }
.idgsb2-builder-shell .fs-11 { font-size: 11px; line-height: 1.4; }
.idgsb2-builder-shell .fs-12 { font-size: 12px; line-height: 1.4; }
.idgsb2-builder-shell .fs-13 { font-size: 13px; line-height: 1.4; }
.idgsb2-builder-shell .fs-14 { font-size: 14px; line-height: 1.4; }
.idgsb2-builder-shell .fs-15 { font-size: 15px; line-height: 1.4; }
.idgsb2-builder-shell .fs-16 { font-size: 16px; line-height: 1.4; }
.idgsb2-builder-shell .fs-18 { font-size: 18px; line-height: 1.3; }
.idgsb2-builder-shell .mono { font-family: 'Geist Mono', monospace; }
.idgsb2-builder-shell .label-cap {
  font-size: 11px; font-weight: 600;
  color: var(--ink-500);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ── Scrollbar ───────────────────────────────────────────── */
.idgsb2-builder-shell .scroll-thin::-webkit-scrollbar { width: 6px; height: 6px; }
.idgsb2-builder-shell .scroll-thin::-webkit-scrollbar-thumb { background: rgba(15,23,42,0.15); border-radius: 3px; }
.idgsb2-builder-shell .scroll-thin::-webkit-scrollbar-track { background: transparent; }

/* ── Animations ──────────────────────────────────────────── */
@keyframes idgsb-fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.idgsb2-builder-shell .fade-up { animation: idgsb-fadeUp .3s ease both; }

/* ── Brand mark ──────────────────────────────────────────── */
.idgsb2-builder-shell .idgsb3-brand-mark {
  width: 40px; height: 40px; border-radius: 12px;
  background: linear-gradient(135deg, var(--grad-from) 0%, var(--grad-to) 100%);
  color: white; font-weight: 700; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(var(--accent-rgb),0.40);
  flex-shrink: 0;
}

/* ── Top bar ─────────────────────────────────────────────── */
.idgsb2-builder-shell .idgsb3-topbar {
  padding: 12px 16px; border-radius: 16px;
  display: flex; align-items: center; gap: 16px;
  flex-wrap: wrap;
}
.idgsb2-builder-shell .idgsb3-branding {
  display: flex; align-items: center; gap: 12px;
  padding-right: 16px; border-right: 1px solid rgba(15,23,42,0.10);
  flex-shrink: 0;
}
.idgsb2-builder-shell .idgsb3-brand-name { font-size: 14px; font-weight: 600; color: var(--ink-900); line-height: 1.2; }
.idgsb2-builder-shell .idgsb3-brand-sub { font-size: 11px; color: var(--ink-500); font-weight: 500; }
.idgsb2-builder-shell .idgsb3-project-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--ink-500);
}
.idgsb2-builder-shell .idgsb3-project-title b { color: var(--ink-900); font-weight: 500; }
.idgsb2-builder-shell .idgsb3-project-title em { color: var(--ink-500); font-style: normal; }
.idgsb2-builder-shell .idgsb3-top-actions {
  display: flex; align-items: center; gap: 8px;
  margin-left: auto; flex-wrap: wrap;
}
.idgsb2-builder-shell .idgsb3-sep {
  width: 1px; height: 24px; background: rgba(15,23,42,0.10);
  margin: 0 4px; flex-shrink: 0;
}

/* ── Buttons ────────────────────────────────────────────── */
.idgsb2-builder-shell .btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px; border-radius: 10px;
  font-size: 13px; font-weight: 600; color: white;
  background: linear-gradient(180deg, var(--grad-from) 0%, var(--accent-deep) 100%);
  box-shadow: 0 1px 0 rgba(255,255,255,0.4) inset, 0 4px 14px rgba(var(--accent-rgb),0.40);
  transition: all .15s ease; border: none; cursor: pointer; white-space: nowrap;
}
.idgsb2-builder-shell .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 1px 0 rgba(255,255,255,0.4) inset, 0 6px 18px rgba(var(--accent-rgb),0.50);
}
.idgsb2-builder-shell .btn-ghost {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 10px;
  font-size: 13px; font-weight: 500; color: var(--ink-700);
  background: rgba(255,255,255,0.55);
  border: 1px solid rgba(15,23,42,0.06);
  transition: all .15s ease; cursor: pointer; white-space: nowrap;
}
.idgsb2-builder-shell .btn-ghost:hover { background: rgba(255,255,255,0.85); border-color: rgba(15,23,42,0.10); }

/* ─ Checkbox ────────────────────────────────────────────── */
.idgsb2-builder-shell .idgsb3-checkbox {
  width: 16px; height: 16px; border-radius: 5px;
  border: 1.5px solid rgba(15,23,42,0.25);
  background: rgba(255,255,255,0.7);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all .15s; flex-shrink: 0;
}
.idgsb2-builder-shell .idgsb3-checkbox.on { background: var(--accent); border-color: var(--accent); }

/* ── Switch ──────────────────────────────────────────────── */
.idgsb2-builder-shell .idgsb3-switch {
  position: relative; width: 30px; height: 18px;
  background: rgba(15,23,42,0.18); border-radius: 999px;
  transition: background .2s; cursor: pointer; flex-shrink: 0;
  border: none; display: inline-block; padding: 0; vertical-align: middle;
}
.idgsb2-builder-shell .idgsb3-switch.on { background: var(--accent); }
.idgsb2-builder-shell .idgsb3-switch::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 14px; height: 14px; border-radius: 50%;
  background: white; transition: transform .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.idgsb2-builder-shell .idgsb3-switch.on::after { transform: translateX(12px); }

/* ── Price pill ──────────────────────────────────────────── */
.idgsb2-builder-shell .idgsb3-price-pill {
  padding: 8px 12px; border-radius: 12px;
  font-size: 13px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px;
  background: linear-gradient(180deg, var(--price-bg-from), var(--price-bg-to));
  color: var(--price-text);
  border: 1px solid rgba(0,0,0,0.06);
  white-space: nowrap;
}
.idgsb2-builder-shell .idgsb3-price-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--price-dot); flex-shrink: 0; }

/* ─ Main grid ───────────────────────────────────────────── */
.idgsb2-builder-shell .idgsb3-main-grid {
  display: grid;
  gap: 16px;
  margin-top: 16px;
  grid-template-columns: 84px 296px 1fr 304px;
  height: calc(100vh - 140px);
  min-height: 640px;
}

/* ── Left nav ────────────────────────────────────────────── */
.idgsb2-builder-shell .idgsb3-left-nav {
  padding: 8px; border-radius: 16px;
  display: flex; flex-direction: column;
  align-items: center; gap: 4px;
}
.idgsb2-builder-shell .idgsb3-nav-tile {
  width: 100%; aspect-ratio: 1 / 1;
  border-radius: 12px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 4px;
  transition: all .15s ease;
  border: none; cursor: pointer;
  background: transparent;
  color: var(--ink-700);
  min-height: 60px;
}
.idgsb2-builder-shell .idgsb3-nav-tile .nav-label { font-size: 10px; font-weight: 600; letter-spacing: 0.02em; }
.idgsb2-builder-shell .idgsb3-nav-tile.active {
  background: linear-gradient(180deg, var(--grad-from) 0%, var(--accent-deep) 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(var(--accent-rgb),0.40);
}
.idgsb2-builder-shell .idgsb3-nav-tile:not(.active):hover { background: rgba(15,23,42,0.04); }
.idgsb2-builder-shell .idgsb3-nav-spacer { flex: 1; }

/* ── Content panel (left sidebar) ────────────────────────── */
.idgsb2-builder-shell .idgsb3-content-panel {
  padding: 16px; border-radius: 16px;
  display: flex; flex-direction: column; gap: 12px;
  overflow: hidden; min-height: 0;
}
.idgsb2-builder-shell .idgsb3-panel-header {
  display: flex; align-items: center; justify-content: space-between; flex-shrink: 0;
}
.idgsb2-builder-shell .idgsb3-panel-title {
  font-size: 15px; font-weight: 600; color: var(--ink-900); margin: 0; text-transform: capitalize;
}
.idgsb2-builder-shell .idgsb3-icon-btn {
  color: var(--ink-400); background: transparent; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 8px; transition: background .15s;
}
.idgsb2-builder-shell .idgsb3-icon-btn:hover { background: rgba(15,23,42,0.06); }

/* ── Upload button ───────────────────────────────────────── */
.idgsb2-builder-shell .idgsb3-upload-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px; border-radius: 12px;
  font-size: 13px; font-weight: 600; color: white;
  background: linear-gradient(135deg, var(--grad-from) 0%, var(--grad-to) 100%);
  box-shadow: 0 4px 14px rgba(var(--accent-rgb),0.40), inset 0 1px 0 rgba(255,255,255,0.3);
  border: none; cursor: pointer; width: 100%;
  transition: all .15s; flex-shrink: 0;
}
.idgsb2-builder-shell .idgsb3-upload-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(var(--accent-rgb),0.50), inset 0 1px 0 rgba(255,255,255,0.3);
}

/* ── Drop zone ───────────────────────────────────────────── */
.idgsb2-builder-shell .idgsb3-dropzone {
  border-radius: 12px;
  border: 2px dashed rgba(var(--accent-rgb),0.3);
  background: rgba(var(--accent-rgb),0.04);
  padding: 24px 8px;
  display: flex; flex-direction: column;
  align-items: center; gap: 8px;
  cursor: pointer; transition: all .15s; flex-shrink: 0;
}
.idgsb2-builder-shell .idgsb3-dropzone:hover { background: rgba(var(--accent-rgb),0.08); }
.idgsb2-builder-shell .idgsb3-dropzone-icon {
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(var(--accent-rgb),0.12);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent);
}

/* ─ Search ──────────────────────────────────────────────── */
.idgsb2-builder-shell .idgsb3-search-wrap { position: relative; flex-shrink: 0; }
.idgsb2-builder-shell .idgsb3-search-ico {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--ink-400); pointer-events: none; display: flex;
}
.idgsb2-builder-shell .idgsb3-pill-input {
  width: 100%; padding: 9px 12px;
  font-size: 13px; color: var(--ink-900);
  background: rgba(255,255,255,0.7);
  border: 1px solid rgba(15,23,42,0.08);
  border-radius: 10px;
  font-family: 'Geist Mono', monospace;
  outline: none; transition: all .15s ease;
}
.idgsb2-builder-shell .idgsb3-pill-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb),0.15);
  background: white;
}
.idgsb2-builder-shell .idgsb3-search-field { padding-left: 36px; }

/* ── Text tool panel ─────────────────────────────────────────
   Matches the builder's design language: gradient cards, accent
   section titles, and a full-width gradient CTA button.
──────────────────────────────────────────────────────────── */
.idgsb2-builder-shell .idgsb3-text-panel {
  display: flex; flex-direction: column; gap: 10px;
}
.idgsb2-builder-shell .idgsb3-text-section {
  border-radius: 16px;
  border: 1px solid rgba(var(--accent-rgb), 0.15);
  background: linear-gradient(145deg, rgba(255,255,255,0.80), rgba(var(--accent-rgb), 0.045));
  padding: 14px 14px 12px;
  box-shadow: 0 4px 14px rgba(15,23,42,0.06), inset 0 1px 0 rgba(255,255,255,0.90);
  display: flex; flex-direction: column; gap: 10px;
}
.idgsb2-builder-shell .idgsb3-text-section-title {
  display: flex; align-items: center; gap: 6px;
  font-size: 10px; font-weight: 800; letter-spacing: 0.07em;
  text-transform: uppercase; color: var(--accent-deep);
}
/* "Place on Sheet" CTA — gradient action button matching .idgsb3-color-action */
.idgsb2-builder-shell .idgsb3-text-add-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 40px; padding: 11px 16px;
  border: 0; border-radius: 13px; cursor: pointer;
  font-size: 13px; font-weight: 800; color: #fff;
  background: linear-gradient(145deg, var(--accent), #7c3aed);
  box-shadow: 0 10px 22px rgba(var(--accent-rgb), 0.28),
              inset 0 1px 0 rgba(255,255,255,0.35);
  transition: transform .18s ease, filter .18s ease, box-shadow .18s ease;
}
.idgsb2-builder-shell .idgsb3-text-add-btn:hover {
  transform: translateY(-1px); filter: saturate(1.12);
  box-shadow: 0 14px 28px rgba(var(--accent-rgb), 0.36),
              inset 0 1px 0 rgba(255,255,255,0.45);
}
.idgsb2-builder-shell .idgsb3-text-add-btn svg { flex-shrink: 0; }

/* ─ Uploaded section header ─────────────────────────────── */
.idgsb2-builder-shell .idgsb3-uploaded-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 11px; font-weight: 600; color: var(--ink-500);
  text-transform: uppercase; letter-spacing: 0.06em; flex-shrink: 0;
  margin-top: 4px;
}
.idgsb2-builder-shell .idgsb3-uploaded-head button {
  background: transparent; border: none; cursor: pointer;
  color: var(--ink-500); font-size: 11px; font-weight: 600;
}

/* ── File grid ───────────────────────────────────────────── */
.idgsb2-builder-shell .idgsb3-file-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 8px; overflow-y: auto; padding-right: 4px;
  flex: 1; min-height: 0;
}
.idgsb2-builder-shell .idgsb3-thumb-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 8px; max-height: 420px; overflow: auto; padding-right: 4px;
}
.idgsb2-builder-shell .idgsb3-file-card {
  background: rgba(255,255,255,0.7);
  border: 1px solid rgba(15,23,42,0.06);
  border-radius: 12px; overflow: hidden;
  text-align: left; transition: all .15s; cursor: pointer;
}
.idgsb2-builder-shell .idgsb3-file-card:hover { transform: scale(1.02); }
.idgsb2-builder-shell .idgsb3-file-thumb {
  aspect-ratio: 1 / 1;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(var(--accent-rgb),0.18) 0%, rgba(var(--accent-rgb),0.32) 100%);
}
.idgsb2-builder-shell .idgsb3-empty-thumb {
  width: 48px; height: 48px; border-radius: 50%;
  background: rgba(255,255,255,0.7);
  display: flex; align-items: center; justify-content: center;
}
.idgsb2-builder-shell .idgsb3-file-meta {
  padding: 6px 8px; font-size: 10px; color: var(--ink-700);
  font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.idgsb2-builder-shell .idgsb3-add-card {
  aspect-ratio: 1 / 1; border-radius: 12px;
  border: 2px dashed var(--ink-300);
  background: transparent; color: var(--ink-400);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 4px; cursor: pointer; transition: all .15s;
}
.idgsb2-builder-shell .idgsb3-add-card:hover { color: var(--accent); border-color: rgba(var(--accent-rgb), 0.5); }

/* ── Canvas area ─────────────────────────────────────────── */
.idgsb2-builder-shell .idgsb3-canvas-col {
  position: relative; display: flex; flex-direction: column;
  gap: 12px; min-width: 0;
}

/* ── Toolbar ─────────────────────────────────────────────── */
.idgsb2-builder-shell .idgsb3-toolbar {
  padding: 6px 8px; border-radius: 16px;
  display: flex; align-items: center; gap: 2px;
  align-self: center; max-width: 100%;
  overflow-x: auto; overflow-y: visible; flex-shrink: 0;
}
.idgsb2-builder-shell .idgsb3-toolbar::-webkit-scrollbar { height: 0; }
.idgsb2-builder-shell .idgsb3-toolbar-divider {
  width: 1px; height: 36px; background: rgba(15,23,42,0.10);
  margin: 0 4px; flex-shrink: 0; align-self: center;
}
.idgsb2-builder-shell .tool-btn {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 4px;
  padding: 6px 10px; min-width: 54px; height: 52px;
  border-radius: 10px;
  font-size: 10px; font-weight: 600; letter-spacing: 0.01em;
  color: var(--ink-700);
  background: transparent; border: none; cursor: pointer;
  transition: all .15s ease; white-space: nowrap; flex-shrink: 0;
}
.idgsb2-builder-shell .tool-btn:hover { background: rgba(15,23,42,0.06); color: var(--ink-900); }
.idgsb2-builder-shell .tool-btn.accent { background: rgba(var(--accent-rgb),0.10); color: var(--accent-deep); }
.idgsb2-builder-shell .tool-btn.accent:hover { background: rgba(var(--accent-rgb),0.18); }
.idgsb2-builder-shell .tool-btn.danger { color: #dc2626; }
.idgsb2-builder-shell .tool-btn.danger:hover { background: rgba(220,38,38,0.08); }
.idgsb2-builder-shell .idgsb3-spacing-input {
  width: 48px; padding: 3px 6px; height: 24px;
  font-size: 12px; font-weight: 600; text-align: center;
  font-family: 'Geist Mono', monospace;
  background: rgba(255,255,255,0.9);
  border: 1px solid rgba(15,23,42,0.15);
  border-radius: 6px; color: var(--ink-900); outline: none;
}
.idgsb2-builder-shell .idgsb3-spacing-input:focus {
  border-color: var(--accent); box-shadow: 0 0 0 2px rgba(var(--accent-rgb),0.15);
}

/* ─ Canvas stage ────────────────────────────────────────── */
.idgsb2-builder-shell .idgsb3-canvas-stage {
  position: relative; border-radius: 16px;
  flex: 1; padding: 24px;
  display: flex; align-items: center; justify-content: center;
  overflow: visible;
}
.idgsb2-builder-shell .idgsb3-ruler-h {
  position: absolute; top: 16px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 12px; pointer-events: none;
}
.idgsb2-builder-shell .idgsb3-ruler-tick-h {
  height: 1px; width: 80px;
  background: linear-gradient(90deg, transparent, rgba(15,23,42,0.4), transparent);
}
.idgsb2-builder-shell .idgsb3-ruler-v {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 12px; pointer-events: none;
}
.idgsb2-builder-shell .idgsb3-ruler-tick-v {
  width: 1px; height: 80px;
  background: linear-gradient(0deg, transparent, rgba(15,23,42,0.4), transparent);
}
.idgsb2-builder-shell .idgsb3-ruler-label {
  font-size: 14px; font-family: 'Geist Mono', monospace;
  font-weight: 600; color: var(--ink-700); letter-spacing: 0.02em;
}
.idgsb2-builder-shell .idgsb3-ruler-label-v {
  writing-mode: vertical-rl; transform: rotate(180deg);
  font-size: 14px; font-family: 'Geist Mono', monospace;
  font-weight: 600; color: var(--ink-700); letter-spacing: 0.02em;
}

/* ── Canvas sheet (the printable area) ───────────────────── */
.idgsb2-builder-shell .idgsb3-canvas-sheet {
  position: relative;
  background: white;
  border-radius: 8px;
  width: min(100%, 560px);
  aspect-ratio: 22 / 24;
  box-shadow: 0 1px 2px rgba(15,23,42,0.06), 0 12px 32px rgba(15,23,42,0.10);
  background-image:
    linear-gradient(rgba(var(--accent-rgb),0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--accent-rgb),0.04) 1px, transparent 1px);
  background-size: 24px 24px;
  border: 1px solid rgba(15,23,42,0.06);
  overflow: hidden;
}

/* Canvas items */
.idgsb2-builder-shell .idgsb2-item {
  position: absolute; cursor: move;
  user-select: none; border: 2px solid transparent; box-sizing: border-box;
}
.idgsb2-builder-shell .idgsb2-item.selected { border-color: var(--accent); }
.idgsb2-builder-shell .idgsb2-item .idgsb2-item-image {
  position: absolute !important; inset: 0 !important;
  width: 100% !important; height: 100% !important;
  display: block !important;
  background-size: 100% 100% !important;
  background-repeat: no-repeat !important;
  background-position: 0 0 !important;
  pointer-events: none !important;
}
.idgsb2-builder-shell .idgsb2-item img { display: none !important; }
.idgsb2-builder-shell .idgsb2-item .resize {
  position: absolute; width: 12px; height: 12px;
  right: -6px; bottom: -6px; border-radius: 50%;
  background: var(--accent); cursor: nwse-resize; border: 2px solid white;
}
.idgsb2-builder-shell .idgsb2-item:not(.selected) .resize { display: none !important; }

/* ── Zoom bar ────────────────────────────────────────────── */
.idgsb2-builder-shell .idgsb3-zoom-bar {
  position: absolute; bottom: 16px; right: 16px;
  padding: 4px; border-radius: 12px;
  display: flex; align-items: center; gap: 2px;
}
.idgsb2-builder-shell .idgsb3-zoom-btn {
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-700); background: transparent;
  border: none; cursor: pointer; transition: background .15s;
}
.idgsb2-builder-shell .idgsb3-zoom-btn:hover { background: rgba(15,23,42,0.06); }
.idgsb2-builder-shell .idgsb3-zoom-pct {
  font-size: 12px; font-family: 'Geist Mono', monospace;
  font-weight: 500; color: var(--ink-700); padding: 0 8px;
}

/* ── Right properties panel ──────────────────────────────── */
.idgsb2-builder-shell .idgsb3-right-panel {
  padding: 16px; border-radius: 16px;
  display: flex; flex-direction: column; gap: 16px;
  overflow-y: auto;
}
.idgsb2-builder-shell .idgsb3-preview-box {
  aspect-ratio: 4 / 3; border-radius: 12px;
  background: rgba(241,245,249,0.6);
  border: 1px solid rgba(15,23,42,0.06);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px; flex-shrink: 0;
}
.idgsb2-builder-shell .idgsb3-field { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }
.idgsb2-builder-shell .idgsb3-dim-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px;
}
.idgsb2-builder-shell .idgsb3-lock-btn {
  display: flex; align-items: center; gap: 4px;
  font-size: 10px; color: var(--ink-500);
  background: transparent; border: none; cursor: pointer; font-weight: 500;
}
.idgsb2-builder-shell .idgsb3-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.idgsb2-builder-shell .idgsb3-number-field { display: flex; flex-direction: column; gap: 4px; }
.idgsb2-builder-shell .idgsb3-number-label { font-size: 10px; font-weight: 500; color: var(--ink-500); }
.idgsb2-builder-shell .idgsb3-number-input-wrap {
  display: flex; align-items: center;
  background: rgba(255,255,255,0.7);
  border: 1px solid rgba(15,23,42,0.08);
  border-radius: 10px; overflow: hidden; transition: all .15s;
}
.idgsb2-builder-shell .idgsb3-number-input-wrap:focus-within {
  border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb),0.15); background: white;
}
.idgsb2-builder-shell .idgsb3-number-input {
  flex: 1; padding: 8px 10px; border: none; background: transparent; outline: none;
  font-size: 13px; font-family: 'Geist Mono', monospace; color: var(--ink-900); width: 0;
}
.idgsb2-builder-shell .idgsb3-number-unit {
  font-size: 10px; font-weight: 600; color: var(--ink-400);
  padding-right: 10px; font-family: 'Geist Mono', monospace; flex-shrink: 0;
}
.idgsb2-builder-shell .idgsb3-divider { height: 1px; background: rgba(15,23,42,0.08); flex-shrink: 0; }

/* ── Sheet size dropdown ────────────────────────────────── */
.idgsb2-builder-shell .idgsb3-sheet-btn {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 12px; cursor: pointer; width: 100%;
  background: rgba(255,255,255,0.7);
  border: 1px solid rgba(15,23,42,0.08);
  border-radius: 10px;
  font-size: 13px; font-family: 'Geist Mono', monospace; color: var(--ink-900);
  transition: all .15s;
}
.idgsb2-builder-shell .idgsb3-sheet-price-tag {
  font-size: 11px; font-family: 'Geist Mono', monospace;
  padding: 2px 6px; border-radius: 4px;
  background: var(--price-bg-to); color: var(--price-text);
}

/* ─ Action tiles ────────────────────────────────────────── */
.idgsb2-builder-shell .idgsb3-action-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; flex-shrink: 0; }
.idgsb2-builder-shell .idgsb3-action-tile {
  padding: 10px 8px; border-radius: 12px;
  background: rgba(255,255,255,0.5);
  border: 1px solid rgba(15,23,42,0.06);
  display: flex; flex-direction: column;
  align-items: center; gap: 4px;
  color: var(--ink-700); cursor: pointer; transition: all .15s;
}
.idgsb2-builder-shell .idgsb3-action-tile:hover { background: rgba(255,255,255,0.85); }
.idgsb2-builder-shell .idgsb3-action-tile span { font-size: 11px; font-weight: 500; }

/* ── Usage card ──────────────────────────────────────────── */
.idgsb2-builder-shell .idgsb3-usage-card {
  padding: 12px; border-radius: 12px;
  background: rgba(var(--accent-rgb),0.06);
  border: 1px solid rgba(var(--accent-rgb),0.14);
  display: flex; align-items: center; justify-content: space-between; flex-shrink: 0;
}
.idgsb2-builder-shell .idgsb3-usage-label {
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--accent-deep); display: block;
}
.idgsb2-builder-shell .idgsb3-usage-pct {
  font-size: 18px; font-family: 'Geist Mono', monospace;
  font-weight: 700; color: var(--ink-900); line-height: 1.1;
}
.idgsb2-builder-shell .idgsb3-usage-objects {
  font-size: 11px; color: var(--ink-700);
  display: flex; align-items: center; gap: 6px;
}
.idgsb2-builder-shell .idgsb3-right-flex { flex: 1; }

/* ── Tooltip (rendered at body level) ───────────────────── */
#idgsb3-tooltip {
  position: fixed;
  background: rgba(15,23,42,0.96);
  backdrop-filter: blur(16px);
  color: white; padding: 10px 12px; border-radius: 12px;
  width: 210px; z-index: 999999;
  box-shadow: 0 20px 48px rgba(15,23,42,0.30);
  border: 1px solid rgba(255,255,255,0.10);
  pointer-events: none;
  font-family: 'Geist', system-ui, sans-serif;
  animation: idgsb-fadeUp .18s ease both;
  display: none;
}
#idgsb3-tooltip.visible { display: block; }
#idgsb3-tooltip::after {
  content: ''; position: absolute;
  bottom: -6px; left: var(--tip-arrow-x, 50%);
  transform: translateX(-50%) rotate(45deg);
  width: 10px; height: 10px;
  background: rgba(15,23,42,0.96);
  border-right: 1px solid rgba(255,255,255,0.10);
  border-bottom: 1px solid rgba(255,255,255,0.10);
}
#idgsb3-tooltip h4 { font-size: 12px; font-weight: 600; margin: 0; }
#idgsb3-tooltip p { font-size: 11px; color: rgba(255,255,255,0.7); margin: 4px 0 0; line-height: 1.4; }
#idgsb3-tooltip .idgsb3-demo-box {
  margin-top: 8px; height: 56px; border-radius: 8px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
#idgsb3-tooltip kbd { font-family: 'Geist Mono', monospace; font-size: 9px; padding: 1px 4px; background: rgba(255,255,255,0.15); border-radius: 3px; }

/* ── DPI badge ───────────────────────────────────────────── */
.idgsb2-builder-shell .idgsb2-dpi {
  display: inline-flex; gap: 8px; align-items: center;
  border-radius: 999px; padding: 7px 12px; margin: 0; font-weight: 700;
  background: #eef2ff; color: #334155; font-size: 13px; flex-shrink: 0;
}
.idgsb2-builder-shell .idgsb2-dpi span { padding: 2px 8px; border-radius: 999px; background: #e2e8f0; }
.idgsb2-builder-shell .idgsb2-dpi.good { background: #e8fff2; color: #0f766e; }
.idgsb2-builder-shell .idgsb2-dpi.good span { background: #c7f7d6; }
.idgsb2-builder-shell .idgsb2-dpi.medium { background: #fff7dc; color: #9a6700; }
.idgsb2-builder-shell .idgsb2-dpi.medium span { background: #ffe8a3; }
.idgsb2-builder-shell .idgsb2-dpi.low { background: #fff0e6; color: #b45309; }
.idgsb2-builder-shell .idgsb2-dpi.low span { background: #fed7aa; }
.idgsb2-builder-shell .idgsb2-dpi.bad { background: #ffe8e8; color: #b91c1c; }
.idgsb2-builder-shell .idgsb2-dpi.bad span { background: #fecaca; }
.idgsb2-builder-shell .idgsb2-dpi.unknown { background: #eef2ff; color: #475569; }
.idgsb2-builder-shell .idgsb2-dpi.unknown span { background: #e2e8f0; }

/* ── Misc helpers ────────────────────────────────────────── */
.idgsb2-builder-shell kbd {
  font-family: 'Geist Mono', monospace; font-size: 9px;
  padding: 1px 4px; background: rgba(15,23,42,0.08); border-radius: 3px;
}
.idgsb2-builder-shell .idgsb3-hint { font-size: 10px; color: var(--ink-500); line-height: 1.4; margin-top: 4px; }

/* ════════════════════════════════════════════════════════════
MOBILE / TABLET VERTICAL LAYOUT
════════════════════════════════════════════════════════════ */
.idgsb2-builder-shell .idgsb3-mobile-view {
  display: none;
  flex-direction: column;
  /* Use dvh (dynamic viewport height) so browser chrome is excluded;
     fall back to 100vh on older browsers */
  height: 100dvh;
  height: 100vh;
  min-height: 600px;
  overflow: hidden; position: relative;
}
/* Mobile top bar */
.idgsb2-builder-shell .idgsb3-m-topbar {
  padding: 10px 16px;
  display: flex; align-items: center; gap: 12px; flex-shrink: 0;
  border-bottom: 1px solid var(--glass-line);
}
.idgsb2-builder-shell .idgsb3-m-menu-btn {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.55); border: 1px solid rgba(15,23,42,0.06);
  cursor: pointer; flex-shrink: 0; color: var(--ink-700);
}
.idgsb2-builder-shell .idgsb3-m-title { flex: 1; overflow: hidden; }
.idgsb2-builder-shell .idgsb3-m-title b {
  display: block; font-size: 14px; font-weight: 600; color: var(--ink-900);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.idgsb2-builder-shell .idgsb3-m-title em {
  display: block; font-size: 11px; font-style: normal; color: var(--ink-500);
}
.idgsb2-builder-shell .idgsb3-m-price {
  padding: 6px 10px; border-radius: 10px; font-size: 12px; font-weight: 600;
  background: linear-gradient(180deg, var(--price-bg-from), var(--price-bg-to));
  color: var(--price-text); border: 1px solid rgba(0,0,0,0.06); flex-shrink: 0;
}
.idgsb2-builder-shell .idgsb3-m-cart-btn {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--grad-from) 0%, var(--accent-deep) 100%);
  box-shadow: 0 4px 12px rgba(var(--accent-rgb),0.40);
  border: none; cursor: pointer; color: white; flex-shrink: 0;
}
/* ── Mobile mini toolbar ──────────────────────────────────────
   Fixed 6-column grid: every button cell is exactly 1fr wide so
   rows are perfectly justified.  With 11 tool buttons the grid
   fills two rows (6 + 5), all items uniformly spaced — no crowding
   on small phones, no ragged gaps on larger phones / tablets.
────────────────────────────────────────────────────────────── */
.idgsb2-builder-shell .idgsb3-m-toolbar {
  padding: 5px 8px;
  display: grid;
  grid-template-columns: repeat(6, 1fr); /* 6 equal columns → 2 balanced rows */
  gap: 3px 0;
  align-items: stretch;
  flex-shrink: 0;
  border-bottom: 1px solid var(--glass-line);
  overflow: visible;
}
.idgsb2-builder-shell .idgsb3-m-toolbar::-webkit-scrollbar { height: 0; }
.idgsb2-builder-shell .idgsb3-mini-tool {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  padding: 5px 2px; border-radius: 8px;
  background: transparent; border: none; cursor: pointer;
  color: var(--ink-700); font-size: 9px; font-weight: 600; white-space: nowrap;
  width: 100%; /* fills 1fr grid cell — equal width across all buttons */
  min-width: 0; /* allow cell to shrink below content width if needed */
}
.idgsb2-builder-shell .idgsb3-mini-tool.accent { background: rgba(var(--accent-rgb),0.10); color: var(--accent-deep); }
.idgsb2-builder-shell .idgsb3-mini-tool.danger { color: #dc2626; }
/* Dividers collapse gracefully in grid context */
.idgsb2-builder-shell .idgsb3-m-mini-divider {
  display: none; /* hidden in two-row grid — visual rhythm from cell boundaries */
}
/* Mobile canvas — Bug #5 fix: equal vertical margins above and below */
.idgsb2-builder-shell .idgsb3-m-canvas-wrap {
  flex: 1;
  /* Symmetric padding: 12px top & bottom so canvas sits centred in remaining
     vertical space between the toolbar and the Uploaded Images footer. */
  padding: 12px;
  display: flex; align-items: center;
  justify-content: center; position: relative; overflow: hidden; min-height: 0;
}
.idgsb2-builder-shell .idgsb3-m-canvas-stage { width: 100%; max-width: 360px; position: relative; }
.idgsb2-builder-shell .idgsb3-m-ruler-h {
  text-align: center; font-size: 11px; font-family: 'Geist Mono', monospace;
  font-weight: 600; color: var(--ink-700); margin-bottom: 6px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.idgsb2-builder-shell .idgsb3-m-tick { width: 40px; height: 1px; background: rgba(15,23,42,0.3); }
.idgsb2-builder-shell .idgsb3-m-canvas-row { display: flex; align-items: center; gap: 6px; }
.idgsb2-builder-shell .idgsb3-m-ruler-v {
  writing-mode: vertical-rl; transform: rotate(180deg);
  font-size: 11px; font-family: 'Geist Mono', monospace;
  font-weight: 600; color: var(--ink-700);
  display: flex; align-items: center; gap: 8px;
}
.idgsb2-builder-shell .idgsb3-m-tick-v { width: 1px; height: 40px; background: rgba(15,23,42,0.3); }
.idgsb2-builder-shell .idgsb3-m-sheet {
  flex: 1; aspect-ratio: 22 / 24;
  background: white; border-radius: 8px;
  border: 1px solid rgba(15,23,42,0.06);
  box-shadow: 0 4px 18px rgba(15,23,42,0.10);
  position: relative; overflow: hidden;
  background-image:
    linear-gradient(rgba(var(--accent-rgb),0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--accent-rgb),0.04) 1px, transparent 1px);
  background-size: 16px 16px;
}
/* Mobile zoom + props */
.idgsb2-builder-shell .idgsb3-m-zoom-bar {
  position: absolute; bottom: 16px; left: 16px;
  border-radius: 8px; display: flex; align-items: center; overflow: hidden;
}
.idgsb2-builder-shell .idgsb3-m-zoom-btn {
  width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
  color: var(--ink-700); background: transparent; border: none; cursor: pointer;
}
.idgsb2-builder-shell .idgsb3-m-zoom-pct {
  font-size: 10px; font-family: 'Geist Mono', monospace; color: var(--ink-700); padding: 0 4px;
}
.idgsb2-builder-shell .idgsb3-m-props-btn {
  position: absolute; bottom: 12px; right: 12px;
  padding: 8px 12px; border-radius: 12px; font-size: 11px; font-weight: 600; color: white;
  display: flex; align-items: center; gap: 6px;
  background: linear-gradient(135deg, var(--grad-from) 0%, var(--accent-deep) 100%);
  box-shadow: 0 4px 14px rgba(var(--accent-rgb),0.45);
  border: none; cursor: pointer;
}
/* Mobile bottom nav — Bug #5 fix: pinned at base, never pushed off-screen */
.idgsb2-builder-shell .idgsb3-m-bottom-nav {
  padding: 0 12px 12px;
  flex-shrink: 0;
  /* Guarantee footer stays at the bottom of the mobile viewport  */
  position: sticky;
  bottom: 0;
  z-index: 50;
  background: var(--glass-bg);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-top: 1px solid var(--glass-line);
}
.idgsb2-builder-shell .idgsb3-m-nav-bar {
  border-radius: 16px; padding: 6px;
  display: flex; align-items: center; justify-content: space-around;
}
.idgsb2-builder-shell .idgsb3-m-nav-btn {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 12px; border-radius: 12px;
  background: transparent; border: none; cursor: pointer;
}
.idgsb2-builder-shell .idgsb3-m-nav-btn.active { background: rgba(var(--accent-rgb),0.10); }
.idgsb2-builder-shell .idgsb3-m-nav-btn .nav-lbl { font-size: 9px; font-weight: 600; color: var(--ink-500); }
.idgsb2-builder-shell .idgsb3-m-nav-btn.active .nav-lbl { color: var(--accent-deep); }
.idgsb2-builder-shell .idgsb3-m-nav-upload {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  margin-top: -20px; background: transparent; border: none; cursor: pointer;
}
.idgsb2-builder-shell .idgsb3-m-nav-upload-ico {
  width: 48px; height: 48px; border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--grad-from) 0%, var(--accent-deep) 100%);
  box-shadow: 0 6px 16px rgba(var(--accent-rgb),0.45), 0 0 0 4px white;
}
.idgsb2-builder-shell .idgsb3-m-nav-upload .nav-lbl { font-size: 9px; font-weight: 600; margin-top: 2px; color: var(--accent-deep); }
/* Mobile bottom sheet */
.idgsb2-builder-shell .idgsb3-m-overlay {
  position: absolute; inset: 0; background: rgba(15,23,42,0.30); z-index: 10;
}
.idgsb2-builder-shell .idgsb3-m-sheet-panel {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 20;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border-top-left-radius: 28px; border-top-right-radius: 28px;
  border-top: 1px solid rgba(255,255,255,0.7);
  box-shadow: 0 -8px 32px rgba(15,23,42,0.18);
  max-height: 75%; overflow-y: auto;
  animation: idgsb-fadeUp .3s ease both;
}
.idgsb2-builder-shell .idgsb3-m-handle-wrap {
  position: sticky; top: 0; padding-top: 12px; padding-bottom: 8px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.6);
}
.idgsb2-builder-shell .idgsb3-m-handle { width: 40px; height: 4px; border-radius: 2px; background: var(--ink-300); }
.idgsb2-builder-shell .idgsb3-m-sheet-inner { padding: 0 20px 24px; }
.idgsb2-builder-shell .idgsb3-m-sheet-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px;
}
.idgsb2-builder-shell .idgsb3-m-sheet-title { font-size: 16px; font-weight: 600; color: var(--ink-900); margin: 0; }
.idgsb2-builder-shell .idgsb3-m-close-btn {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(15,23,42,0.08); border: none; cursor: pointer; color: var(--ink-700);
}
.idgsb2-builder-shell .idgsb3-m-sheet-fields { display: flex; flex-direction: column; gap: 16px; }

/* ── Responsive breakpoints ──────────────────────────────── */
@media (max-width: 1023px) and (orientation: portrait) {
  .idgsb2-builder-shell .idgsb3-desktop-view { display: none !important; }
  .idgsb2-builder-shell .idgsb3-mobile-view { display: flex !important; }
}
@media (max-width: 599px) {
  .idgsb2-builder-shell .idgsb3-desktop-view { display: none !important; }
  .idgsb2-builder-shell .idgsb3-mobile-view { display: flex !important; }
}
@media (min-width: 600px) and (max-width: 1023px) and (orientation: landscape) {
  .idgsb2-builder-shell .idgsb3-desktop-view { display: block !important; }
  .idgsb2-builder-shell .idgsb3-mobile-view { display: none !important; }
  .idgsb2-builder-shell .idgsb3-main-grid {
    grid-template-columns: 72px 230px 1fr 240px !important;
  }
}
@media (min-width: 1024px) {
  .idgsb2-builder-shell .idgsb3-desktop-view { display: block !important; }
  .idgsb2-builder-shell .idgsb3-mobile-view { display: none !important; }
}

/* ── Overlap warning ─────────────────────────────────────── */
.idgsb2-builder-shell .idgsb2-item.has-warning {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 3px rgba(239,68,68,.18), 0 0 18px rgba(239,68,68,.26) !important;
}
.idgsb2-builder-shell .idgsb2-item.has-warning::after {
  content: ""; position: absolute; inset: 0;
  background: repeating-linear-gradient(45deg, rgba(239,68,68,.10) 0 8px, rgba(239,68,68,.02) 8px 16px);
  pointer-events: none;
}

/* ── Pan tool cursor ─────────────────────────────────────── */
.idgsb2-builder-shell.pan-active .upper-canvas { cursor: grab !important; }
.idgsb2-builder-shell.pan-active .upper-canvas:active { cursor: grabbing !important; }

/* ── Overlap / reduce-size tip badge ────────────────────── */
.idgsb3-overlap-tip {
  display: none;
  position: absolute;
  background: #ef4444; color: #fff;
  font-size: 11px; font-weight: 600;
  padding: 4px 10px; border-radius: 20px;
  pointer-events: none; z-index: 9999;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(239,68,68,.4);
  animation: idgsb-fadeUp .2s ease both;
}

/* ── Auto-nest tip badge ─────────────────────────────────── */
.idgsb3-nest-tip {
  display: none;
  animation: idgsb-fadeUp .3s ease both;
}

/* ── Nest loading overlay spin animation ─────────────────── */
@keyframes idgsb-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ── Rotation input row in the right panel ───────────────── */
.idgsb2-builder-shell .idgsb3-rotation-row {
  display: flex; align-items: center; gap: 8px; padding: 8px 0;
  border-top: 1px solid var(--glass-line); margin-top: 4px;
}
.idgsb2-builder-shell .idgsb3-rotation-row label {
  font-size: 11px; font-weight: 600; color: var(--ink-500);
  text-transform: uppercase; letter-spacing: 0.05em; flex-shrink: 0;
}
.idgsb2-builder-shell [data-role="prop-rotation"] {
  width: 64px; padding: 5px 8px; border-radius: 8px; border: 1px solid var(--glass-line);
  background: rgba(255,255,255,0.6); font-size: 13px; color: var(--ink-900);
  text-align: center; font-family: 'Geist Mono', monospace;
}
.idgsb2-builder-shell .idgsb3-rotation-unit {
  font-size: 11px; color: var(--ink-500); font-weight: 500;
}

/* ── Float panel collapse state ─────────────────────────── */
.idgsb3-float-panel.collapsed .idgsb3-float-body {
  display: none;
}
.idgsb3-float-panel.collapsed .idgsb3-float-collapse-bar svg {
  transform: rotate(180deg);
}

/* ── Saved projects ──────────────────────────────────────── */
.idgsb2-builder-shell .idgsb-projects-box {
  max-width: 1100px; margin: 30px auto; padding: 22px;
  background: var(--glass-bg-strong); border-radius: 18px;
  box-shadow: var(--glass-shadow-lg);
}
.idgsb2-builder-shell .idgsb-projects-list {
  display: grid; grid-template-columns: repeat(auto-fit,minmax(240px,1fr)); gap: 16px;
}
.idgsb2-builder-shell .idgsb-project-card {
  padding: 16px; border: 1px solid var(--glass-line); border-radius: 14px;
  background: rgba(255,255,255,.6);
}
.idgsb2-builder-shell .idgsb-project-card strong { display: block; margin-bottom: 8px; font-size: 15px; color: var(--ink-900); }

/* ── Thumb grid (from front.js) ──────────────────────────── */
.idgsb2-builder-shell .idgsb2-thumb {
  border: 1px solid rgba(15,23,42,.08); border-radius: 12px;
  padding: 8px; background: rgba(255,255,255,.7); cursor: pointer; transition: all .15s;
}
.idgsb2-builder-shell .idgsb2-thumb:hover { transform: scale(1.03); border-color: rgba(var(--accent-rgb),.3); }
.idgsb2-builder-shell .idgsb2-thumb img { width: 100%; height: 84px; object-fit: contain; background: #fafafa; border-radius: 8px; }
.idgsb2-builder-shell .idgsb2-thumb .meta { font-size: 11px; margin-top: 6px; color: var(--ink-700); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.idgsb2-builder-shell .idgsb2-upload-status, .idgsb2-builder-shell .idgsb2-cart-message { font-size: 12px; margin-top: 8px; color: var(--ink-500); }

/* ════════════════════════════════════════════════════════════
WARNING OVERLAY — FIXED Z-INDEX (below toolbar, above canvas)
════════════════════════════════════════════════════════════ */
#idgsb3-warning-overlay {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100; /* Below toolbar (z-index: 200+) but above canvas items */
  display: none;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: rgba(255, 248, 240, 0.96);
  border: 1px solid #fbbf24;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.2);
  font-size: 13px;
  color: #92400e;
  backdrop-filter: blur(8px);
  pointer-events: auto;
  max-width: 90%;
}
#idgsb3-warning-overlay.show { display: flex; }
#idgsb3-warning-overlay .warn-icon { color: #f59e0b; font-size: 18px; flex-shrink: 0; }
#idgsb3-warning-overlay .warn-msg { font-weight: 500; }
#idgsb3-warning-overlay .warn-close {
  background: none; border: none; cursor: pointer;
  color: #b45309; font-size: 20px; padding: 0 0 0 8px; line-height: 1;
}
#idgsb3-warning-overlay .warn-close:hover { color: #92400e; }

/* ════════════════════════════════════════════════════════════
FLOATING PANEL: position:FIXED
════════════════════════════════════════════════════════════ */
.idgsb3-float-panel {
  position: fixed !important;
  z-index: 99999 !important;
  top: 140px;
  right: 24px;
  left: auto;
  bottom: auto;
  width: 270px;
  max-width: 90vw;
  display: none;
  box-sizing: border-box;
  background: rgba(255,255,255,0.98);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(15,23,42,0.12);
  border-radius: 12px;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.7) inset,
    0 16px 48px rgba(15,23,42,0.22),
    0 4px 12px rgba(15,23,42,0.12);
  font-family: 'Geist', system-ui, -apple-system, sans-serif;
  font-size: 12px;
  color: #334155;
  user-select: none;
  isolation: isolate;
  transition: box-shadow 0.15s;
}
.idgsb3-float-panel:hover {
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.8) inset,
    0 20px 56px rgba(15,23,42,0.26),
    0 6px 16px rgba(15,23,42,0.14);
}
.idgsb3-float-panel.fp-visible { display: block; }

/* ── Drag header ──────────────────────────────────────────── */
.idgsb3-float-header {
  display: flex; align-items: center; gap: 6px;
  padding: 9px 10px;
  border-bottom: 1px solid rgba(15,23,42,0.08);
  border-radius: 12px 12px 0 0;
  cursor: grab;
  background: linear-gradient(to bottom, rgba(15,23,42,0.04), rgba(15,23,42,0.02));
}
.idgsb3-float-header:active { cursor: grabbing; }
.idgsb3-float-drag-icon {
  color: #c0cad6;
  font-size: 13px; cursor: grab; flex-shrink: 0;
  letter-spacing: -1px; line-height: 1;
}
.idgsb3-float-title {
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-500, #64748b); flex: 1;
}
.idgsb3-float-close {
  background: none; border: none; cursor: pointer;
  font-size: 18px; line-height: 1;
  color: var(--ink-400, #94a3b8); padding: 2px;
  border-radius: 4px; transition: all .1s;
}
.idgsb3-float-close:hover { background: rgba(239,68,68,0.08); color: #ef4444; }

/* ── Scrollable body ──────────────────────────────────────── */
.idgsb3-float-body {
  padding: 10px 12px 14px;
  display: flex; flex-direction: column; gap: 6px;
  overflow-y: auto; max-height: 70vh;
}
.idgsb3-float-body::-webkit-scrollbar { width: 4px; }
.idgsb3-float-body::-webkit-scrollbar-thumb { background: rgba(15,23,42,0.12); border-radius: 2px; }

/* ── Collapse bar ─────────────────────────────────────────── */
.idgsb3-float-collapse-bar {
  display: flex; align-items: center; justify-content: center;
  padding: 8px;
  border-top: 1px solid rgba(15,23,42,0.08);
  border-radius: 0 0 12px 12px;
  cursor: pointer;
  background: linear-gradient(to top, rgba(15,23,42,0.03), rgba(15,23,42,0.01));
  transition: background 0.15s;
}
.idgsb3-float-collapse-bar:hover { background: rgba(15,23,42,0.06); }
.idgsb3-float-collapse-bar svg {
  width: 18px; height: 18px; color: var(--ink-400, #94a3b8);
  transition: transform 0.2s;
}
.idgsb3-float-panel.collapsed .idgsb3-float-body { display: none; }
.idgsb3-float-panel.collapsed .idgsb3-float-collapse-bar svg { transform: rotate(180deg); }

/* ── Font selector ────────────────────────────────────────── */
.idgsb3-fp-fontsel {
  width: 100%; height: 32px;
  background: white; border: 1px solid var(--ink-200, #e2e8f0);
  border-radius: 7px; color: var(--ink-800, #1e293b);
  font-size: 12px; padding: 0 8px; cursor: pointer; transition: border-color .15s;
}
.idgsb3-fp-fontsel:focus {
  outline: none; border-color: var(--accent, #6366f1);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}

/* ─ B I U row ────────────────────────────────────────────── */
.idgsb3-fp-stylebar { display: flex; gap: 5px; }
.idgsb3-fp-style {
  flex: 1; height: 30px;
  background: white; border: 1px solid var(--ink-200, #e2e8f0);
  border-radius: 7px; color: var(--ink-600, #475569);
  font-size: 12px; cursor: pointer; transition: all .12s;
}
.idgsb3-fp-style:hover { border-color: var(--accent, #6366f1); color: var(--accent, #6366f1); }
.idgsb3-fp-style.active {
  background: var(--accent, #6366f1); border-color: var(--accent, #6366f1); color: white;
  box-shadow: 0 2px 8px rgba(99,102,241,0.30);
}

/* ── Label + Slider row ───────────────────────────────────── */
.idgsb3-fp-row { display: flex; align-items: center; gap: 7px; }
.idgsb3-fp-label {
  font-size: 11px; font-weight: 500; color: var(--ink-500, #64748b);
  min-width: 92px; flex-shrink: 0;
}
.idgsb3-fp-range { flex: 1; height: 4px; min-width: 40px; accent-color: var(--accent, #6366f1); cursor: pointer; }
.idgsb3-fp-val {
  font-size: 11px; color: var(--ink-500, #64748b); min-width: 34px; text-align: right; flex-shrink: 0;
}

/* ── Stroke color pickers ─────────────────────────────────── */
.idgsb3-fp-colorpick {
  width: 26px; height: 26px; border: 1.5px solid var(--ink-200, #e2e8f0);
  border-radius: 6px; cursor: pointer; padding: 0; flex-shrink: 0;
}

/* ── Fill color box ───────────────────────────────────────── */
.idgsb3-fp-fillbox {
  flex: 1; height: 30px; border: 1.5px solid var(--ink-200, #e2e8f0);
  border-radius: 7px; cursor: pointer; display: block; position: relative;
  background: #111111; transition: border-color .12s;
}
.idgsb3-fp-fillbox:hover { border-color: var(--accent, #6366f1); }

/* ── Arc toggle switch ────────────────────────────────────── */
.idgsb3-fp-arctoggle { display: flex; align-items: center; gap: 8px; }
.idgsb3-fp-arctoggle .idgsb3-fp-label { min-width: 30px; }
.idgsb3-fp-toggle {
  width: 36px; height: 20px; border-radius: 10px;
  border: none; background: var(--ink-200, #e2e8f0);
  position: relative; cursor: pointer; flex-shrink: 0; transition: background .18s;
}
.idgsb3-fp-toggle::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 14px; height: 14px; border-radius: 50%; background: white;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15); transition: transform .18s;
}
.idgsb3-fp-toggle[aria-pressed="true"] {
  background: var(--accent, #6366f1); box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}
.idgsb3-fp-toggle[aria-pressed="true"]::after { transform: translateX(16px); }

/* ── Arc type buttons ─────────────────────────────────────── */
.idgsb3-fp-arcbtns { display: flex; gap: 4px; }
.idgsb3-fp-arcbtn {
  flex: 1; height: 28px; background: white; border: 1px solid var(--ink-200, #e2e8f0);
  border-radius: 6px; color: var(--ink-500, #64748b);
  font-size: 11px; cursor: pointer; transition: all .12s;
}
.idgsb3-fp-arcbtn:hover { border-color: var(--accent, #6366f1); color: var(--accent, #6366f1); }
.idgsb3-fp-arcbtn.active {
  background: var(--accent, #6366f1); border-color: var(--accent, #6366f1); color: white;
}

/* ── Arc preview ──────────────────────────────────────────── */
.idgsb3-fp-arcpreview {
  background: var(--ink-50, #f8fafc); border: 1px solid var(--ink-200, #e2e8f0);
  border-radius: 8px; height: 64px; display: flex; align-items: center;
  justify-content: center; overflow: hidden; position: relative;
}
#idgsb3-fp-arcpreview-text {
  font-size: 18px; font-weight: 700; color: var(--ink-900, #0f172a); pointer-events: none;
}
#idgsb3-fp-arcpreview-text .char-wrap {
  display: inline-block; transform-origin: center bottom;
}

/* ── Alignment ────────────────────────────────────────────── */
.idgsb3-fp-align-title {
  font-size: 9.5px; font-weight: 600; letter-spacing: 0.07em;
  text-transform: uppercase; color: var(--ink-400, #94a3b8);
  border-top: 1px solid rgba(15,23,42,0.07); padding-top: 8px; margin-top: 2px;
}
.idgsb3-fp-alignbtns { display: flex; gap: 4px; }
.idgsb3-fp-alignbtn {
  flex: 1; height: 28px; background: white; border: 1px solid var(--ink-200, #e2e8f0);
  border-radius: 6px; color: var(--ink-500, #64748b);
  font-size: 11px; cursor: pointer; transition: all .12s;
}
.idgsb3-fp-alignbtn:hover { border-color: var(--accent, #6366f1); color: var(--accent, #6366f1); }
.idgsb3-fp-alignbtn.active {
  background: var(--accent, #6366f1); border-color: var(--accent, #6366f1); color: white;
}

/* ════════════════════════════════════════════════════════════
TEXT ITEMS ON CANVAS — GRAPHIC TEXT (CorelDRAW / Illustrator style)
No bounding box or frame. Handles-only selection indicator.
════════════════════════════════════════════════════════════ */
.idgsb2-text-item {
  position: absolute !important;
  /* Graphic/point text — no word-wrap outside of edit mode.
     The SVG handles its own layout; wrapping here creates vertical stacking. */
  white-space: nowrap !important;
  overflow: visible !important;
  cursor: move; user-select: none; z-index: 50;
  box-sizing: border-box;
  /* NO border, NO background — pure graphic text, no container frame */
  border: none;
  min-width: 20px; min-height: 16px;
  opacity: 1 !important;
  visibility: visible !important;
  background: transparent;
}
/* Selected / hover: still no frame — handles appear instead */
.idgsb2-text-item.selected,
.idgsb2-text-item:hover {
  border: none;
  background: transparent;
}
.idgsb2-text-item.editing {
  cursor: text !important; user-select: text !important;
  /* Subtle typing area — only visible while typing */
  background: rgba(255, 255, 255, 0.90) !important;
  border: 1px dashed rgba(99,102,241,0.40) !important;
  /* GRAPHIC TEXT (Illustrator/CorelDRAW point-text style):
     Expand HORIZONTALLY as user types — never stack letters vertically.
     white-space:pre  → only wraps on explicit Enter, not at container edge.
     width:auto       → element grows with content instead of clipping.
     overflow:visible → typed text is never cut off. */
  width: auto !important;
  min-width: 40px !important;
  white-space: pre !important;
  overflow: visible !important;
}
/* Fix 1: Brand-new empty text placement — no white box until user starts typing */
.idgsb2-text-item.new-placement.editing {
  background: transparent !important;
  border-color: transparent !important;
}

/* Hide handles + delete button while typing — clean edit cursor only */
.idgsb2-text-item.editing .resize-tl,
.idgsb2-text-item.editing .resize-tr,
.idgsb2-text-item.editing .resize-bl,
.idgsb2-text-item.editing .resize-br,
.idgsb2-text-item.editing .resize-tm,
.idgsb2-text-item.editing .resize-bm,
.idgsb2-text-item.editing .resize-ml,
.idgsb2-text-item.editing .resize-mr,
.idgsb2-text-item.editing .idgsb2-text-del { display: none !important; }

/* ── 8 CorelDRAW-style Graphic Text handles ───────────────
   Solid dark squares, no border-radius (= classic vector handles)
   Corners (tl/tr/bl/br) + midpoints (tm/bm/ml/mr)
────────────────────────────────────────────────────────── */
.idgsb2-text-item .resize-tl,
.idgsb2-text-item .resize-tr,
.idgsb2-text-item .resize-bl,
.idgsb2-text-item .resize-br,
.idgsb2-text-item .resize-tm,
.idgsb2-text-item .resize-bm,
.idgsb2-text-item .resize-ml,
.idgsb2-text-item .resize-mr {
  position: absolute;
  width: 8px; height: 8px;
  background: #1e293b;      /* solid dark — CorelDRAW style */
  border: 1px solid #fff;   /* thin white ring for contrast on dark bg */
  border-radius: 0;         /* square, not rounded */
  z-index: 60;
  display: none;
  box-sizing: border-box;
  box-shadow: 0 1px 3px rgba(0,0,0,0.35);
}
/* Show all 8 handles when selected */
.idgsb2-text-item.selected .resize-tl,
.idgsb2-text-item.selected .resize-tr,
.idgsb2-text-item.selected .resize-bl,
.idgsb2-text-item.selected .resize-br,
.idgsb2-text-item.selected .resize-tm,
.idgsb2-text-item.selected .resize-bm,
.idgsb2-text-item.selected .resize-ml,
.idgsb2-text-item.selected .resize-mr {
  display: block;
}
/* Corner handles */
.idgsb2-text-item .resize-tl { top: -5px; left: -5px; cursor: nwse-resize; }
.idgsb2-text-item .resize-tr { top: -5px; right: -5px; cursor: nesw-resize; }
.idgsb2-text-item .resize-bl { bottom: -5px; left: -5px; cursor: nesw-resize; }
.idgsb2-text-item .resize-br { bottom: -5px; right: -5px; cursor: nwse-resize; }
/* Mid-edge handles */
.idgsb2-text-item .resize-tm { top: -5px;    left: 50%; transform: translateX(-50%); cursor: ns-resize; }
.idgsb2-text-item .resize-bm { bottom: -5px; left: 50%; transform: translateX(-50%); cursor: ns-resize; }
.idgsb2-text-item .resize-ml { left: -5px;   top: 50%;  transform: translateY(-50%); cursor: ew-resize; }
.idgsb2-text-item .resize-mr { right: -5px;  top: 50%;  transform: translateY(-50%); cursor: ew-resize; }

/* Hide old single resize handle */
.idgsb2-text-item .resize { display: none !important; }

/* Delete button — removed (use keyboard Delete/Backspace on selected text item) */
.idgsb2-text-del { display: none !important; }

/* ── Tool Cursor States ──────────────────────────────────── */
.idgsb2-builder-shell.tool-text   .idgsb3-canvas-sheet { cursor: text; }
.idgsb2-builder-shell.tool-select .idgsb3-canvas-sheet { cursor: default; }
.idgsb2-builder-shell.tool-hand   .idgsb3-canvas-sheet { cursor: grab; }

/* Hand/Pan nav tile active state (toggled by builder.js via .active class) */
.idgsb2-builder-shell .idgsb3-nav-tile[data-action="pan-tool"].active {
  background: rgba(var(--accent-rgb), 0.12) !important;
  color: var(--accent-deep) !important;
}
/* Mobile Pan nav button active state */
.idgsb2-builder-shell .idgsb3-m-nav-btn[data-action="pan-tool"].active {
  background: rgba(var(--accent-rgb), 0.12) !important;
}
.idgsb2-builder-shell .idgsb3-m-nav-btn[data-action="pan-tool"].active .nav-lbl {
  color: var(--accent-deep) !important;
}
/* ─────────────────────────────────────────────────────────────
   v3.2.7 — Library/Templates panel rebuild + colorful 3D nav
───────────────────────────────────────────────────────────── */
.idgsb-ui-v30 .idgsb3-left-nav{
  gap:10px!important;
}
.idgsb-ui-v30 .idgsb3-nav-tile{
  position:relative;
  border:1px solid rgba(255,255,255,.76)!important;
  background:linear-gradient(145deg,rgba(255,255,255,.95),rgba(240,245,255,.82))!important;
  box-shadow:0 10px 20px rgba(31,41,55,.08), inset 0 1px 0 rgba(255,255,255,.96)!important;
  transition:transform .18s ease, box-shadow .18s ease, filter .18s ease, background .18s ease;
  overflow:hidden;
}
.idgsb-ui-v30 .idgsb3-nav-tile::before{
  content:"";position:absolute;inset:0;border-radius:inherit;opacity:0;
  background:radial-gradient(circle at 35% 20%,rgba(255,255,255,.85),transparent 38%),linear-gradient(135deg,rgba(var(--accent-rgb),.18),rgba(56,189,248,.10));
  transition:opacity .18s ease;
}
.idgsb-ui-v30 .idgsb3-nav-tile svg,.idgsb-ui-v30 .idgsb3-nav-tile .nav-label{position:relative;z-index:1}
.idgsb-ui-v30 .idgsb3-nav-tile[data-nav="builder"]{color:#5b3df0!important;}
.idgsb-ui-v30 .idgsb3-nav-tile[data-nav="images"]{color:#0ea5e9!important;}
.idgsb-ui-v30 .idgsb3-nav-tile[data-nav="select"]{color:#f59e0b!important;}
.idgsb-ui-v30 .idgsb3-nav-tile[data-nav="text"]{color:#ef4444!important;}
.idgsb-ui-v30 .idgsb3-nav-tile[data-nav="library"]{color:#10b981!important;}
.idgsb-ui-v30 .idgsb3-nav-tile[data-nav="templates"]{color:#a855f7!important;}
.idgsb-ui-v30 .idgsb3-nav-tile:hover{
  transform:translateY(-2px) scale(1.018);
  filter:saturate(1.12) contrast(1.04);
  box-shadow:0 16px 28px rgba(31,41,55,.14), inset 0 1px 0 rgba(255,255,255,1)!important;
}
.idgsb-ui-v30 .idgsb3-nav-tile:hover::before{opacity:1;}
.idgsb-ui-v30 .idgsb3-nav-tile.active{
  color:#fff!important;
  background:linear-gradient(145deg,var(--accent),#7c3aed)!important;
  box-shadow:0 16px 30px rgba(var(--accent-rgb),.34), inset 0 1px 0 rgba(255,255,255,.32)!important;
}
.idgsb-ui-v30 .idgsb3-nav-tile.active::before{opacity:.45;}

/* Shared smart panel cards */
.idgsb3-smart-panel{display:flex;flex-direction:column;gap:12px;min-height:0;}
.idgsb3-smart-card{
  padding:20px 16px;
  border:1px dashed rgba(var(--accent-rgb),.34);
  border-radius:20px;
  background:linear-gradient(145deg,rgba(255,255,255,.86),rgba(var(--accent-rgb),.06));
  box-shadow:inset 0 1px 0 rgba(255,255,255,.95),0 14px 34px rgba(15,23,42,.06);
  text-align:center;
  color:var(--ink-700);
}
.idgsb3-smart-card h4{margin:8px 0 6px;font-size:15px;font-weight:800;color:var(--ink-800);letter-spacing:-.01em;}
.idgsb3-smart-card p{margin:0 auto 12px;font-size:12px;line-height:1.55;color:var(--ink-500);max-width:260px;}
.idgsb3-smart-icon{
  width:48px;height:48px;margin:0 auto 6px;border-radius:18px;display:flex;align-items:center;justify-content:center;
  color:var(--accent);
  background:linear-gradient(145deg,rgba(var(--accent-rgb),.16),rgba(255,255,255,.82));
  box-shadow:0 10px 20px rgba(var(--accent-rgb),.12),inset 0 1px 0 rgba(255,255,255,.9);
}
.idgsb3-color-action{
  display:inline-flex;align-items:center;justify-content:center;gap:8px;
  min-height:40px;padding:10px 15px;border:0;border-radius:14px;cursor:pointer;text-decoration:none!important;
  font-size:12px;font-weight:800;color:#fff!important;
  background:linear-gradient(145deg,var(--accent),#7c3aed);
  box-shadow:0 12px 22px rgba(var(--accent-rgb),.28),inset 0 1px 0 rgba(255,255,255,.35);
  transition:transform .18s ease,filter .18s ease,box-shadow .18s ease;
}
.idgsb3-color-action:hover{transform:translateY(-2px);filter:saturate(1.12);box-shadow:0 16px 30px rgba(var(--accent-rgb),.36),inset 0 1px 0 rgba(255,255,255,.45);}
.idgsb3-project-list{margin:10px 0 14px;}
.idgsb3-project-empty{display:flex;align-items:center;justify-content:center;gap:8px;padding:12px;border-radius:14px;background:rgba(255,255,255,.64);color:var(--ink-500);font-size:11px;}

/* Templates — only Graphic Templates + Custom Upload */
.idgsb3-template-options{display:grid;grid-template-columns:1fr;gap:10px;}
.idgsb3-template-option{
  width:100%;display:flex;align-items:center;gap:12px;padding:13px;border:1px solid rgba(var(--accent-rgb),.15);border-radius:18px;background:linear-gradient(145deg,#fff,rgba(var(--accent-rgb),.045));cursor:pointer;text-align:left;
  box-shadow:0 10px 22px rgba(15,23,42,.06),inset 0 1px 0 rgba(255,255,255,.95);
  transition:transform .18s ease,box-shadow .18s ease,background .18s ease,filter .18s ease;
}
.idgsb3-template-option:hover{transform:translateY(-2px);filter:saturate(1.08);box-shadow:0 16px 30px rgba(15,23,42,.10),inset 0 1px 0 rgba(255,255,255,1);}
.idgsb3-template-option.active{background:linear-gradient(145deg,rgba(var(--accent-rgb),.18),rgba(255,255,255,.86));border-color:rgba(var(--accent-rgb),.45);}
.idgsb3-template-icon{width:44px;height:44px;border-radius:16px;display:flex;align-items:center;justify-content:center;background:linear-gradient(145deg,var(--accent),#7c3aed);color:#fff;box-shadow:0 10px 20px rgba(var(--accent-rgb),.25);flex:0 0 auto;}
.idgsb3-template-option b{display:block;font-size:13px;font-weight:900;color:var(--ink-800);}
.idgsb3-template-option small{display:block;margin-top:2px;font-size:10px;color:var(--ink-500);line-height:1.25;}
.idgsb3-template-pane{display:none;animation:idgsbPaneIn .22s ease both;}
.idgsb3-template-pane.active{display:block;}
@keyframes idgsbPaneIn{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
.idgsb3-template-library-placeholder{display:flex;align-items:center;justify-content:center;gap:8px;min-height:78px;border-radius:16px;border:1px dashed rgba(var(--accent-rgb),.24);background:rgba(255,255,255,.64);font-size:12px;color:var(--ink-500);}
.idgsb3-custom-instructions{padding:14px 15px;border-radius:18px;background:linear-gradient(145deg,rgba(16,185,129,.10),rgba(255,255,255,.82));border:1px solid rgba(16,185,129,.20);box-shadow:inset 0 1px 0 rgba(255,255,255,.9);}
.idgsb3-custom-instructions b{display:block;font-size:13px;font-weight:900;color:var(--ink-800);margin-bottom:4px;}
.idgsb3-custom-instructions span{display:block;font-size:11px;line-height:1.5;color:var(--ink-600);}
.idgsb3-upload-source-box{margin-top:12px;padding:12px;border-radius:22px;background:rgba(255,255,255,.62);border:1px solid rgba(255,255,255,.75);box-shadow:0 16px 34px rgba(15,23,42,.08),inset 0 1px 0 rgba(255,255,255,.95);display:grid;grid-template-columns:1fr 1fr;gap:10px;}
.idgsb3-source-choice{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;min-height:90px;border-radius:18px;border:1px solid rgba(15,23,42,.08);background:linear-gradient(145deg,#fff,rgba(var(--accent-rgb),.045));box-shadow:0 10px 20px rgba(15,23,42,.06),inset 0 1px 0 rgba(255,255,255,.9);cursor:pointer;text-align:center;color:var(--ink-700);font-size:11px;font-weight:800;transition:transform .18s ease,box-shadow .18s ease,filter .18s ease;}
.idgsb3-source-choice:hover{transform:translateY(-2px);filter:saturate(1.12);box-shadow:0 16px 28px rgba(15,23,42,.12),inset 0 1px 0 rgba(255,255,255,1);}
.idgsb3-source-computer{color:var(--accent)!important;}
.idgsb3-logo-computer{width:30px;height:30px;border-radius:13px;display:flex;align-items:center;justify-content:center;background:rgba(var(--accent-rgb),.12);}

/* Login modal */
.idgsb3-login-modal{position:fixed;inset:0;z-index:999999;display:none;align-items:center;justify-content:center;background:rgba(15,23,42,.28);backdrop-filter:blur(8px);padding:20px;}
.idgsb3-login-modal.open{display:flex;}
.idgsb3-login-card{position:relative;width:min(380px,100%);border-radius:26px;background:linear-gradient(145deg,rgba(255,255,255,.96),rgba(245,247,255,.92));box-shadow:0 30px 80px rgba(15,23,42,.24),inset 0 1px 0 rgba(255,255,255,1);padding:28px;text-align:center;border:1px solid rgba(255,255,255,.78);}
.idgsb3-login-card h3{margin:10px 0 6px;font-size:18px;font-weight:900;color:var(--ink-800);}
.idgsb3-login-card p{margin:0 0 16px;color:var(--ink-500);font-size:13px;line-height:1.5;}
.idgsb3-login-close{position:absolute;right:14px;top:12px;width:32px;height:32px;border-radius:12px;border:0;background:rgba(15,23,42,.06);cursor:pointer;font-size:20px;line-height:1;color:var(--ink-500);}
.idgsb3-login-close:hover{background:rgba(239,68,68,.12);color:#ef4444;}

@media (max-width: 720px){
  .idgsb3-upload-source-box{grid-template-columns:1fr;}
}


/* ============================================================
   v3.2.8 — Fit-to-browser + Template upload card + soft rounded 3D edges
   Scope: visual polish only. No builder engine changes.
============================================================ */

/* Keep whole app inside the desktop browser viewport more reliably */
.idgsb2-builder-shell.idgsb-ui-v30{
  width:min(98vw, 1840px) !important;
  max-width:calc(100vw - 20px) !important;
  margin:10px auto !important;
  left:auto !important;
  transform:none !important;
  border-radius:0 !important;
  overflow:visible !important;
  box-shadow:
    0 30px 80px rgba(15,23,42,.16),
    0 8px 24px rgba(15,23,42,.08),
    inset 0 1px 0 rgba(255,255,255,.85) !important;
}
.idgsb2-builder-shell.idgsb-ui-v30 .idgsb2-canvas-bg{
  min-height:auto !important;
  height:auto !important;
  padding:14px !important;
  border-radius:0 !important;
  overflow:visible !important;
}
.idgsb2-builder-shell.idgsb-ui-v30 .idgsb3-topbar{
  border-radius:0 !important;
}
.idgsb2-builder-shell.idgsb-ui-v30 .idgsb3-main-grid{
  height:calc(100vh - 118px) !important;
  min-height:560px !important;
  max-height:calc(100vh - 118px) !important;
  grid-template-columns:82px 300px minmax(520px,1fr) 304px !important;
  gap:14px !important;
}

/* Responsive safety: if screen height is small, compress vertical chrome rather than overflowing */
@media (max-height: 780px){
  .idgsb2-builder-shell.idgsb-ui-v30{margin:6px auto !important;}
  .idgsb2-builder-shell.idgsb-ui-v30 .idgsb2-canvas-bg{padding:10px !important;}
  .idgsb2-builder-shell.idgsb-ui-v30 .idgsb3-main-grid{
    height:calc(100vh - 100px) !important;
    max-height:calc(100vh - 100px) !important;
    min-height:500px !important;
  }
  .idgsb2-builder-shell.idgsb-ui-v30 .idgsb3-topbar{padding:9px 13px !important;}
}

/* Canvas/workspace should feel like a floating rounded glass card, not a sharp pasted paper edge */
.idgsb2-builder-shell.idgsb-ui-v30 .idgsb3-content-panel,
.idgsb2-builder-shell.idgsb-ui-v30 .idgsb3-left-nav,
.idgsb2-builder-shell.idgsb-ui-v30 .idgsb3-right-panel,
.idgsb2-builder-shell.idgsb-ui-v30 .idgsb3-canvas-stage{
  border-radius:22px !important;
}
.idgsb2-builder-shell.idgsb-ui-v30 .idgsb3-canvas-stage{
  min-height:0 !important;
  padding:22px !important;
  background:rgba(255,255,255,.26) !important;
  border:1px solid rgba(255,255,255,.48) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.65),
    0 18px 48px rgba(15,23,42,.08) !important;
  overflow:visible !important;
}
.idgsb2-builder-shell.idgsb-ui-v30 .idgsb3-canvas-sheet{
  border-radius:20px !important;
  width:min(100%, 620px, calc((100vh - 220px) * 0.9167)) !important;
  max-height:calc(100vh - 220px) !important;
  box-shadow:
    0 2px 4px rgba(15,23,42,.05),
    0 24px 58px rgba(15,23,42,.16),
    0 8px 20px rgba(15,23,42,.08) !important;
  border:1px solid rgba(15,23,42,.05) !important;
  overflow:hidden !important;
}
@media (max-height:780px){
  .idgsb2-builder-shell.idgsb-ui-v30 .idgsb3-canvas-sheet{
    width:min(100%, 560px, calc((100vh - 190px) * 0.9167)) !important;
    max-height:calc(100vh - 190px) !important;
  }
}

/* Template upload source buttons: equal spacing, centered icon/text, professional card look */
.idgsb2-builder-shell.idgsb-ui-v30 .idgsb3-upload-source-box{
  padding:14px !important;
  gap:14px !important;
  border-radius:24px !important;
  align-items:stretch !important;
}
.idgsb2-builder-shell.idgsb-ui-v30 .idgsb3-source-choice{
  min-height:116px !important;
  padding:16px 12px !important;
  gap:12px !important;
  border-radius:22px !important;
  justify-content:center !important;
  align-items:center !important;
  box-shadow:
    0 12px 24px rgba(15,23,42,.07),
    inset 0 1px 0 rgba(255,255,255,.98) !important;
}
.idgsb2-builder-shell.idgsb-ui-v30 .idgsb3-source-choice svg{
  display:block !important;
  margin:0 auto !important;
  flex-shrink:0 !important;
}
.idgsb2-builder-shell.idgsb-ui-v30 .idgsb3-source-choice b{
  display:block !important;
  max-width:100% !important;
  text-align:center !important;
  line-height:1.18 !important;
  font-size:12px !important;
  font-weight:900 !important;
  letter-spacing:.01em !important;
  white-space:normal !important;
  overflow-wrap:normal !important;
}
.idgsb2-builder-shell.idgsb-ui-v30 .idgsb3-source-computer{
  color:#3f7e63 !important;
  background:linear-gradient(145deg, rgba(255,255,255,.96), rgba(77,138,111,.10)) !important;
}
.idgsb2-builder-shell.idgsb-ui-v30 .idgsb3-logo-computer{
  width:44px !important;
  height:44px !important;
  border-radius:18px !important;
  margin:0 auto !important;
  background:rgba(77,138,111,.14) !important;
  color:#4d8a6f !important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.95), 0 8px 18px rgba(77,138,111,.16) !important;
}
.idgsb2-builder-shell.idgsb-ui-v30 .idgsb3-source-computer:hover{
  background:linear-gradient(145deg, rgba(255,255,255,1), rgba(77,138,111,.16)) !important;
  color:#2f6f54 !important;
}

/* If desktop window is narrower, keep all panels inside viewport without ugly overflow */
@media (max-width: 1320px){
  .idgsb2-builder-shell.idgsb-ui-v30 .idgsb3-main-grid{
    grid-template-columns:72px 260px minmax(420px,1fr) 270px !important;
    gap:10px !important;
  }
  .idgsb2-builder-shell.idgsb-ui-v30 .idgsb3-content-panel,
  .idgsb2-builder-shell.idgsb-ui-v30 .idgsb3-right-panel{padding:12px !important;}
  .idgsb2-builder-shell.idgsb-ui-v30 .idgsb3-upload-source-box{grid-template-columns:1fr 1fr !important;gap:10px !important;}
  .idgsb2-builder-shell.idgsb-ui-v30 .idgsb3-source-choice{min-height:98px !important;padding:12px 8px !important;}
}

@media (max-width: 980px){
  .idgsb2-builder-shell.idgsb-ui-v30{
    width:100% !important;
    max-width:100% !important;
    margin:0 !important;
    border-radius:0 !important;
    box-shadow:none !important;
  }
}


/* ============================================================
   v3.2.9 — Zoom containment patch
   Scope: only stop magnified sheet from covering side panels/menus.
   The sheet can zoom, but it is clipped inside the workspace and stays
   under the fixed UI panels.
============================================================ */
.idgsb2-builder-shell.idgsb-ui-v30 .idgsb3-main-grid{
  position:relative !important;
  overflow:hidden !important;
  border-radius:26px !important;
}
.idgsb2-builder-shell.idgsb-ui-v30 .idgsb3-left-nav,
.idgsb2-builder-shell.idgsb-ui-v30 .idgsb3-content-panel,
.idgsb2-builder-shell.idgsb-ui-v30 .idgsb3-right-panel{
  position:relative !important;
  z-index:40 !important;
}
.idgsb2-builder-shell.idgsb-ui-v30 .idgsb3-canvas-col{
  position:relative !important;
  z-index:10 !important;
  min-width:0 !important;
  overflow:hidden !important;
  border-radius:24px !important;
}
.idgsb2-builder-shell.idgsb-ui-v30 .idgsb3-toolbar{
  position:relative !important;
  z-index:45 !important;
}
.idgsb2-builder-shell.idgsb-ui-v30 .idgsb3-canvas-stage{
  position:relative !important;
  z-index:1 !important;
  overflow:hidden !important;
  isolation:isolate !important;
  contain:paint !important;
  border-radius:26px !important;
}
.idgsb2-builder-shell.idgsb-ui-v30 .idgsb3-canvas-sheet{
  position:relative !important;
  z-index:2 !important;
  transform-origin:center center !important;
  will-change:transform !important;
}
.idgsb2-builder-shell.idgsb-ui-v30 .idgsb3-ruler-h,
.idgsb2-builder-shell.idgsb-ui-v30 .idgsb3-ruler-v{
  z-index:6 !important;
}
.idgsb2-builder-shell.idgsb-ui-v30 .idgsb3-warning-overlay{
  z-index:70 !important;
}
.idgsb2-builder-shell.idgsb-ui-v30 .idgsb3-zoom-bar{
  z-index:75 !important;
}
@media (max-width:900px){
  .idgsb2-builder-shell.idgsb-ui-v30 .idgsb3-main-grid{
    overflow:visible !important;
  }
}


/* v3.3.0 mobile functional repair: keep live sheet and drawers usable on mobile */
.idgsb2-builder-shell.idgsb-mobile-live-sheet .idgsb3-m-sheet{
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  overflow:hidden !important;
  min-height:320px !important;
  background:rgba(255,255,255,.76) !important;
}
.idgsb2-builder-shell .idgsb3-m-sheet .idgsb3-canvas-sheet.idgsb3-sheet-in-mobile{
  flex:none !important;
  width:var(--idgsb-mobile-sheet-w, 660px) !important;
  height:var(--idgsb-mobile-sheet-h, 720px) !important;
  max-width:none !important;
  max-height:none !important;
  aspect-ratio:auto !important;
  margin:0 !important;
  border-radius:14px !important;
  transform:scale(var(--idgsb-mobile-scale, .5)) !important;
  transform-origin:top left !important;
}
@media (max-width:1023px) and (orientation:portrait), (max-width:599px){
  .idgsb2-builder-shell .idgsb3-content-panel.idgsb3-mobile-drawer-open{
    display:flex !important;
    position:absolute !important;
    left:12px !important;
    right:12px !important;
    bottom:86px !important;
    top:auto !important;
    max-height:min(68vh, 560px) !important;
    z-index:80 !important;
    overflow:auto !important;
    border-radius:24px !important;
    box-shadow:0 24px 70px rgba(15,23,42,.24) !important;
  }
  .idgsb2-builder-shell .idgsb3-mobile-drawer-close{
    position:absolute !important;
    right:10px !important;
    top:10px !important;
    width:32px !important;
    height:32px !important;
    border:0 !important;
    border-radius:999px !important;
    background:rgba(15,23,42,.08) !important;
    color:var(--ink-700) !important;
    font-size:20px !important;
    line-height:1 !important;
    cursor:pointer !important;
    z-index:2 !important;
  }
}
#idgsb3-float-panel.idgsb3-fp-mobile{
  position:fixed !important;
  z-index:999999 !important;
  max-height:min(70vh, 560px) !important;
  overflow:auto !important;
  border-radius:24px !important;
}

/* v3.3.1 mobile sheet fit + complete bottom menu repair */
@media (max-width:1023px) and (orientation:portrait), (max-width:599px){
  .idgsb2-builder-shell .idgsb3-mobile-view{
    height:100svh !important;
    min-height:0 !important;
  }
  .idgsb2-builder-shell .idgsb3-m-canvas-wrap{
    padding:10px 8px 96px !important;
    align-items:center !important;
    justify-content:center !important;
    overflow:hidden !important;
  }
  .idgsb2-builder-shell .idgsb3-m-canvas-stage{
    width:100% !important;
    max-width:min(92vw, 430px) !important;
  }
  .idgsb2-builder-shell .idgsb3-m-canvas-row{
    align-items:center !important;
    justify-content:center !important;
    gap:7px !important;
  }
  .idgsb2-builder-shell.idgsb-mobile-live-sheet .idgsb3-m-sheet{
    flex:0 0 auto !important;
    width:min(78vw, 360px) !important;
    height:min(68vh, 520px) !important;
    min-height:260px !important;
    max-height:calc(100svh - 250px) !important;
    display:flex !important;
    align-items:center !important;
    justify-content:center !important;
    overflow:visible !important;
    border-radius:18px !important;
    box-shadow:0 18px 45px rgba(15,23,42,.13), 0 4px 14px rgba(15,23,42,.08) !important;
  }
  .idgsb2-builder-shell .idgsb3-m-sheet-scale-box{
    position:relative !important;
    flex:0 0 auto !important;
    overflow:visible !important;
    transform:none !important;
  }
  .idgsb2-builder-shell .idgsb3-m-sheet .idgsb3-canvas-sheet.idgsb3-sheet-in-mobile{
    position:absolute !important;
    left:0 !important;
    top:0 !important;
    width:var(--idgsb-mobile-sheet-w, 660px) !important;
    height:var(--idgsb-mobile-sheet-h, 720px) !important;
    max-width:none !important;
    max-height:none !important;
    transform:scale(var(--idgsb-mobile-scale, .5)) !important;
    transform-origin:top left !important;
    margin:0 !important;
  }
  .idgsb2-builder-shell .idgsb3-m-bottom-nav{
    padding:0 8px max(8px, env(safe-area-inset-bottom)) !important;
    position:relative !important;
    z-index:90 !important;
  }
  .idgsb2-builder-shell .idgsb3-m-nav-bar{
    justify-content:flex-start !important;
    gap:4px !important;
    overflow-x:auto !important;
    overflow-y:visible !important;
    -webkit-overflow-scrolling:touch !important;
    padding:6px 8px !important;
    scrollbar-width:none !important;
  }
  .idgsb2-builder-shell .idgsb3-m-nav-bar::-webkit-scrollbar{display:none !important;}
  .idgsb2-builder-shell .idgsb3-m-nav-btn{
    min-width:54px !important;
    padding:7px 8px !important;
    border-radius:15px !important;
    flex:0 0 auto !important;
  }
  .idgsb2-builder-shell .idgsb3-m-nav-upload{
    min-width:58px !important;
    flex:0 0 auto !important;
    margin:-18px 4px 0 !important;
  }
  .idgsb2-builder-shell .idgsb3-m-nav-upload-ico{
    width:50px !important;
    height:50px !important;
    border-radius:17px !important;
  }
  .idgsb2-builder-shell .idgsb3-m-nav-btn .nav-lbl,
  .idgsb2-builder-shell .idgsb3-m-nav-upload .nav-lbl{
    font-size:9px !important;
    line-height:1.05 !important;
    white-space:nowrap !important;
  }
  .idgsb2-builder-shell .idgsb3-content-panel.idgsb3-mobile-drawer-open{
    left:10px !important;
    right:10px !important;
    bottom:86px !important;
    max-height:min(70svh, 560px) !important;
  }
}

/* v3.3.2 mobile uploaded image strip + tighter mobile canvas spacing */
@media (max-width:1023px) and (orientation:portrait), (max-width:599px){
  .idgsb2-builder-shell .idgsb3-mobile-view{
    height:100svh !important;
    overflow:hidden !important;
  }
  .idgsb2-builder-shell .idgsb3-m-canvas-wrap{
    flex:1 1 auto !important;
    min-height:0 !important;
    padding:16px 8px 8px !important;
    align-items:flex-start !important;
    justify-content:center !important;
  }
  .idgsb2-builder-shell .idgsb3-m-canvas-stage{
    margin-top:0 !important;
    max-width:min(94vw, 430px) !important;
  }
  .idgsb2-builder-shell.idgsb-mobile-live-sheet .idgsb3-m-sheet{
    width:min(82vw, 370px) !important;
    height:min(56svh, 470px) !important;
    max-height:calc(100svh - 355px) !important;
    min-height:240px !important;
  }

  .idgsb2-builder-shell .idgsb3-m-upload-strip{
    display:none;
    flex:0 0 auto;
    margin:0 10px 8px !important;
    padding:10px 10px 12px !important;
    border-radius:22px !important;
    position:relative !important;
    z-index:88 !important;
    overflow:hidden !important;
  }
  .idgsb2-builder-shell .idgsb3-m-upload-strip.open,
  .idgsb2-builder-shell .idgsb3-m-upload-strip.has-items{
    display:block !important;
  }
  .idgsb2-builder-shell .idgsb3-m-upload-strip-head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    margin:0 2px 8px;
  }
  .idgsb2-builder-shell .idgsb3-m-upload-strip-title{
    display:flex;
    align-items:center;
    gap:7px;
    font-size:12px;
    font-weight:800;
    color:var(--ink-700);
    letter-spacing:.02em;
  }
  .idgsb2-builder-shell .idgsb3-m-upload-strip-close{
    width:28px;
    height:28px;
    border:0;
    border-radius:999px;
    background:rgba(15,23,42,.07);
    color:var(--ink-600);
    display:flex;
    align-items:center;
    justify-content:center;
    cursor:pointer;
    font-size:18px;
    line-height:1;
  }
  .idgsb2-builder-shell .idgsb3-m-upload-list{
    display:flex;
    gap:10px;
    overflow-x:auto;
    overflow-y:hidden;
    -webkit-overflow-scrolling:touch;
    padding:2px 2px 4px;
    scrollbar-width:none;
  }
  .idgsb2-builder-shell .idgsb3-m-upload-list::-webkit-scrollbar{display:none;}
  .idgsb2-builder-shell .idgsb3-m-upload-empty{
    width:100%;
    min-height:74px;
    border:1px dashed rgba(var(--accent-rgb),.25);
    border-radius:16px;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:3px;
    color:var(--ink-500);
    font-size:12px;
    background:rgba(255,255,255,.42);
  }
  .idgsb2-builder-shell .idgsb3-m-thumb{
    width:82px;
    min-width:82px;
    border-radius:16px;
    background:rgba(255,255,255,.74);
    border:1px solid rgba(15,23,42,.07);
    box-shadow:0 4px 14px rgba(15,23,42,.08), inset 0 1px 0 rgba(255,255,255,.7);
    padding:7px;
    cursor:pointer;
    display:flex;
    flex-direction:column;
    align-items:center;
    gap:5px;
    transition:transform .15s ease, box-shadow .15s ease, border-color .15s ease;
  }
  .idgsb2-builder-shell .idgsb3-m-thumb:active,
  .idgsb2-builder-shell .idgsb3-m-thumb:hover{
    transform:translateY(-1px);
    border-color:rgba(var(--accent-rgb),.35);
    box-shadow:0 8px 22px rgba(var(--accent-rgb),.16), inset 0 1px 0 rgba(255,255,255,.8);
  }
  .idgsb2-builder-shell .idgsb3-m-thumb img{
    width:64px;
    height:54px;
    object-fit:contain;
    border-radius:10px;
    background:rgba(248,250,252,.8);
  }
  .idgsb2-builder-shell .idgsb3-m-thumb-name{
    width:100%;
    font-size:9px;
    line-height:1.1;
    font-weight:700;
    color:var(--ink-700);
    text-align:center;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
  }
  .idgsb2-builder-shell .idgsb3-m-thumb-note{
    font-size:8px;
    color:var(--ink-500);
    line-height:1;
  }

  .idgsb2-builder-shell .idgsb3-m-bottom-nav{
    padding-top:0 !important;
  }
}

@media (max-height:760px) and (max-width:1023px){
  .idgsb2-builder-shell .idgsb3-m-toolbar{padding-top:4px !important;padding-bottom:4px !important;}
  .idgsb2-builder-shell .idgsb3-m-canvas-wrap{padding-top:8px !important;}
  .idgsb2-builder-shell.idgsb-mobile-live-sheet .idgsb3-m-sheet{
    height:min(50svh, 420px) !important;
  }
  .idgsb2-builder-shell .idgsb3-m-upload-strip{padding:8px !important;margin-bottom:6px !important;}
  .idgsb2-builder-shell .idgsb3-m-thumb{width:74px;min-width:74px;padding:6px;}
  .idgsb2-builder-shell .idgsb3-m-thumb img{width:58px;height:46px;}
}

/* v3.3.3 Mobile usability patch: tighter canvas, top tools, real mobile drawers */
@media (max-width:1023px) and (orientation:portrait), (max-width:599px){
  .idgsb2-builder-shell .idgsb3-mobile-view{
    position:relative !important;
    height:100svh !important;
    max-height:100svh !important;
    overflow:hidden !important;
  }
  .idgsb2-builder-shell .idgsb3-m-topbar{padding:8px 14px !important;}
  .idgsb2-builder-shell .idgsb3-m-toolbar{
    padding:4px 6px !important;
    gap:2px 0 !important;
    max-width:100% !important;
    overflow:visible !important; /* keep two-row grid, no horizontal scroll */
    grid-template-columns:repeat(6,1fr) !important;
  }
  .idgsb2-builder-shell .idgsb3-mini-tool{
    min-width:0 !important;
    padding:4px 2px !important;
    border-radius:10px !important;
  }
  .idgsb2-builder-shell .idgsb3-m-spacing-tool{
    min-width:54px !important;
    gap:2px !important;
  }
  .idgsb2-builder-shell .idgsb3-m-spacing-tool input{
    width:42px !important;
    height:22px !important;
    padding:0 4px !important;
    text-align:center !important;
    border:1px solid rgba(15,23,42,.08) !important;
    border-radius:8px !important;
    background:rgba(255,255,255,.74) !important;
    color:var(--ink-800) !important;
    font-weight:800 !important;
    font-size:11px !important;
    box-shadow:inset 0 1px 2px rgba(15,23,42,.06) !important;
  }
  .idgsb2-builder-shell .idgsb3-m-auto-mode-btn.active{
    background:rgba(var(--accent-rgb),.14) !important;
    color:var(--accent-deep) !important;
  }

  .idgsb2-builder-shell .idgsb3-m-canvas-wrap{
    /* Equal top/bottom padding so canvas sits centred between the
       toolbar and the absolutely-positioned bottom nav (≈76 px tall) */
    padding:78px 8px !important;
    justify-content:center !important;
    align-items:center !important;
    overflow:hidden !important;
  }
  .idgsb2-builder-shell.idgsb3-m-strip-open .idgsb3-m-canvas-wrap{
    /* When the uploaded-images strip is open, double the reserve on
       both sides so the canvas still appears centred */
    padding:156px 8px !important;
  }
  .idgsb2-builder-shell .idgsb3-m-canvas-stage{
    max-width:min(94vw, 430px) !important;
    margin:0 auto !important;
  }
  .idgsb2-builder-shell.idgsb-mobile-live-sheet .idgsb3-m-sheet{
    width:min(82vw, 380px) !important;
    height:min(50svh, 440px) !important;
    max-height:calc(100svh - 305px) !important;
    min-height:245px !important;
    border-radius:22px !important;
  }
  .idgsb2-builder-shell.idgsb3-m-strip-open.idgsb-mobile-live-sheet .idgsb3-m-sheet{
    height:min(40svh, 360px) !important;
    max-height:calc(100svh - 420px) !important;
    min-height:220px !important;
  }
  .idgsb2-builder-shell .idgsb3-m-ruler-h{margin-bottom:5px !important;}
  .idgsb2-builder-shell .idgsb3-m-canvas-row{gap:5px !important;}
  .idgsb2-builder-shell .idgsb3-m-zoom-bar{bottom:12px !important;left:14px !important;z-index:72 !important;}
  .idgsb2-builder-shell .idgsb3-m-props-btn{bottom:10px !important;right:12px !important;z-index:72 !important;}

  .idgsb2-builder-shell .idgsb3-m-upload-strip{
    position:absolute !important;
    left:14px !important;
    right:14px !important;
    bottom:76px !important;
    margin:0 !important;
    padding:10px 10px 12px !important;
    z-index:86 !important;
    max-height:132px !important;
    overflow:hidden !important;
    border-radius:22px !important;
    box-shadow:0 12px 34px rgba(15,23,42,.14), inset 0 1px 0 rgba(255,255,255,.7) !important;
  }
  .idgsb2-builder-shell .idgsb3-m-upload-strip-head{margin-bottom:7px !important;}
  .idgsb2-builder-shell .idgsb3-m-upload-list{gap:9px !important;}
  .idgsb2-builder-shell .idgsb3-m-thumb{width:78px !important;min-width:78px !important;padding:6px !important;border-radius:15px !important;}
  .idgsb2-builder-shell .idgsb3-m-thumb img{width:62px !important;height:48px !important;}

  .idgsb2-builder-shell .idgsb3-m-bottom-nav{
    position:absolute !important;
    left:0 !important;
    right:0 !important;
    bottom:0 !important;
    z-index:90 !important;
    padding:0 8px max(8px, env(safe-area-inset-bottom)) !important;
  }
  .idgsb2-builder-shell .idgsb3-m-nav-bar{
    padding:6px 8px !important;
    gap:5px !important;
    overflow-x:auto !important;
    justify-content:flex-start !important;
  }

  .idgsb2-builder-shell .idgsb3-m-action-drawer{
    position:absolute !important;
    left:14px !important;
    right:14px !important;
    bottom:76px !important;
    display:none !important;
    z-index:96 !important;
    border-radius:24px !important;
    padding:14px !important;
    max-height:min(58svh, 430px) !important;
    overflow:auto !important;
    box-shadow:0 26px 70px rgba(15,23,42,.24), inset 0 1px 0 rgba(255,255,255,.78) !important;
  }
  .idgsb2-builder-shell .idgsb3-m-action-drawer.open{display:block !important;animation:idgsb-fadeUp .22s ease both;}
  .idgsb2-builder-shell .idgsb3-m-action-drawer-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px;}
  .idgsb2-builder-shell .idgsb3-m-action-drawer-head b{font-size:14px;font-weight:900;color:var(--ink-800);letter-spacing:.01em;}
  .idgsb2-builder-shell .idgsb3-m-action-drawer-head button{width:30px;height:30px;border:0;border-radius:999px;background:rgba(15,23,42,.08);color:var(--ink-600);font-size:18px;line-height:1;}
  .idgsb2-builder-shell .idgsb3-m-menu-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;}
  .idgsb2-builder-shell .idgsb3-m-menu-grid button,
  .idgsb2-builder-shell .idgsb3-m-source-grid button,
  .idgsb2-builder-shell .idgsb3-m-drawer-option,
  .idgsb2-builder-shell .idgsb3-m-drawer-primary{
    border:1px solid rgba(15,23,42,.07);
    border-radius:16px;
    background:linear-gradient(180deg, rgba(255,255,255,.92), rgba(248,250,252,.72));
    box-shadow:0 7px 20px rgba(15,23,42,.08), inset 0 1px 0 rgba(255,255,255,.85);
    color:var(--ink-700);
    font-weight:850;
    padding:12px 10px;
    cursor:pointer;
    text-align:center;
  }
  .idgsb2-builder-shell .idgsb3-m-drawer-card,
  .idgsb2-builder-shell .idgsb3-m-template-card{
    border:1px solid rgba(15,23,42,.06);
    border-radius:18px;
    background:rgba(255,255,255,.60);
    padding:14px;
    text-align:center;
    color:var(--ink-600);
  }
  .idgsb2-builder-shell .idgsb3-m-drawer-card h4{margin:6px 0 4px;color:var(--ink-800);font-size:14px;}
  .idgsb2-builder-shell .idgsb3-m-drawer-card p,
  .idgsb2-builder-shell .idgsb3-m-drawer-note{font-size:12px;line-height:1.45;margin:6px 0 12px;color:var(--ink-500);}
  .idgsb2-builder-shell .idgsb3-m-drawer-card .big{font-size:24px;display:block;color:var(--accent-deep);}
  .idgsb2-builder-shell .idgsb3-m-drawer-primary{background:linear-gradient(135deg,var(--grad-from),var(--accent-deep));color:#fff;border:0;width:100%;}
  .idgsb2-builder-shell .idgsb3-m-drawer-option{display:block;width:100%;margin-bottom:8px;text-align:left;}
  .idgsb2-builder-shell .idgsb3-m-drawer-option small{display:block;font-weight:600;color:var(--ink-500);margin-top:3px;}
  .idgsb2-builder-shell .idgsb3-m-drawer-option.active{border-color:rgba(var(--accent-rgb),.35);box-shadow:0 10px 24px rgba(var(--accent-rgb),.12), inset 0 1px 0 rgba(255,255,255,.8);}
  .idgsb2-builder-shell .idgsb3-m-source-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:10px;}
}


/* v3.3.4 mobile toolbar fit + canvas vertical balance
   Keeps all top tools visible and prevents hidden/cut Spacing/Nest controls. */
@media (max-width:1023px) and (orientation:portrait), (max-width:599px){
  .idgsb2-builder-shell .idgsb3-mobile-view{
    overflow:hidden !important;
  }

  .idgsb2-builder-shell .idgsb3-m-toolbar{
    display:grid !important;
    grid-template-columns:repeat(8, minmax(0, 1fr)) !important;
    gap:3px !important;
    overflow:visible !important;
    padding:4px 6px !important;
    align-items:stretch !important;
  }
  .idgsb2-builder-shell .idgsb3-m-mini-divider{display:none !important;}
  .idgsb2-builder-shell .idgsb3-mini-tool{
    width:auto !important;
    min-width:0 !important;
    max-width:none !important;
    padding:4px 3px !important;
    border-radius:10px !important;
    font-size:9.5px !important;
    line-height:1.05 !important;
    gap:2px !important;
  }
  .idgsb2-builder-shell .idgsb3-mini-tool svg{width:13px !important;height:13px !important;}
  .idgsb2-builder-shell .idgsb3-mini-tool span{
    display:block !important;
    white-space:nowrap !important;
    overflow:hidden !important;
    text-overflow:ellipsis !important;
    max-width:100% !important;
  }
  .idgsb2-builder-shell .idgsb3-m-spacing-tool{
    grid-column:span 2 !important;
    min-width:0 !important;
    padding:3px 3px !important;
  }
  .idgsb2-builder-shell .idgsb3-m-spacing-tool input{
    width:36px !important;
    height:19px !important;
    font-size:10px !important;
    padding:0 2px !important;
  }

  .idgsb2-builder-shell .idgsb3-m-canvas-wrap{
    justify-content:flex-start !important;
    align-items:center !important;
    padding-top:14px !important;
    padding-bottom:78px !important;
  }
  .idgsb2-builder-shell.idgsb3-m-strip-open .idgsb3-m-canvas-wrap{
    padding-bottom:152px !important;
  }
  .idgsb2-builder-shell .idgsb3-m-canvas-stage{
    margin:0 auto !important;
  }
  .idgsb2-builder-shell.idgsb-mobile-live-sheet .idgsb3-m-sheet{
    height:min(54svh, 455px) !important;
    max-height:calc(100svh - 285px) !important;
  }
  .idgsb2-builder-shell.idgsb3-m-strip-open.idgsb-mobile-live-sheet .idgsb3-m-sheet{
    height:min(43svh, 365px) !important;
    max-height:calc(100svh - 400px) !important;
  }
  .idgsb2-builder-shell .idgsb3-m-upload-strip{
    bottom:74px !important;
  }
}

@media (max-width:420px){
  .idgsb2-builder-shell .idgsb3-m-toolbar{
    grid-template-columns:repeat(6, minmax(0, 1fr)) !important;
  }
  .idgsb2-builder-shell .idgsb3-mini-tool{font-size:9px !important;}
}

/* ══════════════════════════════════════════════════════════
   v3.3.5 — Mobile UI Polish
   Matches screenshot design: clean toolbar, working nav,
   proper drawer, uploaded strip above bottom nav.
══════════════════════════════════════════════════════════ */

/* ── Float panel mobile positioning ── */
#idgsb3-float-panel.idgsb3-fp-mobile {
  position: fixed !important;
  z-index: 99999 !important;
  max-height: min(70vh, 520px) !important;
  overflow-y: auto !important;
  border-radius: 24px !important;
  left: 12px !important;
  right: 12px !important;
  width: auto !important;
  bottom: 88px !important;
  top: auto !important;
}

@media (max-width:1023px) and (orientation:portrait), (max-width:599px) {

  /* ── Overall mobile shell ── */
  .idgsb2-builder-shell .idgsb3-mobile-view {
    display: flex !important;
    flex-direction: column !important;
    height: 100svh !important;
    max-height: 100svh !important;
    overflow: hidden !important;
    position: relative !important;
  }

  /* ── Top bar ── */
  .idgsb2-builder-shell .idgsb3-m-topbar {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 10px 14px !important;
    flex-shrink: 0 !important;
    z-index: 10 !important;
  }
  .idgsb2-builder-shell .idgsb3-m-menu-btn {
    width: 36px !important; height: 36px !important;
    border: none !important; border-radius: 10px !important;
    background: rgba(15,23,42,.07) !important;
    display: flex !important; align-items: center !important; justify-content: center !important;
    cursor: pointer !important; flex-shrink: 0 !important;
  }
  .idgsb2-builder-shell .idgsb3-m-title { flex: 1 !important; min-width: 0 !important; }
  .idgsb2-builder-shell .idgsb3-m-title b  { display: block !important; font-size: 14px !important; font-weight: 800 !important; color: var(--ink-900) !important; line-height: 1.2 !important; white-space: nowrap !important; overflow: hidden !important; text-overflow: ellipsis !important; }
  .idgsb2-builder-shell .idgsb3-m-title em { display: block !important; font-size: 11px !important; font-style: normal !important; color: var(--ink-500) !important; white-space: nowrap !important; }
  .idgsb2-builder-shell .idgsb3-m-price {
    font-size: 14px !important; font-weight: 800 !important;
    background: rgba(var(--accent-rgb),.12) !important;
    color: var(--accent-deep) !important;
    padding: 5px 10px !important; border-radius: 20px !important;
    white-space: nowrap !important; flex-shrink: 0 !important;
  }
  .idgsb2-builder-shell .idgsb3-m-cart-btn {
    width: 38px !important; height: 38px !important;
    border: none !important; border-radius: 12px !important;
    background: var(--accent-deep) !important; color: #fff !important;
    display: flex !important; align-items: center !important; justify-content: center !important;
    cursor: pointer !important; flex-shrink: 0 !important;
  }

  /* ── Mini toolbar — 2 rows via grid wrap ── */
  .idgsb2-builder-shell .idgsb3-m-toolbar {
    display: grid !important;
    grid-template-columns: repeat(9, minmax(0, 1fr)) !important;
    gap: 2px !important;
    padding: 4px 8px !important;
    flex-shrink: 0 !important;
    overflow: visible !important;
    background: rgba(255,255,255,.72) !important;
    border-bottom: 1px solid rgba(15,23,42,.06) !important;
    backdrop-filter: blur(12px) !important;
  }
  .idgsb2-builder-shell .idgsb3-m-mini-divider { display: none !important; }
  .idgsb2-builder-shell .idgsb3-mini-tool {
    display: flex !important; flex-direction: column !important;
    align-items: center !important; justify-content: center !important;
    gap: 2px !important; padding: 5px 3px !important;
    border: none !important; border-radius: 10px !important;
    background: transparent !important; cursor: pointer !important;
    font-size: 9px !important; font-weight: 700 !important;
    color: var(--ink-600) !important; line-height: 1.1 !important;
    min-width: 0 !important; width: 100% !important;
    transition: background .12s !important;
  }
  .idgsb2-builder-shell .idgsb3-mini-tool:active {
    background: rgba(15,23,42,.06) !important;
  }
  .idgsb2-builder-shell .idgsb3-mini-tool.accent {
    background: rgba(var(--accent-rgb),.10) !important;
    color: var(--accent-deep) !important;
  }
  .idgsb2-builder-shell .idgsb3-mini-tool.danger { color: #dc2626 !important; }
  .idgsb2-builder-shell .idgsb3-mini-tool svg { width: 14px !important; height: 14px !important; flex-shrink: 0 !important; }
  .idgsb2-builder-shell .idgsb3-mini-tool span {
    display: block !important; white-space: nowrap !important;
    overflow: hidden !important; text-overflow: ellipsis !important;
    max-width: 100% !important; font-size: 9px !important;
  }
  /* Spacing input takes 2 cols */
  .idgsb2-builder-shell .idgsb3-m-spacing-tool {
    grid-column: span 2 !important;
    padding: 3px 4px !important;
    gap: 2px !important;
    background: rgba(var(--accent-rgb),.06) !important;
    border-radius: 10px !important;
  }
  .idgsb2-builder-shell .idgsb3-m-spacing-tool input {
    width: 38px !important; height: 20px !important;
    font-size: 10px !important; font-weight: 800 !important;
    text-align: center !important; padding: 0 3px !important;
    border: 1px solid rgba(15,23,42,.10) !important;
    border-radius: 7px !important;
    background: rgba(255,255,255,.8) !important;
    color: var(--ink-800) !important;
  }
  .idgsb2-builder-shell .idgsb3-m-auto-mode-btn.active {
    background: rgba(var(--accent-rgb),.16) !important;
    color: var(--accent-deep) !important;
  }

  /* ── Canvas area ── */
  .idgsb2-builder-shell .idgsb3-m-canvas-wrap {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    display: flex !important; flex-direction: column !important;
    align-items: center !important; justify-content: flex-start !important;
    padding: 12px 8px 80px !important;
    overflow: hidden !important;
    position: relative !important;
  }
  .idgsb2-builder-shell.idgsb3-m-strip-open .idgsb3-m-canvas-wrap {
    padding-bottom: 155px !important;
  }
  .idgsb2-builder-shell .idgsb3-m-canvas-stage {
    width: 100% !important;
    max-width: min(94vw, 430px) !important;
    margin: 0 auto !important;
  }
  .idgsb2-builder-shell.idgsb-mobile-live-sheet .idgsb3-m-sheet {
    width: min(82vw, 370px) !important;
    height: min(52svh, 450px) !important;
    max-height: calc(100svh - 295px) !important;
    min-height: 240px !important;
    border-radius: 20px !important;
    box-shadow: 0 16px 40px rgba(15,23,42,.12), 0 3px 12px rgba(15,23,42,.07) !important;
  }
  .idgsb2-builder-shell.idgsb3-m-strip-open.idgsb-mobile-live-sheet .idgsb3-m-sheet {
    height: min(42svh, 360px) !important;
    max-height: calc(100svh - 415px) !important;
    min-height: 210px !important;
  }
  .idgsb2-builder-shell .idgsb3-m-sheet-scale-box {
    position: relative !important; flex: 0 0 auto !important;
    overflow: visible !important;
  }
  .idgsb2-builder-shell .idgsb3-m-canvas-sheet.idgsb3-sheet-in-mobile {
    position: absolute !important; left: 0 !important; top: 0 !important;
    width: var(--idgsb-mobile-sheet-w, 660px) !important;
    height: var(--idgsb-mobile-sheet-h, 720px) !important;
    max-width: none !important; max-height: none !important;
    transform: scale(var(--idgsb-mobile-scale, .5)) !important;
    transform-origin: top left !important; margin: 0 !important;
  }

  /* Zoom bar + Properties btn */
  .idgsb2-builder-shell .idgsb3-m-zoom-bar {
    position: absolute !important;
    bottom: 12px !important; left: 14px !important; z-index: 72 !important;
  }
  .idgsb2-builder-shell .idgsb3-m-props-btn {
    position: absolute !important;
    bottom: 10px !important; right: 12px !important; z-index: 72 !important;
    display: flex !important; align-items: center !important; gap: 5px !important;
    padding: 7px 12px !important; border: none !important; border-radius: 12px !important;
    background: rgba(255,255,255,.85) !important;
    backdrop-filter: blur(8px) !important;
    color: var(--ink-700) !important; font-size: 12px !important; font-weight: 700 !important;
    box-shadow: 0 4px 14px rgba(15,23,42,.10), inset 0 1px 0 rgba(255,255,255,.7) !important;
    cursor: pointer !important;
  }

  /* ── Uploaded image strip ── */
  .idgsb2-builder-shell .idgsb3-m-upload-strip {
    display: none;
    position: absolute !important;
    left: 12px !important; right: 12px !important;
    bottom: 74px !important;
    z-index: 86 !important;
    padding: 10px 10px 12px !important;
    border-radius: 22px !important;
    max-height: 135px !important;
    overflow: hidden !important;
    box-shadow: 0 12px 34px rgba(15,23,42,.14), inset 0 1px 0 rgba(255,255,255,.7) !important;
  }
  .idgsb2-builder-shell .idgsb3-m-upload-strip.open,
  .idgsb2-builder-shell .idgsb3-m-upload-strip.has-items {
    display: block !important;
  }
  .idgsb2-builder-shell .idgsb3-m-upload-strip-head {
    display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px;
  }
  .idgsb2-builder-shell .idgsb3-m-upload-strip-title {
    display: flex; align-items: center; gap: 6px;
    font-size: 12px; font-weight: 800; color: var(--ink-700); letter-spacing: .02em;
  }
  .idgsb2-builder-shell .idgsb3-m-upload-strip-close {
    width: 26px; height: 26px; border: 0; border-radius: 999px;
    background: rgba(15,23,42,.07); color: var(--ink-600);
    font-size: 17px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center;
  }
  .idgsb2-builder-shell .idgsb3-m-upload-list {
    display: flex; gap: 10px; overflow-x: auto; overflow-y: hidden;
    -webkit-overflow-scrolling: touch; padding: 2px 2px 4px; scrollbar-width: none;
  }
  .idgsb2-builder-shell .idgsb3-m-upload-list::-webkit-scrollbar { display: none; }
  .idgsb2-builder-shell .idgsb3-m-upload-empty {
    width: 100%; min-height: 68px; border: 1px dashed rgba(var(--accent-rgb),.25); border-radius: 14px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    color: var(--ink-500); font-size: 11px; background: rgba(255,255,255,.4);
  }
  .idgsb2-builder-shell .idgsb3-m-thumb {
    width: 80px; min-width: 80px; border-radius: 15px;
    background: rgba(255,255,255,.75); border: 1px solid rgba(15,23,42,.07);
    box-shadow: 0 4px 12px rgba(15,23,42,.07), inset 0 1px 0 rgba(255,255,255,.7);
    padding: 7px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px;
    transition: transform .14s, box-shadow .14s, border-color .14s;
    -webkit-tap-highlight-color: transparent;
  }
  .idgsb2-builder-shell .idgsb3-m-thumb:active { transform: scale(.96); }
  .idgsb2-builder-shell .idgsb3-m-thumb img {
    width: 62px; height: 52px; object-fit: contain; border-radius: 9px; background: rgba(248,250,252,.8);
  }
  .idgsb2-builder-shell .idgsb3-m-thumb-name {
    width: 100%; font-size: 9px; font-weight: 700; color: var(--ink-700);
    text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .idgsb2-builder-shell .idgsb3-m-thumb-note { font-size: 8px; color: var(--ink-400); line-height: 1; }

  /* ── Bottom nav ── */
  .idgsb2-builder-shell .idgsb3-m-bottom-nav {
    position: absolute !important;
    left: 0 !important; right: 0 !important; bottom: 0 !important;
    z-index: 90 !important;
    padding: 0 8px max(8px, env(safe-area-inset-bottom)) !important;
    flex-shrink: 0 !important;
  }
  .idgsb2-builder-shell .idgsb3-m-nav-bar {
    display: flex !important; align-items: flex-end !important;
    gap: 4px !important; padding: 6px 6px !important;
    border-radius: 22px !important;
    overflow-x: auto !important; overflow-y: visible !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    justify-content: space-around !important;
  }
  .idgsb2-builder-shell .idgsb3-m-nav-bar::-webkit-scrollbar { display: none !important; }
  .idgsb2-builder-shell .idgsb3-m-nav-btn {
    display: flex !important; flex-direction: column !important;
    align-items: center !important; justify-content: center !important;
    gap: 3px !important; padding: 7px 10px !important;
    border: none !important; border-radius: 14px !important;
    background: transparent !important; cursor: pointer !important;
    flex: 0 0 auto !important; min-width: 50px !important;
    -webkit-tap-highlight-color: transparent !important;
    transition: background .12s !important;
  }
  .idgsb2-builder-shell .idgsb3-m-nav-btn.active {
    background: rgba(var(--accent-rgb),.10) !important;
  }
  .idgsb2-builder-shell .idgsb3-m-nav-btn .nav-lbl {
    font-size: 9.5px !important; font-weight: 700 !important;
    color: var(--ink-500) !important; white-space: nowrap !important;
    line-height: 1 !important;
  }
  .idgsb2-builder-shell .idgsb3-m-nav-btn.active .nav-lbl { color: var(--accent-deep) !important; }
  .idgsb2-builder-shell .idgsb3-m-nav-upload {
    display: flex !important; flex-direction: column !important;
    align-items: center !important; gap: 3px !important;
    border: none !important; background: transparent !important;
    cursor: pointer !important; flex: 0 0 auto !important;
    margin-top: -18px !important; min-width: 58px !important;
    -webkit-tap-highlight-color: transparent !important;
  }
  .idgsb2-builder-shell .idgsb3-m-nav-upload-ico {
    width: 52px !important; height: 52px !important;
    border-radius: 18px !important;
    background: linear-gradient(135deg, var(--grad-from, #6366f1), var(--accent-deep, #4f46e5)) !important;
    display: flex !important; align-items: center !important; justify-content: center !important;
    box-shadow: 0 8px 20px rgba(var(--accent-rgb),.35) !important;
  }
  .idgsb2-builder-shell .idgsb3-m-nav-upload .nav-lbl {
    font-size: 9.5px !important; font-weight: 700 !important;
    color: var(--accent-deep) !important; line-height: 1 !important; white-space: nowrap !important;
  }

  /* ── Action Drawer (hamburger / library / templates) ── */
  .idgsb2-builder-shell .idgsb3-m-action-drawer {
    display: none !important;
    position: absolute !important;
    left: 12px !important; right: 12px !important;
    bottom: 74px !important;
    z-index: 96 !important;
    border-radius: 24px !important;
    padding: 14px !important;
    max-height: min(60svh, 440px) !important;
    overflow-y: auto !important;
    box-shadow: 0 26px 70px rgba(15,23,42,.24), inset 0 1px 0 rgba(255,255,255,.78) !important;
    animation: none !important;
  }
  .idgsb2-builder-shell .idgsb3-m-action-drawer.open {
    display: block !important;
    animation: idgsb-fadeUp .2s ease both !important;
  }
  .idgsb2-builder-shell .idgsb3-m-action-drawer-head {
    display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px;
  }
  .idgsb2-builder-shell .idgsb3-m-drawer-title {
    font-size: 15px; font-weight: 900; color: var(--ink-800); letter-spacing: .01em;
  }
  .idgsb2-builder-shell .idgsb3-m-drawer-close {
    width: 30px; height: 30px; border: 0; border-radius: 999px;
    background: rgba(15,23,42,.08); color: var(--ink-600); font-size: 18px; line-height: 1; cursor: pointer;
  }
  /* Menu grid */
  .idgsb2-builder-shell .idgsb3-m-menu-grid {
    display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px;
  }
  .idgsb2-builder-shell .idgsb3-m-menu-grid button,
  .idgsb2-builder-shell .idgsb3-m-source-grid button,
  .idgsb2-builder-shell .idgsb3-m-drawer-option,
  .idgsb2-builder-shell .idgsb3-m-drawer-primary {
    border: 1px solid rgba(15,23,42,.07); border-radius: 16px;
    background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(248,250,252,.72));
    box-shadow: 0 6px 18px rgba(15,23,42,.07), inset 0 1px 0 rgba(255,255,255,.85);
    color: var(--ink-700); font-size: 12px; font-weight: 750;
    padding: 13px 10px; cursor: pointer; text-align: center;
    transition: box-shadow .12s, transform .1s;
  }
  .idgsb2-builder-shell .idgsb3-m-menu-grid button:active { transform: scale(.97); }
  /* Drawer card (library/templates) */
  .idgsb2-builder-shell .idgsb3-m-drawer-card,
  .idgsb2-builder-shell .idgsb3-m-template-card {
    border: 1px solid rgba(15,23,42,.06); border-radius: 18px;
    background: rgba(255,255,255,.60); padding: 16px; text-align: center; color: var(--ink-600);
  }
  .idgsb2-builder-shell .idgsb3-m-drawer-card .big { font-size: 26px; display: block; margin-bottom: 6px; }
  .idgsb2-builder-shell .idgsb3-m-drawer-card h4 { margin: 0 0 6px; color: var(--ink-800); font-size: 14px; }
  .idgsb2-builder-shell .idgsb3-m-drawer-card p,
  .idgsb2-builder-shell .idgsb3-m-drawer-note { font-size: 12px; line-height: 1.45; margin: 0 0 12px; color: var(--ink-500); }
  .idgsb2-builder-shell .idgsb3-m-drawer-primary {
    background: linear-gradient(135deg, var(--grad-from, #6366f1), var(--accent-deep, #4f46e5)) !important;
    color: #fff !important; border: 0 !important; width: 100%; display: block;
  }
  .idgsb2-builder-shell .idgsb3-m-drawer-option {
    display: block; width: 100%; margin-bottom: 8px; text-align: left; padding: 12px 14px;
  }
  .idgsb2-builder-shell .idgsb3-m-drawer-option small { display: block; font-weight: 600; color: var(--ink-500); margin-top: 3px; font-size: 11px; }
  .idgsb2-builder-shell .idgsb3-m-drawer-option.active {
    border-color: rgba(var(--accent-rgb),.35) !important;
    box-shadow: 0 8px 22px rgba(var(--accent-rgb),.12), inset 0 1px 0 rgba(255,255,255,.8) !important;
  }
  .idgsb2-builder-shell .idgsb3-m-source-grid {
    display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; margin-top: 10px;
  }

  /* Drawer overlay backdrop */
  .idgsb2-builder-shell.idgsb3-m-drawer-open::before {
    content: '';
    position: absolute; inset: 0; z-index: 95;
    background: rgba(15,23,42,.18);
    pointer-events: none;
  }

  /* Ruler */
  .idgsb2-builder-shell .idgsb3-m-ruler-h { margin-bottom: 6px !important; }
  .idgsb2-builder-shell .idgsb3-m-canvas-row { gap: 6px !important; }
}

/* Very small screens */
@media (max-width: 390px) {
  .idgsb2-builder-shell .idgsb3-m-toolbar {
    grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
  }
  .idgsb2-builder-shell .idgsb3-mini-tool { font-size: 8.5px !important; padding: 4px 2px !important; }
  .idgsb2-builder-shell .idgsb3-m-nav-btn { min-width: 42px !important; padding: 6px 6px !important; }
}

/* Short screens (landscape-ish) */
@media (max-height: 700px) and (max-width: 1023px) {
  .idgsb2-builder-shell .idgsb3-m-toolbar { padding: 3px 6px !important; }
  .idgsb2-builder-shell .idgsb3-mini-tool { padding: 3px 2px !important; }
  .idgsb2-builder-shell.idgsb-mobile-live-sheet .idgsb3-m-sheet {
    height: min(48svh, 400px) !important;
    max-height: calc(100svh - 275px) !important;
  }
}

/* ══════════════════════════════════════════════════════════
   v3.3.6 — Layout & Spacing Fixes
   1. Spacing input never clips (desktop + mobile)
   2. Canvas centered with proper breathing room  
   3. Bottom nav scrollable — Templates never cut off
   4. Toolbar 2-row professional layout
══════════════════════════════════════════════════════════ */

/* ── Desktop: spacing input full width ── */
.idgsb2-builder-shell .idgsb3-spacing-input {
  width: 54px !important;
  min-width: 54px !important;
  padding: 3px 6px !important;
  box-sizing: border-box !important;
}

/* ── Desktop: canvas stage — match screenshot 2 look ── */
.idgsb2-builder-shell.idgsb-ui-v30 .idgsb3-canvas-stage {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 32px 24px !important;
}
.idgsb2-builder-shell.idgsb-ui-v30 .idgsb3-canvas-sheet {
  width: min(100%, 620px, calc((100vh - 200px) * 0.9167)) !important;
  max-height: calc(100vh - 200px) !important;
  margin: auto !important;
}

@media (max-width:1023px) and (orientation:portrait), (max-width:599px) {

  /* ── Mobile toolbar: 2 perfectly-justified rows ──
     Dividers are display:none, so 11 visible items remain.
     Row 1: Undo · Redo · AutoFill · Copy · Delete · RotL   (6 × 1fr)
     Row 2: RotR · Flip · Auto · Spacing(×2) · Nest          (6 cols)  */
  .idgsb2-builder-shell .idgsb3-m-toolbar {
    display: grid !important;
    grid-template-columns: repeat(6, 1fr) !important;
    grid-template-rows: auto auto !important;
    gap: 3px 0 !important;
    padding: 5px 8px !important;
    overflow: visible !important;
    border-bottom: 1px solid rgba(15,23,42,.07) !important;
  }

  /* Spacing label spans 2 cols so row 2 fills edge-to-edge */
  .idgsb2-builder-shell .idgsb3-m-auto-mode-btn  { grid-column: auto !important; grid-row: auto !important; }
  .idgsb2-builder-shell .idgsb3-m-spacing-tool   { grid-column: span 2 !important; grid-row: auto !important; }

  .idgsb2-builder-shell .idgsb3-m-mini-divider { display: none !important; }

  .idgsb2-builder-shell .idgsb3-mini-tool {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 2px !important;
    padding: 5px 2px !important;
    border: none !important;
    border-radius: 10px !important;
    background: transparent !important;
    cursor: pointer !important;
    font-size: 9px !important;
    font-weight: 700 !important;
    color: var(--ink-600) !important;
    line-height: 1.1 !important;
    min-width: 0 !important;
    width: 100% !important;
    -webkit-tap-highlight-color: transparent !important;
  }
  .idgsb2-builder-shell .idgsb3-mini-tool:active {
    background: rgba(15,23,42,.06) !important;
  }
  .idgsb2-builder-shell .idgsb3-mini-tool.accent {
    background: rgba(var(--accent-rgb),.10) !important;
    color: var(--accent-deep) !important;
  }
  .idgsb2-builder-shell .idgsb3-mini-tool.danger { color: #dc2626 !important; }
  .idgsb2-builder-shell .idgsb3-mini-tool svg {
    width: 13px !important; height: 13px !important; flex-shrink: 0 !important;
  }
  .idgsb2-builder-shell .idgsb3-mini-tool span {
    display: block !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 100% !important;
    font-size: 9px !important;
  }
  .idgsb2-builder-shell .idgsb3-m-auto-mode-btn.active {
    background: rgba(var(--accent-rgb),.16) !important;
    color: var(--accent-deep) !important;
  }

  /* Spacing label tool */
  .idgsb2-builder-shell .idgsb3-m-spacing-tool {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 2px !important;
    padding: 3px 4px !important;
    border-radius: 10px !important;
    background: rgba(var(--accent-rgb),.07) !important;
    min-width: 0 !important;
  }
  /* Mobile spacing input — wide enough to show "0.6" fully */
  .idgsb2-builder-shell .idgsb3-m-spacing-tool input {
    width: 46px !important;
    min-width: 46px !important;
    height: 22px !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    text-align: center !important;
    padding: 0 4px !important;
    box-sizing: border-box !important;
    border: 1px solid rgba(15,23,42,.12) !important;
    border-radius: 7px !important;
    background: rgba(255,255,255,.85) !important;
    color: var(--ink-800) !important;
    -moz-appearance: textfield !important;
  }
  .idgsb2-builder-shell .idgsb3-m-spacing-tool input::-webkit-outer-spin-button,
  .idgsb2-builder-shell .idgsb3-m-spacing-tool input::-webkit-inner-spin-button {
    -webkit-appearance: none !important;
    margin: 0 !important;
  }

  /* ── Canvas wrap: proper top breathing room, sheet centered ── */
  .idgsb2-builder-shell .idgsb3-m-canvas-wrap {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;   /* vertically center the sheet */
    padding: 16px 8px 84px !important;
    overflow: hidden !important;
    position: relative !important;
  }
  .idgsb2-builder-shell.idgsb3-m-strip-open .idgsb3-m-canvas-wrap {
    padding-bottom: 158px !important;
    justify-content: flex-start !important;
    padding-top: 10px !important;
  }
  .idgsb2-builder-shell .idgsb3-m-canvas-stage {
    width: 100% !important;
    max-width: min(94vw, 420px) !important;
    margin: 0 auto !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
  }
  /* Sheet sizing */
  .idgsb2-builder-shell.idgsb-mobile-live-sheet .idgsb3-m-sheet {
    width: min(84vw, 375px) !important;
    height: min(56svh, 460px) !important;
    max-height: calc(100svh - 290px) !important;
    min-height: 240px !important;
    border-radius: 20px !important;
    box-shadow:
      0 2px 4px rgba(15,23,42,.05),
      0 20px 50px rgba(15,23,42,.14),
      0 6px 16px rgba(15,23,42,.08) !important;
    overflow: hidden !important;
    position: relative !important;
  }
  .idgsb2-builder-shell.idgsb3-m-strip-open.idgsb-mobile-live-sheet .idgsb3-m-sheet {
    height: min(44svh, 360px) !important;
    max-height: calc(100svh - 408px) !important;
    min-height: 210px !important;
  }

  /* ── Bottom nav — scrollable, Templates never cut ── */
  .idgsb2-builder-shell .idgsb3-m-bottom-nav {
    position: absolute !important;
    left: 0 !important; right: 0 !important; bottom: 0 !important;
    z-index: 90 !important;
    padding: 0 0 max(6px, env(safe-area-inset-bottom)) !important;
    background: transparent !important;
  }
  .idgsb2-builder-shell .idgsb3-m-nav-bar {
    display: flex !important;
    align-items: flex-end !important;
    flex-wrap: nowrap !important;
    gap: 0 !important;
    padding: 5px 4px 4px !important;
    border-radius: 22px !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    /* Distribute evenly — no items cut off */
    justify-content: space-between !important;
  }
  .idgsb2-builder-shell .idgsb3-m-nav-bar::-webkit-scrollbar { display: none !important; }

  .idgsb2-builder-shell .idgsb3-m-nav-btn {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 3px !important;
    padding: 6px 0 !important;
    border: none !important;
    border-radius: 12px !important;
    background: transparent !important;
    cursor: pointer !important;
    /* Equal width: 100% / 7 items roughly */
    flex: 1 1 0 !important;
    min-width: 44px !important;
    max-width: 70px !important;
    -webkit-tap-highlight-color: transparent !important;
    transition: background .12s !important;
  }
  .idgsb2-builder-shell .idgsb3-m-nav-btn.active {
    background: rgba(var(--accent-rgb),.10) !important;
  }
  .idgsb2-builder-shell .idgsb3-m-nav-btn svg {
    color: var(--ink-500) !important;
  }
  .idgsb2-builder-shell .idgsb3-m-nav-btn.active svg {
    color: var(--accent-deep) !important;
  }
  .idgsb2-builder-shell .idgsb3-m-nav-btn .nav-lbl {
    font-size: 9px !important;
    font-weight: 700 !important;
    color: var(--ink-500) !important;
    white-space: nowrap !important;
    line-height: 1 !important;
    letter-spacing: -.01em !important;
  }
  .idgsb2-builder-shell .idgsb3-m-nav-btn.active .nav-lbl {
    color: var(--accent-deep) !important;
  }

  /* Upload center button */
  .idgsb2-builder-shell .idgsb3-m-nav-upload {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 3px !important;
    border: none !important;
    background: transparent !important;
    cursor: pointer !important;
    flex: 1 1 0 !important;
    min-width: 52px !important;
    max-width: 70px !important;
    margin-top: -16px !important;
    padding-bottom: 0 !important;
    -webkit-tap-highlight-color: transparent !important;
  }
  .idgsb2-builder-shell .idgsb3-m-nav-upload-ico {
    width: 48px !important; height: 48px !important;
    border-radius: 16px !important;
    background: linear-gradient(135deg, var(--grad-from, #6366f1), var(--accent-deep, #4f46e5)) !important;
    display: flex !important;
    align-items: center !important; justify-content: center !important;
    box-shadow: 0 6px 18px rgba(var(--accent-rgb),.35) !important;
    flex-shrink: 0 !important;
  }
  .idgsb2-builder-shell .idgsb3-m-nav-upload .nav-lbl {
    font-size: 9px !important; font-weight: 700 !important;
    color: var(--accent-deep) !important; white-space: nowrap !important;
    line-height: 1 !important;
  }
}

/* Very small phones */
@media (max-width: 360px) {
  .idgsb2-builder-shell .idgsb3-m-toolbar {
    grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
  }
  .idgsb2-builder-shell .idgsb3-m-spacing-tool {
    grid-column: 2 / span 2 !important;
  }
  .idgsb2-builder-shell .idgsb3-mini-tool { font-size: 8px !important; }
  .idgsb2-builder-shell .idgsb3-m-nav-btn { min-width: 36px !important; }
  .idgsb2-builder-shell .idgsb3-m-nav-btn .nav-lbl { font-size: 8px !important; }
}
