/* ============================================ */
/* Tabs                                          */
/* ============================================ */
.tab-btn {
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  color: #78716c;
  border: 1px solid transparent;
  border-bottom: 2px solid transparent;
  border-radius: 8px 8px 0 0;
  background: transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}
.tab-btn:hover:not(.active) {
  color: #44403c;
  background: rgba(231, 229, 228, 0.5);
}
.tab-btn.active {
  color: #ea580c;
  background: #fff7ed;
  border-color: #fed7aa;
  border-bottom-color: #fff7ed;
  position: relative;
  z-index: 1;
}

.tab-panel { animation: fadeIn 0.2s ease; }
.tab-panel.hidden { display: none; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================ */
/* Signs editor layout (2-column)               */
/* ============================================ */
.signs-editor {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 16px;
  align-items: start;
}
/* Preview col: sticky so it stays in view */
.signs-preview-col {
  position: sticky;
  top: 76px; /* below sticky header */
}
/* Controls col: scrollable */
.signs-controls-col {
  display: flex;
  flex-direction: column;
  gap: 0;
}
/* Each control block — compact */
.ctrl-block {
  background: #fff;
  border: 1px solid #e7e5e4;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 6px;
}
.ctrl-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.ctrl-label {
  font-size: 13px;
  font-weight: 700;
  color: #292524;
}
.ctrl-hint {
  font-size: 11px;
  color: #a8a29e;
}

/* Responsive: stack on small screens */
@media (max-width: 900px) {
  .signs-editor {
    grid-template-columns: 1fr;
  }
  .signs-preview-col {
    position: static;
  }
}

/* ============================================ */
/* Tumbler editor controls                       */
/* ============================================ */
.orient-btn {
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  color: #44403c;
  background: #fafaf9;
  border: 2px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
  letter-spacing: 0.02em;
  margin-top: 8px;
  margin-bottom: 8px;
}
.orient-btn:hover:not(.selected) { background: #f5f5f4; }
.orient-btn.selected {
  border-color: #ea580c;
  background: #fff7ed;
  color: #ea580c;
}

/* ============================================ */
/* Material type selector buttons               */
/* ============================================ */
.mat-btn {
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 600;
  color: #44403c;
  background: #fafaf9;
  border: 2px solid #e7e5e4;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.mat-btn:hover:not(.selected) {
  background: #f5f5f4;
  border-color: #d6d3d1;
}
.mat-btn.selected {
  border-color: #ea580c;
  background: #fff7ed;
  color: #ea580c;
  box-shadow: 0 0 0 3px rgba(234,88,12,0.10);
}

/* ============================================ */
/* Preview floating price badge                 */
/* ============================================ */
.preview-price-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1.5px solid rgba(234,88,12,0.25);
  border-radius: 12px;
  padding: 8px 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.12);
  pointer-events: none;
}
#previewPriceVal,
#tumblerPriceVal {
  font-size: 22px;
  font-weight: 800;
  color: #ea580c;
  line-height: 1;
}
.preview-price-ship {
  font-size: 10px;
  font-weight: 600;
  color: #16a34a;
  white-space: nowrap;
}

/* ============================================ */
/* Upload Logo button                           */
/* ============================================ */
.upload-logo-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: #ea580c;
  border: 1.5px solid #ea580c;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.12s;
  white-space: nowrap;
}
.upload-logo-btn:hover {
  background: #c2410c;
  border-color: #c2410c;
}

/* ============================================ */
/* Icon category filter buttons                 */
/* ============================================ */
.icon-cat-btn {
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  color: #78716c;
  background: #f5f5f4;
  border: 1.5px solid #e7e5e4;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.12s;
  white-space: nowrap;
}
.icon-cat-btn:hover:not(.selected) {
  background: #e7e5e4;
}
.icon-cat-btn.selected {
  background: #fff7ed;
  border-color: #fb923c;
  color: #ea580c;
}

