/* ==========================================================================
   Kodxx Configurator — Clean White Professional
   Mimics premium product configurator: white bg, large square swatches,
   dark selection borders with checkmarks, generous whitespace.
   ========================================================================== */


/* ==========================================================================
   1. FOUNDATIONS
   ========================================================================== */

body {
  padding-bottom: 0 !important;
  --footer-height: 0px;
  font-family: 'Inter', -apple-system, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

#main-container {
  flex: 1;
  min-height: 0;
  background: #f0f0f0;
  height: 100vh !important;
  border: none !important;
}

#viewer-container {
  height: 100% !important;
  background: #f0f0f0 !important;
  border: none !important;
  outline: none !important;
}

#viewer-container canvas {
  outline: none !important;
  border: none !important;
}

#buildLoadingOverlay.hidden {
  display: none !important;
}


/* ==========================================================================
   2. CONTROLS PANEL — Clean white, generous padding
   ========================================================================== */

#controls {
  background: #ffffff !important;
  border-left: 1px solid #ebebeb !important;
  border-top: none !important;
  padding: 0 !important;
  width: 400px !important;
  box-shadow: none;
  overflow-y: auto;
}

/* Tablet / foldable (769px–1024px): narrower controls */
@media (min-width: 769px) and (max-width: 1024px) {
  #controls {
    width: 300px !important;
  }
}

/* --- Control Groups: section with divider lines --- */
.control-group-container {
  border-bottom: 1px solid #ebebeb !important;
  padding: 24px 24px 20px !important;
  margin-bottom: 0 !important;
  background: transparent;
  border-radius: 0;
}

.control-group-container:last-child {
  border-bottom: none !important;
}

/* --- Control Wrapper --- */
.control-wrapper {
  border-bottom: 1px solid #f0f0f0 !important;
  padding-bottom: 20px !important;
  margin-bottom: 16px !important;
}

.control-wrapper:last-child {
  border-bottom: none !important;
  padding-bottom: 0 !important;
  margin-bottom: 0 !important;
}

/* --- Top Row --- */
.control-top-row {
  margin-top: 0 !important;
  margin-bottom: 12px;
}

/* --- Labels --- */
.control-label {
  color: #1a1a1a !important;
  font-weight: 600 !important;
  font-size: 0.9rem !important;
  letter-spacing: -0.02em;
}

.value-display {
  color: #1a1a1a !important;
  font-weight: 600 !important;
  font-size: 0.9rem !important;
  font-variant-numeric: tabular-nums;
}

.range-details {
  color: #999 !important;
  font-size: 0.72rem !important;
}


/* ==========================================================================
   3. CONTROL TABS — Clean segmented, no glass
   ========================================================================== */

#control-tabs {
  display: inline-flex;
  gap: 0;
  overflow-x: auto;
  white-space: nowrap;
  overflow: hidden;
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  background: #ffffff;
  border: 1px solid #e5e5e5;
  backdrop-filter: none;
}

@media (min-width: 769px) {
  #control-tabs {
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    max-width: calc(100% - 20px);
  }
}

.control-tab {
  padding: 10px 24px;
  background: transparent;
  cursor: pointer;
  user-select: none;
  font-weight: 500;
  transition: all 0.15s ease;
  font-size: 0.88rem;
  white-space: nowrap;
  color: #888;
  letter-spacing: -0.01em;
  border: none;
}

.control-tab + .control-tab {
  border-left: 1px solid #e5e5e5;
}

.control-tab:hover {
  color: #333;
  background: #fafafa;
}

.control-tab.active {
  background: var(--accent-color, #1a1a1a);
  color: #ffffff;
  font-weight: 600;
}

.control-tab.run-tab {
  color: #888;
}

.control-tab.run-tab:hover {
  color: #333;
  background: #fafafa;
}

.control-tab.run-tab.active {
  background: var(--accent-color, #1a1a1a);
  color: #ffffff;
  font-weight: 600;
}

#control-tabs .control-tab.first-visible {
  border-top-left-radius: 10px;
  border-bottom-left-radius: 10px;
}

#control-tabs .control-tab.last-visible {
  border-top-right-radius: 10px;
  border-bottom-right-radius: 10px;
}


/* ==========================================================================
   4a. MOQ WARNING BADGE
   ========================================================================== */

#moq-warning-floating {
  position: absolute;
  left: 50%;
  bottom: 60px;
  transform: translateX(-50%);
  background: color-mix(in srgb, var(--accent-color, #ffc107) 8%, #fff);
  border: 1px solid color-mix(in srgb, var(--accent-color, #ffc107) 40%, #fff);
  border-radius: 60px;
  padding: 6px 14px;
  font-size: 13px;
  color: var(--accent-color, #856404);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  z-index: 10;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

#moq-warning-floating .moq-warning-text {
  color: var(--accent-color, #856404);
}

#moq-warning-floating .moq-warning-icon {
  font-size: 18px;
}

#moq-warning-floating .moq-warning-text {
  font-weight: 500;
  font-size: 12px;
}


/* ==========================================================================
   4b. BUILD SIZE BADGE
   ========================================================================== */

#build-size-floating {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  font-size: 0.82rem;
  padding: 8px 20px;
  color: #666;
  border-radius: 8px;
  pointer-events: none;
  z-index: 10;
  white-space: nowrap;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  border: 1px solid #e5e5e5;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}


/* ==========================================================================
   5. CREATOR LOGO
   ========================================================================== */

#creator-logo {
  position: absolute;
  left: 16px;
  bottom: 14px;
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  z-index: 10;
}

#creator-logo .powered {
  font-size: 9px;
  font-weight: 500;
  color: #999;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

#creator-logo .brand {
  font-size: 13px;
  font-weight: 700;
  color: #333;
  letter-spacing: 0.2px;
}


/* ==========================================================================
   6. THUMBNAIL GRID
   ========================================================================== */

.thumbnail-select {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 10px !important;
}

.thumbnail-button {
  width: auto !important;
  background: #ffffff !important;
  border: 2px solid #e5e5e5 !important;
  border-radius: 12px !important;
  transition: all 0.2s ease !important;
  box-shadow: none !important;
}

.thumbnail-button:hover {
  border-color: #bbb !important;
  background: #fafafa !important;
}

.thumbnail-button.active {
  border-color: #1a1a1a !important;
  border-width: 3px !important;
  background: #ffffff !important;
}

.thumbnail-button.active .thumbnail-label {
  color: #1a1a1a !important;
  font-weight: 700 !important;
}

.thumbnail-button.active .thumbnail-subtext,
.thumbnail-button.active .thumbnail-subdesc {
  color: #1a1a1a !important;
}

.thumbnail-label {
  color: #333;
  font-weight: 500;
  font-size: 0.75rem;
}

/* fullImageLarge — card-style tiles (matches child-tile appearance) */
.thumbnail-select:has(.thumbnail-button.fullImageLarge) {
  grid-template-columns: repeat(2, 1fr) !important;
}

.thumbnail-button.fullImageLarge {
  border: 1px solid transparent !important;
  border-radius: 8px !important;
  background: #f5f5f5 !important;
  padding: 4px 3px 3px !important;
  aspect-ratio: auto !important;
  box-shadow: none !important;
}

.thumbnail-button.fullImageLarge:hover {
  background: #ececec !important;
  border-color: transparent !important;
}

.thumbnail-button.fullImageLarge.active {
  background: #ffffff !important;
  border-color: #1a1a1a !important;
  border-width: 2px !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1) !important;
}

.thumbnail-button.fullImageLarge .thumbnail-label {
  font-weight: 400 !important;
  color: #666 !important;
  font-size: 0.7rem !important;
}

.thumbnail-button.fullImageLarge.active .thumbnail-label {
  color: #1a1a1a !important;
  font-weight: 600 !important;
}

/* Mobile: 4 columns, compact tiles */
@media (max-width: 768px) {
  .thumbnail-select:has(.thumbnail-button.fullImageLarge) {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 6px !important;
  }

  .thumbnail-button.fullImageLarge {
    padding: 4px 2px 3px !important;
    border-radius: 6px !important;
  }

  .thumbnail-button.fullImageLarge .thumbnail-label {
    font-size: 0.58rem !important;
  }

  .thumbnail-icon.fullImageLarge {
    width: 100% !important;
    height: auto !important;
  }

  /* Colour select modal: 3 columns, smaller swatches */
  .color-select-modal-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 0.8rem !important;
    padding: 1rem 1rem 1.25rem !important;
  }

  .color-select-modal-thumb {
    width: 56px !important;
    height: 56px !important;
  }

  .color-select-modal-item {
    padding: 10px 6px 8px !important;
    border-radius: 12px !important;
  }

  .color-select-modal-name {
    font-size: 0.72rem !important;
    font-weight: 500 !important;
  }

  .color-select-modal-meta {
    font-size: 0.6rem !important;
  }
}

.thumbnail-subtext {
  color: #888;
  font-size: 0.62rem;
}

.thumbnail-subdesc {
  color: #aaa;
  font-size: 0.52rem;
}


/* ==========================================================================
   7. SLIDER BUTTONS
   ========================================================================== */

.slider-button-group {
  gap: 8px !important;
}

.slider-button {
  border: 1.5px solid #d4d4d4 !important;
  color: #666 !important;
  background: #ffffff !important;
  border-radius: 8px !important;
  font-size: 0.82rem !important;
  font-weight: 500 !important;
  padding: 8px 16px !important;
  transition: all 0.15s ease !important;
}

.slider-button:hover {
  border-color: #1a1a1a !important;
  color: #1a1a1a !important;
  background: #fafafa !important;
}

.slider-button.active {
  background: #1a1a1a !important;
  border-color: #1a1a1a !important;
  color: #fff !important;
}


/* ==========================================================================
   8. COLOR SWATCH OVERRIDES
   ========================================================================== */

.color-select-expand {
  border-color: #d4d4d4 !important;
  color: #999 !important;
}

.color-select-expand:hover {
  border-color: #999 !important;
  color: #666 !important;
  background: #f7f7f7 !important;
}

.color-group-label {
  color: #999 !important;
  font-weight: 600 !important;
  text-transform: uppercase !important;
  font-size: 0.68rem !important;
  letter-spacing: 0.1em !important;
  margin-bottom: 8px !important;
}

