/* CSS Design System - Web Color Visualizer */

:root {
  --font-family: 'Outfit', sans-serif;

  /* Compact density tokens */
  --header-h: 48px;
  --panel-left-w: 268px;
  --panel-right-w: 288px;
  --radius-sm: 4px;
  --radius-md: 6px;
  --space-1: 4px;
  --space-2: 6px;
  --space-3: 8px;
  --space-4: 10px;
  --space-5: 12px;

  /* Premium Harmonious Color Palette (HSL Tailored) */
  --bg-app: hsl(230, 20%, 8%);
  --bg-panel: hsla(230, 20%, 12%, 0.75);
  --bg-panel-solid: hsl(230, 20%, 12%);
  --bg-card: hsla(230, 20%, 16%, 0.6);
  --bg-card-hover: hsla(230, 20%, 20%, 0.8);
  
  --border-light: rgba(255, 255, 255, 0.08);
  --border-focus: hsla(210, 100%, 60%, 0.4);
  
  /* Accent Colors */
  --color-primary: hsl(210, 100%, 55%);
  --color-primary-glow: hsla(210, 100%, 55%, 0.35);
  --color-accent: hsl(45, 100%, 50%);
  --color-accent-glow: hsla(45, 100%, 50%, 0.25);
  --color-danger: hsl(355, 85%, 55%);
  
  /* Text Colors */
  --text-main: hsl(220, 20%, 95%);
  --text-muted: hsl(220, 15%, 70%);
  --text-dim: hsl(220, 12%, 50%);
  
  /* Shadows and Blurs */
  --shadow-premium: 0 12px 40px rgba(0, 0, 0, 0.5);
  --shadow-inset: inset 0 2px 4px rgba(255, 255, 255, 0.05);
  --blur-glass: blur(16px);
  --transition-smooth: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  --transition-fast: all 0.15s ease;
}

/* CSS Reset & General Styling */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  font-size: 13px;
  line-height: 1.35;
  background-color: var(--bg-app);
  color: var(--text-main);
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  touch-action: manipulation;
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}

::-webkit-scrollbar-thumb {
  background: hsla(230, 20%, 30%, 0.6);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-primary);
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: hsl(230, 20%, 6%);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.5s ease;
}

.loading-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.loader-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid var(--border-light);
  border-top: 4px solid var(--color-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  box-shadow: 0 0 15px var(--color-primary-glow);
}

.loading-status {
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--text-muted);
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* App Container Layout */
.app-container {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  width: 100%;
}

/* Header */
.app-header {
  height: var(--header-h);
  min-height: var(--header-h);
  background-color: var(--bg-panel);
  backdrop-filter: var(--blur-glass);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-4);
  z-index: 100;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.header-logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.logo-icon {
  font-size: 1.15rem;
  color: var(--color-primary);
}

.logo-text h1 {
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.8px;
  line-height: 1.1;
  background: linear-gradient(135deg, #fff 0%, var(--text-muted) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-text span {
  font-size: 0.62rem;
  color: var(--color-accent);
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.header-meta {
  display: flex;
  gap: var(--space-5);
}

.meta-item label {
  font-size: 0.62rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.meta-item span {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 400;
}

.header-actions {
  display: flex;
  gap: var(--space-2);
}

#save-liked-combinations-btn[hidden] { display: none !important; }
.header-btn {
  font-family: var(--font-family);
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  color: var(--text-main);
  padding: 5px 9px;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 400;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: var(--transition-fast);
  white-space: nowrap;
}

.header-btn:hover {
  background-color: var(--bg-card-hover);
  border-color: var(--text-dim);
}

.header-btn.primary {
  background: linear-gradient(135deg, var(--color-primary) 0%, hsl(210, 100%, 45%) 100%);
  border: none;
  box-shadow: 0 2px 8px var(--color-primary-glow);
}

.header-btn.primary:hover {
  box-shadow: 0 3px 12px var(--color-primary-glow);
}

.header-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: none;
}

.header-btn-liked {
  border-color: rgba(244, 114, 182, 0.45);
  background: rgba(244, 114, 182, 0.12);
  color: #fce7f3;
}

.header-btn-update {
  border-color: rgba(96, 165, 250, 0.45);
  background: rgba(59, 130, 246, 0.15);
  color: #dbeafe;
}

.header-btn-pdf {
  border-color: rgba(52, 211, 153, 0.45);
  background: rgba(16, 185, 129, 0.14);
  color: #d1fae5;
}

.header-btn-liked:hover:not(:disabled),
.header-btn-update:hover:not(:disabled),
.header-btn-pdf:hover:not(:disabled) {
  filter: brightness(1.08);
}

.mobile-only-header-tool {
  display: none;
}

.workspace-save-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  align-self: center;
  padding: 0 6px;
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--text-dim);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.workspace-save-status[hidden] {
  display: none;
}

.workspace-save-status.is-visible {
  opacity: 1;
}

.workspace-save-status.is-saving {
  color: var(--text-dim);
}

.workspace-save-status.is-saved {
  color: #6ee7b7;
}

.workspace-save-status.is-error {
  color: #fca5a5;
}

.workspace-save-status .fa-spinner {
  animation: workspace-save-spin 0.9s linear infinite;
}

@keyframes workspace-save-spin {
  to {
    transform: rotate(360deg);
  }
}

.header-shadow-menu {
  position: relative;
  flex-shrink: 0;
}

.header-btn-shadow.is-active {
  border-color: rgba(148, 163, 184, 0.55);
  background: rgba(148, 163, 184, 0.16);
}

.shadows-popover {
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  z-index: 400;
  width: min(16rem, 78vw);
  padding: 0.65rem 0.75rem 0.75rem;
  border-radius: 0.75rem;
  border: 1px solid var(--border-light);
  background: rgba(15, 23, 42, 0.96);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(10px);
}

.shadows-popover.hidden {
  display: none !important;
}

.shadows-popover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-main);
}

.shadows-popover input[type="range"] {
  width: 100%;
  min-height: 44px;
}

.project-disclaimer-modal {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  padding-bottom: max(1rem, env(safe-area-inset-bottom));
}

.project-disclaimer-modal.hidden {
  display: none;
}

.project-disclaimer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(4px);
}

.project-disclaimer-card {
  position: relative;
  z-index: 1;
  width: min(24rem, 100%);
  max-height: min(78vh, 34rem);
  overflow-y: auto;
  padding: 1rem 1rem 0.9rem;
  border-radius: 1rem;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: #0f172a;
  color: #e2e8f0;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

.project-disclaimer-card h2 {
  margin: 0 0 0.65rem;
  font-size: 1rem;
  line-height: 1.3;
  color: #f8fafc;
}

.project-disclaimer-card p {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.5;
  color: #cbd5e1;
}

.project-disclaimer-actions {
  display: flex;
  flex-direction: column-reverse;
  gap: 0.5rem;
  margin-top: 1rem;
}

.project-disclaimer-btn {
  min-height: 44px;
  width: 100%;
  border-radius: 0.7rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.project-disclaimer-btn-decline {
  background: transparent;
  color: #cbd5e1;
}

.project-disclaimer-btn-agree {
  border: none;
  background: linear-gradient(135deg, var(--color-primary) 0%, hsl(210, 100%, 45%) 100%);
  color: #fff;
}

body.project-disclaimer-open {
  overflow: hidden;
}

/* Hide liked actions while browsing the template gallery */
body:has(#template-gallery:not(.hidden)) #save-combo-variation-btn,
body:has(#template-gallery:not(.hidden)) #update-combo-variation-btn,
body:has(#template-gallery:not(.hidden)) #download-variations-pdf-btn {
  display: none !important;
}

/* Export Config — hidden for customers; remove this rule (or #export-btn display) to re-enable */
#export-btn {
  display: none !important;
}

/* Share — hidden; copies project link (confused with image share). Remove rule to re-enable. */
#share-btn {
  display: none !important;
}

/* Before/after slider — hidden; prepped white base is not a client "original" photo. Set App.BEFORE_AFTER_SLIDER_ENABLED = true in app.js to restore. */
#visualizer-before[hidden],
#slider-handle[hidden],
.split-slider-tip[hidden] {
  display: none !important;
}

/* App Body Grid Layout */
.app-body {
  flex: 1;
  display: grid;
  grid-template-columns: var(--panel-left-w) 1fr var(--panel-right-w);
  height: calc(100vh - var(--header-h));
  overflow: hidden;
  background-color: var(--bg-app);
}

/* Panel Common Styles */
.panel-left, .panel-right {
  background-color: var(--bg-panel);
  backdrop-filter: var(--blur-glass);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.panel-left {
  border-right: 1px solid var(--border-light);
}

.panel-right {
  border-left: 1px solid var(--border-light);
  min-width: 0;
}

.panel-section-header {
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--border-light);
}

.panel-section-header h2 {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.35px;
  text-transform: uppercase;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.panel-section-header h3 {
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

/* Left Panel - Slot Manager List */
.slot-list-container {
  flex: 1 1 55%;
  min-height: 140px;
  overflow-y: auto;
  padding: var(--space-1);
  -webkit-overflow-scrolling: touch;
  cursor: default;
}

.slot-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.slot-item {
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 4px 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  cursor: pointer;
  transition: var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.slot-item:hover {
  background-color: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.15);
}

.slot-item.active {
  border-color: var(--color-primary);
  background-color: hsla(210, 100%, 55%, 0.08);
  box-shadow: inset 0 0 10px rgba(0, 150, 255, 0.15);
}

.slot-color-indicator {
  width: 20px;
  height: 20px;
  border-radius: var(--radius-sm);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
  border: 1px solid rgba(0,0,0,0.25);
  transition: var(--transition-smooth);
}

.slot-info {
  flex: 1;
  min-width: 0;
}

.slot-title {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.slot-title-row {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.slot-label-select,
.slot-label-custom,
.slot-label-fixed {
  width: 100%;
  min-height: 2.25rem;
  padding: 0.25rem 0.4rem;
  font-size: 1rem;
  line-height: 1.2;
  color: var(--text-main);
  background: var(--bg-elevated, hsl(230, 18%, 12%));
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
}

.slot-label-fixed {
  display: flex;
  align-items: center;
  min-height: 1.35rem;
  padding: 0;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.25;
  background: transparent;
  border: none;
  pointer-events: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (min-width: 640px) {
  .slot-label-select,
  .slot-label-custom {
    min-height: 1.75rem;
    font-size: 0.72rem;
  }

  .slot-label-fixed {
    font-size: 0.72rem;
    min-height: 1.15rem;
  }
}

.slot-label-select:focus-visible,
.slot-label-custom:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 1px;
}

.slot-label-custom::placeholder {
  color: var(--text-dim);
}

.lock-icon {
  font-size: 0.7rem;
  color: var(--color-accent);
}

.slot-details {
  font-size: 0.65rem;
  color: var(--text-dim);
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.slot-item-actions {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0;
}

.icon-btn.locked {
  color: var(--color-accent);
}

.icon-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px;
  font-size: 0.8rem;
  transition: var(--transition-fast);
}

.icon-btn:hover {
  color: var(--text-main);
}

.icon-btn.inactive {
  color: var(--text-dim);
}

/* Left Panel - Active Controls Box */
.active-slot-panel {
  padding: var(--space-2) var(--space-3);
  border-top: 1px solid var(--border-light);
  background-color: hsla(230, 20%, 10%, 0.6);
  overflow-y: auto;
  min-height: 0;
  flex: 0 1 45%;
  max-height: 48%;
}

.combo-code-panel {
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border-light);
}

.slot-swap-panel {
  margin-bottom: var(--space-2);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--border-light);
}

.slot-swap-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}

.slot-swap-label {
  flex: 0 0 auto;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}

.slot-swap-select-wrap {
  flex: 1 1 0;
  min-width: 0;
  width: auto;
}

.slot-swap-select-wrap::after {
  right: 0.4rem;
  font-size: 0.58rem;
  z-index: 1;
}

/* Beat `.select-wrapper select { padding: 5px 10px }` so text clears the chevron */
.select-wrapper.slot-swap-select-wrap select.slot-swap-select {
  width: 100%;
  height: 32px;
  min-height: 32px;
  padding: 0 1.5rem 0 0.4rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 0.72rem;
  line-height: 1.2;
  font-family: inherit;
  appearance: none;
  -webkit-appearance: none;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  cursor: pointer;
}

.select-wrapper.slot-swap-select-wrap select.slot-swap-select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px var(--color-primary-glow);
}

.slot-swap-arrow {
  flex-shrink: 0;
  color: var(--text-muted);
  font-size: 0.65rem;
  line-height: 1;
  opacity: 0.85;
}

.slot-swap-row .control-btn.slot-swap-btn {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  padding: 0;
  gap: 0;
  font-size: 0.7rem;
}

@media (max-width: 380px) {
  .slot-swap-label {
    display: none;
  }

  .slot-swap-arrow {
    display: none;
  }
}

.inspiration-launch-panel {
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border-light);
}

.inspiration-launch-btn {
  width: 100%;
  min-height: 44px;
  justify-content: center;
}

.inspiration-launch-btn.is-active {
  box-shadow: 0 0 0 2px var(--color-primary-glow);
}

.slot-color-pick-panel {
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border-light);
}

