/* Gold Note Official Hi-Fi System Configurator Stylesheet
 * Fully Responsive Luxury Dark Edition:
 * - Fluid Phone, Phablet, Tablet & Desktop responsive architecture
 * - Touch-first controls (Tap-to-select, precision nudge toolbar, safe touch targets >= 44px)
 * - Mobile segmented view switcher (Rack Stage <-> Catalog)
 * - Mobile persistent bottom dock bar with direct confirmation access
 * - Mobile modal tabs (Contact Form <-> PDF Document Preview)
 * - iOS Safari auto-zoom prevention (16px input font size)
 * - Dynamic Viewport Height (100dvh) and safe-area-inset support
 * - Scoped styles under .goldnote-configurator-wrapper
 */
:root {
  --bg-primary: #0b0c10;
  --bg-surface: #12141a;
  --bg-card: #181b24;
  --bg-card-hover: #202430;
  --gold-primary: #c5a059;
  --gold-light: #e0be7d;
  --gold-dark: #917232;
  --gold-glow: rgba(197, 160, 89, 0.35);
  --gold-glow-strong: rgba(197, 160, 89, 0.65);
  --text-primary: #f5f6f8;
  --text-secondary: #9da3b4;
  --text-muted: #5e6475;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-gold: rgba(197, 160, 89, 0.4);
  --border-gold-strong: rgba(197, 160, 89, 0.75);
  --danger-color: #e74c3c;
  --danger-glow: rgba(231, 76, 60, 0.3);
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mobile-dock-height: 68px;
  /* Real measured height of the mobile bottom dock, kept in sync by configurator.js */
  --gn-dock-h: 116px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

/* Scoped resets to avoid polluting theme */
.goldnote-configurator-wrapper,
.goldnote-configurator-wrapper * {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  margin: 0;
  padding: 0;
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

.goldnote-configurator-wrapper {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
  width: 100%;
  overflow-x: hidden;
  user-select: none;
  -webkit-user-select: none;
}

/* Accessible Focus States */
.goldnote-configurator-wrapper button:focus-visible,
.goldnote-configurator-wrapper a:focus-visible,
.goldnote-configurator-wrapper input:focus-visible,
.goldnote-configurator-wrapper textarea:focus-visible,
.goldnote-configurator-wrapper .accordion-header:focus-visible,
.goldnote-configurator-wrapper .product-card:focus-visible {
  outline: 2px solid var(--gold-light);
  outline-offset: 2px;
}

/* Header */
.app-header {
  height: 72px;
  background: rgba(18, 20, 26, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 100;
  gap: 16px;
  transition: height 0.25s ease, padding 0.25s ease;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.brand-logo {
  height: 38px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(197, 160, 89, 0.3));
}

.brand-divider {
  width: 1px;
  height: 24px;
  background: var(--border-subtle);
}

.brand-title {
  font-family: var(--font-serif);
  font-size: 1.12rem;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gold-primary);
  white-space: nowrap;
}

/* Rack Switcher */
.rack-switcher {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  padding: 4px;
  border-radius: 30px;
  border: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.rack-btn {
  padding: 8px 18px;
  border-radius: 20px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  touch-action: manipulation;
  line-height: 1;
}

.rack-btn span {
  display: inline-block;
  line-height: 1;
}

.rack-sub-badge {
  display: inline-block;
  line-height: 1;
  font-size: 0.72rem;
  opacity: 0.75;
  letter-spacing: 0.3px;
  vertical-align: middle;
  white-space: nowrap;
  margin: 2px 0px 0px 0px;
}

.rack-btn.active {
  background: linear-gradient(135deg, var(--gold-dark), var(--gold-primary));
  color: #0b0c10;
  font-weight: 700;
  box-shadow: 0 4px 14px var(--gold-glow);
}

.rack-btn.active .rack-sub-badge {
  opacity: 0.9;
  color: #0b0c10;
}

.rack-btn:hover:not(.active) {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.desktop-rack-switcher .rack-btn {
  flex-direction: column;
  gap: 2px;
  min-height: 46px;
  padding: 6px 18px;
}

.desktop-rack-switcher .rack-btn span,
.desktop-rack-switcher .rack-sub-badge {
  text-align: center;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.btn-clear-rack {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-sans);
  letter-spacing: 0.4px;
}

.btn-clear-rack:hover {
  border-color: var(--gold-primary);
  color: var(--gold-light);
  background: rgba(197, 160, 89, 0.08);
}

/* Mobile-only catalog steps: the desktop header already carries the rack switcher */
.mobile-rack-selector-wrap,
.mobile-section-heading {
  display: none;
}

/* Mobile Segmented Navigation Tabs (<= 900px) */
.mobile-nav-tabs {
  display: none;
  position: sticky;
  top: 60px;
  z-index: 85;
  background: rgba(18, 20, 26, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 6px 12px;
  gap: 8px;
}

.mobile-tab-btn {
  flex: 1;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  transition: all 0.2s ease;
  touch-action: manipulation;
}

.mobile-tab-btn .tab-badge {
  background: rgba(197, 160, 89, 0.2);
  color: var(--gold-light);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  border: 1px solid var(--border-gold);
}

.mobile-tab-btn.active {
  background: var(--bg-card);
  color: var(--gold-light);
  border-color: var(--border-gold);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

.mobile-tab-btn.active .tab-badge {
  background: var(--gold-primary);
  color: #0b0c10;
}

.btn-secondary {
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 38px;
}

.btn-secondary:hover {
  background: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--border-gold);
}

.btn-primary {
  padding: 10px 22px;
  border-radius: 8px;
  border: 1px solid var(--gold-primary);
  background: linear-gradient(135deg, var(--gold-primary), var(--gold-light));
  color: #0b0c10;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px var(--gold-glow);
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  min-height: 42px;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(197, 160, 89, 0.45);
}

/* Main Workspace */
.main-workspace {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 440px;
  min-height: calc(100vh - 72px);
  min-height: calc(100dvh - 72px);
  overflow: visible;
  position: relative;
  align-items: stretch;
}

/* Rack Canvas Stage */
.stage-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 28px 28px 64px;
  position: relative;
  background: radial-gradient(circle at center, #171a24 0%, #0b0c10 85%);
  overflow: hidden;
  width: 100%;
}

.stage-instructions {
  position: absolute;
  top: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  background: rgba(18, 20, 26, 0.88);
  padding: 7px 18px;
  border-radius: 24px;
  border: 1px solid var(--border-gold);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  z-index: 50;
  transition: opacity 0.25s ease, transform 0.25s ease;
  text-align: center;
  max-width: 90%;
  pointer-events: none;
}

.stage-instructions .instruction-touch {
  display: none;
}

.stage-instructions strong.highlight {
  color: var(--gold-light);
  font-weight: 600;
}

/* Stage Flank Layout (Speakers positioned at the sides of the rack) */
.stage-flank-layout {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  position: relative;
  width: 100%;
  max-width: min(1040px, 98vw);
  margin: 0 auto;
  gap: 16px;
  will-change: transform;
  transition: transform 0.12s cubic-bezier(0.2, 0, 0, 1);
}

.speaker-flank {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  width: 175px;
  min-width: 130px;
  max-width: 220px;
  flex-shrink: 0;
  min-height: 280px;
  position: relative;
  transition: all 0.3s ease;
  z-index: 15;
}

.speaker-flank.is-empty {
  border: 1.5px dashed rgba(197, 160, 89, 0.2);
  border-radius: 10px;
  background: rgba(197, 160, 89, 0.02);
  transition: all 0.25s ease;
}

.speaker-flank.is-empty:hover,
.stage-container.dragging-speaker .speaker-flank.is-empty {
  border-color: var(--gold-light);
  background: rgba(197, 160, 89, 0.08);
  box-shadow: 0 0 15px var(--gold-glow);
}

.speaker-flank-placeholder {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 8px;
  margin: auto 0;
  text-align: center;
  user-select: none;
  pointer-events: none;
}

.placed-speaker {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  width: 100%;
  cursor: pointer;
  animation: gn-scale-in 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.placed-speaker img {
  max-height: 380px;
  max-width: 100%;
  width: auto;
  height: auto;
  display: block;
  filter: drop-shadow(0 14px 20px rgba(0, 0, 0, 0.85));
  transition: transform 0.2s ease, filter 0.2s ease;
}

.placed-speaker:hover img {
  transform: translateY(-2px);
  filter: drop-shadow(0 18px 26px rgba(0, 0, 0, 0.9)) drop-shadow(0 0 14px var(--gold-glow));
}

.placed-speaker .speaker-remove-btn {
  position: absolute;
  top: -6px;
  right: -4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease, background 0.2s ease;
  z-index: 25;
}

.placed-speaker:hover .speaker-remove-btn {
  opacity: 1;
}

.placed-speaker .speaker-remove-btn:hover {
  background: var(--danger-color);
  border-color: var(--danger-color);
  color: #fff;
}

.placed-speaker .speaker-label {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--gold-light);
  background: rgba(18, 20, 26, 0.92);
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid var(--border-gold);
  margin-top: 6px;
  white-space: nowrap;
  text-align: center;
}

/* Rack Viewport */
.rack-viewport {
  position: relative;
  width: 100%;
  max-width: min(560px, calc(100vh - 200px));
  max-width: min(560px, calc(100dvh - 200px));
  max-height: calc(100vh - 200px);
  max-height: calc(100dvh - 200px);
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: aspect-ratio 0.3s ease, max-width 0.3s ease;
  margin: auto;
}

.rack-viewport.is-xl {
  max-width: min(760px, calc((100vh - 200px) * 1.339));
  max-width: min(760px, calc((100dvh - 200px) * 1.339));
  aspect-ratio: 1200 / 896;
}

.rack-bg-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 20px 35px rgba(0, 0, 0, 0.7));
  border-radius: 12px;
  transition: opacity 0.2s ease;
}

/* Visual Slot Drop Zones */
.slot-drop-zone {
  position: absolute;
  border: 2px dashed rgba(197, 160, 89, 0.3);
  background: rgba(197, 160, 89, 0.04);
  border-radius: 8px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease, border-color 0.2s, background-color 0.2s, transform 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
}

.stage-container.dragging-active .slot-drop-zone {
  opacity: 1;
}

.slot-drop-zone.is-hovered-valid {
  border-color: var(--gold-light);
  background: rgba(197, 160, 89, 0.18);
  box-shadow: 0 0 25px var(--gold-glow), inset 0 0 15px rgba(197, 160, 89, 0.2);
  transform: scale(1.01);
}

.slot-drop-zone.is-hovered-invalid {
  border-color: var(--danger-color);
  background: rgba(231, 76, 60, 0.15);
  box-shadow: 0 0 20px var(--danger-glow);
}

.slot-badge {
  background: rgba(18, 20, 26, 0.92);
  border: 1px solid var(--border-gold);
  color: var(--gold-light);
  padding: 4px 12px;
  border-radius: 14px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
  pointer-events: none;
  transition: all 0.2s;
}

.slot-drop-zone.is-hovered-valid .slot-badge {
  background: var(--gold-primary);
  color: #0b0c10;
  transform: scale(1.08);
}

.slot-drop-zone.is-hovered-invalid .slot-badge {
  background: var(--danger-color);
  color: white;
  border-color: var(--danger-color);
}

/* Placed 3D Component with GPU acceleration */
.placed-component {
  position: absolute;
  cursor: grab;
  touch-action: none;
  z-index: 10;
  transition: filter 0.2s ease, outline 0.2s ease, box-shadow 0.2s ease;
  will-change: transform, left;
  transform: translate3d(0, 0, 0);
  border-radius: 6px;
}

.placed-component:hover {
  filter: drop-shadow(0 0 14px rgba(197, 160, 89, 0.6)) brightness(1.03);
}

.placed-component.is-selected {
  outline: 2px solid var(--gold-light);
  outline-offset: 3px;
  filter: drop-shadow(0 0 16px var(--gold-glow-strong)) brightness(1.06);
  z-index: 20;
}

.placed-component.is-dragging {
  cursor: grabbing;
  z-index: 40;
  filter: drop-shadow(0 25px 35px rgba(0, 0, 0, 0.9)) drop-shadow(0 0 20px var(--gold-glow)) brightness(1.08);
}

.placed-component img {
  width: 100%;
  height: auto;
  display: block;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

/* Component Overlays (Desktop Hover only) */
.component-overlay {
  position: absolute;
  top: -12px;
  right: -10px;
  opacity: 0;
  pointer-events: none; /* Prevents phantom touch-clicks on mobile */
  transition: opacity 0.2s;
  display: flex;
  gap: 5px;
  z-index: 25;
}

@media (hover: hover) {
  .placed-component:hover .component-overlay {
    opacity: 1;
    pointer-events: auto;
  }
}

@media (hover: none), (max-width: 900px) {
  .component-overlay {
    display: none !important;
    pointer-events: none !important;
  }
}

.comp-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--border-gold);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  touch-action: manipulation;
}

.comp-btn:hover {
  background: var(--danger-color);
  border-color: var(--danger-color);
  color: white;
  transform: scale(1.1);
}

.comp-btn.switch-shelf:hover {
  background: var(--gold-primary);
  border-color: var(--gold-primary);
  color: #0b0c10;
}

.comp-label {
  position: absolute;
  bottom: -24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(18, 20, 26, 0.94);
  color: var(--gold-light);
  font-size: 0.7rem;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
  border: 1px solid var(--border-subtle);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
  z-index: 22;
}

@media (hover: hover) {
  .placed-component:hover .comp-label {
    opacity: 1;
  }
}

.comp-drag-hint {
  position: absolute;
  top: -22px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(197, 160, 89, 0.15);
  color: var(--gold-light);
  font-size: 0.65rem;
  padding: 2px 8px;
  border-radius: 10px;
  border: 1px solid var(--border-gold);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

@media (hover: hover) {
  .placed-component:hover .comp-drag-hint {
    opacity: 0.9;
  }
}

/* ==========================================================================
   Selected Component Action Panel (Luxury 2-Tier Floating Controls)
   ========================================================================== */

.selected-component-bar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: auto;
  max-width: min(920px, calc(100% - 32px));
  min-width: min(520px, calc(100% - 32px));
  background: rgba(14, 16, 22, 0.95);
  border: 1px solid var(--border-gold-strong);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 14px;
  padding: 12px 16px 13px;
  margin-top: 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8), 0 0 25px rgba(197, 160, 89, 0.22);
  z-index: 55;
  animation: bar-slide-up 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

@keyframes bar-slide-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Desktop Action Bar: sits in-flow above the rack so it pushes the rack down and never overlaps */
@media (min-width: 901px) {
  .stage-container.has-selected-component {
    padding-top: 16px;
  }

  .selected-component-bar {
    position: relative;
    order: -1;
    top: auto;
    left: auto;
    transform: none;
    margin: 0 auto 20px;
    flex-shrink: 0;
    max-width: min(960px, calc(100% - 48px));
    animation: bar-slide-down 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  }

  @keyframes bar-slide-down {
    from {
      opacity: 0;
      transform: translateY(-10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .stage-container.has-selected-component .stage-instructions {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px);
  }
}

/* Tier 1: Header (Identity + Tools) */
.sc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(197, 160, 89, 0.22);
  box-sizing: border-box;
}

.selected-component-bar.has-no-actions .sc-header {
  border-bottom: none;
  padding-bottom: 0;
}

.sc-info {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  min-width: 0;
  flex: 1;
}

.sc-title-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.sc-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold-light);
  box-shadow: 0 0 10px rgba(197, 160, 89, 0.8);
  flex-shrink: 0;
}

.sc-name {
  font-size: 0.96rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.sc-shelf {
  font-size: 0.77rem;
  color: #a0a3ad;
  background: rgba(255, 255, 255, 0.05);
  padding: 3px 9px;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  white-space: nowrap;
  letter-spacing: 0.2px;
}

.sc-header-tools {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Tier 2: Actions Bar */
.sc-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
}

.sc-group {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.sc-nudge-cluster {
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.04);
}

.sc-nudge-cluster .sc-btn {
  border: none;
  border-radius: 0;
  height: 34px;
  min-width: 34px;
  padding: 0 10px;
  background: transparent;
}

.sc-nudge-cluster .sc-btn + .sc-btn {
  border-left: 1px solid rgba(255, 255, 255, 0.12);
}

.sc-nudge-cluster .sc-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--gold-light);
}