/* ============================================ */
/* Added icons list (per-icon color)            */
/* ============================================ */
.icon-list-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: #fafaf9;
  border: 1px solid #e7e5e4;
  border-radius: 10px;
}
.icon-list-thumb {
  width: 38px;
  height: 38px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 6px;
  background: #fff;
  padding: 3px;
  border: 1px solid #e7e5e4;
}
.icon-list-name {
  font-size: 12px;
  font-weight: 600;
  color: #44403c;
  min-width: 72px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.text-color-btn {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  border: 3px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
}
.text-color-btn.selected {
  border-color: #ea580c;
  box-shadow: 0 0 0 2px rgba(234, 88, 12, 0.2);
  transform: scale(1.05);
}
.text-color-btn:hover:not(.selected) { transform: translateY(-1px); }

.tumbler-color-swatch {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: 10px;
  cursor: pointer;
  border: 3px solid transparent;
  overflow: hidden;
  transition: all 0.15s;
  background-size: cover;
  background-position: center;
}
.tumbler-color-swatch.selected {
  border-color: #ea580c;
  box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.2);
}
.tumbler-color-swatch:hover:not(.selected) { transform: translateY(-2px); }
.tumbler-color-swatch span {
  position: absolute;
  bottom: 4px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  color: white;
  text-shadow: 0 1px 3px rgba(0,0,0,0.7);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Icon picker buttons */
.icon-btn {
  aspect-ratio: 1 / 1;
  background: #fafaf9;
  border: 2px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  color: #44403c;
}
.icon-btn:hover:not(.selected) {
  background: #f5f5f4;
  transform: translateY(-1px);
}
.icon-btn.selected {
  border-color: #ea580c;
  background: #fff7ed;
  color: #ea580c;
}
.icon-btn svg { width: 100%; height: 100%; }

/* Category chip buttons in icon picker */
.cat-btn {
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 600;
  color: #57534e;
  background: #f5f5f4;
  border: 1.5px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 3px;
}
.cat-btn:hover:not(.selected) {
  background: #e7e5e4;
}
.cat-btn.selected {
  background: #fff7ed;
  border-color: #ea580c;
  color: #ea580c;
}

/* Tumbler text vertical orientation */
.tumbler-text-vertical {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  letter-spacing: 0.05em;
}

/* Draggable elements on tumbler */
.draggable {
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  transition: outline 0.15s ease;
  outline: 2px dashed transparent;
  outline-offset: 4px;
  border-radius: 4px;
}
.draggable:hover {
  outline-color: rgba(234, 88, 12, 0.4);
}
.draggable.dragging {
  outline-color: rgba(234, 88, 12, 0.85);
  cursor: grabbing !important;
  z-index: 100;
}

/* Drag zone above printable zones */
#tumblerDecorZone { z-index: 5; overflow: visible; }
#tumblerDecorZone .draggable { z-index: 6; overflow: visible; }

/* When exporting via html2canvas — hide UI helpers (outlines, badges, buttons) */
#tumblerCanvas.exporting .draggable {
  outline: none !important;
}
#tumblerCanvas.exporting .printable-area,
#tumblerCanvas.exporting #downloadBtn,
#tumblerCanvas.exporting > div.absolute.bottom-3 {
  display: none !important;
}