.slot-color-pick-btn {
  width: 100%;
  min-height: 44px;
  justify-content: center;
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

/* Invisible native input stretched over the button — clicking anywhere opens the OS color picker. */
.slot-color-pick-btn input[type='color'] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  border: 0;
  padding: 0;
}

.slot-color-pick-status {
  margin: 6px 0 0;
  font-size: 0.72rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.slot-color-pick-status .pick-status-swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 1px solid rgba(0, 0, 0, 0.25);
  flex-shrink: 0;
}

.combo-code-row {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.combo-code-input {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 1rem;
  font-family: inherit;
}

.combo-code-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px var(--color-primary-glow);
}

.combo-code-row .control-btn {
  min-height: 44px;
  flex-shrink: 0;
  white-space: nowrap;
}

.template-gallery {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  flex: 1;
  min-height: 18rem;
  padding: var(--space-3);
  overflow: auto;
  background:
    linear-gradient(180deg, hsla(230, 22%, 8%, 0.97) 0%, hsla(230, 20%, 12%, 0.98) 100%);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
}

.template-gallery.hidden {
  display: none;
}

.visualizer-outer.is-template-mode .visualizer-viewport,
.visualizer-outer.is-template-mode .visualizer-bottom-bar,
.visualizer-outer.is-template-mode #visualizer-hint,
.visualizer-outer.is-template-mode .combo-variations-strip {
  display: none;
}

.template-gallery-intro h3 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  color: var(--text-main);
}

.template-gallery-intro p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.template-gallery-tabs {
  display: flex;
  gap: var(--space-2);
  flex-shrink: 0;
}

.template-tab {
  min-height: 44px;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.template-tab.active {
  color: var(--color-primary);
  border-color: rgba(0, 242, 254, 0.45);
  background: rgba(0, 242, 254, 0.08);
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
}

@media (min-width: 640px) {
  .template-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .template-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.template-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.45rem;
  min-height: 44px;
  padding: 0.45rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  color: var(--text-main);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.template-card:hover,
.template-card:focus-visible {
  border-color: rgba(0, 242, 254, 0.45);
  transform: translateY(-1px);
  outline: none;
}

.template-card img:not([hidden]) {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: hsla(230, 15%, 18%, 0.8);
}

.template-thumb-placeholder {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, hsla(230, 18%, 22%, 0.9), hsla(230, 15%, 14%, 0.95));
}

.template-card span {
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.3;
}

.template-card-title {
  display: block;
}

.template-space-badge {
  color: var(--text-muted) !important;
  background: hsla(230, 15%, 22%, 0.6) !important;
  border-color: var(--border-light) !important;
}

.template-badge {
  align-self: flex-start;
  font-size: 0.65rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-primary) !important;
  background: rgba(0, 242, 254, 0.1);
  border: 1px solid rgba(0, 242, 254, 0.25);
  border-radius: 999px;
  padding: 0.15rem 0.45rem;
}

.active-slot-info-box {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  padding: var(--space-2);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-3);
}

.active-swatch-display {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(0,0,0,0.25);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.active-swatch-text {
  flex: 1;
  min-width: 0;
}

.active-name {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.active-subtext {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.dot {
  margin: 0 4px;
  color: var(--text-dim);
}

.control-group {
  margin-bottom: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.control-group label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--text-muted);
  font-weight: 400;
}

/* Custom Styled Select */
.select-wrapper {
  position: relative;
  width: 100%;
}

.select-wrapper select {
  width: 100%;
  font-family: var(--font-family);
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  color: var(--text-main);
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  cursor: pointer;
  outline: none;
  appearance: none;
  transition: var(--transition-fast);
}

.select-wrapper select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 8px var(--color-primary-glow);
}

.select-wrapper::after {
  content: '\f107';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  font-size: 0.72rem;
}

/* Custom Styled Range Sliders */
.slider-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.slider-value {
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--color-primary);
  background-color: var(--color-primary-glow);
  padding: 1px 5px;
  border-radius: 3px;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 16px;
  background: transparent;
  outline: none;
  cursor: pointer;
}

/* Webkit (Chrome, Safari, Edge) Track */
input[type="range"]::-webkit-slider-runnable-track {
  width: 100%;
  height: 6px;
  cursor: pointer;
  background: var(--bg-card);
  border-radius: 3px;
  border: 1px solid var(--border-light);
}

/* Webkit Thumb */
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  height: 12px;
  width: 12px;
  border-radius: 50%;
  background: var(--color-primary);
  cursor: pointer;
  margin-top: -4px;
  box-shadow: 0 0 6px var(--color-primary-glow);
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: none;
}

/* Firefox Track */
input[type="range"]::-moz-range-track {
  width: 100%;
  height: 6px;
  cursor: pointer;
  background: var(--bg-card);
  border-radius: 3px;
  border: 1px solid var(--border-light);
}

/* Firefox Thumb */
input[type="range"]::-moz-range-thumb {
  height: 12px;
  width: 12px;
  border: none;
  border-radius: 50%;
  background: var(--color-primary);
  cursor: pointer;
  box-shadow: 0 0 6px var(--color-primary-glow);
}

input[type="range"]::-moz-range-thumb:hover {
  transform: none;
}

.action-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
}

.control-btn {
  font-family: var(--font-family);
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  color: var(--text-main);
  padding: 6px;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 400;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: var(--transition-fast);
}

.control-btn:hover {
  background-color: var(--bg-card-hover);
  border-color: var(--text-muted);
}

.control-btn.inactive {
  background-color: rgba(255, 255, 255, 0.02);
  color: var(--text-dim);
}

.control-btn.locked {
  border-color: var(--color-accent);
  color: var(--color-accent);
  background-color: var(--color-accent-glow);
}

/* Middle Panel: Visualizer Viewport */
.panel-middle {
  display: flex;
  flex-direction: column;
  justify-content: stretch;
  align-items: stretch;
  padding: 0;
  background-color: hsl(230, 20%, 6%);
  overflow: hidden;
  min-height: 0;
  position: relative;
}

/* Desktop app: recent projects card shown on launch (injected by desktop-integration) */
.recent-projects-panel {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 30;
  width: min(420px, calc(100% - 32px));
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.recent-projects-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  margin: 0 0 var(--space-3);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.recent-projects-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.recent-project-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  min-height: 44px;
  padding: var(--space-2) var(--space-3);
  background-color: hsla(230, 20%, 14%, 0.7);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  cursor: pointer;
  text-align: left;
  transition: var(--transition-fast);
}

.recent-project-item:hover {
  background-color: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.25);
}

.recent-project-name {
  font-size: 0.8rem;
  font-weight: 500;
}

.recent-project-path {
  font-size: 0.65rem;
  color: var(--text-muted);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  direction: rtl; /* show the end of long paths (folder name) */
  text-align: left;
}

.recent-projects-browse {
  width: 100%;
  min-height: 40px;
  background: none;
  border: 1px dashed var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.75rem;
  cursor: pointer;
  transition: var(--transition-fast);
}

.recent-projects-browse:hover {
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.3);
}

.visualizer-outer {
  position: relative;
  width: 100%;
  max-width: none;
  height: 100%;
  min-height: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: hidden;
}

.visualizer-workspace {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: var(--space-2);
  width: 100%;
  flex: 1;
  min-height: 0;
  height: 100%;
  padding: var(--space-2);
  box-sizing: border-box;
}

.visualizer-room-column {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  overflow: hidden;
}

.inspiration-float {
  position: fixed;
  z-index: 1200;
  top: auto;
  left: auto;
  right: var(--space-3);
  bottom: var(--space-3);
  width: min(26rem, 36vw);
  height: min(52vh, 24rem);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-2);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  background: hsla(230, 22%, 10%, 0.98);
  backdrop-filter: blur(12px);
  box-shadow: 0 20px 56px rgba(0, 0, 0, 0.62);
  overflow: hidden;
}

.inspiration-float:not(.is-positioned) {
  transform: none;
}

.inspiration-float.is-positioned {
  transform: none;
}

.inspiration-float.hidden {
  display: none;
}

.inspiration-float.is-dragging {
  user-select: none;
  cursor: grabbing;
}

.inspiration-drag-handle {
  cursor: grab;
  touch-action: none;
}

.inspiration-drag-handle:active {
  cursor: grabbing;
}

.inspiration-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.inspiration-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.inspiration-close-btn {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.inspiration-close-btn:hover {
  color: var(--text-main);
  border-color: var(--text-muted);
}

.inspiration-hint {
  margin: 0;
}

.inspiration-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.inspiration-action-buttons {
  display: flex;
  gap: var(--space-2);
  width: 100%;
  flex: 1 1 100%;
}

.inspiration-action-buttons .control-btn {
  flex: 1 1 0;
  min-width: 0;
}

.inspiration-actions .control-btn {
  min-height: 44px;
}

.inspiration-map-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  cursor: pointer;
  min-height: 44px;
  user-select: none;
}

.inspiration-map-toggle input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--color-primary);
}

.inspiration-viewport {
  position: relative;
  flex: 1 1 auto;
  min-height: 10rem;
  overflow: hidden;
  border: 1px dashed var(--border-light);
  border-radius: var(--radius-md);
  background: hsl(230, 20%, 6%);
  cursor: crosshair;
  touch-action: none;
}

.inspiration-viewport.is-pan-armed {
  cursor: grab;
}

.inspiration-viewport.is-panning {
  cursor: grabbing;
}

.inspiration-viewport.is-dragover {
  border-color: var(--color-primary);
  background: hsla(230, 70%, 50%, 0.08);
}

.inspiration-render-canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.inspiration-render-canvas.hidden {
  display: none;
}

.inspiration-viewport-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.72rem;
  color: var(--text-muted);
}

.inspiration-viewport-tools.hidden {
  display: none;
}

.inspiration-viewport-tools .control-btn {
  min-height: 36px;
  padding: 0.35rem 0.65rem;
  font-size: 0.72rem;
}

.inspiration-zoom-val {
  font-family: var(--font-mono, ui-monospace, monospace);
  color: var(--text-main);
  min-width: 3rem;
}

.inspiration-zoom-hint {
  flex: 1 1 auto;
}

.inspiration-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  pointer-events: none;
}

.inspiration-empty i {
  font-size: 1.75rem;
  opacity: 0.65;
}

.inspiration-empty.hidden {
  display: none;
}

.inspiration-pick-preview {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  font-size: 0.75rem;
}

.inspiration-pick-preview.hidden {
  display: none;
}

.inspiration-pick-label {
  color: var(--text-muted);
  font-weight: 500;
}

.inspiration-pick-swatch {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  flex-shrink: 0;
}

.inspiration-pick-hex {
  font-family: var(--font-mono, ui-monospace, monospace);
  color: var(--text-main);
}

.inspiration-pick-match {
  color: var(--text-muted);
  flex: 1 1 100%;
}

.visualizer-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: center;
  background-color: var(--bg-panel);
  border: 1px solid var(--border-light);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.visualizer-outer.has-project .visualizer-hint {
  display: none;
}

.visualizer-outer.has-project .visualizer-room-column {
  position: relative;
}

.visualizer-outer.has-project .visualizer-bottom-bar {
  /* Stay in document flow so the house image is never covered / cropped */
  position: relative;
  left: auto;
  right: auto;
  bottom: auto;
  z-index: 24;
  margin: 0;
  flex-shrink: 0;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(8px);
}

/* Sliding Before/After Visualizer Wrapper */
.visualizer-viewport {
  position: relative;
  overflow: hidden;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  border: 1px solid var(--border-light);
  background-color: hsl(230, 20%, 4%);
}