/* General Button Styling */
.sc-btn {
  height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  font-size: 0.81rem;
  font-family: var(--font-sans);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  touch-action: manipulation;
  white-space: nowrap;
  box-sizing: border-box;
}

.sc-btn:hover,
.sc-btn:active {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-gold);
  color: var(--gold-light);
}

.sc-btn-label {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.76rem;
  font-weight: 500;
}

.sc-btn-val {
  color: var(--gold-light);
  font-weight: 600;
}

.sc-btn.sc-finish,
.sc-btn.sc-tonearm,
.sc-btn.sc-cartridge,
.sc-btn.sc-speaker-support {
  background: rgba(197, 160, 89, 0.1);
  border-color: rgba(197, 160, 89, 0.38);
  color: #f3e5ab;
  font-weight: 500;
}

.sc-btn.sc-finish:hover,
.sc-btn.sc-tonearm:hover,
.sc-btn.sc-cartridge:hover,
.sc-btn.sc-speaker-support:hover {
  background: rgba(197, 160, 89, 0.22);
  border-color: var(--gold-light);
  color: #ffffff;
  box-shadow: 0 0 12px rgba(197, 160, 89, 0.25);
}

.sc-btn.sc-switch-shelf {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.18);
  color: #e5e7eb;
  font-weight: 600;
}