.color-select-modal-trigger {
  color: #1a1a1a !important;
  font-weight: 500 !important;
  font-size: 0.78rem !important;
  background: none !important;
  border: none !important;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.color-select-modal-trigger:hover {
  color: #000 !important;
}


/* ==========================================================================
   9. SWITCH LABEL
   ========================================================================== */

.md3-switch-label {
  color: #333 !important;
  font-size: 0.9rem !important;
}


/* ==========================================================================
   10. SPIN PILLS
   ========================================================================== */

.spin-pill {
  border: 1.5px solid #d4d4d4 !important;
  color: #666 !important;
  background: #ffffff !important;
  border-radius: 8px !important;
  font-weight: 500 !important;
  transition: all 0.15s ease !important;
}

.spin-pill:hover {
  border-color: #1a1a1a !important;
  color: #1a1a1a !important;
  background: #fafafa !important;
}

.spin-pill.active {
  background: var(--accent-color, #085995) !important;
  border-color: var(--accent-color, #085995) !important;
  color: #fff !important;
}

.spin-pill:hover {
  border-color: var(--accent-color, #085995) !important;
  color: #085995 !important;
  background: #f0f6fb !important;
}

.spin-control-label {
  color: #888 !important;
  font-weight: 500 !important;
  font-size: 0.75rem !important;
}

/* --- Themed switch --- */
.md3-switch input:checked + .md3-switch-track {
  background: var(--md3-switch-track-checked, var(--accent-color, #085995)) !important;
}

/* --- Themed slider track and thumb (uses style-variant vars) --- */
.md3-slider .styled-slider {
  background-image: linear-gradient(
    to right,
    var(--md3-slider-track-active, var(--accent-color, #085995)) 0%,
    var(--md3-slider-track-active, var(--accent-color, #085995)) var(--progress, 0%),
    var(--md3-slider-track, #e0e0e0) var(--progress, 0%),
    var(--md3-slider-track, #e0e0e0) 100%
  ) !important;
}

.md3-slider .styled-slider::-webkit-slider-thumb {
  background: var(--md3-slider-thumb, var(--accent-color, #085995)) !important;
}

.md3-slider .styled-slider:active::-webkit-slider-thumb {
  box-shadow: 0 0 0 6px var(--md3-slider-focus, rgba(8, 89, 149, 0.12)), 0 1px 4px rgba(0, 0, 0, 0.15) !important;
}

.md3-slider .styled-slider::-moz-range-thumb {
  background: var(--md3-slider-thumb, var(--accent-color, #085995)) !important;
}

.slider-inc-btn:hover {
  background: color-mix(in srgb, var(--accent-color, #085995) 10%, #fff) !important;
  border-color: var(--md3-slider-thumb, var(--accent-color, #085995)) !important;
  color: var(--md3-slider-thumb, var(--accent-color, #085995)) !important;
}


/* ==========================================================================
   11. CHILD PARTS / ACCESSORIES
   ========================================================================== */

.child-parts-panel {
  margin-top: 0 !important;
}

.child-parts-title {
  display: none !important;
}

.child-group-title {
  color: #333 !important;
  font-weight: 600 !important;
  font-size: 0.85rem !important;
}

.child-group-tiles {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)) !important;
  gap: 8px !important;
}

.child-tile {
  width: auto !important;
  min-width: 0 !important;
  max-width: 100% !important;
  overflow: hidden !important;
  border: 2px solid #e5e5e5 !important;
  background: #ffffff !important;
  border-radius: 12px !important;
  box-shadow: none !important;
  transition: all 0.2s ease !important;
}

.child-tile:hover {
  border-color: #bbb !important;
  background: #fafafa !important;
}

.child-tile.active {
  border-color: #1a1a1a !important;
  border-width: 3px !important;
  background: #ffffff !important;
}

.child-tile-img {
  display: block !important;
  width: 90% !important;
  height: auto !important;
  aspect-ratio: 1 / 1 !important;
  object-fit: contain !important;
  background: #f5f5f5;
  border-radius: 6px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.child-tile-img.loaded {
  opacity: 1;
}

.child-tile-label {
  color: #666 !important;
  font-size: 0.72rem !important;
  font-weight: 500 !important;
}

.child-tile.active .child-tile-label {
  color: #1a1a1a !important;
  font-weight: 700 !important;
}


/* ==========================================================================
   12. CONTROL GUIDANCE REGION
   ========================================================================== */

#control-guidance-region {
  position: relative;
  margin: 8px auto 0;
  padding: 0 16px;
  width: 100%;
  max-width: 640px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 6;
  pointer-events: none;
}

#control-guidance-region > * {
  pointer-events: auto;
}

@media (min-width: 769px) {
  #control-guidance-region {
    position: absolute;
    top: 72px;
    left: 50%;
    transform: translateX(-50%);
    margin: 0;
    padding: 0;
    width: min(600px, calc(100% - 120px));
  }
}


/* ==========================================================================
   13. CONTEXT MENU PILL
   ========================================================================== */

.context-menu-pill {
  position: fixed;
  top: 0;
  left: 0;
  display: none;
  flex-direction: row;
  align-items: center;
  gap: 0;
  padding: 6px;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.04);
  border: none;
  z-index: 2000;
  pointer-events: auto;
  transition: opacity 0.2s ease, transform 0.2s ease;
  opacity: 0;
  transform: scale(0.95);
  overflow: visible;
}

.context-menu-pill.is-visible {
  display: flex;
  opacity: 1;
  transform: scale(1);
}

.context-menu-pill .tooltip::after,
.context-menu-pill .tooltip::before {
  z-index: 2001;
}

.context-menu-btn {
  display: none;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: transparent;
  color: #333;
  font-size: 24px;
  font-weight: 500;
  line-height: 1;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  pointer-events: auto;
  transition: all 0.15s ease;
  position: relative;
  border: none;
}

.context-menu-btn[data-enabled="true"] {
  display: flex;
}

.context-menu-btn:hover {
  background: #f5f5f5;
  color: #1a1a1a;
}

.context-menu-btn:focus-visible {
  outline: 2px solid rgba(26, 26, 26, 0.3);
  outline-offset: 2px;
}

.context-menu-btn .material-symbols-outlined {
  font-size: 24px;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

.context-menu-btn + .context-menu-btn[data-enabled="true"]::before {
  content: '';
  position: absolute;
  left: -3px;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 24px;
  background: #e5e5e5;
}

.context-rotate-btn.is-active {
  background: #1a1a1a;
  color: #ffffff;
}

.context-rotate-btn.is-active:hover {
  background: #333;
}

.context-delete-btn:hover {
  background: #fef2f2;
  color: #dc2626;
}

.context-swap-btn:hover {
  background: #f5f5f5;
  color: #1a1a1a;
}


/* ==========================================================================
   14. DRESSING WIZARD PILL
   ========================================================================== */

.dw-context-pill .dw-ctx-rotate-btn.is-active,
.dw-context-pill .dw-ctx-move-btn.is-active,
.dw-context-pill .dw-ctx-scale-btn.is-active {
  background: #1a1a1a;
  color: #ffffff;
}

.dw-context-pill .dw-ctx-rotate-btn.is-active:hover,
.dw-context-pill .dw-ctx-move-btn.is-active:hover,
.dw-context-pill .dw-ctx-scale-btn.is-active:hover {
  background: #333;
}

.dw-context-pill .dw-ctx-delete-btn:hover {
  background: #fef2f2;
  color: #dc2626;
}


/* ==========================================================================
   15. UTILITIES PANEL
   ========================================================================== */

.utilities-panel__tab.is-active {
  color: #1a1a1a !important;
  border-bottom-color: #1a1a1a !important;
}


/* ==========================================================================
   16. SCROLLBAR
   ========================================================================== */

#controls::-webkit-scrollbar {
  width: 6px;
}

#controls::-webkit-scrollbar-track {
  background: transparent;
}

#controls::-webkit-scrollbar-thumb {
  background: #d4d4d4;
  border-radius: 3px;
}

#controls::-webkit-scrollbar-thumb:hover {
  background: #bbb;
}

/* ==========================================================================
   12. MOBILE PRICE BAR
   ========================================================================== */

.mobile-price-bar {
  display: none;
}

@media (max-width: 768px) {
  .mobile-price-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 200;
    background: #ffffff;
    border-top: 1px solid #e5e7eb;
    padding: 10px 16px;
    gap: 12px;
    box-sizing: border-box;
  }

  .mobile-price-bar-price {
    display: flex;
    flex-direction: column;
    min-width: 0;
  }

  .mobile-price-bar-label {
    font-size: 0.7rem;
    color: #90a4ae;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }

  .mobile-price-bar-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1.2;
  }

  .mobile-price-bar-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 24px;
    background: var(--accent-color, #1e88e5);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .mobile-price-bar-btn .material-symbols-outlined {
    font-size: 1.1rem;
  }

  .mobile-price-bar-btn:active {
    transform: scale(0.97);
  }
}

/* ==========================================================================
   13. MOBILE FULLSCREEN MODE
   ========================================================================== */

@media (max-width: 768px) {
  /* Disable tooltips on mobile — they block touch interaction */
  .tooltip::after,
  .tooltip::before {
    display: none !important;
  }

  /* Smooth transitions for fullscreen toggle */
  body:not(.compact-embed) #viewer-container,
  #viewer-container,
  #controls,
  #control-tabs,
  .floating-toolbar {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1) !important;
  }

  body.kodxx-fullscreen #controls {
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    overflow: hidden !important;
    padding: 0 !important;
    border: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }

  body.kodxx-fullscreen #control-tabs {
    height: 0 !important;
    overflow: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }

  body.kodxx-fullscreen .simple-header {
    display: none !important;
  }

  body:not(.compact-embed).kodxx-fullscreen #viewer-container,
  body.kodxx-fullscreen #viewer-container {
    height: calc(100dvh - 110px) !important;
    max-height: calc(100dvh - 110px) !important;
    top: 0 !important;
  }

  body:not(.compact-embed).kodxx-fullscreen #viewer-container canvas,
  body.kodxx-fullscreen #viewer-container canvas {
    max-height: calc(100dvh - 110px) !important;
  }

  body:not(.compact-embed).kodxx-fullscreen .floating-toolbar,
  body.kodxx-fullscreen .floating-toolbar {
    top: auto !important;
    bottom: 60px !important;
    border-top: none !important;
    border-bottom: 1px solid #ebebeb !important;
  }

  body.kodxx-fullscreen .mobile-price-bar {
    display: flex !important;
  }
}


/* Hide mobile scroll arrows on desktop */
@media (min-width: 769px) {
  .scroll-arrow {
    display: none !important;
  }
}


/* ==========================================================================
   17. INPUT OVERRIDES
   ========================================================================== */

.slider-input-group input[type="number"] {
  border: 1.5px solid #d4d4d4 !important;
  border-radius: 8px !important;
  padding: 8px 10px !important;
  font-size: 0.85rem !important;
  color: #1a1a1a !important;
  background: #ffffff !important;
  font-variant-numeric: tabular-nums;
}

.slider-input-group input[type="number"]:focus {
  border-color: #1a1a1a !important;
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(26, 26, 26, 0.06) !important;
}

.slider-apply-btn {
  background: #ffffff !important;
  border: 1.5px solid #d4d4d4 !important;
  border-radius: 8px !important;
  color: #666 !important;
  font-weight: 500 !important;
}

.slider-apply-btn:hover {
  background: #1a1a1a !important;
  border-color: #1a1a1a !important;
  color: #fff !important;
}


/* ==========================================================================
   18. SECTIONS PANEL
   ========================================================================== */

.sections-show-all-container {
  background: #f7f7f7 !important;
  border: 1px solid #e5e5e5 !important;
  border-radius: 10px !important;
}

.section-tile {
  border-radius: 10px !important;
}

.section-tile.active {
  border-color: #1a1a1a !important;
  background: #f7f7f7 !important;
}

.section-tile.active .section-tile-icon {
  background: #1a1a1a !important;
}

.section-tile.show-all .section-tile-icon {
  background: #333 !important;
}


/* ==========================================================================
   19. FLOATING TOOLBAR — Clean white
   ========================================================================== */

.floating-toolbar {
  background: #ffffff !important;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08) !important;
  border: 1px solid #e5e5e5 !important;
  border-radius: 12px !important;
  backdrop-filter: none !important;
}

.toolbar-button {
  background: transparent !important;
  border: none !important;
  color: #888 !important;
  border-radius: 8px !important;
  box-shadow: none !important;
  transition: all 0.15s ease !important;
}

.toolbar-button:hover {
  background: #f5f5f5 !important;
  color: #1a1a1a !important;
}

.toolbar-button-label {
  display: none;
}


/* ==========================================================================
   20. CHECKBOX
   ========================================================================== */

.checkboxStyle1 input[type="checkbox"]:checked {
  background-color: #1a1a1a !important;
}

.checkboxStyle1 label {
  color: #333 !important;
  font-size: 0.9rem !important;
}


/* ==========================================================================
   21. BOM PANEL — slide from left (desktop), slide from bottom (mobile)
   ========================================================================== */

#bom-panel {
  position: fixed !important;
  top: 0 !important;
  left: -460px !important;
  right: auto !important;
  width: 400px !important;
  height: 100vh !important;
  background: #ffffff !important;
  border-left: none !important;
  border-right: 1px solid #ebebeb !important;
  box-shadow: none !important;
  visibility: hidden;
  transition: left 0.3s ease, box-shadow 0.3s ease, visibility 0s 0.3s !important;
  z-index: 200 !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

#bom-panel.visible {
  left: 0 !important;
  right: auto !important;
  box-shadow: 4px 0 16px rgba(0, 0, 0, 0.08) !important;
  visibility: visible !important;
  transition: left 0.3s ease, box-shadow 0.3s ease, visibility 0s 0s !important;
}

/* --- Panel header / tabs bar --- */
.bom-panel-tabs {
  display: flex !important;
  align-items: center !important;
  background: #ffffff !important;
  border-bottom: 1px solid #ebebeb !important;
  padding: 0 !important;
  flex-shrink: 0 !important;
  min-height: 48px !important;
}

.bom-panel-tab {
  flex: 1 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  padding: 12px 16px !important;
  color: #999 !important;
  font-size: 0.85rem !important;
  font-weight: 500 !important;
  background: transparent !important;
  border: none !important;
  border-bottom: 2px solid transparent !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  white-space: nowrap !important;
}

.bom-panel-tab .material-symbols-outlined {
  font-size: 18px !important;
}

.bom-panel-tab:hover {
  color: #666 !important;
  background: #fafafa !important;
}

.bom-panel-tab.is-active {
  color: #1a1a1a !important;
  font-weight: 700 !important;
  border-bottom-color: #1a1a1a !important;
}

/* Pin / Close actions */
.bom-panel-tabs__actions {
  display: flex !important;
  align-items: center !important;
  gap: 2px !important;
  margin-left: auto !important;
  padding: 0 8px !important;
  flex-shrink: 0 !important;
}

.bom-panel-tab-action {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 32px !important;
  height: 32px !important;
  color: #999 !important;
  background: transparent !important;
  border: none !important;
  border-radius: 8px !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
}

.bom-panel-tab-action .material-symbols-outlined {
  font-size: 18px !important;
}

.bom-panel-tab-action:hover {
  color: #1a1a1a !important;
  background: #f0f0f0 !important;
}

/* --- Tab content visibility --- */
.bom-panel-tab-content {
  display: none !important;
}

.bom-panel-tab-content.is-active {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 !important;
  overflow-y: auto !important;
  min-height: 0 !important;
}


/* --- Build size --- */
#bom-panel .buildSize {
  padding: 10px 16px !important;
  font-size: 0.85rem !important;
  color: #666 !important;
  background: #fafafa !important;
  border-bottom: 1px solid #ebebeb !important;
}

/* --- Controls bar (view toggles + price toggle) --- */
.bom-controls-bar {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 10px 16px !important;
  border-bottom: 1px solid #ebebeb !important;
  flex-shrink: 0 !important;
  gap: 12px !important;
}

.bom-view-controls {
  display: flex !important;
  gap: 6px !important;
}

.bom-view-btn {
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  padding: 6px 12px !important;
  border: 1.5px solid #e5e5e5 !important;
  background: #ffffff !important;
  color: #666 !important;
  border-radius: 8px !important;
  font-size: 0.75rem !important;
  font-weight: 500 !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
}

.bom-view-btn .material-symbols-outlined {
  font-size: 16px !important;
}

.bom-view-btn.is-active {
  background: #1a1a1a !important;
  border-color: #1a1a1a !important;
  color: #ffffff !important;
}

.bom-view-btn:hover:not(.is-active) {
  border-color: #bbb !important;
}

/* Price toggle */
.bom-price-toggle {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}

.bom-price-toggle-label {
  font-size: 0.8rem !important;
  color: #666 !important;
  font-weight: 500 !important;
}

/* --- BOM view containers --- */
.bom-view {
  display: none !important;
}

.bom-view.is-active {
  display: block !important;
}

/* --- BOM Table styling --- */
#bom-table-view {
  overflow: auto !important;
  flex: 1 !important;
  min-height: 0 !important;
}

#bom-table {
  width: 100% !important;
  table-layout: fixed !important;
  border-collapse: collapse !important;
  font-size: 0.78rem !important;
}

#bom-table thead th {
  padding: 8px 6px !important;
  text-align: left !important;
  font-size: 0.65rem !important;
  font-weight: 600 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.3px !important;
  color: #999 !important;
  background: #fafafa !important;
  border-bottom: 1px solid #ebebeb !important;
  position: sticky !important;
  top: 0 !important;
  z-index: 1 !important;
  overflow: hidden !important;
  white-space: nowrap !important;
  text-overflow: ellipsis !important;
}

#bom-table thead th.center-text {
  text-align: center !important;
}

/* Combined part/desc column takes remaining space; numeric columns are fixed % */
#bom-table th:nth-child(2) { width: 9% !important; text-align: center !important; }
#bom-table th:nth-child(3) { width: 11% !important; text-align: center !important; }
#bom-table th:nth-child(4) { width: 17% !important; text-align: right !important; }
#bom-table th:nth-child(5) { width: 17% !important; text-align: right !important; }

#bom-table tbody td {
  padding: 8px 6px !important;
  border-bottom: 1px solid #f5f5f5 !important;
  color: #333 !important;
  vertical-align: top !important;
  overflow: hidden !important;
}

#bom-table tbody td:nth-child(2),
#bom-table tbody td:nth-child(3) {
  text-align: center !important;
  white-space: nowrap !important;
}