.visualizer-viewport.is-zoomed {
  cursor: grab;
}

.visualizer-viewport.is-panning {
  cursor: grabbing;
}

/* Liked-variation swipe — 3D carousel slide (wrapper only, no opacity/snapshots) */
.visualizer-viewport.is-variation-carousel {
  perspective: 1000px;
  overflow: hidden;
}

.visualizer-wrapper.is-carousel-transitioning {
  transform-origin: center center;
  backface-visibility: hidden;
  will-change: transform;
}

.visualizer-wrapper.is-carousel-exit-next {
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translate3d(-40%, 0, 0) rotateY(15deg) scale(0.95);
}

.visualizer-wrapper.is-carousel-exit-prev {
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translate3d(40%, 0, 0) rotateY(-15deg) scale(0.95);
}

.visualizer-wrapper.is-carousel-enter-from-next {
  transition: none;
  transform: translate3d(40%, 0, 0) rotateY(-15deg) scale(0.95);
}

.visualizer-wrapper.is-carousel-enter-from-prev {
  transition: none;
  transform: translate3d(-40%, 0, 0) rotateY(15deg) scale(0.95);
}

.visualizer-wrapper.is-carousel-enter-active {
  transition: transform 0.25s cubic-bezier(0.33, 1, 0.68, 1);
  transform: translate3d(0, 0, 0) rotateY(0deg) scale(1);
}

@keyframes combo-variation-badge-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.12);
  }
}

.combo-variation-viewport-badge.is-pulsing {
  animation: combo-variation-badge-pulse 0.26s ease-out;
}

@media (prefers-reduced-motion: reduce) {
  .visualizer-wrapper.is-carousel-exit-next,
  .visualizer-wrapper.is-carousel-exit-prev,
  .visualizer-wrapper.is-carousel-enter-from-next,
  .visualizer-wrapper.is-carousel-enter-from-prev,
  .visualizer-wrapper.is-carousel-enter-active {
    transition: none !important;
    transform: none !important;
  }

  .combo-variation-viewport-badge.is-pulsing {
    animation: none !important;
  }
}

.visualizer-wrapper {
  position: relative;
  width: 100%;
  max-width: 100%;
  max-height: 100%;
  overflow: hidden;
  transform-origin: 0 0;
  will-change: transform;
  flex-shrink: 0;
}

.visualizer-pane {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* Pane After (Customized version) is standard layout */
#visualizer-after {
  z-index: 1;
}

/* Pane Before (Original version) is clipped overlay */
#visualizer-before {
  z-index: 5;
  width: 50%; /* starting split position */
  overflow: hidden;
  border-right: 1px solid rgba(255, 255, 255, 0.25);
}

.visualizer-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

/* Specific Stacking for Visualizer Layers */
#base-img, #base-img-before {
  z-index: 1;
}

.regions-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2; /* Sits above base image */
}

.region-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Shadows overlay sits on top of color canvases, multiplying textures over them */
.shadows-img {
  z-index: 3;
  mix-blend-mode: multiply !important;
}

.hover-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  mix-blend-mode: normal;
  z-index: 4; /* Sits above shadows when hovering */
}

.click-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10; /* sits on top of everything to catch inputs */
  cursor: default;
}

/* Before/After Split Slider Handle */
.slider-handle {
  position: absolute;
  top: 0;
  left: 50%;
  width: 28px;
  height: 100%;
  background-color: transparent;
  z-index: 15;
  transform: translateX(-50%);
  pointer-events: auto;
  cursor: ew-resize;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  touch-action: none;
}

.slider-line {
  flex: 1;
  width: 3px;
  background-color: #ffffff;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.slider-button {
  width: 30px;
  height: 30px;
  background-color: #ffffff;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  color: hsl(230, 20%, 15%);
  font-size: 0.72rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

/* Bottom Visualizer Controls Bar */
.visualizer-bottom-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-2) var(--space-3);
  background-color: var(--bg-panel);
  border: 1px solid var(--border-light);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
}

.visualizer-bottom-bar .control-group {
  flex: 1 1 200px;
  max-width: 100% !important;
  min-width: 0;
}

.control-group.inline {
  flex-direction: row;
  align-items: center;
  margin-bottom: 0;
  gap: var(--space-3);
  flex: 1;
  max-width: 400px;
}

.control-group.inline label {
  white-space: nowrap;
}

.control-group.inline input[type="range"] {
  flex: 1;
}

.split-slider-tip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-size: 0.68rem;
  color: var(--text-muted);
  flex: 1 1 100%;
}

.visualizer-zoom-controls {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  flex-shrink: 0;
}

.zoom-btn {
  font-family: var(--font-family);
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  transition: var(--transition-fast);
}

.zoom-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--text-dim);
}

.zoom-level-val {
  font-size: 0.68rem;
  color: var(--text-muted);
  min-width: 42px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 767px) {
  .visualizer-zoom-controls {
    display: none;
  }
}

.gradient-bar {
  width: 60px;
  height: 4px;
  background: linear-gradient(to right, var(--text-dim) 0%, var(--color-primary) 100%);
  border-radius: 2px;
}

/* Right Panel: Paint Catalogs & Swatches */
.palette-selectors {
  padding: var(--space-3);
  border-bottom: 1px solid var(--border-light);
  background-color: hsla(230, 20%, 10%, 0.4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

/* Search Bar Styling */
.search-wrapper {
  position: relative;
  width: 100%;
}

.search-wrapper input {
  width: 100%;
  font-family: var(--font-family);
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  color: var(--text-main);
  padding: 5px 34px 5px 30px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  outline: none;
  transition: var(--transition-fast);
}

.search-wrapper input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 8px var(--color-primary-glow);
}

.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-size: 0.72rem;
  pointer-events: none;
}

.search-clear-btn {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  padding: 0;
  line-height: 1;
}

.search-clear-btn:hover,
.search-clear-btn:focus-visible {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.08);
}

.search-clear-btn.hidden {
  display: none;
}

/* Custom Color Picker Button */
.custom-color-row {
  margin-top: 4px;
}

.custom-picker-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-fast);
  position: relative;
}

.custom-picker-btn:hover {
  background-color: var(--bg-card-hover);
  color: var(--text-main);
}

.custom-picker-btn input[type="color"] {
  border: none;
  background: none;
  width: 24px;
  height: 24px;
  cursor: pointer;
  border-radius: 4px;
  outline: none;
}

/* Color Mapping Actions */
.mapping-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.mapping-actions .control-btn.accent {
  border-color: rgba(0, 242, 254, 0.35);
  color: var(--color-primary);
}

.mapping-actions .control-btn.accent:hover {
  background-color: rgba(0, 242, 254, 0.08);
  box-shadow: 0 0 12px var(--color-primary-glow);
}

/* Cross-Brand Match Panel */
.cross-brand-panel {
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
  padding: 14px 16px;
  background-color: hsla(230, 20%, 10%, 0.45);
  flex-shrink: 0;
}

.panel-section-header.compact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-1);
  padding: var(--space-2) var(--space-3);
}

.panel-section-header.compact h3 {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.icon-btn-sm {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-fast);
}

.icon-btn-sm:hover {
  color: var(--color-primary);
  border-color: rgba(0, 242, 254, 0.35);
}

.cross-brand-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 10px;
  line-height: 1.4;
}

.cross-brand-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
}

.cross-brand-empty,
.cross-brand-loading {
  font-size: 0.78rem;
  color: var(--text-dim);
  text-align: center;
  padding: 12px 8px;
}

.cross-brand-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  cursor: pointer;
  transition: var(--transition-fast);
}

.cross-brand-item:hover {
  border-color: rgba(0, 242, 254, 0.35);
  background: var(--bg-card-hover);
}

.cross-brand-item.is-current-brand {
  border-color: rgba(0, 242, 254, 0.5);
  box-shadow: 0 0 10px var(--color-primary-glow);
}

.cross-brand-swatch {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
}

.cross-brand-info {
  flex: 1;
  min-width: 0;
}

.cross-brand-brand {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-main);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.cross-brand-detail {
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cross-brand-delta {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 3px 6px;
  border-radius: 4px;
  background: var(--color-primary-glow);
  color: var(--color-primary);
  flex-shrink: 0;
  text-align: center;
  min-width: 52px;
}

/* Combination Methods Panel */
.combo-methods-panel {
  border-bottom: 1px solid var(--border-light);
  background-color: hsla(230, 20%, 10%, 0.5);
  flex-shrink: 0;
}

.combo-method-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 3px;
  padding: 0 var(--space-2) var(--space-2);
}

.combo-tab {
  font-family: var(--font-family);
  font-size: 0.62rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.2px;
  padding: 5px 2px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-fast);
}

.combo-tab.active {
  color: var(--color-primary);
  border-color: rgba(0, 242, 254, 0.4);
  background: rgba(0, 242, 254, 0.08);
  box-shadow: none;
}

.combo-panel.hidden {
  display: none;
}

.manual-combo-tools {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.manual-combo-tools.hidden {
  display: none;
}

.manual-combo-tools-heading {
  padding: 4px var(--space-2);
  flex-shrink: 0;
}

.manual-combo-tools-heading h2 {
  font-size: 0.68rem;
}

@media (max-height: 740px) {
  #combo-panel-manual .combo-hint {
    display: none;
  }
}

.combo-panel {
  padding: 0 var(--space-2) var(--space-2);
}

.combo-empty {
  font-size: 0.68rem;
  color: var(--text-dim);
  text-align: center;
  padding: var(--space-2) var(--space-1);
}

.combo-hint {
  font-size: 0.66rem;
  color: var(--text-muted);
  line-height: 1.3;
  margin-bottom: var(--space-2);
}

.combo-action-btn {
  width: 100%;
  font-family: var(--font-family);
  font-size: 0.72rem;
  font-weight: 500;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  color: var(--text-main);
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin-top: var(--space-2);
}

.combo-action-btn.primary {
  border-color: rgba(0, 242, 254, 0.35);
  color: var(--color-primary);
}

.combo-action-btn.primary:hover {
  background: rgba(0, 242, 254, 0.08);
}

.genx-slot-rules,
.slot-rules {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  max-height: 140px;
  overflow-y: auto;
  margin-bottom: 2px;
}

.genx-rule-row,
.slot-rule-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-1);
  align-items: end;
  padding: var(--space-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: var(--bg-card);
}

.genx-rule-slot,
.slot-rule-name {
  grid-column: 1 / -1;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-main);
  margin-bottom: 1px;
}

.genx-rule-row label,
.slot-rule-row label {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.2px;
  color: var(--text-muted);
  display: block;
  margin-bottom: 2px;
}

.genx-rule-row select,
.genx-rule-row input[type="range"],
.slot-rule-row select,
.slot-rule-row input[type="range"] {
  width: 100%;
}

.genx-sat-val,
.slot-sat-val {
  font-size: 0.62rem;
  color: var(--color-primary);
}

/* Genie — instant combination button */
.genie-action-row {
  display: flex;
  justify-content: center;
  margin-bottom: var(--space-2);
}

.genie-generate-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  min-width: 96px;
  min-height: 96px;
  padding: var(--space-1);
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-main);
  cursor: pointer;
  transition: var(--transition-fast);
}

.genie-generate-btn:hover,
.genie-generate-btn:focus-visible {
  background: rgba(0, 242, 254, 0.08);
  outline: none;
}

.genie-generate-btn:active {
  transform: scale(0.97);
}

.genie-btn-img {
  display: none;
  width: 96px;
  height: 96px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  pointer-events: none;
}

.genie-generate-btn.genie-img-ready .genie-btn-img {
  display: block;
}

.genie-btn-img.genie-img-missing {
  display: none;
}

.genie-btn-fallback {
  display: flex;
  font-size: 2.5rem;
  color: var(--color-primary);
  width: 96px;
  height: 96px;
  align-items: center;
  justify-content: center;
}

.genie-generate-btn.genie-img-ready .genie-btn-fallback {
  display: none;
}

.genie-btn-caption {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-muted);
  line-height: 1.2;
  text-align: center;
}

/* Mobile Genie — quick combos on the room image */
.genie-mobile-float {
  display: none;
}

.mobile-explore-float {
  display: none;
}

.visualizer-outer.is-template-mode .genie-mobile-float,
.visualizer-outer.is-template-mode .mobile-explore-float {
  display: none !important;
}