.sc-btn.sc-switch-shelf:hover {
  background: var(--gold-primary);
  color: #0b0c10;
  border-color: var(--gold-primary);
  box-shadow: 0 0 12px rgba(197, 160, 89, 0.3);
}

.sc-btn.sc-remove {
  height: 28px;
  padding: 0 10px;
  font-size: 0.73rem;
  font-weight: 600;
  color: #f87171;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.32);
  border-radius: 6px;
}

.sc-btn.sc-remove:hover {
  background: #ef4444;
  color: white;
  border-color: #ef4444;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.4);
}

.sc-btn.sc-close {
  height: 28px;
  width: 28px;
  min-width: 28px;
  padding: 0;
  border-radius: 6px;
  font-size: 1.25rem;
  line-height: 1;
  color: #9ca3af;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  justify-content: center;
}

.sc-btn.sc-close:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.25);
}

.sc-icon {
  flex-shrink: 0;
}

.finish-btn-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.3);
  flex-shrink: 0;
}

/* Floating Bottom-Right Confirmation Button */
.floating-confirm-btn {
  position: absolute;
  bottom: 24px;
  right: 28px;
  padding: 14px 28px;
  border-radius: 30px;
  border: 1px solid var(--gold-light);
  background: linear-gradient(135deg, var(--gold-primary), var(--gold-light));
  color: #0b0c10;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  box-shadow: 0 8px 25px rgba(197, 160, 89, 0.4);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 60;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.floating-confirm-btn:hover:not(.disabled) {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 12px 30px rgba(197, 160, 89, 0.6);
}

.floating-confirm-btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(0.5);
  box-shadow: none;
}

.btn-item-count {
  background: #0b0c10;
  color: var(--gold-light);
  font-size: 0.75rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 12px;
  border: 1px solid var(--gold-primary);
}

/* Sidebar & Accordion Catalog */
.catalog-sidebar {
  background: var(--bg-surface);
  border-left: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.catalog-header {
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--border-subtle);
}

.catalog-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.catalog-caption {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Accordion Container */
.accordion-container {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-subtle) transparent;
}

.accordion-item {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  transition: border-color 0.25s, box-shadow 0.25s;
}

.accordion-item.is-expanded {
  border-color: var(--border-gold);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.accordion-header {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  background: transparent;
  transition: background-color 0.2s;
  user-select: none;
}

.accordion-header:hover {
  background: rgba(255, 255, 255, 0.03);
}

.accordion-item.is-expanded .accordion-header {
  background: rgba(197, 160, 89, 0.08);
}

.acc-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.acc-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.accordion-item.is-expanded .acc-title {
  color: var(--gold-light);
}

.acc-subtitle {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.acc-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.acc-count {
  white-space: nowrap;
  font-size: 0.7rem;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 8px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
}

.acc-chevron {
  font-size: 0.75rem;
  color: var(--gold-primary);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.accordion-item.is-expanded .acc-chevron {
  transform: rotate(180deg);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
  background: rgba(0, 0, 0, 0.2);
}

.accordion-item.is-expanded .accordion-content {
  max-height: 5000px;
}

.acc-product-grid {
  padding: 12px 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Product Card */
.product-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 12px;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s ease;
  touch-action: manipulation;
}

.product-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-gold);
  transform: translateX(2px);
}

.product-card:active {
  transform: scale(0.99);
}

.product-card.just-added {
  border-color: var(--gold-light);
  box-shadow: 0 0 15px var(--gold-glow);
  background: rgba(197, 160, 89, 0.1);
}

/* Line-compatibility gate (max 1-step range across lines already in the rack,
   see isLineCompatible() in configurator.js). Card stays clickable so tapping it
   still surfaces the rejection toast — this is only the visual half of the rule. */
.product-card.is-line-blocked {
  opacity: 0.4;
  cursor: not-allowed;
  filter: grayscale(0.6);
}

.product-card.is-line-blocked:hover {
  background: var(--bg-surface);
  border-color: var(--border-subtle);
  transform: none;
}

.prod-thumb-box {
  width: 80px;
  height: 54px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.04));
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3px;
}

.prod-thumb-box img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.prod-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.prod-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: normal;
  line-height: 1.3;
  word-break: normal;
}

.prod-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  min-width: 0;
}

.prod-badge {
  display: inline-block;
  flex: 0 0 auto;
  max-width: 100%;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(197, 160, 89, 0.14);
  border: 1px solid rgba(197, 160, 89, 0.3);
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  line-height: 1.35;
  color: var(--gold-light);
  white-space: normal;
  text-align: center;
}

.prod-dims {
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.2px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.prod-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.btn-add-prod {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border-gold);
  background: var(--gold-glow);
  color: var(--gold-light);
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  touch-action: manipulation;
  flex-shrink: 0;
}

.btn-add-prod:hover,
.btn-add-prod:active {
  background: var(--gold-primary);
  color: #0b0c10;
  transform: scale(1.08);
}

/* ==========================================================================
   Mobile Persistent Bottom Dock (<= 900px)
   ========================================================================== */
.mobile-sticky-dock {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 990;
  background: rgba(12, 14, 19, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-gold);
  padding: 8px 16px calc(8px + var(--safe-bottom));
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.75);
}

.dock-top-row {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

/* Segmented view switch: both destinations always visible */
.dock-view-switch {
  display: flex;
  width: 100%;
  gap: 4px;
  padding: 3px;
  background: rgba(24, 27, 36, 0.95);
  border: 1px solid var(--border-gold);
  border-radius: 12px;
}

.dock-view-btn {
  flex: 1 1 0;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  padding: 6px 8px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.4px;
  line-height: 1.15;
  cursor: pointer;
  overflow: hidden;
  touch-action: manipulation;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.dock-view-btn > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dock-view-btn.is-active {
  background: linear-gradient(135deg, var(--gold-dark), var(--gold-primary));
  color: #0b0c10;
  font-weight: 700;
  box-shadow: 0 3px 12px var(--gold-glow);
}

.dock-view-badge {
  flex: 0 0 auto;
  min-width: 20px;
  padding: 2px 6px;
  border-radius: 10px;
  background: rgba(197, 160, 89, 0.22);
  color: var(--gold-light);
  font-size: 0.7rem;
  font-weight: 800;
  line-height: 1.4;
  text-align: center;
}

.dock-view-btn.is-active .dock-view-badge {
  background: rgba(11, 12, 16, 0.82);
  color: var(--gold-light);
}

.dock-view-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(24, 27, 36, 0.95);
  border: 1px solid var(--border-gold-strong);
  color: var(--gold-light);
  padding: 6px 20px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
  touch-action: manipulation;
  line-height: 1;
}

.dock-view-toggle-btn:hover,
.dock-view-toggle-btn:active {
  background: var(--gold-primary);
  color: #0b0c10;
  border-color: var(--gold-light);
}

.dock-view-toggle-btn:hover .dock-toggle-badge,
.dock-view-toggle-btn:active .dock-toggle-badge {
  background: #0b0c10;
  color: var(--gold-light);
}

.dock-toggle-badge {
  background: var(--gold-primary);
  color: #0b0c10;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 10px;
  line-height: 1;
  transition: all 0.2s ease;
}

.dock-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}

.dock-info-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 24px;
  padding: 8px 14px;
  color: var(--text-primary);
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  min-height: 44px;
  font-family: var(--font-sans);
  touch-action: manipulation;
}

.dock-pill-rack {
  flex: 0 0 auto;
  white-space: nowrap;
}

.dock-pill-count {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dock-pill-divider {
  flex: 0 0 auto;
}

.dock-info-pill:hover,
.dock-info-pill:active {
  border-color: var(--border-gold);
  background: var(--bg-card-hover);
}

.dock-pill-rack {
  font-weight: 700;
  color: var(--gold-light);
  letter-spacing: 0.3px;
}

.dock-pill-divider {
  color: var(--text-muted);
  font-size: 0.6rem;
}

.dock-pill-count {
  color: var(--text-secondary);
  font-size: 0.78rem;
}

.dock-confirm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold-primary));
  color: #0b0c10;
  border: none;
  border-radius: 24px;
  padding: 8px 22px;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 4px 16px var(--gold-glow);
  white-space: nowrap;
  min-height: 44px;
  flex: 0 0 auto;
  touch-action: manipulation;
}

.dock-confirm-btn:hover:not(.disabled) {
  box-shadow: 0 4px 20px var(--gold-glow-strong);
  transform: translateY(-1px);
}

.dock-confirm-btn:active:not(.disabled) {
  transform: scale(0.97);
}

.dock-confirm-btn.disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.8);
  box-shadow: none;
}

/* ==========================================================================
   Confirmation Modal & Lead Generation Form
   ========================================================================== */