#bom-table tbody td:nth-child(4),
#bom-table tbody td:nth-child(5) {
  text-align: right !important;
  white-space: nowrap !important;
}

/* Stacked part code / description in first cell */
#bom-table .bom-part-code {
  font-weight: 600 !important;
  font-size: 12px !important;
  line-height: 1.3 !important;
  color: #111 !important;
}
#bom-table .bom-part-desc {
  font-size: 11px !important;
  color: #888 !important;
  margin-top: 2px !important;
  line-height: 1.3 !important;
}

#bom-table tbody tr:hover {
  background: #fafafa !important;
}

/* --- Stacked view cards --- */
.bom-stacked-card {
  margin: 8px 12px !important;
  padding: 14px !important;
  border: 1px solid #ebebeb !important;
  border-radius: 10px !important;
  background: #ffffff !important;
}

/* --- Qty section (footer) --- */
.bom-qty-section {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 12px 16px !important;
  border-top: 1px solid #ebebeb !important;
  background: #fafafa !important;
  flex-shrink: 0 !important;
}

.bom-qty-field {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
}

.bom-qty-field label {
  font-size: 0.75rem !important;
  color: #999 !important;
  font-style: italic !important;
}

.bom-qty-input {
  width: 60px !important;
  height: 34px !important;
  text-align: center !important;
  border: 1.5px solid #e5e5e5 !important;
  border-radius: 8px !important;
  font-size: 0.9rem !important;
}