body:has(#template-gallery:not(.hidden)) .genie-mobile-float,
body:has(#template-gallery:not(.hidden)) .mobile-explore-float {
  display: none !important;
}

/* Desktop Genie — below paint palette swatches */
.desktop-room-toolbar {
  display: none;
}

.palette-genie-bar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2) var(--space-3);
  border-top: 1px solid var(--border-light);
  background: hsla(230, 20%, 8%, 0.92);
}

/* "Generate 4 variations" button beside Genie */
.genie-4x-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  min-width: 96px;
  min-height: 52px;
  margin-left: var(--space-3);
  padding: 8px 14px;
  background: linear-gradient(160deg, rgba(0, 242, 254, 0.16), rgba(0, 242, 254, 0.04));
  border: 1px solid rgba(0, 242, 254, 0.45);
  border-radius: var(--radius-md);
  color: var(--color-primary);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: var(--transition-fast);
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.12);
}

.genie-4x-btn i {
  font-size: 0.95rem;
  margin-bottom: 1px;
}

.genie-4x-btn small {
  font-size: 0.58rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.genie-4x-btn:hover {
  background: linear-gradient(160deg, rgba(0, 242, 254, 0.28), rgba(0, 242, 254, 0.08));
  border-color: rgba(0, 242, 254, 0.75);
  box-shadow: 0 0 16px var(--color-primary-glow);
}

/* Genie ×4 variations modal */
.genie-variations-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-3);
}

.genie-variations-modal.hidden {
  display: none;
}

.genie-variations-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 8, 16, 0.72);
}

.genie-variations-card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(960px, 100%);
  max-height: calc(100vh - 48px);
  overflow: hidden;
  background-color: hsl(230, 20%, 11%);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  box-shadow: 0 16px 60px rgba(0, 0, 0, 0.55);
}

.genie-variations-body {
  display: flex;
  gap: var(--space-3);
  flex: 1;
  min-height: 0;
}

.genie-variations-side {
  flex: 0 0 220px;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  overflow-y: auto;
  min-height: 0;
  padding-right: var(--space-1);
}

.genie-side-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--text-muted);
  margin-top: var(--space-1);
}

.genie-side-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-top: var(--space-1);
}

/* ---- House sides bar (multi-project session) ---- */
.house-sides-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  padding: 2px 0;
  margin: 0;
  min-width: 0;
  background: transparent;
  border: none;
  border-radius: 0;
}

.house-sides-bar.hidden {
  display: none;
}

.house-sides-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
  flex-shrink: 0;
}

.house-sides-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
}

.house-side-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 4px 12px;
  border: 1px solid var(--border-light);
  border-radius: 999px;
  background: none;
  color: var(--text-muted);
  font-family: var(--font-family);
  font-size: 0.72rem;
  cursor: pointer;
  transition: var(--transition-fast);
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.house-side-chip:hover {
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.35);
}

.house-side-chip.is-active {
  color: var(--text-main);
  border-color: var(--accent, #e8b13c);
  background: rgba(232, 177, 60, 0.12);
}

.house-side-chip:disabled {
  opacity: 0.6;
  cursor: wait;
}

.house-sides-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 36px;
  padding: 4px 8px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text-muted);
  font-family: var(--font-family);
  font-size: 0.68rem;
  white-space: nowrap;
  cursor: pointer;
  transition: var(--transition-fast);
}

.house-sides-btn:hover {
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.35);
}

.house-sides-btn.accent {
  color: var(--accent, #e8b13c);
  border-color: rgba(232, 177, 60, 0.45);
}

.house-sides-btn.accent:hover {
  background: rgba(232, 177, 60, 0.12);
}

.house-sides-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

body.mobile-tab-mode .house-sides-bar {
  padding: 0;
}

.genie-global-controls {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: var(--space-1);
  transition: opacity 0.15s ease;
}

.genie-global-controls.is-disabled {
  opacity: 0.45;
}

.genie-global-note {
  font-size: 0.6rem;
  color: var(--text-muted);
  font-weight: 400;
  text-transform: none;
}

.genie-global-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.genie-global-name {
  font-size: 0.68rem;
  color: var(--text-muted);
  min-width: 62px;
}

.genie-global-slider {
  flex: 1;
  min-width: 0;
}

.genie-global-slider:disabled {
  cursor: not-allowed;
}

.genie-global-val {
  font-size: 0.68rem;
  color: var(--text-muted);
  min-width: 34px;
  text-align: right;
}

.genie-side-label-row .genie-side-label {
  margin-top: 0;
}

.genie-variations-reset {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 28px;
  padding: 3px 8px;
  background: none;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: var(--font-family);
  font-size: 0.65rem;
  cursor: pointer;
  transition: var(--transition-fast);
}

.genie-variations-reset:hover {
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.35);
}

.genie-variations-rules {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.genie-rule-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: var(--space-2);
  background-color: hsla(230, 20%, 16%, 0.55);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
}

.genie-rule-name {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-main);
}

.genie-rule-tone {
  width: 100%;
  min-height: 32px;
  padding: 4px 8px;
  background-color: hsla(230, 20%, 12%, 0.9);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: var(--font-family);
  font-size: 0.72rem;
  cursor: pointer;
}

.genie-rule-sat {
  display: flex;
  align-items: center;
  gap: 8px;
}

.genie-rule-sat-slider {
  flex: 1;
  min-width: 0;
}

.genie-rule-sat-val {
  font-size: 0.68rem;
  color: var(--text-muted);
  min-width: 34px;
  text-align: right;
}

.genie-variations-apply-btn {
  margin-top: var(--space-1);
  min-height: 40px;
}

.genie-variations-scroll {
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
}

@media (max-width: 700px) {
  .genie-variations-body {
    flex-direction: column;
  }

  .genie-variations-side {
    flex: 0 0 auto;
    max-height: 36vh;
  }
}

.genie-variations-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.genie-variations-method {
  width: 100%;
  min-height: 36px;
  padding: 6px 10px;
  background-color: hsla(230, 20%, 16%, 0.9);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: var(--font-family);
  font-size: 0.75rem;
  cursor: pointer;
}

.genie-variations-method:hover {
  border-color: rgba(255, 255, 255, 0.35);
}

.genie-variations-header h2 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.genie-variations-close {
  min-width: 36px;
  min-height: 36px;
  background: none;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-fast);
}

.genie-variations-close:hover {
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.35);
}

.genie-variations-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}

/* Liked variations — delivery review grid */
.liked-review-modal {
  position: fixed;
  inset: 0;
  z-index: 1250;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}

@media (min-width: 640px) {
  .liked-review-modal {
    align-items: center;
    padding: var(--space-3);
  }
}

.liked-review-modal.hidden {
  display: none;
}

body.liked-review-open {
  overflow: hidden;
}

.liked-review-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 8, 16, 0.78);
}

.liked-review-card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-height: min(92vh, 920px);
  overflow: hidden;
  background-color: hsl(230, 20%, 11%);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  padding: var(--space-3) var(--space-3) calc(var(--space-3) + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.45);
}

@media (min-width: 640px) {
  .liked-review-card {
    width: min(1080px, 100%);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    box-shadow: 0 16px 60px rgba(0, 0, 0, 0.55);
  }
}

.liked-review-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
}

.liked-review-header h2 {
  font-size: 1.05rem;
  color: var(--text-main);
  margin: 0 0 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.liked-review-subtitle {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.liked-review-close {
  flex-shrink: 0;
  min-width: 44px;
  min-height: 44px;
  background: none;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
}

.liked-review-close:hover {
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.35);
}

.liked-review-similar-hint {
  margin: 0 0 var(--space-2);
  padding: 0.55rem 0.75rem;
  font-size: 0.78rem;
  line-height: 1.4;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(251, 191, 36, 0.35);
  background: rgba(251, 191, 36, 0.1);
  color: #fef3c7;
}

.liked-review-similar-hint.hidden {
  display: none;
}

.liked-review-grid {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
  padding: 2px 0 var(--space-2);
}

@media (min-width: 640px) {
  .liked-review-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-3);
  }
}

@media (min-width: 960px) {
  .liked-review-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.liked-review-cell {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: hsla(230, 20%, 16%, 0.55);
  text-align: left;
}

.liked-review-cell.active {
  border-color: rgba(96, 165, 250, 0.75);
  box-shadow: 0 0 0 1px rgba(96, 165, 250, 0.35);
}

.liked-review-cell.is-similar {
  border-color: rgba(251, 191, 36, 0.45);
}

.liked-review-cell.is-duplicate {
  border-color: rgba(248, 113, 113, 0.5);
}

.liked-review-apply {
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  min-height: 44px;
}

.liked-review-thumb {
  width: 100%;
  height: auto;
  display: block;
  vertical-align: middle;
}

.liked-review-meta {
  padding: 0.45rem 0.5rem 0.35rem;
}

.liked-review-num {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.liked-review-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.liked-review-swatches {
  display: flex;
  gap: 3px;
  padding: 0 0.5rem 0.45rem;
}

.liked-review-swatch {
  flex: 1;
  min-width: 0;
  height: 8px;
  border-radius: 2px;
}

.liked-review-badge {
  margin: 0 0.5rem 0.45rem;
  padding: 0.35rem 0.45rem;
  font-size: 0.68rem;
  line-height: 1.3;
  border-radius: var(--radius-sm);
  background: rgba(251, 191, 36, 0.12);
  color: #fde68a;
  border: 1px solid rgba(251, 191, 36, 0.25);
}

.liked-review-badge.is-duplicate {
  background: rgba(248, 113, 113, 0.12);
  color: #fecaca;
  border-color: rgba(248, 113, 113, 0.3);
}

.liked-review-remove {
  align-self: flex-end;
  margin: 0 0.5rem 0.5rem;
  min-height: 44px;
  padding: 0 0.75rem;
  font-size: 0.72rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  cursor: pointer;
}

.liked-review-footer {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding-top: var(--space-2);
  border-top: 1px solid var(--border-light);
}

.liked-review-footer .control-btn {
  flex: 1 1 auto;
  min-height: 44px;
}

@media (min-width: 640px) {
  .liked-review-footer .control-btn {
    flex: 0 1 auto;
  }
}

.genie-variation-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  background-color: hsla(230, 20%, 16%, 0.6);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: var(--transition-fast);
  min-height: 120px;
  align-items: stretch;
  justify-content: center;
}

.genie-variation-cell:hover {
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-2px);
}

.genie-variation-cell.is-loading {
  align-items: center;
  cursor: default;
}

.genie-variation-apply {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
}

.genie-variation-like {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 12, 22, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition-fast);
}

.genie-variation-like:hover {
  background: rgba(10, 12, 22, 0.85);
  border-color: rgba(255, 255, 255, 0.5);
  transform: scale(1.08);
}

.genie-variation-like.is-liked {
  color: #ff5b77;
  border-color: rgba(255, 91, 119, 0.7);
}

.genie-variation-spinner {
  color: var(--text-muted);
  font-size: 1.3rem;
  animation: genie-spin 1.2s linear infinite;
}

@keyframes genie-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.genie-variation-thumb {
  display: block;
  width: 100%;
  height: auto;
}

.genie-variation-strip {
  display: flex;
  height: 16px;
}

.genie-variation-strip span {
  flex: 1;
  min-width: 0;
}

.genie-variations-error {
  grid-column: 1 / -1;
  color: #f2b8b5;
  font-size: 0.8rem;
  text-align: center;
  padding: var(--space-4);
}

.genie-variations-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.genie-variations-hint {
  font-size: 0.7rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

@media (max-width: 640px) {
  .genie-variations-grid {
    grid-template-columns: 1fr;
  }
}

/* Previous Genie combinations (bottom bar, beside shadows slider) */
.genie-recent-bar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.genie-recent-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--text-muted);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
}

.genie-recent-chips {
  display: flex;
  gap: 6px;
}

.genie-recent-chip {
  display: flex;
  width: 110px;
  height: 28px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition-fast);
  background: none;
}

.genie-recent-chip:hover {
  transform: scale(1.08);
  border-color: rgba(255, 255, 255, 0.55);
}

.genie-recent-stripe {
  flex: 1;
  min-width: 0;
}

.palette-genie-bar.hidden {
  display: none;
}