.confirm-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 6, 9, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.confirm-modal-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.confirm-modal-box {
  width: 95%;
  max-width: 1150px;
  height: 90vh;
  height: 90dvh;
  max-height: 820px;
  background: var(--bg-surface);
  border: 1px solid var(--border-gold);
  border-radius: 14px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.9), 0 0 35px var(--gold-glow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(20px) scale(0.98);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.confirm-modal-backdrop.is-open .confirm-modal-box {
  transform: translateY(0) scale(1);
}

.modal-header {
  height: 64px;
  padding: 0 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(24, 27, 36, 0.6);
  flex-shrink: 0;
}

.modal-header-title {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  margin: 0;
  padding: 0;
}

.modal-title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: var(--gold-light);
  letter-spacing: 0.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1.2 !important;
}

.modal-badge-id {
  background: rgba(197, 160, 89, 0.15);
  border: 1px solid var(--border-gold);
  color: var(--gold-light);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 12px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 !important;
  line-height: 1.2 !important;
  vertical-align: middle;
}

.btn-close-modal {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-secondary);
  font-size: 1.3rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
  flex-shrink: 0;
}

.btn-close-modal:hover,
.btn-close-modal:active {
  background: #e74c3c;
  border-color: #e74c3c;
  color: white;
}

/* Modal Segmented Tabs (<= 900px) */
.modal-tabs {
  display: none;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-card);
  padding: 4px;
  gap: 6px;
  flex-shrink: 0;
}

.modal-tab-btn {
  flex: 1;
  padding: 10px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all 0.2s;
  touch-action: manipulation;
}

.modal-tab-btn.active {
  background: var(--bg-surface);
  color: var(--gold-light);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.modal-body {
  flex: 1;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  overflow: hidden;
  min-height: 0;
}

.modal-preview-pane {
  background: #090a0d;
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 16px;
  min-height: 0;
}

.pane-title-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-shrink: 0;
}

.pane-label {
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--gold-primary);
}

.btn-download-pdf {
  font-size: 0.78rem;
  color: var(--gold-light);
  text-decoration: none;
  background: rgba(197, 160, 89, 0.12);
  border: 1px solid var(--border-gold);
  padding: 6px 14px;
  border-radius: 14px;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  touch-action: manipulation;
}

.btn-download-pdf:hover,
.btn-download-pdf:active {
  background: var(--gold-primary);
  color: #0b0c10;
}

.modal-pdf-container {
  flex: 1;
  border-radius: 8px;
  overflow: hidden;
  background: #1e2029;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pdf-iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.pdf-loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  text-align: center;
  padding: 20px;
}

.spinner-gold {
  width: 38px;
  height: 38px;
  border: 3px solid rgba(197, 160, 89, 0.2);
  border-top-color: var(--gold-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.modal-form-pane {
  background: var(--bg-surface);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  scrollbar-width: thin;
  min-height: 0;
  touch-action: pan-y;
  /* Without this, the wheel scroll "chains" to the page behind the modal once this
     pane hits its own top/bottom boundary — feels like the form isn't scrolling at
     all when it's actually the page underneath moving instead. */
  overscroll-behavior-y: contain;
}

/* Mobile Quick PDF Bar in Form View */
.modal-mobile-pdf-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  background: rgba(197, 160, 89, 0.08);
  border: 1px solid var(--border-gold);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 16px;
  gap: 10px;
}

.mobile-pdf-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mobile-pdf-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--gold-light);
}

.mobile-pdf-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.modal-form-header {
  margin-bottom: 18px;
}

.form-heading {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: var(--text-primary);
  margin: 0 0 6px 0 !important;
  padding: 0 !important;
  line-height: 1.3 !important;
}

.form-intro {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.subject-preview-box {
  margin-top: 10px;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 6px;
  border-left: 3px solid var(--gold-primary);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.subject-preview-box strong {
  color: var(--gold-light);
}

/* Dealer Picker: nearby-dealers list, rendered by configurator.js (fetchAndRenderDealers/
   renderDealerList) once the customer enters their Paese/Provincia/Città. Matching-line
   dealers (dealer-card-match) come first and carry the gold "in evidenza" badge. */
.dealer-picker {
  margin-bottom: 18px;
  padding: 16px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
}

.dealer-picker-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  padding: 4px 0 14px;
}

.dealer-picker-spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--border-subtle);
  border-top-color: var(--gold-primary);
  animation: gn-dealer-spin 0.7s linear infinite;
  flex-shrink: 0;
}

@keyframes gn-dealer-spin {
  to { transform: rotate(360deg); }
}

.dealer-picker-title {
  font-family: var(--font-serif);
  font-size: 1rem;
  color: var(--text-primary);
  margin: 0 0 4px;
}

.dealer-picker-hint {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin: 0 0 14px;
  line-height: 1.4;
}

.dealer-picker-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

.dealer-card {
  position: relative;
  display: block;
  cursor: pointer;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  transition: all 0.2s;
}

.dealer-card:hover {
  border-color: var(--border-gold);
  background: var(--bg-card-hover);
}

/* The host theme (Uncode) applies a blanket appearance:none reset to every
   checkbox/radio site-wide for its own custom-styled form elements, but that reset
   only pairs with a replacement checked-state visual on Uncode's own form markup —
   these plugin-rendered inputs (privacy/newsletter consent, dealer picker radios)
   inherit the "invisible" half without it, leaving a plain white box that never
   visibly shows checked. Restoring native appearance here (scoped to this modal,
   !important to beat Uncode's specificity) brings back the checkmark/dot, which
   accent-color then colors gold instead of the browser default blue. */
#confirm-modal input[type="checkbox"],
#confirm-modal input[type="radio"] {
  appearance: auto !important;
  -webkit-appearance: auto !important;
  accent-color: var(--gold-primary);
}

.dealer-card input[type="radio"] {
  position: absolute;
  top: 12px;
  right: 12px;
  accent-color: var(--gold-primary);
  width: 16px;
  height: 16px;
}

.dealer-card:has(input:checked) {
  border-color: var(--gold-primary);
  background: rgba(197, 160, 89, 0.1);
  box-shadow: 0 0 10px var(--gold-glow);
}

.dealer-card-match {
  border-color: var(--border-gold);
}

.dealer-card-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-right: 24px;
}

.dealer-match-badge {
  align-self: flex-start;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--bg-primary);
  background: var(--gold-primary);
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 4px;
}

.dealer-card-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
}

.dealer-card-city {
  font-size: 0.8rem;
  color: var(--gold-light);
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 2px 0 3px 0;
  line-height: 1.3;
}

.dealer-card-city strong {
  color: var(--gold-light);
  font-weight: 600;
  letter-spacing: 0.2px;
}

.dealer-card-address {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.35;
}

.dealer-card-distance {
  font-size: 0.72rem;
  color: var(--gold-light);
}

.dealer-picker-empty {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
}

.gn-form-group {
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.gn-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.gn-form-group label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.gn-form-group label span.required {
  color: var(--gold-primary);
}

/* Form Inputs: font-size 16px prevents iOS Safari auto-zoom! */
.gn-input,
.gn-textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 16px;
  font-family: var(--font-sans);
  transition: all 0.2s;
  min-height: 46px;
}

.gn-input:focus,
.gn-textarea:focus {
  outline: none;
  border-color: var(--gold-primary);
  box-shadow: 0 0 12px var(--gold-glow);
  background: #1a1d27;
}

.gn-textarea {
  resize: vertical;
  min-height: 80px;
}

/* Custom Paese/Provincia dropdown — replaces the OS-rendered native <select>
   popup (unstylable) with a themed listbox. The real <select> stays in the
   DOM (value/name/required/native validation untouched), sized under the
   trigger button but invisible and inert (see initGnCustomSelects in JS). */
.gn-select {
  position: relative;
}

.gn-select select.gn-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.gn-select-trigger {
  width: 100%;
  min-height: 46px;
  padding: 12px 40px 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 16px;
  font-family: var(--font-sans);
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  position: relative;
  transition: all 0.2s;
}

.gn-select-trigger:hover {
  border-color: var(--border-gold);
}

.gn-select.is-open .gn-select-trigger,
.gn-select-trigger:focus-visible {
  outline: none;
  border-color: var(--gold-primary);
  box-shadow: 0 0 12px var(--gold-glow);
  background: #1a1d27;
}

.gn-select-trigger-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gn-select-arrow {
  position: absolute;
  right: 16px;
  top: 50%;
  width: 9px;
  height: 9px;
  margin-top: -6px;
  border-right: 2px solid var(--text-secondary);
  border-bottom: 2px solid var(--text-secondary);
  transform: rotate(45deg);
  transition: transform 0.2s ease, border-color 0.2s ease;
  pointer-events: none;
}

.gn-select.is-open .gn-select-arrow {
  transform: rotate(-135deg);
  border-color: var(--gold-primary);
}

.gn-select-panel {
  position: absolute;
  z-index: 40;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border-gold);
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55), 0 0 20px var(--gold-glow);
  padding: 6px;
}