/* Printable zone — always-visible dashed boundary on tumbler */
.printable-area {
  position: absolute;
  pointer-events: none;
  z-index: 2;
}
.printable-zone-border {
  position: absolute;
  inset: 0;
  border: 2px dashed rgba(234, 88, 12, 0.55);
  border-radius: 8px;
  pointer-events: none;
}
.printable-zone-label {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: white;
  border: 1.5px solid rgba(234, 88, 12, 0.55);
  border-radius: 4px;
  padding: 1px 8px;
  font-size: 9px;
  font-weight: 800;
  color: #ea580c;
  letter-spacing: 0.08em;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* Acrylic Mirror & Solid Color Effects */

/* GOLD MIRROR */
/* GOLD MIRROR — real mirror acrylic: dark edge → bright stripe → dark edge */
.acrylic-gold {
  background: linear-gradient(
    160deg,
    #3d2600 0%,
    #a07010 12%,
    #d4af37 28%,
    #fff5a0 42%,
    #ffe066 50%,
    #d4af37 62%,
    #a07010 78%,
    #5c3a00 92%,
    #3d2600 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(1px 2px 6px rgba(100, 70, 0, 0.55));
}

/* ROSE GOLD MIRROR */
.acrylic-rose-gold {
  background: linear-gradient(
    160deg,
    #3d1a1f 0%,
    #9b5060 12%,
    #c98a7d 28%,
    #fde8e0 42%,
    #f0bdb4 50%,
    #c98a7d 62%,
    #9b5060 78%,
    #5c2530 92%,
    #3d1a1f 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(1px 2px 6px rgba(120, 60, 70, 0.5));
}

/* PINK MIRROR */
.acrylic-pink {
  background: linear-gradient(
    160deg,
    #4a0025 0%,
    #b53066 12%,
    #e64f87 28%,
    #ffc0d8 42%,
    #ffaacc 50%,
    #e64f87 62%,
    #b53066 78%,
    #6b0033 92%,
    #4a0025 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(1px 2px 6px rgba(180, 40, 100, 0.5));
}

/* BLUE MIRROR */
.acrylic-blue {
  background: linear-gradient(
    160deg,
    #0a1540 0%,
    #1e4fa0 12%,
    #4a90e2 28%,
    #b8d8ff 42%,
    #90c4f8 50%,
    #4a90e2 62%,
    #1e4fa0 78%,
    #0e2560 92%,
    #0a1540 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(1px 2px 6px rgba(20, 50, 150, 0.5));
}

/* GREEN MIRROR */
.acrylic-green {
  background: linear-gradient(
    160deg,
    #0a2e0a 0%,
    #1a6e1a 12%,
    #3dae3d 28%,
    #b0f0b0 42%,
    #88e088 50%,
    #3dae3d 62%,
    #1a6e1a 78%,
    #0d420d 92%,
    #0a2e0a 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(1px 2px 6px rgba(15, 80, 15, 0.5));
}

/* SOLID ORANGE */
.acrylic-orange {
  color: #ff8c00;
  filter: drop-shadow(2px 3px 4px rgba(204, 102, 0, 0.4));
}

/* SOLID YELLOW */
.acrylic-yellow {
  color: #ffd700;
  filter: drop-shadow(2px 3px 4px rgba(184, 134, 11, 0.5));
}

/* SOLID BLACK */
.acrylic-black {
  color: #1a1a1a;
  filter: drop-shadow(2px 3px 5px rgba(0, 0, 0, 0.5));
}

/* SOLID WHITE */
.acrylic-white {
  color: #fafafa;
  filter: drop-shadow(2px 3px 5px rgba(0, 0, 0, 0.45));
}

/* Color swatch button styles */
.color-swatch {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s ease;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 6px;
  font-size: 11px;
  font-weight: 600;
  color: rgba(0, 0, 0, 0.7);
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

.color-swatch.selected {
  border-color: #ea580c;
  box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.2);
  transform: scale(1.02);
}

.color-swatch:hover:not(.selected) {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.swatch-gold        { background: linear-gradient(135deg, #fff8b6, #d4af37, #8b6914); }
.swatch-rose-gold   { background: linear-gradient(135deg, #fbe5dc, #b76e79, #8b4f5b); }
.swatch-pink        { background: linear-gradient(135deg, #ffe4ec, #ff69b4, #b53066); }
.swatch-blue        { background: linear-gradient(135deg, #c7e3ff, #4a90e2, #1e3a8a); }
.swatch-green       { background: linear-gradient(135deg, #d6f5d6, #4caf50, #145214); }
.swatch-orange      { background: #ff8c00; color: white; text-shadow: 0 1px 2px rgba(0,0,0,0.4); }
.swatch-yellow      { background: #ffd700; }
.swatch-black       { background: #1a1a1a; color: white; text-shadow: none; }
.swatch-white       { background: #fafafa; border: 2px solid #d6d3d1; }

/* Font picker item */
.font-option {
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.15s;
  font-size: 22px;
  line-height: 1.1;
  background: #fafaf9;
}

.font-option:hover {
  background: #f5f5f4;
}

.font-option.selected {
  border-color: #ea580c;
  background: #fff7ed;
}

/* Sign text base styles */
#signText {
  display: inline-block;
  transition: font-size 0.15s ease, font-family 0.2s ease;
}

/* Smooth color transitions */
.acrylic-gold, .acrylic-rose-gold, .acrylic-pink, .acrylic-blue, .acrylic-green {
  transition: filter 0.2s ease;
}

/* ============================================ */
/* Dimension Arrows (red, on photo) */
/* ============================================ */

/* Horizontal arrow (crib width) */
.dimension-h {
  position: absolute;
  height: 22px;
  pointer-events: none;
  z-index: 5;
}
.dimension-h .dim-line {
  position: absolute;
  left: 0; right: 0; top: 50%;
  height: 2px;
  background: #dc2626;
  transform: translateY(-50%);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.6);
}
.dimension-h .dim-tick-left,
.dimension-h .dim-tick-right {
  position: absolute;
  top: calc(50% - 9px);
  width: 2px;
  height: 18px;
  background: #dc2626;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.6);
}
.dimension-h .dim-tick-left  { left: 0; }
.dimension-h .dim-tick-right { right: 0; }
.dimension-h .dim-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  border: 1.5px solid #dc2626;
  border-radius: 6px;
  padding: 1px 8px;
  font-size: 11px;
  font-weight: 700;
  color: #dc2626;
  white-space: nowrap;
  letter-spacing: 0.02em;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

/* Vertical arrow (crib height) */
.dimension-v {
  position: absolute;
  width: 22px;
  pointer-events: none;
  z-index: 5;
}
.dimension-v .dim-line-v {
  position: absolute;
  top: 0; bottom: 0; left: 50%;
  width: 2px;
  background: #dc2626;
  transform: translateX(-50%);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.6);
}
.dimension-v .dim-tick-top,
.dimension-v .dim-tick-bottom {
  position: absolute;
  left: calc(50% - 9px);
  width: 18px;
  height: 2px;
  background: #dc2626;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.6);
}
.dimension-v .dim-tick-top    { top: 0; }
.dimension-v .dim-tick-bottom { bottom: 0; }
.dimension-v .dim-label-v {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-90deg);
  transform-origin: center;
  background: white;
  border: 1.5px solid #dc2626;
  border-radius: 6px;
  padding: 1px 8px;
  font-size: 11px;
  font-weight: 700;
  color: #dc2626;
  white-space: nowrap;
  letter-spacing: 0.02em;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

/* ============================================ */
/* Size buttons (discrete sign widths) */
/* ============================================ */
.size-btn {
  padding: 10px 0;
  border-radius: 8px;
  border: 2px solid transparent;
  background: #fafaf9;
  font-weight: 700;
  font-size: 14px;
  color: #44403c;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
}
.size-btn:hover:not(.selected) {
  background: #f5f5f4;
  border-color: #e7e5e4;
  transform: translateY(-1px);
}
.size-btn.selected {
  border-color: #ea580c;
  background: #fff7ed;
  color: #ea580c;
  box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.15);
}

/* ============================================ */
/* Inch Ruler (toggleable horizontal scale) */
/* ============================================ */

.ruler-bar {
  position: absolute;
  left: 0; right: 0; top: 50%;
  height: 2px;
  background: rgba(220, 38, 38, 0.85);
  transform: translateY(-50%);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.7);
}
.ruler-tick {
  position: absolute;
  top: calc(50% - 7px);
  width: 2px;
  height: 14px;
  background: rgba(220, 38, 38, 0.85);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.7);
}
.ruler-tick:has(span) {
  height: 20px;
  top: calc(50% - 10px);
}
.ruler-tick span {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 4px;
  background: white;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 700;
  color: #dc2626;
  border: 1px solid rgba(220, 38, 38, 0.85);
  white-space: nowrap;
  letter-spacing: 0.02em;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* ============================================ */
/* Multi-icon remove button                      */
/* ============================================ */
.icon-remove-btn {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ef4444;
  color: white;
  border: none;
  font-size: 9px;
  line-height: 18px;
  text-align: center;
  cursor: pointer;
  display: none;
  z-index: 10;
  padding: 0;
}
.icon-instance:hover .icon-remove-btn {
  display: block;
}

/* ============================================ */
/* Icon resize handle (corner drag)              */
/* ============================================ */
.icon-resize-handle {
  position: absolute;
  bottom: -5px;
  right: -5px;
  width: 14px;
  height: 14px;
  background: #fff;
  border: 2px solid #ea580c;
  border-radius: 3px;
  cursor: se-resize;
  z-index: 12;
  display: none;
}
.icon-instance:hover .icon-resize-handle {
  display: block;
}

/* Text elements need relative positioning for the handle */
#tumblerText, #tumblerText2 { position: absolute; }

/* Resize handle for tumbler text elements */
.text-resize-handle {
  position: absolute;
  bottom: -6px;
  right: -6px;
  width: 14px;
  height: 14px;
  background: #fff;
  border: 2px solid #ea580c;
  border-radius: 3px;
  cursor: se-resize;
  z-index: 20;
  display: none;
  pointer-events: all;
}
#tumblerText:hover .text-resize-handle,
#tumblerText2:hover .text-resize-handle {
  display: block;
}

/* Scene switcher */
/* ── Niche pills (row 1 of scene switcher) ── */
.niche-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.niche-pill {
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  border: 1.5px solid #e7e5e4;
  border-radius: 20px;
  background: #fff;
  color: #57534e;
  cursor: pointer;
  transition: all 0.12s;
  white-space: nowrap;
}
.niche-pill:hover { border-color: #ea580c; color: #ea580c; }
.niche-pill.selected {
  background: #fff7ed;
  border-color: #ea580c;
  color: #ea580c;
}

/* ── Scene thumb buttons (row 2) ── */
.scene-thumb-row {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.scene-thumb-btn {
  position: relative;
  width: 52px;
  height: 36px;
  border-radius: 6px;
  border: 2px solid #e7e5e4;
  background: #f5f5f4;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.12s;
  font-size: 12px;
  font-weight: 700;
  color: #78716c;
  display: flex;
  align-items: center;
  justify-content: center;
}
.scene-thumb-btn:hover { border-color: #fb923c; }
.scene-thumb-btn.selected { border-color: #ea580c; box-shadow: 0 0 0 2px #fed7aa; }
.scene-thumb-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.85;
}
.scene-upload-btn {
  border-style: dashed;
  flex-direction: column;
  gap: 1px;
  font-size: 11px;
  color: #a8a29e;
  width: 52px;
  height: 36px;
}
.scene-upload-label { font-size: 9px; line-height: 1; }

/* Sign icon instances — hover reveals remove/resize controls */
.sign-icon-instance:hover .icon-remove-btn {
  display: block;
}
.sign-icon-instance:hover .icon-resize-handle {
  display: block;
}

/* ============================================ */
/* Sign text drag hint + cursor                  */
/* ============================================ */
#signOverlay { cursor: grab; }
#signOverlay:active { cursor: grabbing; }
#signOverlay2 { cursor: grab; }
#signOverlay2:active { cursor: grabbing; }

.sign-drag-hint {
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  color: rgba(255,255,255,0.8);
  background: rgba(0,0,0,0.4);
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}
#signOverlay:hover .sign-drag-hint { opacity: 1; }

/* ============================================ */
/* Resize size badge                             */
/* ============================================ */
.resize-size-badge {
  position: absolute;
  top: -24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.7);
  color: #fff;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 10px;
  white-space: nowrap;
  pointer-events: none;
  display: none;
  font-family: sans-serif;
}

/* ============================================ */
/* Price estimator badges                        */
/* ============================================ */
.price-badge {
  display: inline-block;
  background: white;
  border: 1px solid #e7e5e4;
  color: #57534e;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 500;
}
.price-badge-color {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #c2410c;
}
.price-badge-icon {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}
.price-badge-multipiece {
  border-color: #fca5a5;
  background: #fef2f2;
  color: #b91c1c;
  font-weight: 600;
  width: 100%;
  display: block;
  padding: 4px 10px;
  border-radius: 8px;
  margin-top: 2px;
}

/* ============================================
   Per-line controls
   ============================================ */
.line-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: white;
  border: 1px solid #e7e5e4;
  border-radius: 12px;
  padding: 10px 12px;
  flex-wrap: wrap;
}

.line-text-input {
  flex: 1;
  min-width: 120px;
  font-size: 20px;
  padding: 4px 10px;
  border: 1.5px solid #d4d0cb;
  border-radius: 8px;
  outline: none;
  font-family: inherit;
  transition: border-color 0.15s;
}
.line-text-input:focus {
  border-color: #f97316;
}

.line-size-select {
  font-size: 13px;
  font-weight: 600;
  padding: 5px 8px;
  border: 1.5px solid #d4d0cb;
  border-radius: 8px;
  cursor: pointer;
  background: white;
  min-width: 64px;
  outline: none;
}
.line-size-select:focus {
  border-color: #f97316;
}

.line-color-wrap {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  max-width: 160px;
}

.line-color-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.1s, border-color 0.1s;
  flex-shrink: 0;
}
.line-color-dot:hover {
  transform: scale(1.15);
}
.line-color-dot.selected {
  border-color: #1c1917;
  transform: scale(1.1);
}

/* Reuse existing swatch backgrounds for dots */
.line-color-dot.swatch-gold      { background: linear-gradient(135deg, #d4af37 0%, #f5e17a 50%, #b8952a 100%); }
.line-color-dot.swatch-rose-gold { background: linear-gradient(135deg, #c98a7d 0%, #e8b4ac 50%, #b07068 100%); }
.line-color-dot.swatch-pink      { background: linear-gradient(135deg, #ff8aab 0%, #ffb3c6 50%, #e06080 100%); }
.line-color-dot.swatch-blue      { background: linear-gradient(135deg, #4a90e2 0%, #87bbff 50%, #2c6ab0 100%); }
.line-color-dot.swatch-green     { background: linear-gradient(135deg, #4caf50 0%, #81e682 50%, #2e7d32 100%); }
.line-color-dot.swatch-orange    { background: #ff8c00; }
.line-color-dot.swatch-yellow    { background: #ffd700; }
.line-color-dot.swatch-black     { background: #1a1a1a; }
.line-color-dot.swatch-white     { background: #fff; border: 1.5px solid #ccc; }

.line-font-select {
  font-size: 14px;
  padding: 5px 8px;
  border: 1.5px solid #d4d0cb;
  border-radius: 8px;
  cursor: pointer;
  background: white;
  min-width: 130px;
  max-width: 180px;
  outline: none;
}
.line-font-select:focus {
  border-color: #f97316;
}

.line-delete-btn {
  font-size: 14px;
  color: #a8a29e;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
  flex-shrink: 0;
}
.line-delete-btn:hover {
  color: #ef4444;
  background: #fee2e2;
}

/* Line overlays on preview */
.line-overlay {
  cursor: grab;
}
.line-overlay:active {
  cursor: grabbing;
}
.line-overlay:hover .sign-drag-hint { opacity: 1; }

/* Slider styling */
input[type="range"] {
  height: 8px;
  border-radius: 4px;
  background: #e7e5e4;
}
input[type="range"]::-webkit-slider-thumb {
  appearance: -webkit-appearance;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ea580c;
  border: 3px solid white;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  cursor: pointer;
}

/* ── QR CODE SIGNS ──────────────────────────────────────────── */

/* Sign shape */
.qr-sign-shape {
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,.25);
  transition: width .2s, height .2s;
}

/* Draggable elements */
.qr-draggable {
  position: absolute;
  cursor: grab;
  user-select: none;
  -webkit-user-drag: none;
  white-space: nowrap;
}
.qr-draggable:active { cursor: grabbing; }

/* Drag hint ring on hover */
.qr-draggable:hover {
  outline: 1.5px dashed rgba(255,255,255,0.6);
  outline-offset: 4px;
  border-radius: 4px;
}

/* Text elements */
.qr-sign-text {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .02em;
  text-align: center;
  padding: 2px 6px;
  white-space: nowrap;
}

/* QR slots */
.qr-slots-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  justify-content: center;
}

.qr-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.qr-slot-label {
  font-size: 9px;
  font-weight: 600;
  text-align: center;
  letter-spacing: .02em;
  white-space: nowrap;
}

/* QR placeholder */
.qr-placeholder {
  border-radius: 4px;
  overflow: hidden;
  background: white;
  flex-shrink: 0;
}

/* Logo */
.qr-logo-img {
  max-width: 70px;
  max-height: 50px;
  object-fit: contain;
  display: block;
}

/* Sign overlay — centered on scene image */
#qrSignOverlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 5;
}

/* Shape picker */
.qr-shape-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 6px;
  border: 2px solid #e7e5e4;
  border-radius: 10px;
  background: white;
  cursor: pointer;
  font-size: 11px;
  color: #57534e;
  transition: border-color .15s, background .15s;
}
.qr-shape-btn:hover  { border-color: #f97316; background: #fff7ed; }
.qr-shape-btn.selected { border-color: #f97316; background: #fff7ed; color: #c2410c; }
.qr-shape-icon { display: flex; align-items: center; justify-content: center; }

/* Size / count pill buttons */
.qr-pill-btn {
  padding: 6px 18px;
  border: 2px solid #e7e5e4;
  border-radius: 999px;
  background: white;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #57534e;
  transition: border-color .15s, background .15s;
}
.qr-pill-btn:hover   { border-color: #f97316; background: #fff7ed; }
.qr-pill-btn.selected { border-color: #f97316; background: #f97316; color: white; }

/* Color swatches — 30 colors grid */
.qr-color-swatch {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  position: relative;
  transition: transform .1s, box-shadow .1s;
  overflow: hidden;
}
.qr-color-swatch:hover { transform: scale(1.12); }
.qr-color-swatch.selected { box-shadow: 0 0 0 3px #f97316, 0 0 0 5px white; transform: scale(1.1); }
.qr-color-swatch span {
  position: absolute;
  bottom: -40px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,.75);
  color: white;
  font-size: 10px;
  padding: 2px 5px;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
  transition: bottom .15s;
}
.qr-color-swatch:hover span { bottom: -2px; }

/* Slot config card */
.qr-slot-config { padding: 12px; background: #f9fafb; border-radius: 12px; }
.qr-slot-config-title { font-size: 12px; font-weight: 700; color: #57534e; margin-bottom: 8px; }

/* Icon picker */
.qr-icon-picker-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.qr-icon-btn {
  width: 44px;
  height: 44px;
  border: 2.5px solid #e7e5e4;
  border-radius: 10px;
  background: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3px;
  transition: border-color .15s, transform .1s;
  overflow: hidden;
}
.qr-icon-btn:hover   { border-color: #f97316; transform: scale(1.08); }
.qr-icon-btn.selected { border-color: #f97316; box-shadow: 0 0 0 2px #fff7ed inset; }
.qr-icon-btn img { width: 36px; height: 36px; object-fit: contain; }

/* Color grid - 6 columns */
#qrColorPicker { grid-template-columns: repeat(6, 1fr); }

/* ── QR TWO-PANEL LAYOUT ─────────────────────────────────── */

/* Section wrapper — compact */
.qr-scene-section,
.qr-editor-section {
  margin-bottom: 6px;
}

.qr-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}
.qr-section-label {
  font-size: 11px;
  font-weight: 700;
  color: #78716c;
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* Scene photo wrapper */
.qr-scene-wrap {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,.15);
  line-height: 0;
}
.qr-scene-img {
  width: 100%;
  display: block;
  object-fit: cover;
  max-height: 220px;
}

/* Sign placed on desk in scene */
.qr-scene-sign-overlay {
  position: absolute;
  pointer-events: none;
  box-shadow: 0 12px 40px rgba(0,0,0,.45), 0 2px 8px rgba(0,0,0,.3);
  transform-origin: center center;
  overflow: hidden;
}

/* Scene switcher pills */
.qr-scene-switcher-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.qr-scene-pill {
  padding: 3px 10px;
  border: 1.5px solid #e7e5e4;
  border-radius: 999px;
  background: white;
  cursor: pointer;
  font-size: 10px;
  font-weight: 600;
  color: #78716c;
  transition: border-color .15s, background .15s;
}
.qr-scene-pill:hover    { border-color: #f97316; color: #c2410c; }
.qr-scene-pill.selected { border-color: #f97316; background: #fff7ed; color: #c2410c; }

/* Close-up editor canvas — compact */
.qr-editor-canvas {
  background: #f5f5f4;
  border-radius: 12px;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  border: 1.5px dashed #e7e5e4;
}

/* ── SIGN STAND/BASE ───────────────────────────────────────── */
.qr-sign-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}
.qr-sign-stand {
  width: 90%;
  height: 14px;
  margin-top: -2px;
  /* Gold mirror gradient */
  background: linear-gradient(180deg,
    #fff5cc 0%,
    #f5d585 18%,
    #d4af37 38%,
    #b8860b 50%,
    #d4af37 65%,
    #f5d585 85%,
    #b8860b 100%
  );
  border-radius: 2px 2px 4px 4px;
  box-shadow:
    0 4px 8px rgba(0,0,0,.35),
    inset 0 1px 0 rgba(255,255,255,.5),
    inset 0 -2px 0 rgba(0,0,0,.2);
  position: relative;
}
.qr-sign-stand::before {
  content: '';
  position: absolute;
  left: 20%;
  right: 20%;
  top: 1px;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.6), transparent);
  border-radius: 1px;
}
/* In scene preview, the stand is part of the sign-unit overlay */
.qr-scene-sign-overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.qr-scene-sign-overlay .qr-sign-shape {
  /* sign body inside the unit */
}
.qr-scene-sign-overlay .qr-sign-stand {
  /* override defaults if needed */
}

/* ── Custom hex color input ─────────────────────────────────── */
.qr-custom-color-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 8px;
  background: #f5f5f4;
  border-radius: 8px;
}
.qr-custom-color-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: #57534e;
  white-space: nowrap;
}
.qr-custom-swatch {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 2px solid #d6d3d1;
  display: inline-block;
}
.qr-custom-color-input {
  flex: 1;
  min-width: 0;
  padding: 4px 8px;
  border: 1.5px solid #d6d3d1;
  border-radius: 6px;
  font-size: 12px;
  font-family: 'Courier New', monospace;
  text-transform: uppercase;
  outline: none;
}
.qr-custom-color-input:focus { border-color: #f97316; }
.qr-custom-color-btn {
  padding: 4px 10px;
  background: #f97316;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.qr-custom-color-btn:hover { background: #ea580c; }
.qr-custom-color-btn:active { background: #c2410c; }

/* ── Flashing CTA banner (top of every page) ─────────────── */
@keyframes ctaPulse {
  0%, 100% {
    background: linear-gradient(90deg, #10b981, #059669);
    box-shadow: 0 2px 8px rgba(16,185,129,.4);
  }
  50% {
    background: linear-gradient(90deg, #34d399, #10b981);
    box-shadow: 0 4px 20px rgba(16,185,129,.7), 0 0 30px rgba(52,211,153,.5);
  }
}
.cta-banner {
  transition: transform .15s;
}
.cta-banner:hover {
  transform: scale(1.01);
  text-decoration: none !important;
}

/* ── Color wheel picker ─────────────────────────────────────── */
.qr-color-wheel-row {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
}
.qr-color-wheel-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #f97316 0%, #ec4899 50%, #a855f7 100%);
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  color: white;
  font-weight: 600;
  font-size: 12px;
  transition: transform .15s, box-shadow .15s;
}
.qr-color-wheel-label:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(168, 85, 247, .35);
}
.qr-color-wheel-input {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 2px solid white;
  border-radius: 6px;
  cursor: pointer;
  background: transparent;
}
.qr-color-wheel-input::-webkit-color-swatch-wrapper { padding: 0; }
.qr-color-wheel-input::-webkit-color-swatch { border: none; border-radius: 4px; }
.qr-color-wheel-text { white-space: nowrap; }

/* ── Font picker (custom dropdown showing each font in itself) ─── */
.qr-font-picker {
  position: relative;
}
.qr-font-picker-current {
  width: 100%;
  padding: 8px 32px 8px 12px;
  border: 2px solid #d6d3d1;
  border-radius: 8px;
  background: white;
  cursor: pointer;
  font-size: 14px;
  text-align: left;
  position: relative;
  transition: border-color .15s;
}
.qr-font-picker-current:hover { border-color: #f97316; }
.qr-font-picker-current::after {
  content: '▾';
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #78716c;
  font-size: 12px;
}
.qr-font-picker-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 280px;
  overflow-y: auto;
  background: white;
  border: 2px solid #f97316;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  z-index: 50;
  display: none;
}
.qr-font-picker.open .qr-font-picker-list { display: block; }
.qr-font-picker-cat-label {
  font-size: 10px;
  font-weight: 700;
  color: #78716c;
  background: #f5f5f4;
  padding: 4px 12px;
  text-transform: uppercase;
  letter-spacing: .05em;
  position: sticky;
  top: 0;
  z-index: 1;
}
.qr-font-option {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 16px;
  border: none;
  background: white;
  width: 100%;
  text-align: left;
  display: block;
  transition: background .1s;
}
.qr-font-option:hover { background: #fff7ed; }
.qr-font-option.selected { background: #fff7ed; color: #c2410c; font-weight: 600; }

/* ── Download button in editor canvas corner ─────────────── */
.qr-editor-download-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 20;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  background: linear-gradient(135deg, #1c1917 0%, #292524 100%);
  color: white;
  border: none;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,.25);
  transition: transform .15s, box-shadow .15s, background .15s;
  white-space: nowrap;
}
.qr-editor-download-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0,0,0,.35);
  background: linear-gradient(135deg, #292524 0%, #44403c 100%);
}
.qr-editor-download-btn:active {
  transform: translateY(0);
}
.qr-editor-download-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

/* ── Resize handle on draggable elements ────────────────── */
.qr-resize-handle {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 22px;
  height: 22px;
  background: #f97316;
  color: white;
  border: 2px solid white;
  border-radius: 50% 0 4px 0;
  font-size: 12px;
  font-weight: bold;
  cursor: nwse-resize;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .15s, transform .1s;
  z-index: 100;
  user-select: none;
  touch-action: none;
  box-shadow: 0 2px 6px rgba(0,0,0,.3);
  pointer-events: auto;
}
.qr-draggable:hover .qr-resize-handle,
.qr-resize-handle:hover {
  opacity: 1;
}
.qr-resize-handle:hover {
  transform: scale(1.2);
}

/* ── 3-column editor canvas (color | sign | text) ── */
.qr-editor-3col {
  display: grid;
  grid-template-columns: 200px 1fr 260px;
  gap: 12px;
  padding: 12px;
  align-items: stretch;
  min-height: 380px;
}
.qr-editor-3col .qr-editor-center {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 360px;
}

.qr-side-panel {
  background: white;
  border: 1px solid #e7e5e4;
  border-radius: 10px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  /* No overflow-y so font dropdown can escape the container */
}
.qr-side-label {
  font-size: 11px;
  font-weight: 700;
  color: #78716c;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 2px;
}

/* LEFT — color picker (square swatches in 4-col grid, bigger) */
.qr-side-left .qr-side-palette {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
}
.qr-side-color-wheel {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #f97316 0%, #ec4899 50%, #a855f7 100%);
  padding: 5px 8px;
  border-radius: 8px;
  cursor: pointer;
  color: white;
  font-weight: 700;
  font-size: 11px;
  transition: transform .15s;
  white-space: nowrap;
}
.qr-side-color-wheel:hover { transform: translateY(-1px); }
.qr-side-color-wheel input[type="color"] {
  width: 22px;
  height: 22px;
  padding: 0;
  border: 2px solid white;
  border-radius: 5px;
  cursor: pointer;
  background: transparent;
}
.qr-side-color-wheel input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.qr-side-color-wheel input[type="color"]::-webkit-color-swatch { border: none; border-radius: 3px; }

/* RIGHT — text + font (bigger inputs) */
.qr-side-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid #d6d3d1;
  border-radius: 8px;
  font-size: 14px;
  resize: none;
  font-family: inherit;
  outline: none;
  transition: border-color .15s;
  min-height: 60px;
}
.qr-side-textarea:focus { border-color: #f97316; }
.qr-side-right .qr-font-picker .qr-font-picker-current {
  font-size: 14px;
  padding: 10px 32px 10px 12px;
}

/* Stack on smaller screens */
@media (max-width: 1100px) {
  .qr-editor-3col {
    grid-template-columns: 1fr;
  }
  .qr-side-panel {
    max-height: none;
  }
  .qr-side-left .qr-side-palette {
    grid-template-columns: repeat(8, 1fr);
  }
}

/* ── MOBILE responsive — all pages ───────────────────────── */
@media (max-width: 768px) {
  /* Compact header on mobile */
  header .max-w-6xl,
  header .max-w-\[1600px\] { padding-top: 8px; padding-bottom: 8px; }
  header .text-xl { font-size: 16px; }
  /* Tabs scroll horizontally */
  header .flex.gap-1 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  header .flex.gap-1::-webkit-scrollbar { display: none; }
  .tab-btn { padding: 8px 10px; font-size: 12px; flex-shrink: 0; }
  /* CTA banner smaller text */
  .cta-banner { font-size: 11px; padding: 6px 8px !important; line-height: 1.3; }
  /* Main padding */
  main { padding-left: 12px !important; padding-right: 12px !important; padding-top: 12px !important; }
  /* Stack everything on mobile */
  .signs-editor {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }
  .signs-preview-col { position: static; }
  /* Quick controls 1-col on small screens */
  .qr-quick-controls { grid-template-columns: 1fr !important; }
  /* QR slot pickers larger touch targets */
  .qr-icon-btn { width: 48px !important; height: 48px !important; }
  /* Color swatches in side panel — bigger on mobile */
  .qr-side-left .qr-side-palette {
    grid-template-columns: repeat(8, 1fr);
  }
  /* Editor canvas padding */
  .qr-editor-canvas { padding: 8px !important; }
  /* Bigger touch targets for buttons */
  .qr-pill-btn { padding: 10px 16px; font-size: 14px; }
  .qr-shape-btn { padding: 12px 8px; }
  /* Bulk slider input wider */
  #qrBulkQty { height: 28px; }
  /* Scene preview height */
  .qr-scene-img { max-height: 180px; }
}

/* Tablet */
@media (min-width: 769px) and (max-width: 1099px) {
  .signs-editor { grid-template-columns: 1fr !important; }
  .signs-preview-col { position: static; }
  .qr-side-left .qr-side-palette {
    grid-template-columns: repeat(6, 1fr);
  }
}

/* Compact SQUARE swatches in side panel */
.qr-side-left .qr-color-swatch {
  width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
  border-radius: 6px;
}

/* ── Logo Remove BG button (toggle) ─────────────────────── */
.qr-remove-bg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 700;
  border: 1.5px solid #d6d3d1;
  border-radius: 8px;
  background: #fafaf9;
  color: #57534e;
  cursor: pointer;
  transition: all 0.12s;
  white-space: nowrap;
  margin-top: 4px;
}
.qr-remove-bg-btn:hover {
  border-color: #f97316;
  color: #c2410c;
}
.qr-remove-bg-btn.active {
  background: linear-gradient(135deg, #10b981, #059669);
  border-color: #059669;
  color: white;
  box-shadow: 0 2px 6px rgba(16,185,129,.3);
}
.qr-remove-bg-btn.active::before {
  content: '✓ ';
  margin-right: 2px;
}

/* Font dropdown — escape container */
.qr-font-picker { position: relative; }
.qr-font-picker.open .qr-font-picker-list {
  z-index: 999;
  max-height: 320px;
}

/* ── MOBILE: Reorder + Collapsible color picker ──────────── */
@media (max-width: 900px) {
  /* Make signs-editor a flex column for QR tab */
  #panel-qr .signs-editor {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  /* Both columns become transparent containers — children become direct flex items */
  #panel-qr .signs-preview-col,
  #panel-qr .signs-controls-col {
    display: contents;
  }
  /* Order the items: quick-controls → editor → slots+style → price → scene → cta */
  #panel-qr .qr-quick-controls       { order: 1; }
  #panel-qr .ctrl-block:has(#qrLogoUpload) { order: 1; }
  #panel-qr .qr-editor-section       { order: 2; }
  #panel-qr #qrSlotConfigs           { order: 3; }
  #panel-qr .ctrl-block:has(#qrIconStyleColor) { order: 4; }
  #panel-qr .ctrl-block:has(#qrPriceBase),
  #panel-qr .bg-gradient-to-br.from-orange-50 { order: 5; }
  #panel-qr .qr-scene-section        { order: 6; }
  #panel-qr .mt-2.space-y-2          { order: 7; }
}

/* ── COLLAPSIBLE color picker on mobile ─────────────────── */
@media (max-width: 900px) {
  /* Color side panel becomes collapsible */
  .qr-side-left .qr-side-label {
    cursor: pointer;
    user-select: none;
    background: linear-gradient(135deg, #f97316, #ec4899);
    color: white;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    margin-bottom: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .qr-side-left .qr-side-label::after {
    content: '▼';
    font-size: 12px;
    transition: transform .2s;
  }
  .qr-side-left.open .qr-side-label::after {
    transform: rotate(180deg);
  }
  /* Hide palette + color wheel by default; show when open */
  .qr-side-left .qr-side-color-wheel,
  .qr-side-left .qr-side-palette {
    display: none;
  }
  .qr-side-left.open .qr-side-color-wheel {
    display: inline-flex;
    margin-top: 10px;
  }
  .qr-side-left.open .qr-side-palette {
    display: grid;
    margin-top: 8px;
  }
  /* Stack 3-col editor on mobile */
  .qr-editor-3col {
    grid-template-columns: 1fr;
  }
  .qr-side-panel { max-height: none; }
}