.palette-genie-btn {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  width: 100%;
  min-height: 56px;
  padding: 0.55rem 0.9rem;
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(0, 242, 254, 0.35);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.palette-genie-btn:hover,
.palette-genie-btn:focus-visible {
  background: rgba(15, 23, 42, 1);
  border-color: rgba(0, 242, 254, 0.55);
  outline: none;
}

.palette-genie-btn:active {
  transform: scale(0.98);
}

.palette-genie-btn .genie-btn-img {
  display: block;
  width: 44px;
  height: 44px;
}

.palette-genie-btn .genie-btn-fallback {
  width: auto;
  height: auto;
  font-size: 1.6rem;
}

.palette-genie-btn.genie-img-ready .genie-btn-fallback {
  display: none;
}

.palette-genie-btn .genie-btn-caption {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
}

.genie-desktop-float {
  display: none;
}

.visualizer-outer.is-template-mode .desktop-room-toolbar,
body:has(#template-gallery:not(.hidden)) .desktop-room-toolbar {
  display: none !important;
}

@media (min-width: 1200px) {
  .desktop-room-toolbar:not(.hidden) {
    display: none;
  }

  .desktop-room-toolbar:not(.hidden) .genie-desktop-float {
    display: none;
  }
}

.save-preset-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  width: 100%;
  min-height: 44px;
  margin: 0 0 var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(0, 242, 254, 0.35);
  background: rgba(0, 242, 254, 0.08);
  color: var(--text-main);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

.save-preset-btn:hover:not(:disabled) {
  border-color: rgba(0, 242, 254, 0.55);
  background: rgba(0, 242, 254, 0.14);
}

.save-preset-btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

.save-preset-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0 0 var(--space-2);
  padding: var(--space-2);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
}

.save-preset-form.hidden,
.save-preset-form[hidden] {
  display: none;
}

.save-preset-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
}

.save-preset-input {
  width: 100%;
  min-height: 44px;
  padding: 0.55rem 0.7rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: var(--bg-main);
  color: var(--text-main);
  font-size: 1rem; /* avoid iOS zoom */
}

@media (min-width: 640px) {
  .save-preset-input {
    font-size: 0.875rem;
  }
}

.save-preset-form-actions {
  display: flex;
  gap: var(--space-2);
  margin-top: 4px;
}

.save-preset-secondary,
.save-preset-primary {
  flex: 1;
  min-height: 44px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.save-preset-secondary {
  border: 1px solid var(--border-light);
  background: transparent;
  color: var(--text-main);
}

.save-preset-primary {
  border: 1px solid rgba(0, 242, 254, 0.45);
  background: rgba(0, 242, 254, 0.16);
  color: var(--text-main);
}

.save-preset-primary:disabled,
.save-preset-secondary:disabled {
  opacity: 0.55;
  cursor: wait;
}

.save-preset-status {
  margin: 0;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.save-preset-status.is-error {
  color: #f87171;
}

.save-preset-status.is-ok {
  color: #4ade80;
}

.preset-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  max-height: 160px;
  overflow-y: auto;
}

.preset-card {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  cursor: pointer;
  transition: var(--transition-fast);
}

.preset-card:hover {
  border-color: rgba(0, 242, 254, 0.3);
  background: var(--bg-card-hover);
}

.preset-swatches {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}

.preset-info {
  flex: 1;
  min-width: 0;
}

.preset-swatch {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  border: 1px solid rgba(0, 0, 0, 0.2);
}

.preset-name {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-main);
}

.preset-desc {
  font-size: 0.64rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.slot-params-panel {
  padding: 0 var(--space-2) var(--space-2);
  border-bottom: 1px solid var(--border-light);
}

.slot-params-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: 2px;
}

.slot-params-header .method-section-label {
  margin-bottom: 0;
}

.slot-rules-reset-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 var(--space-2);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
  flex-shrink: 0;
}

.slot-rules-reset-btn:hover,
.slot-rules-reset-btn:focus-visible {
  border-color: rgba(0, 242, 254, 0.35);
  color: var(--color-primary);
  background: rgba(0, 242, 254, 0.06);
  outline: none;
}

.slot-params-panel.hidden {
  display: none;
}

/* Settings / Methods: use full left panel height (manual tools hidden) */
.panel-left.combo-method-auto .combo-methods-panel {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-left.combo-method-auto #combo-panel-settings:not(.hidden) {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  /* Tools tab stacks several sections — scroll instead of clipping */
  overflow-y: auto;
}

.panel-left.combo-method-auto .slot-params-panel {
  flex: none;
  display: block;
  overflow: visible;
}

.panel-left.combo-method-auto .slot-rules,
.panel-left.combo-method-auto .genx-slot-rules {
  flex: none;
  max-height: none;
  min-height: 0;
  overflow-y: visible;
  margin-bottom: 0;
}

.panel-left.combo-method-auto #combo-panel-harmony:not(.hidden) {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-left.combo-method-auto .method-pill-grid {
  flex: 1 1 auto;
  max-height: none;
  min-height: 0;
  overflow-y: visible;
  align-content: flex-start;
}

.catalog-mapping-panel {
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border-light);
}

.white-label-panel {
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border-light);
}

.white-label-fields {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.white-label-field-label {
  margin: 0.15rem 0 0;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-muted, #64748b);
}

.white-label-input {
  width: 100%;
}

.white-label-check {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  min-height: 44px;
  margin: 0.35rem 0 0.15rem;
  padding: 0.35rem 0;
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1.35;
  color: var(--text-main, #0f172a);
  -webkit-tap-highlight-color: transparent;
}

.white-label-check input {
  flex-shrink: 0;
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.15rem;
  accent-color: var(--color-primary, #1a4d3e);
}

.white-label-fields .control-btn {
  align-self: stretch;
  min-height: 44px;
  margin-top: 0.25rem;
}

@media (min-width: 640px) {
  .white-label-fields .control-btn {
    align-self: flex-start;
  }
}

.panel-left.combo-method-auto.combo-mode-presets .preset-list {
  flex: 1 1 auto;
  max-height: none;
  min-height: 0;
  overflow-y: visible;
}

.panel-left.combo-method-auto.combo-mode-presets #combo-panel-presets:not(.hidden) {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* UXP Color Method Pills */
.method-section-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--text-muted);
  font-weight: 400;
  margin: var(--space-2) 0 var(--space-1);
  display: block;
}

.method-pill-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-height: 120px;
  overflow-y: auto;
}

.method-pill {
  font-family: var(--font-family);
  font-size: 0.62rem;
  font-weight: 400;
  line-height: 1.2;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: hsl(210, 55%, 42%);
  color: #fff;
  cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;
}

.method-pill:hover {
  filter: brightness(1.08);
  border-color: rgba(255, 255, 255, 0.45);
}

.method-pill.active {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 1px var(--color-primary), 0 0 8px var(--color-primary-glow);
}

/* Color Family Filter Bar */
.header-btn-icon {
  padding: 5px 8px;
}

.header-btn-icon:disabled {
  opacity: 0.4;
  cursor: default;
}

/* Recent colors strip (palette panel) */
.recent-colors-bar {
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--border-light);
  background-color: hsla(230, 20%, 10%, 0.35);
  flex-shrink: 0;
  min-width: 0;
}

.recent-colors-row {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.recent-color-swatch {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  padding: 0;
  transition: var(--transition-fast);
}

.recent-color-swatch:hover {
  transform: scale(1.1);
  border-color: rgba(255, 255, 255, 0.5);
}

.color-family-bar {
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--border-light);
  background-color: hsla(230, 20%, 10%, 0.35);
  flex-shrink: 0;
  overflow: hidden;
  min-width: 0;
}

.color-family-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--text-muted);
  font-weight: 400;
  margin-bottom: var(--space-1);
  display: block;
}

.color-family-row {
  display: grid;
  gap: 3px;
  width: 100%;
  overflow: hidden;
}

.family-swatch {
  width: 100%;
  aspect-ratio: 1;
  min-width: 0;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  cursor: pointer;
  transition: var(--transition-fast);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15);
  padding: 0;
  background-clip: padding-box;
}

.family-swatch.active {
  border-color: var(--color-primary);
  box-shadow: 0 0 4px var(--color-primary-glow), inset 0 0 0 1px rgba(0, 0, 0, 0.1);
}

/* Swatch Grid Area */
.swatch-grid-container {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-2);
}

.swatch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
  gap: var(--space-1);
}

.swatch-item {
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 4px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 3px;
  transition: var(--transition-fast);
}

.swatch-item:hover {
  background-color: var(--bg-card-hover);
  border-color: var(--text-dim);
}

.swatch-item.selected {
  border-color: var(--color-primary);
  background-color: hsla(210, 100%, 55%, 0.08);
}

.swatch-color {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 3px;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
  border: 1px solid rgba(0,0,0,0.15);
}

.swatch-check {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  font-size: 0.72rem;
  transition: var(--transition-smooth);
  pointer-events: none;
}

.swatch-item.selected .swatch-check {
  transform: translate(-50%, -50%) scale(1);
}

.swatch-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.swatch-code {
  font-size: 0.6rem;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.swatch-name {
  font-size: 0.62rem;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.palette-loader, .palette-error, .palette-no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: var(--space-5) 0;
  color: var(--text-dim);
  font-size: 0.75rem;
}

/* Saved color combination variations strip */
.combo-variations-strip {
  flex: 0 0 8.5rem;
  width: 8.5rem;
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: min(72vh, 34rem);
  padding: 0.4rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(8px);
}

.combo-variations-toolbar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.35rem;
  flex-shrink: 0;
  margin-bottom: 0.35rem;
}

.combo-variations-title {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.2;
}

.combo-variations-title i {
  color: #f472b6;
}

.combo-variations-count {
  font-weight: 500;
  color: var(--text-muted);
}

.combo-variations-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.combo-variation-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  min-height: 30px;
  height: 30px;
  flex: 1 1 calc(50% - 0.15rem);
  width: auto;
  min-width: 0;
  padding: 0 0.4rem;
  border-radius: 6px;
  border: 1px solid var(--border-light);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  font-size: 0.62rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, filter 0.15s ease;
}

.combo-variation-action-btn i {
  font-size: 0.68rem;
}

.combo-variation-action-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: none;
}

.combo-variation-action-liked {
  border-color: rgba(244, 114, 182, 0.45);
  background: rgba(244, 114, 182, 0.12);
  color: #fce7f3;
}

.combo-variation-action-update {
  border-color: rgba(96, 165, 250, 0.45);
  background: rgba(59, 130, 246, 0.15);
  color: #dbeafe;
}

.combo-variation-action-review {
  border-color: rgba(167, 139, 250, 0.45);
  background: rgba(139, 92, 246, 0.14);
  color: #ede9fe;
  flex: 1 1 100%;
}

.combo-variation-action-liked:hover:not(:disabled),
.combo-variation-action-update:hover:not(:disabled),
.combo-variation-action-review:hover:not(:disabled) {
  filter: brightness(1.08);
}

.whatsapp-send-panel {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: var(--space-2);
  padding-top: var(--space-2);
  border-top: 1px solid var(--border-light);
}

.whatsapp-send-panel.hidden {
  display: none;
}

.whatsapp-send-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--text-muted);
  font-weight: 500;
}

.whatsapp-send-phone {
  width: 100%;
  min-height: 44px;
  padding: 0.45rem 0.6rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: rgba(15, 23, 42, 0.85);
  color: var(--text-main);
  font-size: 1rem;
  box-sizing: border-box;
}

.whatsapp-send-phone:focus {
  outline: none;
  border-color: rgba(37, 211, 102, 0.65);
}

.whatsapp-send-btn {
  justify-content: center;
  min-height: 44px;
  background: rgba(37, 211, 102, 0.16);
  border-color: rgba(37, 211, 102, 0.45);
  color: #d1fae5;
}

.whatsapp-send-btn:hover:not(:disabled),
.whatsapp-send-btn:focus-visible:not(:disabled) {
  background: rgba(37, 211, 102, 0.28);
  border-color: rgba(37, 211, 102, 0.7);
}

.whatsapp-send-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.whatsapp-send-status {
  margin: 0;
  font-size: 0.68rem;
  line-height: 1.35;
  color: var(--text-muted);
}

.whatsapp-send-status.is-ok {
  color: #86efac;
}

.whatsapp-send-status.is-error {
  color: #fca5a5;
}

.combo-variations-scroll {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 0.1rem;
  scroll-snap-type: y proximity;
  -webkit-overflow-scrolling: touch;
}