.gn-select-filter {
  width: 100%;
  padding: 9px 10px;
  margin-bottom: 6px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 14px;
  font-family: var(--font-sans);
}

.gn-select-filter:focus {
  outline: none;
  border-color: var(--gold-primary);
}

.gn-select-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 260px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--gold-dark) transparent;
}

.gn-select-list::-webkit-scrollbar {
  width: 8px;
}

.gn-select-list::-webkit-scrollbar-track {
  background: transparent;
}

.gn-select-list::-webkit-scrollbar-thumb {
  background: var(--gold-dark);
  border-radius: 8px;
}

.gn-select-option {
  padding: 11px 12px;
  min-height: 44px;
  display: flex;
  align-items: center;
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 15px;
  cursor: pointer;
}

.gn-select-option:hover,
.gn-select-option.is-active {
  background: var(--gold-glow);
  color: var(--gold-light);
}

.gn-select-option.is-selected {
  color: var(--gold-primary);
  font-weight: 600;
}

.gn-select-option.is-selected::after {
  content: '\2713';
  margin-left: auto;
  padding-left: 10px;
  color: var(--gold-primary);
}

.gn-select-option[hidden] {
  display: none;
}

.gn-select-option.is-disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.form-actions {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.form-legal-note {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-align: center;
}

.form-success-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
  gap: 16px;
  margin: auto 0;
}

.success-icon {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--gold-primary);
  color: #0b0c10;
  font-size: 1.8rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 25px var(--gold-glow);
}

.success-title {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  color: var(--gold-light);
}

.success-msg {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  max-width: 380px;
}

.success-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 280px;
  margin-top: 10px;
}

/* Toast Notifications */
.toast-notice {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(14px);
  opacity: 0;
  background: rgba(18, 20, 26, 0.96);
  border: 1px solid var(--gold-primary);
  color: var(--gold-light);
  padding: 10px 22px;
  border-radius: 24px;
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1.35;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), 0 0 15px rgba(197, 160, 89, 0.3);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.2s ease;
  z-index: 1100;
  pointer-events: none;
  max-width: 90vw;
  text-align: center;
}

.toast-notice.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.2s ease;
}

@media (prefers-reduced-motion: reduce) {
  .toast-notice,
  .toast-notice.show {
    transition: opacity 0.15s ease;
    transform: translateX(-50%);
  }
}

/* Shutter snapshot camera flash */
.rack-viewport.snapshot-flash::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.85) 0%, rgba(197, 160, 89, 0.65) 50%, rgba(0, 0, 0, 0.2) 100%);
  border-radius: 12px;
  pointer-events: none;
  z-index: 100;
  animation: snapshot-fade 0.38s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes snapshot-fade {
  0% { opacity: 0.95; transform: scale(1.02); }
  100% { opacity: 0; transform: scale(1); }
}

/* ==========================================================================
   RESPONSIVE BREAKPOINTS (Tablet Landscape, Tablet Portrait, Mobile)
   ========================================================================== */

/* Tablet Landscape & Medium Desktops (901px - 1100px) */
@media (max-width: 1100px) {
  .main-workspace {
    grid-template-columns: 1fr 380px;
  }
  .app-header {
    padding: 0 16px;
    gap: 10px;
  }
  .brand-section {
    gap: 10px;
  }
  .brand-title {
    font-size: 1rem;
    letter-spacing: 1px;
  }
  .brand-logo {
    height: 32px;
    max-width: 110px;
  }
  .rack-btn {
    padding: 7px 14px;
    font-size: 0.82rem;
  }
  .btn-clear-rack {
    padding: 7px 12px;
    font-size: 0.78rem;
  }
  .stage-container {
    padding: 16px;
  }
  .rack-viewport {
    max-width: min(500px, calc(100vh - 190px));
    max-width: min(500px, calc(100dvh - 190px));
    max-height: calc(100vh - 190px);
    max-height: calc(100dvh - 190px);
  }
  .rack-viewport.is-xl {
    max-width: min(640px, calc((100vh - 190px) * 1.339));
    max-width: min(640px, calc((100dvh - 190px) * 1.339));
  }
  .floating-confirm-btn {
    bottom: 16px;
    right: 18px;
    padding: 11px 20px;
    font-size: 0.88rem;
    gap: 8px;
  }
  .rack-gesture-hint {
    left: 18px;
    bottom: 16px;
    min-height: 40px;
    max-width: calc(100% - 210px);
  }
}

/* Tablet Portrait & Mobile (<= 900px) */
@media (max-width: 900px) {
  /* Header: strictly logo + brand title centered, no clutter */
  .desktop-rack-switcher,
  .app-header .header-actions {
    display: none !important;
  }

  .app-header {
    height: 56px;
    padding: 0 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
    overflow: hidden;
  }

  .brand-section {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: auto;
    min-width: 0;
    max-width: 100%;
    flex: 0 1 auto;
  }

  .brand-logo {
    height: 32px;
    width: auto;
    max-width: 150px;
    object-fit: contain;
    flex: 0 0 auto;
  }

  .brand-divider {
    display: block;
    width: 1px;
    height: 18px;
    background: var(--border-subtle);
  }

  .brand-title {
    font-size: clamp(0.68rem, 3.3vw, 0.95rem);
    font-family: var(--font-serif);
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--gold-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    flex: 0 1 auto;
    margin: 0;
    line-height: 1.1;
  }

  /* Hide old top tabs - now cleanly handled in bottom dock */
  .mobile-nav-tabs {
    display: none !important;
  }

  /* Show Mobile Persistent Bottom Dock */
  .mobile-sticky-dock {
    display: flex;
  }

  /* Hide Desktop Floating Confirm Button on mobile */
  .floating-confirm-btn {
    display: none !important;
  }

  /* No button to align with on mobile — back to centered static flow */
  .rack-gesture-hint {
    position: static;
    margin: 12px 0 0;
    max-width: 92%;
    min-height: 0;
    text-align: center;
    justify-content: center;
  }

  /* Mobile Rack Selector in Catalog */
  .mobile-rack-selector-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 22px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border-subtle);
  }

  .mobile-section-heading {
    display: block;
    font-family: var(--font-serif);
    font-size: 0.84rem;
    font-weight: 600;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--gold-primary);
  }

  .mobile-rack-switcher {
    display: flex;
    width: 100%;
    background: var(--bg-card);
    padding: 4px;
    border-radius: 14px;
    border: 1px solid var(--border-subtle);
  }

  .mobile-rack-switcher .rack-btn {
    flex: 1 1 0;
    min-width: 0;
    flex-direction: column;
    gap: 3px;
    border-radius: 10px;
    min-height: 52px;
    padding: 8px 6px;
    font-size: 0.85rem;
    line-height: 1.15;
    text-align: center;
  }

  .mobile-rack-switcher .rack-btn span {
    white-space: nowrap;
    line-height: 1.15;
  }

  .mobile-rack-switcher .rack-sub-badge {
    font-size: 0.63rem;
    letter-spacing: 0.2px;
    white-space: normal;
    text-align: center;
    line-height: 1.15;
  }

  /* Main Workspace flows cleanly with dock padding */
  .main-workspace {
    display: block;
    height: auto;
    overflow: visible;
    padding-bottom: calc(108px + var(--safe-bottom) + 20px);
  }

  .stage-container {
    min-height: calc(100vh - 170px);
    min-height: calc(100dvh - 170px);
    padding: 14px 8px 24px;
    justify-content: flex-start;
  }

  .stage-instructions {
    position: static;
    margin-bottom: 12px;
    font-size: 0.78rem;
    padding: 6px 14px;
  }

  .stage-instructions .instruction-desktop {
    display: none;
  }

  .stage-instructions .instruction-touch {
    display: inline;
  }

  /* Stage Flank Layout on Mobile: Vertical Stack (Rack full-width on top, Loudspeakers underneath) */
  .stage-flank-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    gap: 12px;
  }

  .rack-viewport {
    width: 100%;
    max-width: min(540px, 98vw);
    aspect-ratio: 1 / 1;
    height: auto !important;
    max-height: none !important;
    margin: 0 auto;
    padding: 0 !important;
    flex-shrink: 0;
    order: 1;
  }

  .rack-viewport.is-xl {
    width: 100%;
    max-width: min(640px, 98vw);
    aspect-ratio: 1200 / 896;
  }

  .speaker-flank {
    width: 100%;
    max-width: min(540px, 98vw);
    min-width: 0;
    min-height: auto;
    margin: 0 auto;
    flex-shrink: 0;
    order: 2;
  }

  #flank-speaker-left {
    display: none !important;
  }

  .speaker-flank.is-empty {
    min-height: 46px;
    height: 46px;
    padding: 0 16px;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    border: 1.5px dashed rgba(197, 160, 89, 0.28);
    background: rgba(197, 160, 89, 0.03);
  }

  .speaker-flank-placeholder {
    font-size: 0.72rem;
    margin: 0;
    padding: 0;
    letter-spacing: 0.08em;
  }

  .placed-speaker {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6px 0;
  }

  .placed-speaker img {
    max-height: 130px;
    max-width: 80%;
    width: auto;
    height: auto;
    object-fit: contain;
  }

  /* Catalog Sidebar becomes full-width on mobile */
  .catalog-sidebar {
    height: auto;
    border-left: none;
    padding: 18px 16px 24px;
  }

  .catalog-title {
    font-size: 1.25rem;
  }

  .accordion-container {
    overflow-y: visible;
    max-height: none;
  }

  /* Toast is docked just above the sticky bar, never over it */
  .toast-notice {
    left: 12px;
    right: 12px;
    bottom: calc(var(--gn-dock-h) + 12px);
    max-width: none;
    transform: translateY(14px);
  }

  .toast-notice.show {
    transform: translateY(0);
  }

  @media (prefers-reduced-motion: reduce) {
    .toast-notice,
    .toast-notice.show {
      transform: none;
    }
  }

  /* Modal responsiveness for mobile & tablet */
  .confirm-modal-box {
    width: 96%;
    height: 92vh;
    height: 92dvh;
    max-height: none;
    border-radius: 12px;
  }

  .modal-header {
    height: 56px;
    padding: 0 16px;
  }

  .modal-title {
    font-size: 1rem;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1.2 !important;
  }

  .modal-tabs {
    display: flex;
  }

  .modal-body {
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .modal-preview-pane {
    flex: 1;
    border-right: none;
    padding: 12px;
  }

  .modal-preview-pane.is-hidden-mobile {
    display: none;
  }

  .modal-form-pane {
    flex: 1;
    padding: 16px 18px;
  }

  .modal-form-pane.is-hidden-mobile {
    display: none;
  }

  .modal-mobile-pdf-bar {
    display: flex;
  }
}