#bomTotalPrice {
  font-weight: 700 !important;
  font-size: 1.1rem !important;
  color: #1a1a1a !important;
}

/* --- Backdrop overlay --- */
.bom-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 199;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.bom-backdrop.visible {
  opacity: 1;
  pointer-events: auto;
}


/* ==========================================================================
   22. APPS PANEL
   ========================================================================== */

.apps-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 249;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.apps-backdrop.visible {
  opacity: 1;
  pointer-events: auto;
}

.apps-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  width: 420px;
  max-width: 90vw;
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.04);
  z-index: 250;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  overflow: hidden;
}

.apps-panel.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.apps-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid #ebebeb;
}

.apps-panel-title {
  font-size: 1rem;
  font-weight: 700;
  color: #1a1a1a;
}

.apps-panel-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: #999;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.apps-panel-close:hover {
  background: #f0f0f0;
  color: #1a1a1a;
}

.apps-panel-close .material-symbols-outlined {
  font-size: 20px;
}

.apps-panel-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 20px;
}

.apps-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  aspect-ratio: 1 / 1;
  padding: 14px;
  background: color-mix(in srgb, var(--accent-color, #085995) 4%, #fff);
  border: 1.5px solid color-mix(in srgb, var(--accent-color, #085995) 12%, #e8e8e8);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.apps-tile:hover {
  background: color-mix(in srgb, var(--accent-color, #085995) 10%, #fff);
  border-color: color-mix(in srgb, var(--accent-color, #085995) 30%, #e8e8e8);
  transform: translateY(-1px);
}

.apps-tile:active {
  transform: translateY(0);
  background: color-mix(in srgb, var(--accent-color, #085995) 14%, #fff);
}

.apps-tile-icon {
  font-size: 36px !important;
  color: var(--accent-color, #085995);
}

.apps-tile-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--accent-color, #085995);
  text-align: center;
}

/* Mobile: keep tiles compact */
@media (max-width: 768px) {
  .apps-tile {
    padding: 16px 10px;
    gap: 6px;
  }
  .apps-tile-icon {
    font-size: 26px !important;
  }
  .apps-tile-label {
    font-size: 0.68rem;
  }
}

/* ==========================================================================
   23. TOOLBAR FLYOUT (Plan View, Desktop, etc.)
   ========================================================================== */

.toolbar-flyout {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  width: 360px !important;
  max-width: 90vw !important;
  max-height: 80vh !important;
  padding: 0 !important;
  border-radius: 20px !important;
  background: #ffffff !important;
  color: #1e293b !important;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.04) !important;
  display: none !important;
  z-index: 260 !important;
  overflow-y: auto !important;
  border: none !important;
}

.toolbar-flyout[data-open="true"] {
  display: block !important;
}

/* Plan View wireframe menu – slide-in panel (matches dressing wizard) */
#plan-view-wireframe-menu {
  position: fixed !important;
  top: 0 !important;
  right: -470px !important;
  left: auto !important;
  bottom: auto !important;
  width: 420px !important;
  max-width: none !important;
  height: 100vh !important;
  max-height: none !important;
  border-radius: 0 !important;
  transform: none !important;
  display: flex !important;
  flex-direction: column !important;
  overflow-y: auto !important;
  box-shadow: none !important;
  z-index: 1002 !important;
  transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.35s ease !important;
}

#plan-view-wireframe-menu[data-open="true"] {
  display: flex !important;
  right: 0 !important;
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.12), -2px 0 8px rgba(0, 0, 0, 0.08) !important;
}

/* Header */
.toolbar-flyout__header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  padding: 16px 20px !important;
  border-bottom: 1px solid #ebebeb !important;
  margin: 0 !important;
}

.toolbar-flyout__brand {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}

.toolbar-flyout__icon {
  color: #1a1a1a !important;
  font-size: 22px !important;
}

.toolbar-flyout__title {
  font-size: 1rem !important;
  font-weight: 700 !important;
  color: #1a1a1a !important;
  margin: 0 !important;
}

.toolbar-flyout__close {
  width: 30px !important;
  height: 30px !important;
  border: 1.5px solid #e5e5e5 !important;
  border-radius: 8px !important;
  background: transparent !important;
  color: #999 !important;
  font-size: 18px !important;
  line-height: 1 !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  transition: all 0.15s ease !important;
}

.toolbar-flyout__close:hover {
  background: #1a1a1a !important;
  border-color: #1a1a1a !important;
  color: #ffffff !important;
}

/* Hint text */
.toolbar-flyout__hint {
  font-size: 0.78rem !important;
  color: #999 !important;
  line-height: 1.5 !important;
  margin: 4px 0 !important;
  padding: 0 !important;
}

.toolbar-flyout p.toolbar-flyout__hint:first-of-type {
  padding: 14px 20px 0 !important;
  margin-bottom: 0 !important;
}

/* Sections */
.toolbar-flyout__section {
  padding: 14px 20px !important;
  border-bottom: 1px solid #f3f4f6 !important;
}

.toolbar-flyout__section:last-child {
  border-bottom: none !important;
}

.toolbar-flyout__section-title {
  font-size: 0.68rem !important;
  font-weight: 700 !important;
  color: #1a1a1a !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  margin: 0 0 10px 0 !important;
}

/* Toggle (checkbox) */
.toolbar-flyout__toggle {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  cursor: pointer !important;
  padding: 6px 0 !important;
  user-select: none !important;
}

.toolbar-flyout__toggle input[type="checkbox"] {
  width: 18px !important;
  height: 18px !important;
  cursor: pointer !important;
  margin: 0 !important;
  accent-color: #1a1a1a !important;
}

.toolbar-flyout__toggle span {
  font-size: 0.85rem !important;
  color: #333 !important;
  flex: 1 !important;
}

.toolbar-flyout__toggle:hover span {
  color: #1a1a1a !important;
}

/* Labels */
.toolbar-flyout__label {
  display: block !important;
  font-size: 0.68rem !important;
  font-weight: 700 !important;
  color: #1a1a1a !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  margin-bottom: 8px !important;
}

/* Range slider */
.toolbar-flyout input[type="range"] {
  width: 100% !important;
  height: 4px !important;
  border-radius: 2px !important;
  background: #e5e5e5 !important;
  outline: none !important;
  -webkit-appearance: none !important;
  appearance: none !important;
  margin: 8px 0 !important;
}

.toolbar-flyout input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none !important;
  appearance: none !important;
  width: 14px !important;
  height: 14px !important;
  border-radius: 50% !important;
  background: #1a1a1a !important;
  border: 2px solid #fff !important;
  cursor: pointer !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2) !important;
}

.toolbar-flyout input[type="range"]::-moz-range-thumb {
  width: 14px !important;
  height: 14px !important;
  border-radius: 50% !important;
  background: #1a1a1a !important;
  border: 2px solid #fff !important;
  cursor: pointer !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2) !important;
}

/* View preset buttons */
.toolbar-flyout__view-grid {
  display: flex !important;
  gap: 6px !important;
  flex-wrap: wrap !important;
  margin-top: 8px !important;
}

.toolbar-flyout__view-btn {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 2px !important;
  padding: 8px 10px !important;
  border: 1.5px solid #e5e5e5 !important;
  border-radius: 10px !important;
  background: #fafafa !important;
  color: #666 !important;
  cursor: pointer !important;
  font-size: 0.68rem !important;
  font-family: inherit !important;
  transition: all 0.15s ease !important;
  min-width: 52px !important;
}

.toolbar-flyout__view-btn .material-symbols-outlined {
  font-size: 20px !important;
}

.toolbar-flyout__view-btn:hover {
  border-color: #bbb !important;
  background: #f0f0f0 !important;
  color: #1a1a1a !important;
}

.toolbar-flyout__view-btn.active {
  background: #1a1a1a !important;
  color: #ffffff !important;
  border-color: #1a1a1a !important;
}

/* Dimension controls */
.toolbar-flyout__dim-controls {
  margin-top: 10px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
}

.toolbar-flyout__dim-row {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
}

.toolbar-flyout__dim-row-label {
  flex: 0 0 70px !important;
  font-size: 0.75rem !important;
  font-weight: 500 !important;
  color: #999 !important;
}

.toolbar-flyout__dim-range {
  flex: 1 !important;
  height: 4px !important;
  margin: 0 !important;
}

.toolbar-flyout__dim-toggle-pair {
  display: flex !important;
  gap: 4px !important;
  flex: 1 !important;
}

.toolbar-flyout__dim-chip {
  flex: 1 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
}

.toolbar-flyout__dim-chip input[type="radio"] {
  display: none !important;
}

.toolbar-flyout__dim-chip span {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  padding: 5px 10px !important;
  border: 1.5px solid #e5e5e5 !important;
  border-radius: 8px !important;
  font-size: 0.75rem !important;
  font-weight: 500 !important;
  color: #666 !important;
  background: #fff !important;
  transition: all 0.15s ease !important;
}

.toolbar-flyout__dim-chip:hover span {
  border-color: #bbb !important;
  background: #fafafa !important;
}

.toolbar-flyout__dim-chip input[type="radio"]:checked + span {
  border-color: #1a1a1a !important;
  background: #f5f5f5 !important;
  color: #1a1a1a !important;
  font-weight: 600 !important;
}

/* Profile extrude dialog */
.profile-extrude-dialog {
  position: fixed !important;
  inset: 0 !important;
  display: none !important;
  align-items: center !important;
  justify-content: center !important;
  background: rgba(0, 0, 0, 0.4) !important;
  z-index: 12000 !important;
  padding: 24px !important;
}

.profile-extrude-dialog.open {
  display: flex !important;
}

.profile-extrude-dialog__panel {
  background: #ffffff !important;
  max-width: min(640px, 100%) !important;
  width: 100% !important;
  border-radius: 20px !important;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2) !important;
  padding: 24px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 16px !important;
}

.profile-extrude-dialog__fields {
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
}

.profile-extrude-dialog__description {
  margin: 0 0 8px !important;
  line-height: 1.5 !important;
  color: #666 !important;
}

.profile-extrude-dialog textarea {
  width: 100% !important;
  min-height: 140px !important;
  font-family: 'Roboto Mono', 'Courier New', monospace !important;
  font-size: 0.9rem !important;
  padding: 12px !important;
  border: 1.5px solid #e5e5e5 !important;
  border-radius: 12px !important;
  resize: vertical !important;
}

.profile-extrude-dialog input[type="number"],
.profile-extrude-dialog input[type="text"] {
  width: 100% !important;
  padding: 10px 12px !important;
  border-radius: 10px !important;
  border: 1.5px solid #e5e5e5 !important;
  font-size: 1rem !important;
}

.profile-extrude-dialog__footer {
  display: flex !important;
  justify-content: flex-end !important;
  gap: 12px !important;
}

.profile-extrude-dialog__error {
  color: #b91c1c !important;
  font-weight: 600 !important;
}


/* ==========================================================================
   24. MATERIAL ICONS
   ========================================================================== */

.material-symbols-outlined {
  font-variation-settings:
    'FILL' 0,
    'wght' 400,
    'GRAD' 0,
    'opsz' 24;
}


/* ==========================================================================
   24a. MD3 MODAL (shared)
   ========================================================================== */

.md3-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.45);
  justify-content: center;
  align-items: center;
  z-index: 10000;
  backdrop-filter: blur(4px);
}