.combo-variation-card {
  position: relative;
  flex: 0 0 auto;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 0.55rem 0.65rem 0.5rem;
  border-radius: 0.75rem;
  border: 1px solid var(--border-light);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  scroll-snap-align: start;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.combo-variation-card:hover {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.07);
}

.combo-variation-card.active {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 1px rgba(45, 212, 191, 0.35);
  background: rgba(45, 212, 191, 0.08);
}

.combo-variation-swatches {
  display: flex;
  gap: 0.2rem;
  margin-bottom: 0.35rem;
}

.combo-variation-swatch {
  flex: 1 1 0;
  min-width: 0;
  height: 1.15rem;
  border-radius: 0.25rem;
  border: 1px solid rgba(0, 0, 0, 0.2);
}

.combo-variation-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 1.1rem;
}

.combo-variation-remove {
  position: absolute;
  top: 0.2rem;
  right: 0.2rem;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.75);
  color: #94a3b8;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
}

.combo-variation-remove:hover {
  color: #fecaca;
  background: rgba(127, 29, 29, 0.65);
}

.combo-variation-card--num {
  width: 32px;
  min-width: 32px;
  min-height: 32px;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.combo-variation-card--num:hover {
  background: transparent;
  border-color: transparent;
}

.combo-variation-card--num.active {
  border: none;
  box-shadow: none;
  background: transparent;
}

.combo-variation-num {
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.combo-variation-card--num.active .combo-variation-num {
  background: #0f172a;
  border-color: #0f172a;
  color: #fff;
}

.combo-variation-card--num .combo-variation-remove {
  top: -0.2rem;
  right: -0.2rem;
  width: 18px;
  height: 18px;
  font-size: 0.5rem;
}

.combo-variation-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.combo-variation-viewport-controls {
  position: absolute;
  left: 0.55rem;
  bottom: 0.55rem;
  z-index: 20;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  pointer-events: none;
}

.combo-variation-viewport-badge {
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.combo-variation-viewport-remove {
  width: 1.35rem;
  height: 1.35rem;
  border: none;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  line-height: 1;
  color: #94a3b8;
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  pointer-events: auto;
}

.combo-variation-viewport-remove:hover,
.combo-variation-viewport-remove:focus-visible {
  color: #fecaca;
  background: rgba(127, 29, 29, 0.88);
  border-color: rgba(254, 202, 202, 0.35);
}

body.mobile-tab-mode .combo-variation-viewport-remove {
  width: 2.75rem;
  height: 2.75rem;
  font-size: 0.9rem;
}

.palette-error {
  color: var(--color-danger);
}

/* ==========================================================================
   Responsive: Phone, Tablet, Desktop
   ========================================================================== */
.mobile-tab-bar {
  display: none;
}

.color-accuracy-notice {
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.625rem 0.875rem;
  padding-bottom: calc(0.625rem + env(safe-area-inset-bottom, 0px));
  font-size: 0.75rem;
  line-height: 1.45;
  color: #475569;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
}

.color-accuracy-notice i {
  margin-top: 0.125rem;
  color: #1a4d3e;
  flex-shrink: 0;
}

.color-accuracy-notice p {
  margin: 0;
}

body.mobile-tab-mode .color-accuracy-notice {
  display: none;
}

body.mobile-tab-mode .mobile-only-header-tool {
  display: flex;
}

body.mobile-tab-mode .header-shadow-menu {
  display: flex;
}

body.mobile-tab-mode .visualizer-bottom-bar .shadows-control-group,
body.mobile-tab-mode .visualizer-bottom-bar .genie-recent-bar {
  display: none !important;
}

body.mobile-tab-mode .mobile-tab-bar {
  border-top: 1px solid #e2e8f0;
}

/* Tablet (iPad, Android tablets, ~768–1199px) — stacked scroll, all sections visible */
@media (min-width: 768px) and (max-width: 1199px) {
  body.tablet-mode {
    overflow: auto;
  }

  body.tablet-mode .app-container {
    height: auto;
    min-height: 100dvh;
  }

  body.tablet-mode .app-body {
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  body.tablet-mode .panel-middle {
    order: -1;
    flex-shrink: 0;
    padding: var(--space-3);
    width: 100%;
    height: auto;
    max-height: none;
  }

  body.tablet-mode .panel-left,
  body.tablet-mode .panel-right {
    width: 100%;
    max-height: none;
    min-height: 240px;
    flex-shrink: 0;
    border-left: none;
    border-right: none;
    border-top: 1px solid var(--border-light);
    box-shadow: none;
  }

  body.tablet-mode .visualizer-outer {
    max-width: 100%;
  }

  body.tablet-mode .app-header {
    height: auto;
    min-height: var(--header-h);
    flex-wrap: wrap;
    padding: var(--space-3);
    gap: var(--space-2);
  }

  body.tablet-mode .header-meta {
    display: none;
  }

  body.tablet-mode .header-actions {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
  }

  body.tablet-mode .header-btn {
    flex-shrink: 0;
  }

  body.tablet-mode .slot-item-actions .icon-btn {
    min-width: 36px;
    min-height: 36px;
  }

  body.tablet-mode .method-pill {
    min-height: 30px;
    padding: 6px 10px;
  }
}

/* Phone only (≤767px) — bottom tab navigation */
@media (max-width: 767px) {
  :root {
    --mobile-tab-h: 56px;
    --mobile-header-h: 44px;
  }

  body.mobile-tab-mode {
    overflow: hidden;
  }

  body.mobile-tab-mode .app-container {
    height: 100dvh;
    max-height: 100dvh;
    padding-bottom: env(safe-area-inset-bottom, 0);
  }

  /* Compact single-row header */
  body.mobile-tab-mode .app-header {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-start;
    min-height: var(--mobile-header-h);
    height: auto;
    flex-shrink: 0;
    padding: max(var(--space-2), env(safe-area-inset-top, 0)) var(--space-3) var(--space-2);
    gap: var(--space-2);
  }

  body.mobile-tab-mode .header-logo {
    display: none;
  }

  body.mobile-tab-mode .header-meta {
    display: none;
  }

  body.mobile-tab-mode .header-actions {
    flex: 1;
    width: 100%;
    min-width: 0;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 0;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  body.mobile-tab-mode .header-actions::-webkit-scrollbar {
    display: none;
  }

  /* Hide desktop-only actions on phone */
  body.mobile-tab-mode #open-folder-btn,
  body.mobile-tab-mode #load-id-btn,
  body.mobile-tab-mode .header-actions a[href="admin.html"] {
    display: none;
  }

  /* Staff studio: keep Open Project available on phones (local folders only). */
  body.mobile-tab-mode.studio-staff-local #open-folder-btn {
    display: inline-flex !important;
  }

  body.mobile-tab-mode.studio-staff-local #load-id-btn,
  body.mobile-tab-mode.studio-staff-local #browse-templates-btn,
  body.mobile-tab-mode.studio-staff-local #share-btn {
    display: none !important;
  }

  body.mobile-tab-mode .header-btn {
    flex-shrink: 0;
    padding: 8px 10px;
    font-size: 0;
    min-width: 36px;
    min-height: 36px;
    justify-content: center;
  }

  body.mobile-tab-mode .header-shadow-menu .header-btn {
    min-width: 36px;
  }

  body.mobile-tab-mode .shadows-popover {
    position: fixed;
    right: max(0.5rem, env(safe-area-inset-right, 0px));
    top: calc(var(--mobile-header-h) + 0.35rem);
  }

  body.mobile-tab-mode .header-btn i {
    font-size: 0.85rem;
    margin: 0;
  }

  body.mobile-tab-mode .app-body {
    display: block;
    position: relative;
    flex: 1 1 0;
    height: auto;
    min-height: 0;
    overflow: hidden;
  }

  body.mobile-tab-mode .panel-left,
  body.mobile-tab-mode .panel-middle,
  body.mobile-tab-mode .panel-right {
    display: none;
    position: absolute;
    inset: 0;
    width: 100%;
    max-height: none;
    height: 100%;
    overflow: hidden;
    border-top: none;
    -webkit-overflow-scrolling: touch;
  }

  body.mobile-tab-mode .panel-left.mobile-active,
  body.mobile-tab-mode .panel-middle.mobile-active,
  body.mobile-tab-mode .panel-right.mobile-active {
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  body.mobile-tab-mode .panel-middle.mobile-active {
    justify-content: flex-start;
    align-items: stretch;
    overflow-y: auto;
    padding: var(--space-2);
  }

  body.mobile-tab-mode .panel-left.mobile-active {
    overflow-y: auto;
  }

  body.mobile-tab-mode .panel-right.mobile-active {
    overflow: hidden;
  }

  body.mobile-tab-mode .slot-list-container {
    flex: 1 1 auto;
    min-height: 160px;
    overflow-y: auto;
  }

  body.mobile-tab-mode .active-slot-panel {
    flex: 0 1 auto;
    max-height: 42vh;
  }

  body.mobile-tab-mode .swatch-grid-container {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  body.mobile-tab-mode .palette-selectors,
  body.mobile-tab-mode .color-family-bar,
  body.mobile-tab-mode .mobile-active-slot {
    flex-shrink: 0;
  }

  body.mobile-tab-mode .visualizer-outer {
    flex-shrink: 0;
    width: 100%;
    align-items: center;
  }

  body.mobile-tab-mode .visualizer-viewport {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
  }

  body.mobile-tab-mode .visualizer-wrapper {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
  }

  body.mobile-tab-mode .visualizer-hint {
    font-size: 0.68rem;
    flex-shrink: 0;
  }

  body.mobile-tab-mode .visualizer-workspace {
    flex-direction: column;
    gap: var(--space-1);
  }

  body.mobile-tab-mode .combo-variations-strip {
    flex: 0 0 auto;
    width: 100%;
    max-height: none;
    flex-direction: row;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.5rem;
    order: -1;
  }

  body.mobile-tab-mode .combo-variations-toolbar {
    margin-bottom: 0;
    flex-shrink: 0;
    flex-direction: row;
    align-items: center;
    gap: 0.35rem;
  }

  body.mobile-tab-mode .whatsapp-send-panel:not(.hidden) {
    flex: 1 1 100%;
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 0.35rem;
    padding-top: 0.35rem;
  }

  body.mobile-tab-mode .whatsapp-send-phone {
    flex: 1 1 8rem;
    min-width: 0;
  }

  body.mobile-tab-mode .whatsapp-send-btn {
    flex: 0 0 auto;
  }

  body.mobile-tab-mode .whatsapp-send-status {
    flex: 1 1 100%;
  }

  body.mobile-tab-mode .combo-variations-actions {
    flex-direction: row;
    gap: 0.25rem;
  }

  body.mobile-tab-mode .combo-variation-action-btn {
    flex: 1 1 auto;
    width: auto;
    min-width: 44px;
    min-height: 44px;
    height: 44px;
    padding: 0 0.55rem;
    font-size: 0.68rem;
  }

  body.mobile-tab-mode .combo-variations-title {
    gap: 0.25rem;
    font-size: 0.72rem;
  }

  body.mobile-tab-mode .combo-variations-title > span:not(.combo-variations-count) {
    display: none;
  }

  body.mobile-tab-mode .combo-variations-scroll {
    flex: 1 1 auto;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 0.15rem;
    min-height: 0;
    max-height: none;
    padding: 0;
    scroll-snap-type: x proximity;
  }

  body.mobile-tab-mode .combo-variation-card--num {
    scroll-snap-align: center;
    width: 1.35rem;
    min-width: 1.35rem;
    min-height: 1.35rem;
    height: 1.35rem;
  }

  body.mobile-tab-mode .mobile-room-tools:not(.hidden) {
    position: fixed;
    left: max(0.5rem, env(safe-area-inset-left, 0px));
    bottom: calc(var(--mobile-tab-h) + env(safe-area-inset-bottom, 0px) + 0.45rem);
    z-index: 250;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    max-width: calc(100vw - 1rem);
    pointer-events: none;
  }

  body.mobile-tab-mode .genie-mobile-float {
    display: flex;
    position: relative;
    transform: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    width: 52px;
    min-width: 52px;
    height: 52px;
    min-height: 52px;
    padding: 0.2rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.92);
    border: 1px solid rgba(0, 242, 254, 0.35);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
    pointer-events: auto;
    touch-action: manipulation;
  }

  body.mobile-tab-mode .genie-mobile-float:active {
    transform: scale(0.96);
  }

  body.mobile-tab-mode .mobile-explore-float {
    display: flex;
    position: relative;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    width: 52px;
    min-width: 52px;
    height: 52px;
    min-height: 52px;
    padding: 0.2rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.92);
    border: 1px solid rgba(0, 242, 254, 0.55);
    color: var(--color-primary);
    font-size: 0.52rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    cursor: pointer;
    pointer-events: auto;
    box-shadow: 0 0 10px rgba(0, 242, 254, 0.18);
  }

  body.mobile-tab-mode .mobile-explore-float i {
    font-size: 1.05rem;
  }

  body.mobile-tab-mode .mobile-explore-float:active {
    transform: scale(0.96);
  }

  body.mobile-tab-mode .genie-mobile-float .genie-btn-img {
    display: block;
    width: 38px;
    height: 38px;
  }

  body.mobile-tab-mode .genie-mobile-float .genie-btn-fallback {
    width: auto;
    height: auto;
    font-size: 1.45rem;
  }

  body.mobile-tab-mode .genie-mobile-float.genie-img-ready .genie-btn-fallback {
    display: none;
  }

  body.mobile-tab-mode .mobile-slot-swatches {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    max-width: calc(100vw - 8.6rem);
    overflow-x: auto;
    padding: 0.1rem 0.1rem 0.1rem 0;
    pointer-events: auto;
    scrollbar-width: none;
  }

  body.mobile-tab-mode .mobile-slot-swatches::-webkit-scrollbar {
    display: none;
  }

  body.mobile-tab-mode .mobile-slot-swatch {
    width: 32px;
    min-width: 32px;
    height: 32px;
    border-radius: 999px;
    border: 2px solid rgba(255, 255, 255, 0.65);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  }

  body.mobile-tab-mode .mobile-slot-swatch.active {
    transform: scale(1.05);
    border-color: #0f172a;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9), 0 2px 8px rgba(0, 0, 0, 0.32);
  }

  body.mobile-tab-mode .visualizer-bottom-bar {
    display: none;
  }

  .inspiration-float {
    top: auto;
    bottom: calc(var(--mobile-tab-h) + env(safe-area-inset-bottom, 0px));
    left: 0;
    right: 0;
    width: 100%;
    height: min(44vh, 20rem);
    transform: none;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding-bottom: max(var(--space-2), env(safe-area-inset-bottom));
  }

  .inspiration-float.is-positioned {
    transform: none;
  }

  .inspiration-viewport {
    min-height: 9rem;
  }

  .inspiration-drag-handle {
    cursor: default;
  }

  body.mobile-tab-mode .mobile-tab-bar {
    display: flex;
    flex-shrink: 0;
    height: var(--mobile-tab-h);
    padding-bottom: env(safe-area-inset-bottom, 0);
    background: var(--bg-panel-solid);
    border-top: 1px solid var(--border-light);
    z-index: 200;
  }

  .mobile-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font-family);
    font-size: 0.65rem;
    font-weight: 500;
    cursor: pointer;
    padding: 6px 4px;
    min-height: 44px;
    touch-action: manipulation;
  }

  .mobile-tab i {
    font-size: 1.1rem;
  }

  .mobile-tab.active {
    color: var(--color-primary);
  }

  .mobile-active-slot {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin: 0 var(--space-2) var(--space-2);
    padding: var(--space-2) var(--space-3);
    background: hsla(210, 100%, 55%, 0.1);
    border: 1px solid var(--border-focus);
    border-radius: var(--radius-sm);
    font-size: 0.72rem;
  }

  .mobile-active-slot-label {
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    font-size: 0.62rem;
    flex-shrink: 0;
  }

  .mobile-active-slot-name {
    color: var(--color-primary);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .slot-item-actions .icon-btn {
    min-width: 36px;
    min-height: 36px;
  }

  .method-pill {
    min-height: 36px;
    padding: 8px 12px;
  }

  .combo-tab {
    min-height: 36px;
  }

  .visualizer-bottom-bar {
    flex-direction: column;
    gap: var(--space-3);
    align-items: stretch;
    padding: var(--space-3);
    flex-shrink: 0;
  }

  .visualizer-bottom-bar .control-group {
    max-width: none !important;
  }

  .visualizer-bottom-bar input[type="range"] {
    min-height: 28px;
  }

  .split-slider-tip {
    justify-content: center;
  }

  .slider-handle {
    z-index: 15;
    pointer-events: auto;
    width: 44px;
    transform: translateX(-50%);
  }

  .slider-button {
    width: 36px;
    height: 36px;
    font-size: 0.8rem;
    pointer-events: auto;
  }

  .swatch-grid {
    grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
    gap: var(--space-2);
  }

  .swatch-item {
    padding: 6px;
  }

  #color-search,
  #brand-select {
    font-size: 16px;
  }

  .search-clear-btn {
    width: 44px;
    height: 44px;
    right: 2px;
    font-size: 0.85rem;
  }

  .search-wrapper input {
    padding-right: 46px;
  }

  .combo-action-btn {
    min-height: 44px;
  }

  .control-btn {
    min-height: 40px;
  }
}

/* Desktop (≥1200px) — fill center column with the room image */
@media (min-width: 1200px) {
  .app-body {
    grid-template-columns: var(--panel-left-w) 1fr var(--panel-right-w);
    height: calc(100dvh - var(--header-h));
  }

  .panel-middle {
    flex-direction: column;
    align-items: stretch;
    justify-content: stretch;
    padding: var(--space-2);
    min-height: 0;
    overflow: hidden;
  }

  .visualizer-outer {
    flex: 1;
    width: 100%;
    max-width: none;
    min-height: 0;
    height: 100%;
    justify-content: flex-start;
    overflow: hidden;
  }

  .visualizer-workspace {
    flex: 1;
    min-height: 0;
    height: 100%;
    align-items: stretch;
  }

  .visualizer-room-column {
    flex: 1;
    min-height: 0;
    min-width: 0;
    overflow: hidden;
  }

  .combo-variations-strip {
    max-height: 100%;
  }

  .visualizer-wrapper {
    flex-shrink: 0;
    align-self: center;
    max-width: 100%;
  }

  .visualizer-viewport {
    flex: 1 1 auto;
    align-self: stretch;
    width: 100%;
    min-height: 0;
  }

  .visualizer-hint {
    flex-shrink: 0;
  }

  .visualizer-outer.has-project .visualizer-bottom-bar {
    flex-shrink: 0;
  }

  .template-gallery:not(.hidden) {
    min-height: 0;
  }
}

/* ===== Ported from STANDALONE visualizer (v1.15.0 feature set) ===== */
.app-toast {
  position: fixed;
  left: 50%;
  bottom: max(1.25rem, env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%) translateY(12px);
  z-index: 10000;
  max-width: min(90vw, 320px);
  padding: 10px 16px;
  border-radius: var(--radius-md, 8px);
  background: rgba(20, 24, 32, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #f8fafc;
  font-family: var(--font-family);
  font-size: 0.85rem;
  font-weight: 500;
  text-align: center;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.app-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.app-toast.is-ok {
  border-color: rgba(110, 231, 183, 0.45);
}

.app-toast.is-error {
  border-color: rgba(252, 165, 165, 0.55);
}

.slot-color-studio {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.slot-color-studio-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 44px;
}

.slot-color-pick-label {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.slot-from-image-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  color: var(--text-main);
  font-family: var(--font-family);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  flex-shrink: 0;
}

.slot-from-image-btn.is-active {
  border-color: rgba(0, 242, 254, 0.45);
  box-shadow: 0 0 0 2px var(--color-primary-glow);
  color: var(--color-primary);
}

.slot-color-studio-main {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 8px;
  align-items: stretch;
}

.slot-adjust-panel {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.slot-adjust-sliders {
  display: flex;
  flex-direction: column;
  gap: 0;
  height: 100%;
  justify-content: space-between;
}

.slot-adjust-slider-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 36px;
  align-items: center;
  gap: 6px;
  min-height: 44px;
}

.slot-adjust-slider-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-muted);
}

.slot-adjust-slider-val {
  font-size: 0.68rem;
  font-variant-numeric: tabular-nums;
  color: var(--color-primary);
  text-align: right;
}

.slot-adjust-sliders input[type="range"] {
  height: 44px;
  min-height: 44px;
}

.slot-adjust-sliders input[type="range"]::-webkit-slider-runnable-track {
  height: 8px;
  border: none;
  background: var(--slot-adjust-track, var(--bg-card));
}

.slot-adjust-sliders input[type="range"]::-webkit-slider-thumb {
  width: 22px;
  height: 22px;
  margin-top: -7px;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35), 0 0 6px var(--color-primary-glow);
}