/* Smartphone Portrait (<= 600px) */
@media (max-width: 600px) {
  .app-header {
    height: 52px;
    min-height: 52px;
    padding: 0 14px;
    gap: 8px;
    flex-wrap: nowrap;
    justify-content: center;
  }

  .brand-section {
    gap: 10px;
    align-items: center;
    justify-content: center;
  }

  .brand-divider {
    display: block;
    width: 1px;
    height: 16px;
    background: var(--border-subtle);
  }

  .brand-logo {
    height: 25px;
    max-width: 95px;
  }

  .brand-title {
    font-size: clamp(0.66rem, 3.1vw, 0.88rem);
    letter-spacing: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    margin: 0;
    line-height: 1.1;
  }

  /* Nested paddings (sidebar + accordion + grid + card) were eating ~100px of a
     narrow theme container, collapsing the text column under the add button */
  .catalog-sidebar {
    padding: 18px 12px 24px;
  }

  .accordion-container {
    padding: 12px 10px;
  }

  .accordion-header {
    padding: 12px;
  }

  .acc-product-grid {
    padding: 10px 8px;
  }

  .product-card {
    grid-template-columns: 56px minmax(0, 1fr) auto;
    gap: 10px;
    padding: 10px 8px;
  }

  .prod-thumb-box {
    width: 56px;
    height: 44px;
  }

  .prod-dims {
    white-space: normal;
  }

  .prod-name {
    font-size: 0.84rem;
    line-height: 1.3;
    white-space: normal;
  }

  .prod-badge {
    font-size: 0.6rem;
  }

  .prod-dims {
    font-size: 0.63rem;
  }

  .acc-meta {
    gap: 6px;
    flex-shrink: 0;
  }

  .prod-desc {
    font-size: 0.7rem;
    -webkit-line-clamp: 2;
  }

  .btn-add-prod {
    width: 44px;
    height: 44px;
  }

  .gn-form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .selected-component-bar {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: 12px;
  }

  .sc-header {
    flex-wrap: wrap;
    gap: 8px;
    padding-bottom: 8px;
  }

  .sc-info {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    min-width: 0;
    flex: 1;
  }

  .sc-shelf {
    font-size: 0.72rem;
    white-space: normal;
  }

  .sc-header-tools {
    align-self: flex-start;
  }

  .sc-actions {
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
  }

  .sc-group {
    width: 100%;
    gap: 8px;
  }

  .sc-group-custom {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  .sc-group-custom .sc-btn {
    width: 100%;
    justify-content: flex-start;
  }

  .sc-group-position {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .sc-group-position .sc-btn.sc-switch-shelf {
    flex: 1;
    justify-content: center;
  }

  .sc-nudge-cluster {
    flex-shrink: 0;
  }

  /* Dock stays inside narrow theme containers */
  .mobile-sticky-dock {
    padding: 8px 10px calc(8px + var(--safe-bottom));
  }

  .dock-view-btn {
    font-size: 0.75rem;
    gap: 5px;
    padding: 6px 4px;
  }

  .dock-info-pill {
    padding: 8px 12px;
    font-size: 0.78rem;
    gap: 6px;
  }

  .dock-pill-count {
    font-size: 0.74rem;
  }

  .dock-confirm-btn {
    padding: 8px 16px;
    font-size: 0.84rem;
    gap: 6px;
  }
}

/* Ultra-compact screens (<= 360px) */
@media (max-width: 360px) {
  .app-header {
    height: 48px;
    min-height: 48px;
    padding: 0 8px;
    justify-content: center;
  }

  .brand-logo {
    height: 22px;
    max-width: 80px;
  }

  .brand-title {
    font-size: clamp(0.6rem, 3vw, 0.78rem);
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
  }
}

/* ==========================================================================
   Theme isolation
   The shortcode lives inside a WordPress theme whose own rules (Bootstrap-style
   .btn-primary, heading and link colours, sticky header z-indexes) reach the
   configurator and win on specificity or load order. The overlay layers are
   re-parented to <body> by configurator.js, so they are anchored here on
   #gn-cfg-portal and the in-page markup on #goldnote-configurator-root.
   ========================================================================== */

.gn-cfg-portal,
.gn-cfg-portal * {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

.gn-cfg-portal {
  position: static;
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
}

/* Above the theme's sticky header, footer and any overlay it paints */
#gn-cfg-portal .mobile-sticky-dock {
  z-index: 999990;
}

#gn-cfg-portal .toast-notice {
  z-index: 999995;
}

#gn-cfg-portal .confirm-modal-backdrop {
  z-index: 999999;
}

/* Typography and colour the theme must not repaint */
#gn-cfg-portal .modal-header-title {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

#gn-cfg-portal .modal-title,
#gn-cfg-portal .form-heading,
#gn-cfg-portal .pane-label,
#gn-cfg-portal .mobile-pdf-title,
#goldnote-configurator-root .brand-title,
#goldnote-configurator-root .catalog-title {
  font-family: var(--font-serif);
  text-shadow: none;
}

#gn-cfg-portal .modal-title {
  color: var(--text-primary) !important;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1.2 !important;
}

#gn-cfg-portal .modal-badge-id {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 !important;
  line-height: 1.2 !important;
  vertical-align: middle !important;
}

#gn-cfg-portal .form-heading {
  color: var(--text-primary) !important;
  margin: 0 0 6px 0 !important;
  padding: 0 !important;
  line-height: 1.3 !important;
}

#gn-cfg-portal .pane-label,
#gn-cfg-portal .mobile-pdf-title {
  color: var(--gold-light) !important;
}

#gn-cfg-portal .form-intro,
#gn-cfg-portal .mobile-pdf-sub,
#gn-cfg-portal .modal-tab-btn {
  color: var(--text-secondary) !important;
}

#gn-cfg-portal .modal-tab-btn.active {
  color: var(--gold-light) !important;
}

#gn-cfg-portal .form-legal-note {
  color: var(--text-muted) !important;
}

#gn-cfg-portal .gn-form-group label {
  color: var(--text-secondary) !important;
}

/* The PDF call to action is a link: theme link colours made it unreadable */
#gn-cfg-portal .btn-download-pdf {
  color: var(--gold-light) !important;
  background: rgba(197, 160, 89, 0.12);
  text-decoration: none !important;
  box-shadow: none;
}

#gn-cfg-portal .btn-download-pdf:hover,
#gn-cfg-portal .btn-download-pdf:active,
#gn-cfg-portal .btn-download-pdf:focus {
  color: #0b0c10 !important;
  background: var(--gold-primary);
  text-decoration: none !important;
}

/* .btn-primary / .btn-secondary collide by name with the theme's own buttons */
#gn-cfg-portal .btn-primary,
#goldnote-configurator-root .btn-primary {
  background: linear-gradient(135deg, var(--gold-dark), var(--gold-primary)) !important;
  color: #0b0c10 !important;
  border: none !important;
  border-radius: 8px;
  font-family: var(--font-sans);
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: none;
  text-shadow: none;
  min-height: 44px;
}