.md3-modal-content {
  background: #ffffff;
  border-radius: 20px;
  padding: 28px 24px 24px;
  width: 90%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.04);
  font-family: 'Roboto', sans-serif;
  animation: md3FadeIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  color: #1e293b;
}

@keyframes md3FadeIn {
  from { opacity: 0; transform: scale(0.92) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.md3-title {
  margin: 0 0 20px;
  font-size: 1.1rem;
  font-weight: 700;
  color: #1a1a1a;
  letter-spacing: -0.01em;
}

.md3-field {
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
}

.md3-field label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  color: var(--accent-color, #6750a4);
}

.md3-field input,
.md3-field textarea {
  padding: 12px 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  font-size: 0.9rem;
  font-family: inherit;
  color: #1e293b;
  background: #f8fafc;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  outline: none;
  resize: vertical;
}

.md3-field input:focus,
.md3-field textarea:focus {
  border-color: var(--accent-color, #6750a4);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-color, #6750a4) 12%, transparent);
}

.md3-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 4px;
}

.md3-btn {
  padding: 9px 20px;
  border-radius: 10px;
  border: 1.5px solid transparent;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
}

.md3-btn.open {
  border-color: var(--accent-color, #6750a4);
  background: var(--accent-color, #6750a4);
  color: #fff;
}

.md3-btn.open:hover {
  filter: brightness(1.1);
  box-shadow: 0 2px 8px color-mix(in srgb, var(--accent-color, #6750a4) 30%, transparent);
}

.md3-btn.delete {
  border-color: #e2e8f0;
  background: transparent;
  color: #64748b;
}

.md3-btn.delete:hover {
  border-color: #cbd5e1;
  background: #f1f5f9;
  color: #475569;
}

/* ==========================================================================
   24a-ii. SAVE DRAFT FAB + MODAL
   ========================================================================== */

/* --- Modal content tweaks --- */
.save-draft-modal-content {
  max-width: 400px;
}
.save-draft-modal-content .md3-title {
  font-weight: 400;
  font-size: 1rem;
  color: #334155;
}
.save-draft-modal-content .md3-field label {
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  font-size: 12px;
  color: #64748b;
}
.save-draft-modal-content .md3-btn.open {
  font-weight: 500;
}

/* --- Consent checkbox --- */
.save-draft-consent {
  margin-bottom: 14px;
}
.save-draft-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 13px;
  line-height: 1.5;
  color: #475569;
}
.save-draft-request-price-label {
  font-size: 15px;
  font-weight: 500;
  color: #1e293b;
  align-items: center;
}
.save-draft-checkbox-label input[type="checkbox"] {
  display: none;
}
.save-draft-checkbox-mark {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border: 2px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  transition: all 0.15s ease;
  position: relative;
  margin-top: 1px;
}
.save-draft-checkbox-label input[type="checkbox"]:checked + .save-draft-checkbox-mark {
  background: var(--accent-color, #6750a4);
  border-color: var(--accent-color, #6750a4);
}
.save-draft-checkbox-label input[type="checkbox"]:checked + .save-draft-checkbox-mark::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 6px;
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.save-draft-consent-text {
  font-size: 11px;
  line-height: 1.5;
  color: #94a3b8;
}

/* --- Qty row --- */
.save-draft-qty-field {
  margin-bottom: 14px;
}
.save-draft-qty-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.save-draft-qty-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1.5px solid #e2e8f0;
  background: #f8fafc;
  color: #1e293b;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}
.save-draft-qty-btn:hover {
  border-color: var(--accent-color, #6750a4);
  background: #f1f5f9;
}
.save-draft-qty-input {
  width: 60px;
  text-align: center;
  padding: 8px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  font-size: 0.9rem;
  font-family: inherit;
  color: #1e293b;
  background: #f8fafc;
  outline: none;
}
.save-draft-qty-input:focus {
  border-color: var(--accent-color, #6750a4);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-color, #6750a4) 12%, transparent);
}

/* --- Toast notification --- */
.save-draft-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  z-index: 11000;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  background: #1a1a2e;
  color: #fff;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.save-draft-toast .material-symbols-outlined {
  color: #4ade80;
  font-size: 22px;
}
.save-draft-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

/* --- Mobile adjustments --- */
@media (max-width: 768px) {
  .save-draft-modal-content {
    width: 75%;
    max-width: none;
    padding: 20px 18px 18px;
  }
  .save-draft-toast {
    left: 16px;
    right: 16px;
    transform: translateX(0) translateY(100px);
    font-size: 13px;
    padding: 12px 18px;
  }
  .save-draft-toast.visible {
    transform: translateX(0) translateY(0);
  }
}

/* ==========================================================================
   24a-iii. DOWNLOAD MODAL
   ========================================================================== */

.dl-modal-content {
  max-width: 480px;
}

.dl-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.dl-modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #5f6368;
  padding: 0 4px;
  line-height: 1;
}
.dl-modal-close:hover {
  color: #1c1b1f;
}

.dl-modal-subtitle {
  font-size: 0.88rem;
  color: #64748b;
  margin: 0 0 16px;
  line-height: 1.5;
}

.dl-format-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-color, #085995);
  margin-bottom: 8px;
}

.dl-format-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.dl-format-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  cursor: pointer;
  background: #f8fafc;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.dl-format-card:hover {
  background: color-mix(in srgb, var(--accent-color, #085995) 6%, #fff);
  border-color: color-mix(in srgb, var(--accent-color, #085995) 30%, #e2e8f0);
}

.dl-format-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.dl-format-card input[type="radio"]:checked ~ .dl-format-info .dl-format-name {
  color: var(--accent-color, #085995);
}

.dl-format-card:has(input[type="radio"]:checked) {
  border-color: var(--accent-color, #085995);
  background: color-mix(in srgb, var(--accent-color, #085995) 6%, #fff);
}

.dl-format-card input[type="radio"]:checked + .md3-radio-custom {
  border-color: var(--accent-color, #085995);
}

.dl-format-card input[type="radio"]:checked + .md3-radio-custom::after {
  background: var(--accent-color, #085995);
  transform: scale(1);
}

.dl-format-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dl-format-name {
  font-weight: 500;
  font-size: 0.88rem;
  color: #334155;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dl-format-badge {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 500;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--accent-color, #085995);
  color: #fff;
  vertical-align: middle;
}

.dl-format-desc {
  font-size: 0.82rem;
  color: #64748b;
  font-weight: 400;
}

.dl-floorplan-subformats {
  display: none;
  gap: 6px;
  margin-top: 8px;
}
.dl-floorplan-subformats.visible {
  display: flex;
}

.dl-subformat-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 14px;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  background: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s ease;
}
.dl-subformat-pill:hover {
  border-color: var(--accent-color, #085995);
  background: color-mix(in srgb, var(--accent-color, #085995) 6%, #fff);
}
.dl-subformat-pill.active {
  background: var(--accent-color, #085995);
  color: #fff;
  border-color: var(--accent-color, #085995);
}

.dl-btn-download {
  background: var(--accent-color, #085995) !important;
  color: #fff !important;
  border-color: var(--accent-color, #085995) !important;
  font-weight: 500 !important;
}
.dl-btn-download:hover {
  filter: brightness(1.1);
  box-shadow: 0 2px 8px color-mix(in srgb, var(--accent-color, #085995) 30%, transparent);
}

/* Queue notice for STEP/IFC exports */
.dl-queue-notice-wrap {
  margin-top: 4px;
  margin-bottom: 16px;
  padding: 12px 14px;
  background: color-mix(in srgb, var(--accent-color, #085995) 6%, #fff);
  border: 1px solid color-mix(in srgb, var(--accent-color, #085995) 25%, #e2e8f0);
  border-radius: 10px;
}
.dl-queue-notice-text {
  font-size: 0.82rem;
  color: #334155;
  margin: 0 0 10px;
  line-height: 1.5;
}
.dl-queue-email-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.dl-queue-email-input {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  font-size: 0.9rem;
  box-sizing: border-box;
  font-family: inherit;
  color: #1e293b;
  background: #f8fafc;
}
.dl-queue-email-input:focus {
  border-color: var(--accent-color, #085995);
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-color, #085995) 12%, transparent);
}

/* Shapes toggle */
.dl-shapes-toggle-wrap {
  margin-bottom: 12px;
}

/* Loading spinner */
.model-download-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75em;
  margin-top: 1.5em;
  min-height: 40px;
  visibility: hidden;
}
.model-download-loader[aria-hidden="false"] {
  visibility: visible;
}
.model-download-loader .spinner {
  width: 24px;
  height: 24px;
  border: 3px solid #e2e8f0;
  border-top-color: var(--accent-color, #085995);
  border-radius: 50%;
  animation: dl-spin 0.8s linear infinite;
}
.model-download-loader-text {
  font-size: 0.88rem;
  color: #475569;
}
@keyframes dl-spin {
  to { transform: rotate(360deg); }
}

/* Mobile */
@media (max-width: 768px) {
  .dl-modal-content {
    max-width: none;
    width: 75%;
  }
}

/* ==========================================================================
   24a-iv. AR SHARE MODAL (themed override)
   ========================================================================== */

#arShareModal {
  background: rgba(0, 0, 0, 0.45) !important;
  backdrop-filter: blur(4px);
}

#arShareModal > .modal-content {
  border-radius: 20px !important;
  padding: 28px 24px 24px !important;
  max-width: 400px !important;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.04) !important;
  font-family: 'Roboto', sans-serif;
  animation: md3FadeIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

#arShareModal h3 {
  font-size: 1.1rem !important;
  font-weight: 700 !important;
  color: #1a1a1a !important;
  letter-spacing: -0.01em;
}

#arShareModal p {
  color: #64748b !important;
  font-size: 12px !important;
}

/* Close button */
#arShareModal .modal-content > div:first-child > button {
  width: 28px !important;
  height: 28px !important;
  border: 1.5px solid #1a1a1a !important;
  border-radius: 6px !important;
  font-size: 18px !important;
  color: #1a1a1a !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  line-height: 1;
}

#arShareModal .modal-content > div:first-child > button:hover {
  background: #1a1a1a !important;
  color: #fff !important;
}

/* QR canvas */
#arShareQRCanvas {
  border: 1.5px solid #e2e8f0 !important;
  border-radius: 12px !important;
  padding: 12px;
}

/* Link input */
#arShareLinkInput {
  border: 1.5px solid #e2e8f0 !important;
  border-radius: 10px !important;
  background: #f8fafc !important;
  font-size: 13px !important;
  color: #1e293b !important;
  padding: 10px 14px !important;
}

#arShareLinkInput:focus {
  border-color: var(--accent-color, #6750a4) !important;
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-color, #6750a4) 12%, transparent);
}

/* Copy button */
#arShareModal .modal-content div[style*="display:flex;gap:8px"] > button {
  background: #1a1a1a !important;
  border-radius: 10px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  padding: 10px 18px !important;
  transition: all 0.15s;
}

#arShareModal .modal-content div[style*="display:flex;gap:8px"] > button:hover {
  background: #333 !important;
}

/* Open AR View link */
#arShareOpenBtn {
  background: var(--accent-color, #6750a4) !important;
  border-radius: 10px !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  padding: 13px !important;
  transition: filter 0.15s;
}

#arShareOpenBtn:hover {
  filter: brightness(1.1);
  box-shadow: 0 2px 8px color-mix(in srgb, var(--accent-color, #6750a4) 30%, transparent);
}

/* ==========================================================================
   24b. SCENE MARKUP SIDE PANEL
   ========================================================================== */

#sceneMarkupSidePanel {
  position: fixed;
  top: 0;
  right: -470px;
  width: 420px;
  height: 100vh;
  background: #ffffff;
  box-shadow: none;
  z-index: 1002;
  display: flex;
  flex-direction: column;
  transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.35s ease;
  overflow: hidden;
  border-radius: 0;
  font-family: 'Roboto', sans-serif;
}

#sceneMarkupSidePanel.visible {
  right: 0;
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.12), -2px 0 8px rgba(0, 0, 0, 0.08);
}

.markup-side-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid #e8e8e8;
  flex-shrink: 0;
}

.markup-side-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 15px;
  color: #1e293b;
}

.markup-side-title .material-symbols-outlined {
  color: var(--accent-color, #6750a4);
  font-size: 22px;
}

.markup-side-close {
  width: 28px;
  height: 28px;
  border: 1.5px solid var(--accent-color, #6750a4);
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  color: var(--accent-color, #6750a4);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.markup-side-close:hover {
  background: var(--accent-color, #6750a4);
  color: #fff;
}

.markup-side-body {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
  overflow-y: auto;
}

.markup-section-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-color, #6750a4);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.markup-section-label span {
  font-weight: 400;
  color: #94a3b8;
}

.markup-tools-row {
  display: flex;
  gap: 6px;
}

.markup-tool-btn {
  flex: 1;
  border: 1.5px solid #e2e8f0;
  background: #fff;
  cursor: pointer;
  padding: 10px 6px;
  border-radius: 10px;
  color: #475569;
  transition: all 0.15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 11px;
  font-family: inherit;
}

.markup-tool-btn .material-symbols-outlined {
  font-size: 20px;
}

.markup-tool-btn:hover {
  border-color: var(--accent-color, #6750a4);
  background: color-mix(in srgb, var(--accent-color, #6750a4) 5%, transparent);
}

.markup-tool-btn.active {
  color: var(--accent-color, #6750a4);
  background: color-mix(in srgb, var(--accent-color, #6750a4) 10%, transparent);
  border-color: var(--accent-color, #6750a4);
}

.markup-visibility-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: #f8fafc;
  border-radius: 10px;
  font-size: 13px;
  color: #475569;
}

.markup-toggle {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
}

.markup-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.markup-toggle-slider {
  position: absolute;
  inset: 0;
  background: #cbd5e1;
  border-radius: 22px;
  cursor: pointer;
  transition: background 0.2s;
}

.markup-toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.markup-toggle input:checked + .markup-toggle-slider {
  background: var(--accent-color, #6750a4);
}

.markup-toggle input:checked + .markup-toggle-slider::before {
  transform: translateX(18px);
}

.markup-annotation-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.markup-list-empty {
  padding: 16px 12px;
  text-align: center;
  color: #94a3b8;
  font-size: 12px;
  background: #f8fafc;
  border: 1.5px dashed #e2e8f0;
  border-radius: 10px;
  line-height: 1.5;
}

.markup-ann-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.markup-ann-item:hover {
  border-color: color-mix(in srgb, var(--accent-color, #6750a4) 40%, transparent);
  background: color-mix(in srgb, var(--accent-color, #6750a4) 3%, transparent);
}

.markup-ann-item.selected {
  border-color: var(--accent-color, #6750a4);
  background: color-mix(in srgb, var(--accent-color, #6750a4) 8%, transparent);
}

.markup-ann-color {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.markup-ann-info {
  flex: 1;
  min-width: 0;
}

.markup-ann-text {
  font-size: 12.5px;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}

.markup-ann-type {
  font-size: 10.5px;
  color: #94a3b8;
  text-transform: capitalize;
}

.markup-ann-actions {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}

.markup-ann-btn {
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  color: #94a3b8;
  transition: all 0.15s;
  display: flex;
  align-items: center;
}

.markup-ann-btn .material-symbols-outlined {
  font-size: 16px;
}

.markup-ann-btn:hover {
  background: color-mix(in srgb, var(--accent-color, #6750a4) 10%, transparent);
  color: var(--accent-color, #6750a4);
}

.markup-ann-btn.delete:hover {
  background: rgba(220, 38, 38, 0.1);
  color: #dc2626;
}

.markup-clear-btn {
  width: 100%;
  border: 1.5px solid #e2e8f0;
  background: #fff;
  color: #64748b;
  padding: 9px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
  margin-top: auto;
}

.markup-clear-btn:hover {
  border-color: #dc2626;
  color: #dc2626;
  background: rgba(220, 38, 38, 0.05);
}

.markup-clear-btn .material-symbols-outlined {
  font-size: 18px;
}

.markup-style-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px 12px;
  background: #f8fafc;
  border-radius: 10px;
}

.markup-slider-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.markup-slider-row label {
  font-size: 11px;
  font-weight: 500;
  color: #475569;
}

.markup-slider-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.markup-slider-wrap input[type="range"] {
  flex: 1;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: #cbd5e1;
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.markup-slider-wrap input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent-color, #6750a4);
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  cursor: pointer;
}

.markup-slider-wrap input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent-color, #6750a4);
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  cursor: pointer;
}

.markup-slider-val {
  min-width: 28px;
  text-align: right;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-color, #6750a4);
  font-variant-numeric: tabular-nums;
}

.markup-color-swatch {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid #e2e8f0;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  display: inline-block;
}

.markup-color-swatch:hover {
  border-color: #94a3b8;
}

.markup-color-swatch.active {
  border-color: var(--accent-color, #6750a4);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent-color, #6750a4) 30%, transparent);
}

#scene-markup-banner {
  background: color-mix(in srgb, var(--accent-color, #6750a4) 7%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent-color, #6750a4) 18%, transparent);
  color: var(--accent-color, #6750a4);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.45;
}

/* ==========================================================================
   25. DRESSING WIZARD PANEL
   ========================================================================== */

#dressingWizardPanel {
  position: fixed;
  top: 0;
  right: -470px;
  width: 420px;
  height: 100vh;
  background: #ffffff;
  box-shadow: none;
  z-index: 1002;
  display: flex;
  flex-direction: column;
  transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.35s ease;
  overflow: hidden;
  border-radius: 0;
}

#dressingWizardPanel.visible {
  right: 0;
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.12), -2px 0 8px rgba(0, 0, 0, 0.08);
}

.dw-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid #ebebeb;
  flex-shrink: 0;
}

.dw-header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dw-header-icon {
  font-size: 22px;
  color: #1a1a1a;
}

.dw-header-title {
  font-size: 16px;
  font-weight: 600;
  color: #1a1a1a;
}

.dw-panel-close {
  width: 28px;
  height: 28px;
  border: 1.5px solid #1a1a1a;
  border-radius: 6px;
  background: transparent;
  color: #1a1a1a;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: all 0.2s;
}

.dw-panel-close:hover {
  background: #1a1a1a;
  color: #fff;
}

.dw-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.dw-section {
  background: #fafafa;
  border-radius: 10px;
  padding: 14px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.dw-section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #1a1a1a;
  margin-bottom: 10px;
}

.dw-control {
  margin-bottom: 10px;
}

.dw-control label {
  display: block;
  font-size: 12px;
  color: #555;
  margin-bottom: 4px;
}

.dw-control .slider-component {
  margin-top: 4px;
}

/* Selected item section */
.dw-selected-section {
  padding: 0;
  flex-shrink: 0;
  overflow: visible;
  position: sticky;
  top: 0;
  z-index: 2;
}

.dw-selected-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  cursor: pointer;
  user-select: none;
}

.dw-selected-header:hover {
  background: rgba(0, 0, 0, 0.03);
}

.dw-selected-header-left {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.dw-selected-icon {
  font-size: 18px;
  color: #1a1a1a;
}

.dw-selected-name {
  font-size: 13px;
  font-weight: 600;
  color: #1a1a1a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dw-selected-chevron {
  font-size: 20px;
  color: #999;
  transition: transform 0.2s ease;
}

.dw-selected-header.is-collapsed .dw-selected-chevron,
.dw-selected-section.is-collapsed .dw-selected-chevron {
  transform: rotate(-90deg);
}

.dw-selected-body {
  padding: 4px 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dw-selected-body.is-collapsed {
  display: none;
}

.dw-control-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dw-control-row > label {
  font-size: 11px;
  color: #777;
  min-width: 52px;
  flex-shrink: 0;
}

.dw-slider-mount {
  flex: 1;
  min-width: 0;
}

.dw-slider-mount .slider-component {
  width: 100%;
  gap: 8px;
}

.dw-slider-mount .slider-bar-wrap {
  height: 32px;
  --pill-height: 28px;
  --btn-size: 24px;
}

.dw-btn-sm {
  font-size: 12px;
  padding: 6px 10px;
  margin-top: 2px;
}

.dw-category-header {
  grid-column: 1 / -1;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #1a1a1a;
  padding: 8px 0 4px;
  border-bottom: 1px solid #eee;
  margin-bottom: 4px;
}

.dw-item-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.dw-item-tile {
  border: 2px solid transparent;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  background: #f5f5f5;
  text-align: center;
}

.dw-item-tile:hover {
  border-color: rgba(26, 26, 26, 0.4);
}

.dw-item-tile.active {
  border-color: #1a1a1a;
  box-shadow: 0 0 0 2px rgba(26, 26, 26, 0.2);
}

.dw-item-tile img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  padding: 4px;
}

.dw-item-tile-label {
  font-size: 10px;
  padding: 4px;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dw-item-tile-icon {
  font-size: 48px;
  color: #aaa;
  display: block;
  padding: 10px;
}

.dw-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dw-btn {
  width: 100%;
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: opacity 0.15s, background 0.15s;
}

.dw-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.dw-btn-primary {
  background: #1a1a1a;
  color: white;
}

.dw-btn-primary:hover:not(:disabled) {
  background: #333;
}

.dw-btn-danger {
  background: #dc2626;
  color: white;
}

.dw-btn-danger:hover:not(:disabled) {
  background: #b91c1c;
}

.dw-status {
  font-size: 12px;
  color: #666;
  text-align: center;
  min-height: 20px;
}

.dw-loading {
  color: #888;
  font-size: 13px;
  text-align: center;
  padding: 20px 0;
}

.dw-placed-count {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  background: rgba(26, 26, 26, 0.06);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #1a1a1a;
}

.dw-placed-count .material-symbols-outlined {
  font-size: 20px;
}

.dw-visibility-toggle {
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  color: #1a1a1a;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  transition: background 0.15s;
}

.dw-visibility-toggle:hover {
  background: rgba(26, 26, 26, 0.08);
}

.dw-visibility-toggle .material-symbols-outlined {
  font-size: 20px;
}

.dw-visibility-toggle.is-hidden {
  opacity: 0.5;
}

/* Dressing context pill active button states */
.dw-context-pill .dw-ctx-rotate-btn.is-active,
.dw-context-pill .dw-ctx-move-btn.is-active,
.dw-context-pill .dw-ctx-scale-btn.is-active {
  background: #1a1a1a;
  color: #ffffff;
}

.dw-context-pill .dw-ctx-rotate-btn.is-active:hover,
.dw-context-pill .dw-ctx-move-btn.is-active:hover,
.dw-context-pill .dw-ctx-scale-btn.is-active:hover {
  background: #333;
}

.dw-context-pill .dw-ctx-delete-btn:hover {
  background: #fee2e2;
  color: #dc2626;
}


/* ==========================================================================
   22. MOBILE LAYOUT — Bottom sheet with integrated tabs
   Tab bar height = 44px. Controls sheet = 50% of viewport.
   Total bottom area = tabs (44px) + controls (50dvh) sitting flush.
   ========================================================================== */

@media (max-width: 768px) {

  /* --- Lock viewport --- */
  html, body {
    height: 100dvh !important;
    overflow: hidden !important;
  }

  /* --- Main: fill viewport --- */
  body:not(.compact-embed) #main-container,
  #main-container {
    display: block !important;
    height: 100dvh !important;
    overflow: hidden !important;
    position: relative !important;
  }

  /* --- Viewer: top portion, leaving room for toolbar strip --- */
  body:not(.compact-embed) #viewer-container,
  #viewer-container {
    width: 100% !important;
    height: calc(50dvh - 36px) !important;
    max-height: calc(50dvh - 36px) !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    overflow: hidden !important;
    border: none !important;
    z-index: 1 !important;
  }

  body:not(.compact-embed) #viewer-container canvas,
  #viewer-container canvas {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-height: calc(50dvh - 36px) !important;
    object-fit: contain !important;
  }

  /* --- Tab bar: flush below viewer, horizontal scroll --- */
  #control-tabs {
    position: fixed !important;
    top: 50dvh !important;
    bottom: auto !important;
    left: 0 !important;
    right: 0 !important;
    transform: none !important;
    z-index: 101 !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 44px !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    background: #ffffff !important;
    border: none !important;
    border-top: 1px solid #ebebeb !important;
    border-bottom: 1px solid #ebebeb !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0 !important;
  }

  #control-tabs::-webkit-scrollbar {
    display: none;
  }

  /* --- Scroll arrow indicators --- */
  .scroll-arrow {
    display: none;
    position: fixed;
    z-index: 110;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: opacity 0.2s ease;
    opacity: 0;
    pointer-events: none;
  }

  .scroll-arrow .material-symbols-outlined {
    font-size: 18px;
  }

  .scroll-arrow.visible {
    display: flex;
    opacity: 1;
    pointer-events: auto;
  }

  /* Tab arrows: left/right on the tab bar */
  .scroll-arrow-left {
    top: calc(50dvh + 8px);
    left: 4px;
  }

  .scroll-arrow-right {
    top: calc(50dvh + 8px);
    right: 4px;
  }

  /* Controls arrow: bottom-right of controls panel */
  .scroll-arrow-down {
    position: sticky;
    bottom: 10px;
    float: right;
    margin-right: 10px;
    margin-top: -36px;
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.65);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    animation: bounceDown 1.5s infinite ease-in-out;
  }

  .scroll-arrow-down .material-symbols-outlined {
    font-size: 22px;
  }

  @keyframes bounceDown {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(5px); }
  }

  .control-tab {
    flex: 0 0 auto !important;
    text-align: center;
    padding: 0 16px !important;
    font-size: 0.8rem !important;
    border-radius: 0 !important;
    min-width: 0;
    color: #999 !important;
    font-weight: 500 !important;
    border: none !important;
    background: transparent !important;
    white-space: nowrap;
    position: relative;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 44px !important;
    line-height: 1 !important;
  }

  .control-tab.hidden-tab {
    display: none !important;
  }

  .child-parts-title {
    display: none !important;
  }

  .control-tab + .control-tab {
    border-left: none !important;
  }

  .control-tab.active {
    background: transparent !important;
    color: var(--accent-color, #1a1a1a) !important;
    font-weight: 700 !important;
  }

  /* Active underline */
  .control-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 12px;
    right: 12px;
    height: 3px;
    background: var(--accent-color, #1a1a1a);
    border-radius: 3px 3px 0 0;
  }

  .control-tab.run-tab.active {
    background: transparent !important;
    color: var(--accent-color, #1a1a1a) !important;
  }

  #control-tabs .control-tab.first-visible,
  #control-tabs .control-tab.last-visible {
    border-radius: 0 !important;
  }

  /* --- Controls: fills from below tabs to bottom --- */
  body:not(.compact-embed) #controls,
  #controls {
    position: fixed !important;
    top: calc(50dvh + 44px) !important;
    bottom: 54px !important;
    left: 0 !important;
    width: 100% !important;
    height: calc(50dvh - 44px - 54px) !important;
    min-height: calc(50dvh - 44px - 54px) !important;
    max-height: calc(50dvh - 44px - 54px) !important;
    z-index: 100 !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow-y: scroll !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior: contain !important;
    touch-action: pan-y !important;
    background: #ffffff !important;
    box-shadow: none !important;
  }

  /* --- Footer: hidden on kodxx mobile --- */
  .configurator-footer {
    display: none !important;
    height: 0 !important;
  }

  /* --- Controls container: vertical stack, no scroll (let #controls scroll) --- */
  body:not(.compact-embed) #controls-container,
  #controls-container {
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
    padding: 0 !important;
    min-width: 0 !important;
    min-width: unset !important;
    width: 100% !important;
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
    scroll-snap-type: none !important;
  }

  /* --- Control groups --- */
  .control-group-container {
    padding: 16px 20px 14px !important;
    margin-bottom: 0 !important;
    border-bottom: 1px solid #ebebeb !important;
    border-radius: 0 !important;
    overflow: visible !important;
    max-height: none !important;
    flex-shrink: 0 !important;
  }

  .control-group-container:last-child {
    padding-bottom: 28px !important;
  }

  /* --- Child parts panel: ensure scrollable --- */
  .child-parts-panel,
  #child-parts-panel {
    overflow: visible !important;
    max-height: none !important;
    flex-shrink: 0 !important;
  }

  .child-parts-grid {
    overflow-y: visible !important;
    max-height: none !important;
  }

  body:not(.compact-embed) .control-wrapper,
  .control-wrapper {
    flex: none !important;
    min-width: 0 !important;
    width: 100% !important;
    border-bottom: 1px solid #f0f0f0 !important;
    border-right: none !important;
    padding: 0 0 14px 0 !important;
    margin-bottom: 12px !important;
    scroll-snap-align: none !important;
  }

  .control-wrapper:last-child {
    border-bottom: none !important;
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
  }

  /* --- Labels --- */
  .control-label {
    font-size: 0.92rem !important;
    margin-bottom: 4px !important;
    color: #1a1a1a !important;
  }

  .value-display {
    font-size: 1rem !important;
  }

  .control-top-row {
    flex-direction: row !important;
    align-items: center !important;
  }

  .md3-switch-label {
    color: #333 !important;
  }

  /* --- Thumbnails: 3-col grid --- */
  .thumbnail-select {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 8px !important;
    overflow-x: visible !important;
    padding-bottom: 0 !important;
  }

  .thumbnail-icon {
    width: 48px !important;
    height: 48px !important;
  }

  /* --- Colour swatches --- */
  .md3-swatch-circle {
    width: 52px !important;
    height: 52px !important;
  }

  .color-select-expand {
    width: 52px !important;
    height: 52px !important;
  }

  /* --- Slider --- */
  .md3-slider .slider-inc-btn {
    width: 40px !important;
    height: 40px !important;
    flex: 0 0 40px !important;
    font-size: 1.5rem !important;
  }

  .md3-slider .styled-slider {
    height: 6px !important;
  }

  .md3-slider .styled-slider::-webkit-slider-thumb {
    width: 24px !important;
    height: 24px !important;
  }

  .slider-button {
    padding: 10px 16px !important;
    font-size: 0.85rem !important;
  }

  .spin-pill {
    padding: 10px 14px !important;
  }

  /* --- MOQ warning badge: inside viewer area --- */
  #moq-warning-floating {
    bottom: auto !important;
    top: 40px !important;
    font-size: 11px !important;
    padding: 4px 10px !important;
    border-radius: 30px !important;
  }

  #moq-warning-floating .moq-warning-icon {
    font-size: 14px !important;
  }

  #moq-warning-floating .moq-warning-text {
    font-size: 10px !important;
  }

  /* --- Build size badge: inside viewer area --- */
  #build-size-floating {
    bottom: auto !important;
    top: 8px !important;
    font-size: 0.72rem !important;
    padding: 5px 12px !important;
  }

  /* --- Floating toolbar: horizontal row above tabs --- */
  .floating-toolbar {
    position: fixed !important;
    top: calc(50dvh - 52px) !important;
    left: 0 !important;
    right: 0 !important;
    bottom: auto !important;
    width: 100% !important;
    z-index: 102 !important;
    border-radius: 0 !important;
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    box-shadow: none !important;
    border: none !important;
    border-top: 1px solid #ebebeb !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: auto !important;
    padding: 6px 0 4px !important;
  }

  .floating-toolbar .toolbar-button-list {
    flex-direction: row !important;
    gap: 0 !important;
    padding: 0 4px !important;
    display: flex !important;
    align-items: flex-start !important;
    justify-content: center !important;
    width: 100% !important;
  }

  .floating-toolbar .toolbar-button-item {
    flex: 0 0 auto !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 2px !important;
    padding: 2px 10px !important;
  }

  .floating-toolbar .toolbar-button-item:not([style*="display:none"]):not([style*="display: none"]) {
    display: flex !important;
  }

  .toolbar-button {
    padding: 0 !important;
    font-size: 26px !important;
    line-height: 1 !important;
  }

  .toolbar-button-label {
    display: block !important;
    font-size: 9px !important;
    font-weight: 600 !important;
    letter-spacing: 0.3px !important;
    color: #666 !important;
    text-transform: uppercase !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    user-select: none !important;
    pointer-events: none !important;
  }

  /* --- Toolbar toggle: hide hamburger on kodxx --- */
  .toolbar-toggle {
    display: none !important;
  }

  /* --- Creator logo: hide on mobile (not enough space) --- */
  #creator-logo {
    display: none !important;
  }

  /* --- Child tiles --- */
  .child-tile {
    width: auto !important;
    min-width: 110px !important;
  }

  /* --- Switch --- */
  .md3-switch-track {
    width: 50px !important;
    height: 28px !important;
  }

  .md3-switch-thumb {
    width: 22px !important;
    height: 22px !important;
  }

  .md3-switch input:checked + .md3-switch-track .md3-switch-thumb {
    left: 25px !important;
  }


  /* --- Hide range details --- */
  .range-details {
    display: none !important;
  }

  /* --- Context menu --- */
  .context-menu-pill {
    z-index: 3000 !important;
  }

  /* --- Checkbox --- */
  .checkboxStyle1 input[type="checkbox"] {
    width: 50px !important;
    height: 26px !important;
    border-radius: 13px !important;
  }

  .checkboxStyle1 input[type="checkbox"]::before {
    width: 20px !important;
    height: 20px !important;
    top: 3px !important;
    left: 3px !important;
  }

  .checkboxStyle1 input[type="checkbox"]:checked::before {
    transform: translateX(24px) !important;
  }

  /* --- Guidance region --- */
  #control-guidance-region {
    top: 8px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: calc(100% - 24px) !important;
    max-width: 500px !important;
    position: absolute !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* --- BOM panel: slide up from bottom on mobile --- */
  #bom-panel {
    top: auto !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 60dvh !important;
    max-height: 60dvh !important;
    border-left: none !important;
    border-right: none !important;
    border-top: none !important;
    border-radius: 16px 16px 0 0 !important;
    box-shadow: none !important;
    transition: transform 0.3s ease, box-shadow 0.3s ease !important;
    transform: translateY(100%) !important;
    z-index: 300 !important;
  }

  #bom-panel.visible {
    left: 0 !important;
    transform: translateY(0) !important;
    box-shadow: none !important;
  }

  /* Drag handle hint at top */
  #bom-panel::before {
    content: '';
    display: block;
    width: 36px;
    height: 4px;
    background: #d4d4d4;
    border-radius: 2px;
    margin: 10px auto 6px;
    flex-shrink: 0;
  }

  /* Mobile: hide pin button, not useful */
  #bom-panel #bom-pin-toggle {
    display: none !important;
  }

  /* Mobile: larger close button */
  #bom-panel .bom-panel-tab-action {
    width: 36px !important;
    height: 36px !important;
  }

  /* Mobile: compact controls bar */
  #bom-panel .bom-controls-bar {
    padding: 8px 14px !important;
  }

  #bom-panel .bom-view-btn {
    padding: 6px 10px !important;
    font-size: 0.7rem !important;
  }

  /* Mobile: table sizing */
  #bom-panel #bom-table {
    font-size: 0.72rem !important;
  }

  #bom-panel #bom-table th:nth-child(1) { width: 25% !important; }
  #bom-panel #bom-table th:nth-child(3) { width: 32px !important; }
  #bom-panel #bom-table th:nth-child(4) { width: 44px !important; }
  #bom-panel #bom-table th:nth-child(5) { width: 50px !important; }

  #bom-panel #bom-table thead th {
    padding: 6px 5px !important;
    font-size: 0.58rem !important;
  }

  #bom-panel #bom-table tbody td {
    padding: 8px 5px !important;
  }

  /* Mobile: stacked cards */
  #bom-panel .bom-stacked-card {
    margin: 6px 10px !important;
    padding: 12px !important;
  }

  /* Mobile: qty section */
  #bom-panel .bom-qty-section {
    padding: 10px 14px !important;
  }

  /* --- Scene Markup: bottom half sheet on mobile --- */
  #sceneMarkupSidePanel {
    width: 100% !important;
    height: 50dvh !important;
    top: auto !important;
    bottom: 0 !important;
    right: 0 !important;
    left: 0 !important;
    border-radius: 16px 16px 0 0 !important;
    box-shadow: none !important;
    transform: translateY(100%) !important;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1) !important;
  }

  #sceneMarkupSidePanel.visible {
    right: 0 !important;
    transform: translateY(0) !important;
  }

  #sceneMarkupSidePanel::before {
    content: '';
    display: block;
    width: 36px;
    height: 4px;
    background: #d4d4d4;
    border-radius: 2px;
    margin: 10px auto 0;
    flex-shrink: 0;
  }

  /* --- Dressing wizard: bottom half sheet on mobile --- */
  #dressingWizardPanel {
    width: 100% !important;
    height: 50dvh !important;
    top: auto !important;
    bottom: 0 !important;
    right: 0 !important;
    left: 0 !important;
    border-radius: 16px 16px 0 0 !important;
    box-shadow: none !important;
    transform: translateY(100%) !important;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1) !important;
  }

  #dressingWizardPanel.visible {
    right: 0 !important;
    transform: translateY(0) !important;
  }

  /* --- Plan View wireframe menu: bottom half sheet on mobile --- */
  #plan-view-wireframe-menu {
    width: 100% !important;
    height: 50dvh !important;
    top: auto !important;
    bottom: 0 !important;
    right: 0 !important;
    left: 0 !important;
    border-radius: 16px 16px 0 0 !important;
    box-shadow: none !important;
    transform: translateY(100%) !important;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1) !important;
  }

  #plan-view-wireframe-menu[data-open="true"] {
    right: 0 !important;
    transform: translateY(0) !important;
  }

  /* Drag handle hint */
  #plan-view-wireframe-menu::before {
    content: '';
    display: block;
    width: 36px;
    height: 4px;
    background: #d4d4d4;
    border-radius: 2px;
    margin: 10px auto 0;
    flex-shrink: 0;
  }

  /* Drag handle hint */
  #dressingWizardPanel::before {
    content: '';
    display: block;
    width: 36px;
    height: 4px;
    background: #d4d4d4;
    border-radius: 2px;
    margin: 10px auto 0;
    flex-shrink: 0;
  }

  /* Smaller item tiles on mobile */
  .dw-item-grid {
    grid-template-columns: repeat(6, 1fr) !important;
    gap: 6px !important;
  }

  .dw-item-tile img {
    padding: 2px !important;
  }

  .dw-item-tile-label {
    font-size: 9px !important;
    padding: 2px 3px !important;
  }

  .dw-item-tile-icon {
    font-size: 32px !important;
    padding: 6px !important;
  }

  .dw-panel-body {
    padding: 10px 12px !important;
    gap: 10px !important;
  }

  .dw-section {
    padding: 10px !important;
  }

  .dw-section-label {
    font-size: 10px !important;
    margin-bottom: 6px !important;
  }

  .dw-category-header {
    font-size: 10px !important;
    padding: 6px 0 2px !important;
  }
}