.slot-adjust-sliders input[type="range"]::-moz-range-track {
  height: 8px;
  border: none;
  background: var(--slot-adjust-track, var(--bg-card));
}

.slot-adjust-sliders input[type="range"]::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35), 0 0 6px var(--color-primary-glow);
}

#slot-adjust-hue {
  --slot-adjust-track: linear-gradient(
    to right,
    #ff0000,
    #ffff00,
    #00ff00,
    #00ffff,
    #0000ff,
    #ff00ff,
    #ff0000
  );
}

#slot-adjust-sat {
  --slot-adjust-track: var(--slot-adjust-sat-track, var(--bg-card));
}

#slot-adjust-light {
  --slot-adjust-track: var(--slot-adjust-light-track, var(--bg-card));
}

.slot-color-wheel {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.slot-color-sv {
  position: relative;
  width: 100%;
  height: auto;
  min-height: 158px;
  border-radius: 8px;
  overflow: hidden;
  cursor: crosshair;
  touch-action: none;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background:
    linear-gradient(to top, #000, transparent),
    linear-gradient(to right, #fff, var(--slot-wheel-hue, #ff0000));
}

.slot-color-sv-thumb {
  position: absolute;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border-radius: 999px;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45), 0 2px 6px rgba(0, 0, 0, 0.4);
  pointer-events: none;
}

.slot-color-wheel-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.slot-color-wheel-controls .slot-color-rgb-row {
  flex: 1 1 auto;
  min-width: 0;
}

.slot-color-eyedropper {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 8px;
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  color: var(--text-main);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.slot-color-eyedropper:hover {
  border-color: rgba(255, 255, 255, 0.35);
}

.slot-color-preview {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.7);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25);
  background: #808080;
}

.slot-color-rgb-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.slot-color-rgb-field {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.slot-color-rgb-field span {
  flex: 0 0 auto;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
}

.slot-color-rgb-input {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 8px 6px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text-main);
  font-family: var(--font-family);
  font-size: 1rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.slot-color-rgb-input:focus {
  outline: none;
  border-color: rgba(0, 242, 254, 0.45);
}

@media (min-width: 1200px) {
  .slot-color-studio-main {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  .slot-color-sv {
    min-height: 120px;
    height: 120px;
  }

  .slot-color-studio-head,
  .slot-from-image-btn {
    min-height: 36px;
  }

  .slot-from-image-btn {
    padding: 0 10px;
    font-size: 0.72rem;
  }

  .slot-adjust-slider-row,
  .slot-adjust-sliders input[type="range"] {
    min-height: 36px;
    height: 36px;
  }

  .slot-color-eyedropper,
  .slot-color-preview {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
  }

  .slot-color-rgb-input {
    min-height: 36px;
    font-size: 0.8125rem;
    padding: 4px 4px;
  }

  .slot-item {
    min-height: 32px;
    padding: 3px 6px;
  }
}

.slot-color-pick-status {
  margin: 6px 0 0;
  min-height: calc(2 * 1.3em);
  font-size: 0.72rem;
  line-height: 1.3;
  color: var(--text-muted);
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.slot-color-pick-status[hidden] {
  display: flex !important;
  visibility: hidden;
  pointer-events: none;
}

.slot-color-pick-status .pick-status-swatch {
  width: 14px;
  height: 14px;
  margin-top: 0.15em;
  border-radius: 3px;
  border: 1px solid rgba(0, 0, 0, 0.25);
  flex-shrink: 0;
}

.slot-color-pick-status > span:last-child {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  min-width: 0;
}

.slot-color-hex-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.slot-color-hex-label {
  flex: 0 0 auto;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.slot-color-hex-input {
  flex: 1 1 auto;
  min-height: 44px;
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-main);
  font-family: var(--font-family);
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

.slot-color-hex-input:focus {
  outline: none;
  border-color: rgba(0, 242, 254, 0.45);
}

.combo-code-row {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.visualizer-outer.is-template-mode #quick-slot-swap-bar,
.visualizer-outer.is-template-mode #recent-colors-bar,
.visualizer-outer.is-template-mode .combo-variations-strip {
  display: none;
}

/* One row: swap buttons (left) + house-side actions (right) */
.visualizer-room-toolbar {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 0 0 4px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.visualizer-room-toolbar::-webkit-scrollbar {
  display: none;
}

.visualizer-room-toolbar:not(:has(> :not(.hidden))) {
  display: none;
}

.visualizer-room-column > .visualizer-room-toolbar {
  order: 0;
}

.quick-slot-swap-bar {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  flex: 1 1 auto;
  flex-shrink: 1;
  width: auto;
  min-width: 0;
  max-width: 100%;
  padding: 0;
  margin: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.visualizer-room-column > .quick-slot-swap-bar {
  order: 0;
}

.quick-slot-swap-bar.hidden {
  display: none;
}

.quick-slot-swap-bar::-webkit-scrollbar {
  display: none;
}

.quick-slot-swap-mode {
  display: inline-flex;
  align-items: stretch;
  flex-shrink: 0;
  margin-right: 2px;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  overflow: hidden;
}

.quick-slot-swap-mode-btn {
  min-height: 36px;
  padding: 0 10px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-family);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  touch-action: manipulation;
}

.quick-slot-swap-mode-btn + .quick-slot-swap-mode-btn {
  border-left: 1px solid var(--border-light);
}

.quick-slot-swap-mode-btn.is-active {
  background: #111827;
  color: #f8fafc;
}

.quick-slot-swap-mode-btn:focus-visible {
  outline: 2px solid rgba(232, 177, 60, 0.7);
  outline-offset: -2px;
}

.quick-slot-swap-btn {
  flex: 0 0 auto;
  min-width: 40px;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  background: #111827;
  color: #f8fafc;
  font-family: var(--font-family);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
  transition: background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

.quick-slot-swap-btn:hover:not(:disabled),
.quick-slot-swap-btn:focus-visible {
  background: #1f2937;
  border-color: rgba(255, 255, 255, 0.28);
  outline: none;
}

.quick-slot-swap-btn:active:not(:disabled) {
  background: #0b1220;
}

.quick-slot-swap-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

@media (max-width: 639px) {
  .quick-slot-swap-mode-btn,
  .quick-slot-swap-btn {
    min-width: 44px;
    min-height: 44px;
  }
}

.shadows-more-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 260px;
}

.shadows-more-row .shadows-control-group {
  flex: 1 1 auto !important;
  max-width: 120px !important;
  min-width: 72px;
  margin-bottom: 0;
}

.shadows-more-row .shadows-control-group .slider-label-row {
  gap: 4px;
}

.shadows-more-row .shadows-control-group label {
  font-size: 0.68rem;
  white-space: nowrap;
}

.more-combos-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex: 0 0 auto;
  min-height: 44px;
  padding: 6px 10px;
  border: 1px solid rgba(232, 177, 60, 0.45);
  border-radius: var(--radius-sm);
  background: rgba(232, 177, 60, 0.1);
  color: var(--accent, #e8b13c);
  font-family: var(--font-family);
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: var(--transition-fast);
}

.more-combos-btn:hover:not(:disabled) {
  background: rgba(232, 177, 60, 0.18);
  border-color: rgba(232, 177, 60, 0.7);
}

.more-combos-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.genie-slot-params {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 0;
  flex: 1 1 auto;
}

.genie-slot-params-hint {
  margin: 0;
  font-size: 0.62rem;
  line-height: 1.35;
  color: var(--text-muted);
}

.genie-variations-side .genie-slot-rules {
  max-height: min(42vh, 320px);
  margin-bottom: 0;
  flex: 1 1 auto;
}

/* ---- House sides bar (multi-project session) ---- */
.house-sides-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  padding: 2px 0;
  margin: 0;
  min-width: 0;
  background: transparent;
  border: none;
  border-radius: 0;
}

.house-sides-bar.hidden {
  display: none;
}

.visualizer-room-toolbar > .house-sides-bar {
  margin-left: auto;
}

.house-sides-bar > .quick-slot-swap-bar {
  order: -1;
  flex: 1 1 auto;
  min-width: 0;
  margin-right: 0;
  justify-content: flex-start;
}

.house-sides-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
  flex-shrink: 0;
}

.house-sides-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
}

.house-side-chip {
  display: inline-flex;
  align-items: center;
  gap: 0;
  min-height: 36px;
  padding: 0 2px 0 0;
  border: 1px solid var(--border-light);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  font-family: var(--font-family);
  font-size: 0.72rem;
  max-width: 260px;
  overflow: visible;
  transition: var(--transition-fast);
}

.house-side-chip-select {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 4px 8px 4px 12px;
  border: none;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.house-side-chip-close {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 32px;
  min-width: 32px;
  height: 32px;
  min-height: 32px;
  margin: 0 2px 0 0;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #f8fafc !important;
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  transition: var(--transition-fast);
}

.house-side-chip-close:hover:not(:disabled) {
  color: #fff !important;
  background: rgba(220, 60, 80, 0.55);
  border-color: rgba(252, 165, 165, 0.7);
}

.house-side-chip-close:disabled,
.house-side-chip-select:disabled {
  opacity: 0.6;
  cursor: wait;
}

.house-side-chip:hover {
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.35);
}

.house-side-chip.is-active {
  color: var(--text-main);
  border-color: var(--accent, #e8b13c);
  background: rgba(232, 177, 60, 0.12);
}

.house-sides-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
  flex-shrink: 0;
}

.house-sides-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 36px;
  padding: 4px 8px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text-muted);
  font-family: var(--font-family);
  font-size: 0.68rem;
  white-space: nowrap;
  cursor: pointer;
  transition: var(--transition-fast);
}

.house-sides-btn:hover {
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.35);
}

.house-sides-btn.accent {
  color: var(--accent, #e8b13c);
  border-color: rgba(232, 177, 60, 0.45);
}

.house-sides-btn.accent:hover {
  background: rgba(232, 177, 60, 0.12);
}

.house-sides-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

body.mobile-tab-mode .house-sides-bar {
  padding: 0;
}

.genie-mix-presets-wrap {
  margin-top: var(--space-2);
}

.genie-mix-presets {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 2px 0 6px;
  scrollbar-width: thin;
}

.genie-mix-preset-chip {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: hsla(230, 20%, 16%, 0.55);
  color: var(--text-main);
  font-family: var(--font-family);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition-fast);
}

.genie-mix-preset-chip:hover {
  border-color: rgba(255, 255, 255, 0.35);
}

.genie-mix-preset-chip.is-active {
  background: var(--accent, #3d8bfd);
  border-color: var(--accent, #3d8bfd);
  color: #fff;
}

.genie-mix-presets.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.genie-global-controls {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: var(--space-1);
  transition: opacity 0.15s ease;
}

.genie-global-controls.is-disabled {
  opacity: 0.45;
}

.genie-global-note {
  font-size: 0.6rem;
  color: var(--text-muted);
  font-weight: 400;
  text-transform: none;
}

.genie-global-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.genie-global-name {
  font-size: 0.68rem;
  color: var(--text-muted);
  min-width: 62px;
}

.genie-global-slider {
  flex: 1;
  min-width: 0;
}

.genie-global-slider:disabled {
  cursor: not-allowed;
}

.genie-global-val {
  font-size: 0.68rem;
  color: var(--text-muted);
  min-width: 34px;
  text-align: right;
}

.genie-side-label-row .genie-side-label {
  margin-top: 0;
}

.genie-seeds-wrap {
  margin-top: var(--space-2);
}

.genie-seeds-hint {
  margin: 0 0 6px;
  font-size: 0.65rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.genie-seeds-code-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
}

.genie-seeds-code-input {
  width: 100%;
  min-height: 44px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text-main);
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
  font-size: 1rem; /* 16px — avoid iOS zoom */
  line-height: 1.3;
}

.genie-seeds-code-input::placeholder {
  color: var(--text-muted);
  opacity: 0.75;
}

.genie-seeds-code-apply {
  width: 100%;
  min-height: 44px;
}

@media (min-width: 640px) {
  .genie-seeds-code-row {
    flex-direction: row;
    align-items: stretch;
  }

  .genie-seeds-code-input {
    flex: 1;
    min-width: 0;
    font-size: 0.75rem;
  }

  .genie-seeds-code-apply {
    width: auto;
    flex: 0 0 auto;
    white-space: nowrap;
  }
}

.genie-seeds-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.genie-seeds-mini-btn {
  min-height: 32px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-family);
  font-size: 0.65rem;
  cursor: pointer;
}

.genie-seeds-mini-btn:hover {
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.35);
}