#gn-cfg-portal .btn-secondary,
#goldnote-configurator-root .btn-secondary {
  background: transparent !important;
  color: var(--text-secondary) !important;
  border: 1px solid var(--border-subtle) !important;
  border-radius: 8px;
  font-family: var(--font-sans);
  text-transform: none;
  text-shadow: none;
  min-height: 44px;
}

#gn-cfg-portal .gn-input,
#gn-cfg-portal .gn-textarea {
  color: var(--text-primary) !important;
  font-family: var(--font-sans);
}

/* The PDF call to action must stay on one line inside its bar */
#gn-cfg-portal .btn-download-pdf {
  white-space: nowrap;
  flex: 0 0 auto;
}

#gn-cfg-portal .modal-mobile-pdf-bar {
  flex-wrap: wrap;
}

#gn-cfg-portal .mobile-pdf-info {
  flex: 1 1 160px;
  min-width: 0;
}

/* Wording that differs by input type (pointer vs touch) */
.gn-on-touch {
  display: none;
}

@media (hover: none), (max-width: 900px) {
  .gn-on-desktop {
    display: none;
  }

  .gn-on-touch {
    display: inline;
  }
}

/* ==========================================================================
   Rack affordances
   ========================================================================== */

.rack-gesture-hint {
  position: absolute;
  left: 28px;
  bottom: 24px;
  margin: 0;
  max-width: calc(100% - 260px);
  min-height: 48px;
  display: flex;
  align-items: center;
  font-size: 0.78rem;
  line-height: 1.4;
  letter-spacing: 0.2px;
  color: var(--text-muted);
  text-align: left;
  z-index: 55;
}

/* Only the filter is animated: the drag writes an inline transform on the same
   element, and animating transform here would fight it mid-gesture. */
@keyframes gn-hint-pulse {
  0%, 100% {
    filter: drop-shadow(0 0 0 rgba(197, 160, 89, 0)) brightness(1);
  }
  50% {
    filter: drop-shadow(0 0 18px var(--gold-glow-strong)) brightness(1.14);
  }
}

.placed-component.is-hinting {
  animation: gn-hint-pulse 0.9s ease-in-out 3;
}

@media (prefers-reduced-motion: reduce) {
  .placed-component.is-hinting {
    animation: none;
    outline: 2px solid var(--gold-light);
    outline-offset: 3px;
  }
}

/* ==========================================================================
   Contact Form 7 integration
   CF7 wraps every field in its own markup and appends a spinner and a response
   area that the plugin's form never had, none of which is styled for a dark panel.
   ========================================================================== */

#gn-cfg-portal .wpcf7-form-control-wrap {
  display: block;
  width: 100%;
}

/* The spinner is a flex item inside .form-actions: left to stretch it reserves a
   full-width empty strip above the legal note. */
#gn-cfg-portal .wpcf7-spinner {
  align-self: center;
  margin: 0;
}

#gn-cfg-portal .wpcf7-response-output {
  margin: 14px 0 0;
  padding: 10px 14px;
  border: 1px solid var(--border-gold);
  border-radius: 8px;
  background: rgba(197, 160, 89, 0.08);
  color: var(--text-primary) !important;
  font-size: 0.8rem;
  line-height: 1.4;
  text-align: center;
}

#gn-cfg-portal .wpcf7-form.invalid .wpcf7-response-output,
#gn-cfg-portal .wpcf7-form.failed .wpcf7-response-output {
  border-color: var(--danger-color);
  background: rgba(231, 76, 60, 0.12);
}

/* CF7's default validation red is unreadable on the dark panel */
#gn-cfg-portal .wpcf7-not-valid-tip {
  display: block;
  margin-top: 4px;
  color: #ff8a7a !important;
  font-size: 0.72rem;
  font-weight: 500;
}

#gn-cfg-portal .gn-input.wpcf7-not-valid,
#gn-cfg-portal .gn-textarea.wpcf7-not-valid {
  border-color: var(--danger-color);
}

#gn-cfg-portal input.wpcf7-submit {
  width: 100%;
  padding: 13px;
  cursor: pointer;
}

/* ==========================================================================
   Cartridge selector (per turntable) — v1.7.0
   Cartridges have no rack footprint: they are picked on the placed turntable
   (badge + overlay button on desktop, selected-component bar on touch) and the
   picker is a sheet re-parented to #gn-cfg-portal, so it is anchored there.
   ========================================================================== */

.comp-btn.pick-cartridge:hover {
  background: var(--gold-primary);
  border-color: var(--gold-primary);
  color: #0b0c10;
}

.comp-accessories-wrap {
  position: absolute;
  left: 50%;
  bottom: 2%;
  transform: translateX(-50%);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 4px 6px;
  width: max-content;
  max-width: min(380px, 140%);
  z-index: 22;
  pointer-events: auto;
}

.comp-acc-badge {
  padding: 2.5px 8px;
  border-radius: 999px;
  background: rgba(18, 20, 26, 0.94);
  border: 1px solid var(--border-gold);
  color: var(--gold-light);
  font-size: 0.63rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  box-sizing: border-box;
  transition: all 0.2s;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
}

.comp-acc-badge .badge-icon,
.comp-acc-badge .finish-badge-dot {
  flex-shrink: 0;
}

.comp-acc-badge .badge-text {
  flex-shrink: 0;
  white-space: nowrap;
}

.comp-acc-badge:hover {
  background: var(--gold-primary);
  color: #0b0c10;
  border-color: var(--gold-light);
}

.comp-cartridge-badge {
  position: absolute;
  left: 50%;
  bottom: 2%;
  transform: translateX(-50%);
  max-width: 90%;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(18, 20, 26, 0.92);
  border: 1px solid var(--border-gold);
  color: var(--gold-light);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
  z-index: 21;
}

#gn-cfg-portal .gn-cart-picker {
  position: fixed;
  inset: 0;
  z-index: 999992;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(5, 6, 9, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

#gn-cfg-portal .gn-cart-picker.is-open {
  opacity: 1;
  pointer-events: auto;
}

#gn-cfg-portal .gn-cart-sheet {
  width: 100%;
  max-width: 460px;
  max-height: min(640px, 100%);
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--border-gold);
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
  color: var(--text-primary);
  font-family: var(--font-sans);
  overflow: hidden;
  transform: translateY(8px);
  transition: transform 0.25s ease;
}

#gn-cfg-portal .gn-cart-picker.is-open .gn-cart-sheet {
  transform: none;
}

#gn-cfg-portal .gn-cart-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--border-subtle);
}

#gn-cfg-portal .gn-cart-eyebrow {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

#gn-cfg-portal .gn-cart-title {
  margin: 2px 0 0;
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 400;
  line-height: 1.2;
  color: var(--gold-light);
  text-shadow: none;
}

#gn-cfg-portal .gn-cart-close {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
}

#gn-cfg-portal .gn-cart-close:hover {
  border-color: var(--border-gold);
  color: var(--gold-light);
}

#gn-cfg-portal .gn-cart-list {
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  -webkit-overflow-scrolling: touch;
}

#gn-cfg-portal .gn-cart-option {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 10px 12px;
  text-align: left;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-primary);
  font-family: var(--font-sans);
  cursor: pointer;
  touch-action: manipulation;
  transition: border-color 0.2s, background 0.2s;
}

#gn-cfg-portal .gn-cart-option:hover,
#gn-cfg-portal .gn-cart-option:focus-visible {
  background: var(--bg-card-hover);
  border-color: var(--border-gold);
  outline: none;
}

#gn-cfg-portal .gn-cart-option.is-selected {
  border-color: var(--gold-primary);
  background: rgba(197, 160, 89, 0.1);
}

#gn-cfg-portal .gn-cart-option.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  border-color: rgba(255, 255, 255, 0.05);
  background: rgba(0, 0, 0, 0.2);
  pointer-events: none;
}
#gn-cfg-portal .gn-cart-option.is-disabled:hover {
  background: rgba(0, 0, 0, 0.2);
  border-color: rgba(255, 255, 255, 0.05);
}

#gn-cfg-portal .gn-cart-thumb {
  flex-shrink: 0;
  width: 72px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#gn-cfg-portal .gn-cart-thumb img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

#gn-cfg-portal .gn-cart-none-mark {
  color: var(--text-muted);
  font-size: 1.4rem;
}

#gn-cfg-portal .gn-cart-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

#gn-cfg-portal .gn-cart-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

#gn-cfg-portal .gn-cart-type {
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid var(--border-gold);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--gold-light);
  vertical-align: 1px;
}

#gn-cfg-portal .gn-cart-desc {
  font-size: 0.76rem;
  line-height: 1.4;
  color: var(--text-secondary);
}

@media (max-width: 900px) {
  #gn-cfg-portal .gn-cart-picker {
    align-items: flex-end;
    padding: 0;
  }

  #gn-cfg-portal .gn-cart-sheet {
    max-width: none;
    max-height: 82%;
    border-radius: 16px 16px 0 0;
    padding-bottom: var(--safe-bottom);
  }
}