.genie-seeds-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 0;
}

.genie-seeds-preview:empty {
  display: none;
}

.genie-seed-chip {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: var(--seed-hex, #888);
  flex: 0 0 auto;
}

.preset-search-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin: 0 0 var(--space-2);
  padding: 0 2px;
  min-height: 40px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
}

.preset-search-row i {
  margin-left: 10px;
  color: var(--text-muted);
  font-size: 0.75rem;
  flex-shrink: 0;
}

.preset-search-input {
  flex: 1;
  min-width: 0;
  min-height: 40px;
  padding: 8px 10px 8px 0;
  border: none;
  background: transparent;
  color: var(--text-main);
  font-family: var(--font-family);
  font-size: 1rem; /* 16px — avoids iOS zoom on focus */
  outline: none;
}

.preset-search-input::placeholder {
  color: var(--text-muted);
}

@media (min-width: 640px) {
  .preset-search-input {
    font-size: 0.8rem;
  }
}

.preset-like-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
  margin: 0 0 var(--space-2);
}

.preset-like-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-height: 40px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  font-family: var(--font-family);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

.preset-like-btn:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.09);
}

.preset-like-btn.accent {
  border-color: rgba(244, 114, 182, 0.45);
  background: rgba(244, 114, 182, 0.12);
  color: #fce7f3;
}

.preset-like-btn.accent:hover:not(:disabled) {
  background: rgba(244, 114, 182, 0.2);
}

.preset-like-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.color-tweak-panel {
  padding: 0 var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--border-light);
  margin-bottom: var(--space-2);
}

.color-tweak-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 6px;
}

.color-tweak-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 0.9fr) minmax(64px, 1.1fr) 40px;
  align-items: center;
  gap: 6px;
  min-height: 40px;
}

.color-tweak-keys {
  display: inline-flex;
  gap: 3px;
  flex-wrap: wrap;
}

.color-tweak-keys kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35em;
  min-height: 1.35em;
  padding: 0 4px;
  border-radius: 4px;
  border: 1px solid var(--border-light);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.65rem;
  font-family: var(--font-family);
  color: var(--text-main);
}

.color-tweak-name {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.color-tweak-slider {
  width: 100%;
  min-height: 28px;
  accent-color: var(--color-primary);
}

.color-tweak-val {
  font-size: 0.68rem;
  font-variant-numeric: tabular-nums;
  color: var(--color-primary);
  text-align: right;
}

.color-tweak-shift-hint {
  margin-bottom: 0;
}

.header-shortcuts-wrap {
  position: relative;
  flex-shrink: 0;
}

.shortcuts-help-popover {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 80;
  width: min(320px, 88vw);
  max-height: min(70vh, 420px);
  overflow-y: auto;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background: rgba(15, 23, 42, 0.96);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
}

.shortcuts-help-popover.hidden {
  display: none;
}

.shortcuts-help-title {
  margin: 0 0 6px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.shortcuts-help-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 5px;
}

.shortcuts-help-list li {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 0.75rem;
  color: var(--text-main);
  line-height: 1.35;
}

.shortcuts-help-list kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  min-height: 1.35rem;
  padding: 0 5px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  font-family: var(--font-family);
  font-size: 0.68rem;
  font-weight: 600;
  color: #f8fafc;
}

/* Mobile more-combos / shadows row */
body.mobile-tab-mode .visualizer-bottom-bar .shadows-more-row {
  max-width: none;
  flex: 0 0 auto;
}

body.mobile-tab-mode .visualizer-bottom-bar .more-combos-btn {
  min-height: 44px;
  width: 100%;
}

/* Deferred features (Methods / Presets / Genie / Explore / Slot params / Color tweaks) — flip App.*_FEATURE to restore */
.feature-gated-off,
[hidden].feature-gated-off {
  display: none !important;
}