/* ==========================================================================
   PRODUCT & RACK COLOR FINISHES (v1.7.5)
   ========================================================================== */

/* Finish Swatch in Cards and Sheets */
.finish-swatch-circle {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  display: inline-block;
  vertical-align: middle;
}

/* Finish Swatches Row in Catalog Cards */
.prod-finishes-row {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.prod-finishes-header {
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary, #a0a5b5);
  font-weight: 600;
}
.prod-finishes-dots {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.prod-finish-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  color: var(--text-primary, #e2e4ea);
  background: rgba(255, 255, 255, 0.04);
  padding: 2px 7px 2px 5px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.2s ease;
  cursor: pointer;
}
.prod-finish-tag:hover {
  border-color: var(--border-gold, #c5a059);
  background: rgba(197, 160, 89, 0.15);
  color: #fff;
}
.prod-finish-tag .finish-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}
.prod-finish-tag .finish-label {
  font-size: 0.7rem;
  font-weight: 500;
}

/* Rack Finish Switcher Bar */
.rack-finish-bar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  background: rgba(18, 20, 26, 0.7);
  border: 1px solid rgba(197, 160, 89, 0.25);
  border-radius: 20px;
  font-size: 0.75rem;
  margin-left: 12px;
}
.rack-finish-title {
  color: var(--gold-light, #d8b775);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.rack-finish-options {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.rack-finish-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text-primary, #e0e0e0);
  font-size: 0.72rem;
  cursor: pointer;
  transition: all 0.2s ease;
}
.rack-finish-btn:hover {
  border-color: var(--border-gold, #c5a059);
  background: rgba(197, 160, 89, 0.15);
  color: #fff;
}
.rack-finish-btn.is-active {
  border-color: var(--gold-primary, #c5a059);
  background: rgba(197, 160, 89, 0.25);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 0 10px rgba(197, 160, 89, 0.25);
}
.rack-finish-btn .finish-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  flex-shrink: 0;
}

@media (max-width: 900px) {
  .rack-finish-bar.desktop-rack-finish-bar {
    display: none !important;
  }
  .rack-finish-bar.mobile-rack-finish-bar {
    display: flex;
    margin-left: 0;
    margin-top: 8px;
    width: 100%;
    justify-content: space-between;
    box-sizing: border-box;
  }
}

/* Placed component finish badge and toolbar */
.finish-btn-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.4);
  vertical-align: middle;
  margin-right: 5px;
}
.finish-badge-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  min-width: 8px;
  min-height: 8px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.4);
  vertical-align: middle;
  margin-right: 4px;
}

/* Finish Photo Preview in Modal Sheets - Optimized for 200x200px images (Zero blur, anti-pixelation) */
#gn-cfg-portal .finish-photo-thumb {
  width: 72px;
  height: 72px;
  min-width: 72px;
  min-height: 72px;
  max-width: 80px;
  max-height: 80px;
  aspect-ratio: 1 / 1;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 45%, rgba(255, 255, 255, 0.07) 0%, rgba(18, 20, 26, 0.82) 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 6px;
  box-sizing: border-box;
  overflow: hidden;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.08), 0 2px 8px rgba(0, 0, 0, 0.4);
}

#gn-cfg-portal .finish-photo-thumb img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: auto;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.6));
  transform: translateZ(0);
  backface-visibility: hidden;
  transition: transform 0.25s ease;
}

#gn-cfg-portal .gn-cart-option.has-photo {
  min-height: 84px;
  gap: 16px;
  padding: 10px 14px;
  align-items: center;
}

#gn-cfg-portal .gn-cart-option.has-photo:hover .finish-photo-thumb,
#gn-cfg-portal .gn-cart-option.has-photo.is-selected .finish-photo-thumb {
  border-color: var(--gold-primary, #c5a059);
  background: radial-gradient(circle at 50% 45%, rgba(197, 160, 89, 0.15) 0%, rgba(18, 20, 26, 0.88) 100%);
  box-shadow: 0 0 16px rgba(197, 160, 89, 0.3), inset 0 1px 2px rgba(255, 255, 255, 0.1);
}

#gn-cfg-portal .gn-cart-option.has-photo:hover .finish-photo-thumb img,
#gn-cfg-portal .gn-cart-option.has-photo.is-selected .finish-photo-thumb img {
  transform: scale(1.06) translateZ(0);
}

#gn-cfg-portal .gn-cart-name .finish-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  vertical-align: middle;
  margin-right: 6px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

/* Cartridge square thumbnail handling in sidebar */
.accordion-item[data-category-id="cartridge"] .prod-thumb-box,
.product-card[data-category="cartridge"] .prod-thumb-box {
  width: 64px;
  height: 64px;
  aspect-ratio: 1 / 1;
  padding: 4px;
}

.accordion-item[data-category-id="cartridge"] .prod-thumb-box img,
.product-card[data-category="cartridge"] .prod-thumb-box img {
  image-rendering: -webkit-optimize-contrast;
  image-rendering: auto;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.45));
  transform: translateZ(0);
}

@media (max-width: 640px) {
  #gn-cfg-portal .finish-photo-thumb {
    width: 60px;
    height: 60px;
    min-width: 60px;
    min-height: 60px;
    padding: 4px;
    border-radius: 8px;
  }
  #gn-cfg-portal .gn-cart-option.has-photo {
    min-height: 72px;
    gap: 12px;
    padding: 8px 12px;
  }
}

/* ==========================================================================
   UNIFIED LOUDSPEAKER CONFIGURATION MODAL (Setup + Finish)
   ========================================================================== */

#sc-speaker-support {
  display: none !important;
}

#gn-cfg-portal .gn-speaker-modal-sheet {
  max-width: 520px;
  max-height: min(720px, 92vh);
}

.gn-spk-modal-body {
  overflow-y: auto;
  padding: 16px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  -webkit-overflow-scrolling: touch;
}

.gn-spk-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gn-spk-section-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--gold-primary);
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.gn-spk-badge-hint {
  font-size: 0.65rem;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  text-transform: none;
  font-weight: normal;
}

.gn-spk-supports-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gn-spk-support-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  text-align: left;
}

.gn-spk-support-card:hover {
  border-color: var(--border-gold);
  background: rgba(197, 160, 89, 0.06);
}

.gn-spk-support-card.is-selected {
  border-color: var(--gold-primary);
  background: rgba(197, 160, 89, 0.12);
  box-shadow: 0 0 0 1px var(--gold-primary);
}

.gn-spk-support-thumb {
  width: 58px;
  height: 58px;
  min-width: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  border-radius: 6px;
  padding: 4px;
  box-sizing: border-box;
}

.gn-spk-support-thumb img {
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.6));
}

.gn-spk-support-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.gn-spk-support-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.gn-spk-support-desc {
  font-size: 0.72rem;
  color: var(--text-secondary);
  line-height: 1.3;
}

.gn-spk-support-dims {
  font-size: 0.68rem;
  color: var(--gold-light);
  opacity: 0.85;
  margin-top: 2px;
}

.gn-spk-check-mark {
  width: 20px;
  height: 20px;
  min-width: 20px;
  border-radius: 50%;
  border: 1.5px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: transparent;
  transition: all 0.2s;
  box-sizing: border-box;
}

.gn-spk-support-card.is-selected .gn-spk-check-mark {
  border-color: var(--gold-primary);
  background: var(--gold-primary);
  color: #0b0c10;
  font-weight: 700;
}

.gn-spk-finishes-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.gn-spk-finish-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.gn-spk-finish-chip:hover {
  border-color: var(--border-gold);
  background: rgba(197, 160, 89, 0.06);
}

.gn-spk-finish-chip.is-selected {
  border-color: var(--gold-primary);
  background: rgba(197, 160, 89, 0.15);
  box-shadow: 0 0 0 1px var(--gold-primary);
}

.gn-spk-finish-dot {
  width: 14px;
  height: 14px;
  min-width: 14px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.4);
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.gn-spk-finish-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: #fff;
}

.gn-spk-chip-check {
  font-size: 0.75rem;
  color: var(--gold-primary);
  opacity: 0;
  margin-left: 2px;
  font-weight: bold;
  transition: opacity 0.15s;
}

.gn-spk-finish-chip.is-selected .gn-spk-chip-check {
  opacity: 1;
}

.gn-spk-modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: rgba(18, 20, 26, 0.95);
}

.gn-spk-btn-cancel {
  padding: 9px 18px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.gn-spk-btn-cancel:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
}

.gn-spk-btn-apply {
  padding: 9px 24px;
  border-radius: 6px;
  border: 1px solid var(--gold-primary);
  background: var(--gold-primary);
  color: #0b0c10;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 14px rgba(197, 160, 89, 0.25);
}

.gn-spk-btn-apply:hover {
  background: #d4b06a;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(197, 160, 89, 0.35);
}

