/* 
  ========================================================================
  PALMA STUDIO 2026 - ARCHITECTURE & STYLES PREMIUM
  Apple HIG + Futura Féminin Design System (Liquid Glass 2.0)
  ========================================================================
*/

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Space+Grotesk:wght@400;500;600;700&family=Playfair+Display:ital,wght@0,400..900;1,400..900&display=block');

/* Design Tokens */
:root {
  --bg-void:        #08080c;
  --bg-surface:     #0c0c12;
  --bg-elevated:    #111118;
  --bg-glass:       rgba(14, 14, 22, 0.85);
  --bg-glass-card:  rgba(18, 18, 28, 0.92);
  --bg-glass-input: rgba(22, 22, 34, 0.5);
  
  --border-subtle:  rgba(255, 255, 255, 0.06);
  --border-active:  rgba(139, 92, 246, 0.3);
  --border-highlight: rgba(217, 70, 239, 0.25);
  
  --text-primary:   #f0eef5;
  --text-secondary: #8e8c9f;
  --text-muted:     #5a586e;
  
  --magenta:        #ec4899;
  --violet:         #8b5cf6;
  --fuchsia:        #d946ef;
  --success:        #10b981;
  
  --accent-gradient: linear-gradient(135deg, #8b5cf6 0%, #d946ef 50%, #ec4899 100%);
  --font-title:     'Outfit', sans-serif;
  --font-body:      'Plus Jakarta Sans', sans-serif;
  --font-mono:      'Space Grotesk', Courier, monospace;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  --shadow-glow: 0 0 40px -8px rgba(139, 92, 246, 0.15);
  --transition-apple: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);

  --glow-color-a: rgba(139, 92, 246, 0.14);
  --glow-color-b: rgba(217, 70, 239, 0.1);
  --glow-color-c: rgba(236, 72, 153, 0.07);
}

[data-theme="horizon"] {
  --bg-void:        #08080c;
  --bg-surface:     #0c0c12;
  --bg-elevated:    #111118;
  --bg-glass:       rgba(14, 14, 22, 0.85);
  --bg-glass-card:  rgba(18, 18, 28, 0.92);
  --bg-glass-input: rgba(22, 22, 34, 0.5);
  
  --border-subtle:  rgba(255, 255, 255, 0.06);
  --border-active:  rgba(139, 92, 246, 0.3);
  --border-highlight: rgba(217, 70, 239, 0.25);
  
  --text-primary:   #f0eef5;
  --text-secondary: #8e8c9f;
  --text-muted:     #5a586e;
  
  --magenta:        #ec4899;
  --violet:         #8b5cf6;
  --fuchsia:        #d946ef;
  --success:        #10b981;
  
  --accent-gradient: linear-gradient(135deg, #8b5cf6 0%, #d946ef 50%, #ec4899 100%);
  --font-title:     'Outfit', sans-serif;
  --font-body:      'Plus Jakarta Sans', sans-serif;
  --font-mono:      'Space Grotesk', Courier, monospace;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  --shadow-glow: 0 0 40px -8px rgba(139, 92, 246, 0.15);
  --transition-apple: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  --glow-color-a: rgba(139, 92, 246, 0.14);
  --glow-color-b: rgba(217, 70, 239, 0.1);
  --glow-color-c: rgba(236, 72, 153, 0.07);

  --shadow-header:  0 4px 30px rgba(0,0,0,0.2);
  --bg-indicator:   rgba(255, 255, 255, 0.08);
  --border-indicator: 1.5px solid rgba(255, 255, 255, 0.05);
  --shadow-indicator: 0 4px 15px rgba(0, 0, 0, 0.3);

  --bg-pill-active: rgba(236, 72, 153, 0.08);
  --border-pill-active: rgba(236, 72, 153, 0.25);
  --color-pill-active: var(--magenta);
  --shadow-pill-active: 0 0 15px rgba(236, 72, 153, 0.1);

  --bg-niche-active: rgba(167, 139, 250, 0.08);
  --border-niche-active: rgba(167, 139, 250, 0.25);
  --color-niche-active: #a78bfa;
  --shadow-niche-active: 0 0 15px rgba(167, 139, 250, 0.1);
}

[data-theme="summer-fridays"] {
  --bg-void:        #fdfbf7;
  --bg-surface:     #f5ede2;
  --bg-elevated:    #ebe0d0;
  --bg-glass:       rgba(245, 237, 226, 0.85);
  --bg-glass-card:  rgba(247, 242, 235, 0.92);
  --bg-glass-input: rgba(235, 224, 208, 0.5);
  
  --border-subtle:  rgba(180, 160, 140, 0.15);
  --border-active:  rgba(180, 120, 80, 0.3);
  --border-highlight: rgba(212, 163, 115, 0.25);
  
  --text-primary:   #4a3e3d;
  --text-secondary: #8d7a76;
  --text-muted:     #b6a5a0;
  
  --magenta:        #d4a373;
  --violet:         #b07d62;
  --fuchsia:        #c68a4c;
  --success:        #2d6a4f;
  
  --accent-gradient: linear-gradient(135deg, #d4a373 0%, #c68a4c 50%, #b07d62 100%);
  --font-title:     'Playfair Display', serif;
  --font-body:      'Plus Jakarta Sans', sans-serif;
  --font-mono:      'Space Grotesk', Courier, monospace;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;
  --shadow-glow: 0 0 40px -8px rgba(212, 163, 115, 0.12);
  --transition-apple: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  --glow-color-a: rgba(212, 163, 115, 0.14);
  --glow-color-b: rgba(198, 138, 76, 0.1);
  --glow-color-c: rgba(176, 125, 98, 0.07);

  --shadow-header:  0 4px 30px rgba(0,0,0,0.03);
  --bg-indicator:   #ffffff;
  --border-indicator: 1px solid rgba(0, 0, 0, 0.04);
  --shadow-indicator: 0 3px 8px rgba(0, 0, 0, 0.12), 0 1px 3px rgba(0, 0, 0, 0.04);

  --bg-pill-active: rgba(212, 163, 115, 0.12);
  --border-pill-active: rgba(212, 163, 115, 0.35);
  --color-pill-active: var(--magenta);
  --shadow-pill-active: 0 2px 10px rgba(212, 163, 115, 0.15);

  --bg-niche-active: rgba(176, 125, 98, 0.12);
  --border-niche-active: rgba(176, 125, 98, 0.35);
  --color-niche-active: var(--violet);
  --shadow-niche-active: 0 2px 10px rgba(176, 125, 98, 0.15);
}

[data-theme="rhode"] {
  --bg-void:        #f4f4f5;
  --bg-surface:     #e4e4e7;
  --bg-elevated:    #d4d4d8;
  --bg-glass:       rgba(228, 228, 231, 0.85);
  --bg-glass-card:  rgba(244, 244, 245, 0.92);
  --bg-glass-input: rgba(212, 212, 216, 0.5);
  
  --border-subtle:  rgba(0, 0, 0, 0.08);
  --border-active:  rgba(39, 39, 42, 0.3);
  --border-highlight: rgba(82, 82, 91, 0.25);
  
  --text-primary:   #18181b;
  --text-secondary: #52525b;
  --text-muted:     #71717a;
  
  --magenta:        #27272a;
  --violet:         #3f3f46;
  --fuchsia:        #18181b;
  --success:        #166534;
  
  --accent-gradient: linear-gradient(135deg, #71717a 0%, #3f3f46 50%, #18181b 100%);
  --font-title:     'Outfit', sans-serif;
  --font-body:      'Plus Jakarta Sans', sans-serif;
  --font-mono:      'Space Grotesk', Courier, monospace;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --shadow-glow: 0 0 40px -8px rgba(39, 39, 42, 0.05);
  --transition-apple: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  --glow-color-a: rgba(113, 113, 122, 0.14);
  --glow-color-b: rgba(63, 63, 70, 0.1);
  --glow-color-c: rgba(24, 24, 27, 0.07);

  --shadow-header:  0 4px 30px rgba(0,0,0,0.03);
  --bg-indicator:   #ffffff;
  --border-indicator: 1px solid rgba(0, 0, 0, 0.04);
  --shadow-indicator: 0 3px 8px rgba(0, 0, 0, 0.12), 0 1px 3px rgba(0, 0, 0, 0.04);

  --bg-pill-active: rgba(39, 39, 42, 0.08);
  --border-pill-active: rgba(39, 39, 42, 0.25);
  --color-pill-active: var(--magenta);
  --shadow-pill-active: none;

  --bg-niche-active: rgba(63, 63, 70, 0.08);
  --border-niche-active: rgba(63, 63, 70, 0.25);
  --color-niche-active: var(--violet);
  --shadow-niche-active: none;
}

[data-theme="rare-beauty"] {
  --bg-void:        #fbf8f7;
  --bg-surface:     #f6ecea;
  --bg-elevated:    #eddcd9;
  --bg-glass:       rgba(246, 236, 234, 0.85);
  --bg-glass-card:  rgba(251, 248, 247, 0.92);
  --bg-glass-input: rgba(237, 220, 217, 0.5);
  
  --border-subtle:  rgba(229, 152, 155, 0.15);
  --border-active:  rgba(229, 152, 155, 0.4);
  --border-highlight: rgba(181, 101, 118, 0.25);
  
  --text-primary:   #3d262a;
  --text-secondary: #805d63;
  --text-muted:     #a88d92;
  
  --magenta:        #e5989b;
  --violet:         #b56576;
  --fuchsia:        #eaacb0;
  --success:        #3a5a40;
  
  --accent-gradient: linear-gradient(135deg, #b56576 0%, #e5989b 50%, #ffb5a7 100%);
  --font-title:     'Playfair Display', serif;
  --font-body:      'Plus Jakarta Sans', sans-serif;
  --font-mono:      'Space Grotesk', Courier, monospace;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-full: 9999px;
  --shadow-glow: 0 0 40px -8px rgba(229, 152, 155, 0.15);
  --transition-apple: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  --glow-color-a: rgba(181, 101, 118, 0.14);
  --glow-color-b: rgba(229, 152, 155, 0.1);
  --glow-color-c: rgba(255, 181, 167, 0.07);

  --shadow-header:  0 4px 30px rgba(0,0,0,0.03);
  --bg-indicator:   #ffffff;
  --border-indicator: 1px solid rgba(0, 0, 0, 0.04);
  --shadow-indicator: 0 3px 8px rgba(0, 0, 0, 0.12), 0 1px 3px rgba(0, 0, 0, 0.04);

  --bg-pill-active: rgba(229, 152, 155, 0.15);
  --border-pill-active: rgba(229, 152, 155, 0.4);
  --color-pill-active: var(--magenta);
  --shadow-pill-active: 0 2px 10px rgba(229, 152, 155, 0.15);

  --bg-niche-active: rgba(181, 101, 118, 0.15);
  --border-niche-active: rgba(181, 101, 118, 0.4);
  --color-niche-active: var(--violet);
  --shadow-niche-active: 0 2px 10px rgba(181, 101, 118, 0.15);
}

[data-theme="fenty-skin"] {
  --bg-void:        #fafaff;
  --bg-surface:     #f1effd;
  --bg-elevated:    #e4e0fa;
  --bg-glass:       rgba(241, 239, 253, 0.85);
  --bg-glass-card:  rgba(250, 250, 255, 0.92);
  --bg-glass-input: rgba(228, 224, 250, 0.5);
  
  --border-subtle:  rgba(167, 139, 250, 0.15);
  --border-active:  rgba(139, 92, 246, 0.3);
  --border-highlight: rgba(167, 139, 250, 0.25);
  
  --text-primary:   #2d264a;
  --text-secondary: #6e678e;
  --text-muted:     #9f98bf;
  
  --magenta:        #a78bfa;
  --violet:         #8b5cf6;
  --fuchsia:        #c4b5fd;
  --success:        #15803d;
  
  --accent-gradient: linear-gradient(135deg, #8b5cf6 0%, #a78bfa 50%, #c4b5fd 100%);
  --font-title:     'Outfit', sans-serif;
  --font-body:      'Plus Jakarta Sans', sans-serif;
  --font-mono:      'Space Grotesk', Courier, monospace;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  --shadow-glow: 0 0 40px -8px rgba(139, 92, 246, 0.1);
  --transition-apple: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  --glow-color-a: rgba(139, 92, 246, 0.14);
  --glow-color-b: rgba(167, 139, 250, 0.1);
  --glow-color-c: rgba(196, 181, 253, 0.07);

  --shadow-header:  0 4px 30px rgba(0,0,0,0.03);
  --bg-indicator:   #ffffff;
  --border-indicator: 1px solid rgba(0, 0, 0, 0.04);
  --shadow-indicator: 0 3px 8px rgba(0, 0, 0, 0.12), 0 1px 3px rgba(0, 0, 0, 0.04);

  --bg-pill-active: rgba(167, 139, 250, 0.15);
  --border-pill-active: rgba(167, 139, 250, 0.4);
  --color-pill-active: var(--magenta);
  --shadow-pill-active: 0 2px 10px rgba(167, 139, 250, 0.15);

  --bg-niche-active: rgba(139, 92, 246, 0.15);
  --border-niche-active: rgba(139, 92, 246, 0.4);
  --color-niche-active: var(--violet);
  --shadow-niche-active: 0 2px 10px rgba(139, 92, 246, 0.15);
}

/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
}

html, body {
  background: var(--bg-void);
  color: var(--text-primary);
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  font-family: var(--font-body);
  transition: background-color 0.4s ease, color 0.4s ease;
}

body {
  display: flex;
  position: relative;
  transition: background-color 0.4s ease, color 0.4s ease;
}

.top-header, .segmented-nav, .contextual-carousel-wrapper, .component-card, .gallery-niche-bar .niche-pill, .global-dropdown-menu, .card-download-toggle {
  transition: background-color 0.4s ease, border-color 0.4s ease, color 0.4s ease, box-shadow 0.4s ease;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--magenta);
}

/* Background Glowing Layers */
.scene-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.perf-layer {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  will-change: transform, opacity;
  transform: translate3d(0, 0, 0);
}

.glow-a {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, var(--glow-color-a) 0%, transparent 70%);
  top: -10%;
  left: 10%;
  animation: driftA 25s infinite ease-in-out;
}

.glow-b {
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, var(--glow-color-b) 0%, transparent 70%);
  bottom: -5%;
  right: 8%;
  animation: driftB 30s infinite ease-in-out alternate;
}

.glow-c {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, var(--glow-color-c) 0%, transparent 70%);
  top: 40%;
  left: 45%;
  animation: driftC 28s infinite ease-in-out;
}

.scene-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 35%, var(--bg-void) 95%);
}

@keyframes driftA {
  0%, 100% { transform: translate3d(0,0,0) scale(1); opacity: 0.6; }
  50% { transform: translate3d(40px,-50px,0) scale(1.15); opacity: 0.8; }
}
@keyframes driftB {
  0%, 100% { transform: translate3d(0,0,0) scale(1.1); opacity: 0.5; }
  50% { transform: translate3d(-50px,30px,0) scale(0.95); opacity: 0.7; }
}
@keyframes driftC {
  0%, 100% { transform: translate3d(0,0,0) scale(1); opacity: 0.4; }
  50% { transform: translate3d(30px,40px,0) scale(1.1); opacity: 0.6; }
}

/* ========================================================================
   DASHBOARD STRUCTURE
   ======================================================================== */
.app-container {
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  position: relative;
  z-index: 10;
}

/* Top Horizontal Header Bar */
.top-header {
  height: 72px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  background: var(--bg-glass);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border-bottom: 1px solid var(--border-subtle);
  position: relative;
  z-index: 1000;
  flex-shrink: 0;
  box-shadow: var(--shadow-header);
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.brand-logo {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 16px;
  color: #08080c;
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.35);
}

.brand-title {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.brand-tagline {
  font-size: 9px;
  font-weight: 700;
  color: var(--magenta);
  background: rgba(236, 72, 153, 0.08);
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid rgba(236, 72, 153, 0.12);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Category Tabs (Centered in Header) */
.category-tabs {
  display: flex;
  gap: 6px;
  background: rgba(255, 255, 255, 0.03);
  padding: 4px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
}

.category-tab {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 8px 22px;
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 13px;
  border-radius: 8px;
  cursor: pointer;
  letter-spacing: 0.01em;
  transition: var(--transition-apple);
}

.category-tab:hover {
  color: var(--text-primary);
}

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

/* Header Action Buttons (Right Aligned) */
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tool-tab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 13px;
  transition: var(--transition-apple);
}

.tool-tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.02);
}

.tool-tab-btn.active {
  background: rgba(139, 92, 246, 0.08);
  border-color: rgba(139, 92, 246, 0.15);
  color: #a78bfa;
}

/* Premium Primary Button */
.btn-primary {
  background: var(--text-primary);
  color: var(--bg-void);
  font-weight: 700;
  font-family: var(--font-title);
  border: none;
  padding: 10px 18px;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: var(--transition-apple);
}

.btn-primary:hover {
  background: var(--accent-gradient);
  color: #ffffff;
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.4);
  transform: translateY(-0.5px);
}

/* Premium Secondary Button */
.btn-secondary {
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-weight: 700;
  font-family: var(--font-title);
  padding: 10px 18px;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: var(--transition-apple);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.12);
}

/* Main Screen Wrapper */
.main-content {
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 16px 40px;
  position: relative;
}

.app-screen {
  display: none;
  opacity: 0;
  transform: translate3d(0, 12px, 0);
  transition: var(--transition-apple);
  flex: 1;
  min-height: 0;
  overflow: hidden;
  height: 100%;
}

.app-screen.active {
  display: flex;
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

/* ========================================================================
   SCREEN 1: CATALOGUE GALLERY
   ======================================================================== */
.gallery-wrapper {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  overflow: hidden;
}

#standard-gallery-view, #brand-experience-view {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.gallery-header {
  margin-bottom: 12px;
  flex-shrink: 0;
}

.gallery-header h2 {
  font-family: var(--font-title);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.gallery-header p {
  color: var(--text-secondary);
  font-size: 13.5px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  grid-auto-rows: max-content;
  gap: 24px;
  overflow-y: auto;
  padding-top: 12px;
  padding-bottom: 32px;
  flex-grow: 1;
  padding-right: 4px;
}

/* Premium Card (Folder) with Card Shine border */
.component-card {
  background: var(--bg-glass-card);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  transition: border-color 0.25s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(10px);
}

.component-card:hover {
  border-color: rgba(236, 72, 153, 0.25);
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  position: relative;
  z-index: 10;
}

.niche-badge {
  font-size: 8.5px;
  font-weight: 700;
  color: var(--violet);
  background: rgba(139, 92, 246, 0.06);
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid rgba(139, 92, 246, 0.1);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* iOS Toggle Switch for Direct Download */
.card-download-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  padding: 4px 8px;
  border-radius: 10px;
}

.dl-symbol svg {
  color: var(--text-secondary);
  display: block;
}

.ios-switch {
  position: relative;
  display: inline-block;
  width: 28px;
  height: 16px;
}

.ios-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.ios-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: rgba(255, 255, 255, 0.08);
  transition: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 34px;
}

.ios-slider:before {
  position: absolute;
  content: "";
  height: 12px;
  width: 12px;
  left: 2px;
  bottom: 2px;
  background-color: var(--text-secondary);
  transition: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 50%;
}

.dl-toggle-input:checked + .ios-slider {
  background-color: var(--success);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.25);
}

.dl-toggle-input:checked + .ios-slider:before {
  transform: translateX(12px);
  background-color: #08080c;
}

.card-body {
  margin-bottom: 12px;
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.card-title {
  font-family: var(--font-title);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.card-subtitle {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
}

.card-description {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.45;
  height: 4.35em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.card-footer {
  margin-top: auto;
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 12px;
  position: relative;
  z-index: 10;
}

.btn-card-copy {
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 10px;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-apple);
}

.btn-card-copy:hover {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.12);
}

.btn-card-view {
  background: var(--text-primary);
  color: var(--bg-void);
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 10px;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-apple);
}

.btn-card-view:hover {
  background: var(--accent-gradient);
  color: #ffffff;
  box-shadow: 0 0 15px rgba(217, 70, 239, 0.3);
}

/* ========================================================================
   SCREEN 2: THEME CUSTOMIZER (Schema Builder)
   ======================================================================== */
.builder-layout {
  display: grid;
  grid-template-columns: 350px 1fr;
  gap: 24px;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.builder-controls-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  height: 100%;
  overflow-y: auto;
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow-glow);
}

.builder-header h2 {
  font-family: var(--font-title);
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 3px;
}

.builder-header p {
  color: var(--text-secondary);
  font-size: 11.5px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-label {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.input-text, .select-input {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 12.5px;
  outline: none;
  transition: var(--transition-apple);
}

.input-text:focus, .select-input:focus {
  border-color: rgba(139, 92, 246, 0.35);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.06);
}

.color-presets {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.color-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: var(--transition-apple);
}

.color-dot.active {
  border-color: #FFFFFF;
  transform: scale(1.1);
}

.range-slider-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.range-slider {
  flex-grow: 1;
  accent-color: var(--magenta);
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  cursor: pointer;
}

.slider-val {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--magenta);
  min-width: 35px;
  text-align: right;
}

.builder-output-pane {
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

/* Reusable Preview Simulator Bezel & Frame Mockup styles */
.preview-window-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.preview-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  flex-shrink: 0;
  height: 48px;
}

.preview-canvas-wrapper {
  background: #040407;
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 0;
  padding: 20px;
  position: relative;
  overflow: hidden;
}

/* Device Mockups Bezel frames */
.device-frame {
  background: #000000;
  border-style: solid;
  border-color: #121218;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: var(--transition-apple);
}

.device-frame.mode-desktop {
  width: 100%;
  height: 100%;
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 10px;
  box-shadow: none;
}

.device-frame.mode-tablet {
  width: 100%;
  max-width: 580px;
  height: 90%;
  max-height: 380px;
  border-width: 14px;
  border-radius: 24px;
}

.device-frame.mode-mobile {
  width: 270px;
  height: 95%;
  max-height: 450px;
  border-width: 12px;
  border-radius: 30px;
}

/* Dynamic Island Bezel details */
.device-frame.mode-mobile::before {
  content: "";
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 70px;
  height: 15px;
  background: #000000;
  border-radius: 8px;
  z-index: 100;
}

.preview-iframe {
  border: none;
  width: 100%;
  height: 100%;
  background: #08080c;
}

/* Reusable Xcode Code Panel Inspector styles */
.code-panel-container {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  background: #040407;
  overflow: hidden;
  flex-shrink: 0;
}

.code-tabs {
  display: flex;
  background: rgba(12, 12, 18, 0.5);
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
  height: 38px;
}

.code-tab-btn {
  padding: 0 16px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-title);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  line-height: 38px;
  transition: var(--transition-apple);
}

.code-tab-btn.active {
  color: var(--magenta);
}

.code-box-wrapper {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  position: relative;
}

.code-pre {
  margin: 0;
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.55;
  color: #e2e8f0;
  white-space: pre-wrap;
  word-break: break-all;
}

/* Code Syntax Styling tokens */
.syntax-comment { color: #5a586e; font-style: italic; }
.syntax-tag { color: var(--magenta); }
.syntax-attr { color: var(--violet); }
.syntax-string { color: var(--success); }
.syntax-keyword { color: var(--fuchsia); }

/* iOS Segmented Controls */
.segmented-control {
  display: flex;
  background: rgba(255, 255, 255, 0.04);
  padding: 2px;
  border-radius: 9px;
  border: 1px solid var(--border-subtle);
}

.segmented-control button {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 6px 14px;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-title);
  border-radius: 7px;
  cursor: pointer;
  transition: var(--transition-apple);
  display: flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.segmented-control button.active {
  color: var(--text-primary);
}

/* ========================================================================
   SCREEN 3: COMPARATOR (Scrollable Grid List)
   ======================================================================== */
.battle-container {
  height: 100%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-right: 4px;
}

.battle-cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  flex-shrink: 0;
}

.battle-card {
  padding: 28px;
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-glow);
}

.battle-card.our-card {
  border-color: var(--border-highlight);
  background: radial-gradient(circle at top right, rgba(236, 72, 153, 0.06) 0%, var(--bg-glass) 100%);
}

.battle-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 8.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

.battle-badge.our-badge {
  background: var(--magenta);
  color: #08080c;
}

.battle-badge.competitor-badge {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.battle-card h3 {
  font-family: var(--font-title);
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 12px;
}

.performance-metric {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.metric-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.metric-info {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--text-secondary);
}

.metric-info span strong {
  color: var(--text-primary);
}

.metric-bar-bg {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 2px;
  overflow: hidden;
}

.metric-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.our-fill { background: linear-gradient(90deg, var(--violet), var(--magenta)); }
.comp-fill { background: var(--text-muted); }

.score-circle-container {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px;
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow-glow);
  flex-shrink: 0;
}

.score-circle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 3px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 20px;
}

.our-circle {
  border-color: var(--violet);
  color: var(--violet);
  box-shadow: 0 0 15px rgba(139, 92, 246, 0.2);
}

.score-label h4 {
  font-family: var(--font-title);
  font-size: 14.5px;
  font-weight: 700;
  margin-bottom: 2px;
}

.score-label p {
  color: var(--text-secondary);
  font-size: 11.5px;
}

/* ========================================================================
   INTERACTIVE PREVIEW MODAL
   ======================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 4, 6, 0.65);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 32px;
  will-change: opacity, backdrop-filter;
}

.modal-overlay[aria-hidden="false"] {
  opacity: 1;
  pointer-events: all;
}
.modal-content {
  background: rgba(12, 12, 18, 0.95);
  border: 1px solid var(--border-subtle);
  border-radius: 24px;
  width: 100%;
  max-width: 1200px;
  height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.8), 0 0 100px rgba(139, 92, 246, 0.08);
  overflow: hidden;
  transform: scale(0.92) translate3d(0, 40px, 0);
  transition: transform 0.45s cubic-bezier(0.25, 1, 0.5, 1);
}

.modal-overlay[aria-hidden="false"] .modal-content {
  transform: scale(1) translate3d(0, 0, 0);
}

.modal-header {
  height: 72px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 28px;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
  background: rgba(10, 10, 16, 0.3);
}

.modal-title-group {
  display: flex;
  flex-direction: column;
}

.modal-niche-badge {
  font-size: 8px;
  font-weight: 700;
  color: var(--magenta);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1;
}

.modal-title {
  font-family: var(--font-title);
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
  margin-top: 4px;
  line-height: 1.2;
}

.modal-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-apple);
}

.modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  transform: scale(1.05);
}

.modal-body {
  flex-grow: 1;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  min-height: 0;
  overflow: hidden;
}

.modal-preview-column {
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  background: #040407;
  padding: 24px;
  min-height: 0;
  overflow: hidden;
}

.preview-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fps-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 6px var(--success);
  animation: pulse 2s infinite;
}

.fps-text {
  font-size: 10px;
  font-weight: 700;
  color: var(--success);
  letter-spacing: 0.05em;
}

@keyframes pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

.modal-controls-column {
  display: flex;
  flex-direction: column;
  padding: 24px;
  gap: 20px;
  overflow-y: auto;
  height: 100%;
}

.controls-card {
  background: var(--bg-glass-card);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 20px;
  flex-shrink: 0;
}

.controls-heading {
  font-family: var(--font-title);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--violet);
  margin-bottom: 16px;
}

.control-fields-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.code-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  background: #040407;
  flex-grow: 1;
  min-height: 300px;
}

.code-card .code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(12, 12, 18, 0.6);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 16px;
  height: 48px;
  flex-shrink: 0;
}

.modal-action-buttons {
  display: flex;
  gap: 8px;
}

.btn-sm {
  padding: 6px 14px !important;
  border-radius: 8px !important;
  font-size: 10px !important;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* iOS Toast Notification Alert */
.ios-toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translate3d(-50%, 60px, 0);
  background: rgba(14, 14, 22, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 12px 20px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-title);
  z-index: 10000;
  opacity: 0;
  transition: var(--transition-apple);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(139, 92, 246, 0.1);
}

.ios-toast.show {
  transform: translate3d(-50%, 0, 0);
  opacity: 1;
}

.ios-toast svg {
  width: 14px;
  height: 14px;
  fill: var(--magenta);
}

/* ========================================================================
   RESPONSIVE DESIGN (Top header and Gallery wrap adjustments)
   ======================================================================== */
@media (max-width: 992px) {
  .top-header {
    padding: 0 24px;
  }
  
  .category-tabs {
    position: static;
    transform: none;
  }
  
  .modal-content {
    width: 95vw;
    height: 90vh;
  }
}

/* Mobile Media Query moved to the bottom of the file to preserve cascade order */

/* ========================================================================
   QUICK FILTERS PILLS BAR
   ======================================================================== */
.gallery-filter-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.filter-pill {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-family: var(--font-title);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  transition: var(--transition-apple);
}

.filter-pill:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
}

.filter-pill.active {
  background: var(--bg-pill-active);
  border-color: var(--border-pill-active);
  color: var(--color-pill-active);
  box-shadow: var(--shadow-pill-active);
}

/* Taxonomy Niche Filters */
.gallery-niche-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.niche-pill {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-family: var(--font-title);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  transition: var(--transition-apple);
}

.niche-pill:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
}

.niche-pill.active {
  background: var(--bg-niche-active);
  border-color: var(--border-niche-active);
  color: var(--color-niche-active);
  box-shadow: var(--shadow-niche-active);
}

/* ========================================================================
   CARDS VISUAL MINIATURE PREVIEWS
   ======================================================================== */
.card-preview-visual {
  height: 95px;
  background: #040407;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  margin-bottom: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: inset 0 0 20px rgba(0,0,0,0.8);
}

/* Boutique Multi-Liens Visual */
.preview-link-in-bio {
  background: radial-gradient(circle at center, rgba(139, 92, 246, 0.1) 0%, #040407 70%);
}
.preview-link-in-bio .mini-phone {
  width: 55px;
  height: 80px;
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: #08080c;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px;
  gap: 4px;
}
.preview-link-in-bio .mini-avatar {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8b5cf6, #ec4899);
}
.preview-link-in-bio .mini-line {
  width: 100%;
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.05);
}
.preview-link-in-bio .mini-btn {
  width: 100%;
  height: 10px;
  border-radius: 3px;
  border: 1px solid rgba(236, 72, 153, 0.2);
  background: rgba(236, 72, 153, 0.05);
}

/* Stories Highlights Visual */
.preview-stories {
  background: radial-gradient(circle at center, rgba(236, 72, 153, 0.08) 0%, #040407 70%);
  gap: 12px;
}
.preview-stories .mini-story-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid transparent;
  background: linear-gradient(#040407, #040407) padding-box,
              var(--accent-gradient) border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  box-shadow: 0 4px 10px rgba(139, 92, 246, 0.15);
}

/* UGC Video Grid Visual */
.preview-ugc-grid {
  background: radial-gradient(circle at center, rgba(219, 70, 239, 0.08) 0%, #040407 70%);
  gap: 10px;
}
.preview-ugc-grid .mini-video-card {
  width: 44px;
  height: 76px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.06);
  background: linear-gradient(135deg, #111118, #0c0c12);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.preview-ugc-grid .play-icon {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 7px;
  color: #fff;
  backdrop-filter: blur(2px);
}
.preview-ugc-grid .mini-video-card::after {
  content: "";
  position: absolute;
  bottom: 6px;
  left: 6px;
  width: 20px;
  height: 4px;
  border-radius: 2px;
  background: var(--magenta);
}

/* Slide Cart Drawer Visual */
.preview-cart-drawer {
  background: radial-gradient(circle at right, rgba(139, 92, 246, 0.15) 0%, #040407 60%);
}
.preview-cart-drawer .mini-drawer-frame {
  width: 130px;
  height: 90px;
  border: 1.5px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  background: #08080c;
  position: relative;
  overflow: hidden;
}
.preview-cart-drawer .mini-drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: 44px;
  height: 100%;
  background: #0c0c12;
  border-left: 1px solid rgba(255,255,255,0.08);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.preview-cart-drawer .mini-drawer-item {
  width: 100%;
  height: 8px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.04);
}
.preview-cart-drawer .mini-drawer-btn {
  width: 100%;
  height: 10px;
  border-radius: 3px;
  background: var(--magenta);
  margin-top: auto;
}

/* Social Proof Reviews Visual */
.preview-reviews {
  background: radial-gradient(circle at center, rgba(16, 185, 129, 0.06) 0%, #040407 70%);
}
.preview-reviews .mini-review-bubble {
  width: 120px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1.5px solid rgba(255, 255, 255, 0.04);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.preview-reviews .mini-stars {
  color: var(--magenta);
  font-size: 8px;
  line-height: 1;
}
.preview-reviews .mini-review-text {
  width: 100%;
  height: 6px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.06);
}
.preview-reviews .mini-review-text::after {
  content: "";
  display: block;
  width: 60%;
  height: 6px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.06);
  margin-top: 4px;
}

/* Immersive Video Banner Visual */
.preview-video-banner {
  background: radial-gradient(circle at center, rgba(236, 72, 153, 0.1) 0%, #040407 70%);
}
.preview-video-banner .mini-banner {
  width: 130px;
  height: 76px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.06);
  background: linear-gradient(to right, #111118, #08080c);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.preview-video-banner .play-btn-large {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  color: #08080c;
  box-shadow: 0 0 15px rgba(236, 72, 153, 0.4);
}

/* Conversion Countdown Visual */
.preview-countdown {
  background: radial-gradient(circle at center, rgba(217, 70, 239, 0.08) 0%, #040407 70%);
}
.preview-countdown .mini-timer-box {
  width: 110px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: 8px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.preview-countdown .timer-digits {
  display: flex;
  gap: 4px;
}
.preview-countdown .digit {
  width: 16px;
  height: 18px;
  background: rgba(255,255,255,0.06);
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  font-family: monospace;
  color: var(--magenta);
}
.preview-countdown .mini-progress {
  width: 100%;
  height: 3px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 4px;
}
.preview-countdown .mini-progress-bar {
  width: 75%;
  height: 100%;
  background: var(--success);
}

/* Gift Pop-up discount Visual */
.preview-popup-discount {
  background: radial-gradient(circle at bottom, rgba(139, 92, 246, 0.15) 0%, #040407 60%);
}
.preview-popup-discount .mini-phone-popup {
  width: 55px;
  height: 80px;
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: #08080c;
  position: relative;
  overflow: hidden;
}
.preview-popup-discount .popup-drawer {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 28px;
  background: #0c0c12;
  border-top: 1px solid rgba(139, 92, 246, 0.3);
  padding: 3px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: center;
  justify-content: center;
}
.preview-popup-discount .popup-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--magenta);
}
.preview-popup-discount .popup-bar {
  width: 80%;
  height: 3px;
  border-radius: 1px;
  background: rgba(255, 255, 255, 0.05);
}

/* ========================================================================
   PALMA 2026 - FLUID PHYSICS, ACTIVE TOUCH & INDEPENDENT HAPTICS
   ======================================================================== */

/* Universal active elastic press scale */
button:active,
.btn-primary:active,
.btn-secondary:active,
.tool-tab-btn:active,
.category-tab:active,
.filter-pill:active,
.niche-pill:active,
.btn-card-copy:active,
.btn-card-view:active,
.viewport-btn:active,
.code-tab-btn:active,
.ios-switch:active {
  transform: scale(0.955) translateZ(0) !important;
}

/* Fast spring transitions on elements */
button,
.btn-primary,
.btn-secondary,
.tool-tab-btn,
.category-tab,
.filter-pill,
.niche-pill,
.btn-card-copy,
.btn-card-view,
.viewport-btn,
.code-tab-btn,
.ios-switch {
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.3s, border-color 0.3s, box-shadow 0.3s !important;
}

/* Container positioning contexts */
.category-tabs,
.segmented-control,
.code-tabs {
  position: relative !important;
}

/* Button stacking contexts */
.category-tab,
.segmented-control button,
.code-tab-btn {
  position: relative !important;
  z-index: 2 !important;
}

/* Sliding active highlights backdrop styling */
.category-indicator {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: var(--bg-indicator);
  border: var(--border-indicator);
  border-radius: 8px;
  box-shadow: var(--shadow-indicator);
  transition: transform 0.35s cubic-bezier(0.25, 1, 0.5, 1), width 0.35s cubic-bezier(0.25, 1, 0.5, 1);
  pointer-events: none;
  z-index: 1;
}

.viewport-indicator {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: var(--bg-indicator);
  border: var(--border-indicator);
  border-radius: 7px;
  box-shadow: var(--shadow-indicator);
  transition: transform 0.35s cubic-bezier(0.25, 1, 0.5, 1), width 0.35s cubic-bezier(0.25, 1, 0.5, 1);
  pointer-events: none;
  z-index: 1;
}

.code-tab-indicator {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  background: var(--magenta);
  box-shadow: 0 0 8px var(--magenta);
  transition: transform 0.35s cubic-bezier(0.25, 1, 0.5, 1), width 0.35s cubic-bezier(0.25, 1, 0.5, 1);
  pointer-events: none;
  z-index: 1;
}

/* Modal Drag Grabber styling */
.modal-grabber {
  width: 36px;
  height: 5px;
  border-radius: 2.5px;
  background: rgba(255, 255, 255, 0.15);
  margin: 10px auto 2px auto;
  cursor: grab;
  flex-shrink: 0;
  display: block;
  transition: background 0.3s, transform 0.3s;
  z-index: 2100;
}
.modal-grabber:hover {
  background: rgba(255, 255, 255, 0.3);
}
.modal-grabber:active {
  cursor: grabbing;
  transform: scale(0.95);
}

/* Apple HIG - iOS Page Sheet Backplate Zoom */
body.modal-open {
  background-color: #000000 !important;
  overflow: hidden !important;
}

body.modal-open .app-container {
  transform: scale(0.965) translate3d(0, -10px, 0) !important;
  border-radius: 24px !important;
  filter: brightness(0.65) !important;
  pointer-events: none !important;
  transform-origin: center top !important;
}

.app-container {
  transition: transform 0.45s cubic-bezier(0.25, 1, 0.5, 1), filter 0.45s cubic-bezier(0.25, 1, 0.5, 1), border-radius 0.45s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Smooth drag transitions */
.modal-content.dragging {
  transition: none !important;
}

/* ========================================================================
   PALMA 2026 - SAAS ENGINE (SHOPIFY CONNECT, STYLE CLONER, EXA SOURCER)
   ======================================================================== */

/* Laser Scan Animation for Style Cloner */
.laser-scan-active {
  position: relative;
}

.laser-scan-active::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, transparent, var(--fuchsia), var(--magenta), var(--fuchsia), transparent);
  box-shadow: 0 0 12px var(--fuchsia), 0 0 24px var(--magenta);
  z-index: 1000;
  animation: laserScan 2.4s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  pointer-events: none;
}

@keyframes laserScan {
  0% { top: 0%; opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}

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

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; box-shadow: 0 0 0 0 rgba(217, 70, 239, 0.7); }
  50% { transform: scale(1.15); opacity: 0.5; box-shadow: 0 0 0 8px rgba(217, 70, 239, 0); }
}

/* Shopify Hub Modal elements */
.shopify-status-card {
  transition: all 0.3s;
}
.status-dot.connected {
  background: #10b981 !important;
  box-shadow: 0 0 10px #10b981 !important;
}
.status-dot.disconnected {
  background: #ef4444 !important;
  box-shadow: 0 0 10px #ef4444 !important;
}

.log-entry {
  opacity: 0;
  transform: translate3d(0, 4px, 0);
  animation: logFadeIn 0.3s forwards ease-out;
}
@keyframes logFadeIn {
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

/* Exa Sourcing Panel elements */
.exa-spinner {
  flex-shrink: 0;
}

.exa-result-card {
  background: var(--bg-glass-card);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
}
.exa-result-card:hover {
  transform: translateY(-2px);
  border-color: rgba(139, 92, 246, 0.25);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.exa-result-title {
  font-family: var(--font-title);
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.35;
}

.exa-result-url {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--violet);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.exa-result-snippet {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.45;
  height: 5.8em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
}

.cloner-url-input:focus {
  border-color: rgba(217, 70, 239, 0.35) !important;
  box-shadow: 0 0 0 3px rgba(217, 70, 239, 0.06) !important;
}

/* exa query moved to bottom */



/* ========================================================================
   ADDITIONAL COMPONENT MINIATURES (LOOKBOOK, BEFORE-AFTER, MARQUEE)
   ======================================================================== */
.preview-lookbook .mini-lookbook {
  position: relative;
  width: 100%;
  height: 100%;
  background: #08080c;
  display: flex;
  justify-content: center;
  align-items: center;
}
.preview-lookbook .mini-lookbook-img {
  width: 80%;
  height: 80%;
  background: linear-gradient(135deg, rgba(236,72,153,0.15) 0%, rgba(167,139,250,0.1) 100%);
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.05);
}
.preview-lookbook .mini-hotspot {
  position: absolute;
  width: 8px;
  height: 8px;
  background: var(--magenta);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--magenta);
}
.preview-lookbook .mini-hotspot-card {
  position: absolute;
  bottom: 15px;
  right: 15px;
  width: 45px;
  height: 18px;
  background: rgba(255,255,255,0.9);
  border-radius: 4px;
}

.preview-before-after .mini-before-after {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
}
.preview-before-after .mini-split-left {
  width: 50%;
  height: 100%;
  background: linear-gradient(135deg, #ec4899 0%, #d946ef 100%);
  opacity: 0.25;
}
.preview-before-after .mini-split-right {
  width: 50%;
  height: 100%;
  background: linear-gradient(135deg, #8b5cf6 0%, #3b82f6 100%);
  opacity: 0.4;
}
.preview-before-after .mini-split-bar {
  position: absolute;
  left: 50%;
  top: 0;
  width: 2px;
  height: 100%;
  background: var(--magenta);
  box-shadow: 0 0 6px var(--magenta);
}

.preview-marquee .mini-marquee-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
.preview-marquee .mini-marquee-row {
  font-family: var(--font-title);
  font-size: 8px;
  font-weight: 800;
  padding: 3px;
  width: 130%;
  white-space: nowrap;
}
.preview-marquee .mini-marquee-row.r1 {
  background: #ffffff;
  color: #000000;
  transform: rotate(3deg) translateX(-10px);
}
.preview-marquee .mini-marquee-row.r2 {
  background: var(--magenta);
  color: #ffffff;
  transform: rotate(-3deg) translateX(-5px);
}

/* ========================================================================
   ZONE 1: Barre de Navigation & Menu Option Global (Apple HIG Compliant)
   ======================================================================== */
.global-menu-btn, .header-action-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-apple);
  outline: none;
  position: relative;
  flex-shrink: 0;
}

.global-menu-btn:hover, .header-action-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.12);
}

.header-action-btn.active {
  background: rgba(139, 92, 246, 0.12) !important;
  border-color: rgba(139, 92, 246, 0.35) !important;
  color: #a78bfa !important;
  box-shadow: 0 0 15px rgba(139, 92, 246, 0.15);
}

/* Tooltip style */
.header-action-btn::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: -36px;
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: #0c0c12;
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 10px;
  font-family: var(--font-body), sans-serif;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition-apple);
  z-index: 10000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.header-action-btn:hover::before {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 768px) {
  .header-action-btn::before {
    display: none !important;
  }
}

.global-dropdown-menu {
  position: absolute;
  top: 60px;
  right: 40px;
  width: 220px;
  background: var(--bg-glass-card);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 6px;
  display: none;
  flex-direction: column;
  gap: 2px;
  z-index: 2050;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3), var(--shadow-glow);
  opacity: 0;
  transform: translateY(-10px) scale(0.95);
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.global-dropdown-menu.show {
  display: flex;
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.dropdown-item {
  height: 44px;
  width: 100%;
  padding: 0 14px;
  background: transparent;
  border: none;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-secondary);
  font-family: var(--font-title);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: var(--transition-apple);
  outline: none;
}

.dropdown-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
}

.dropdown-item.active {
  background: rgba(139, 92, 246, 0.08);
  border: 1px solid rgba(139, 92, 246, 0.15);
  color: #a78bfa;
}

.dropdown-item svg {
  color: inherit;
  flex-shrink: 0;
}

.dropdown-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 4px 6px;
}

.header-sync-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  height: 40px;
  cursor: pointer;
  transition: var(--transition-apple);
}

.header-sync-status:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
}

.header-sync-status .shopify-icon-svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: #96bf48; /* Official Shopify Green */
  opacity: 0.95;
  transition: opacity 0.3s ease;
}

.header-sync-status:hover .shopify-icon-svg {
  opacity: 1;
}

.header-sync-status .status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  position: relative;
}

.header-sync-status .status-dot.connected {
  background: var(--success);
  box-shadow: 0 0 10px var(--success);
}

.header-sync-status .status-dot.disconnected {
  background: #ef4444;
  box-shadow: 0 0 10px #ef4444;
}

.header-sync-status .status-text {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ========================================================================
   ZONE 2 & 3 & 4: Segmented Selector, Carousel, Title (Apple HIG)
   ======================================================================== */
.segmented-nav-container {
  width: 100%;
  display: flex;
  justify-content: center;
  margin: 0;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border-subtle);
}

.segmented-nav {
  display: flex;
  background: transparent;
  padding: 0;
  border-radius: 0;
  border: none;
  position: relative;
  width: 100%;
  max-width: 600px;
}

.segmented-tab {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  height: 48px;
  font-family: var(--font-title), sans-serif;
  font-weight: 500;
  font-size: 13.5px;
  border-radius: 0;
  cursor: pointer;
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition-apple);
  outline: none;
}

.segmented-tab:hover {
  color: var(--text-primary);
}

.segmented-tab.active {
  color: var(--text-primary);
  font-weight: 600;
}

.segmented-indicator {
  position: absolute;
  top: auto;
  bottom: 0;
  left: 0;
  height: 2px;
  background: var(--text-primary);
  border: none;
  border-radius: 0;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1;
  box-shadow: none;
}

.inspired-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--fuchsia);
  box-shadow: 0 0 8px var(--fuchsia);
  display: inline-block;
  animation: pulse-badge 1.8s infinite;
}

@keyframes pulse-badge {
  0%, 100% { opacity: 0.8; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.3); }
}

.contextual-carousel-wrapper {
  width: 100%;
  margin-bottom: 24px;
  overflow: hidden;
  flex-shrink: 0;
}

.contextual-carousel {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding: 4px 0;
  width: 100%;
}

.contextual-carousel::-webkit-scrollbar {
  display: none;
}

.editorial-title {
  font-family: 'Playfair Display', serif;
  font-weight: 800;
  font-size: 32px;
  background: linear-gradient(135deg, var(--text-primary) 30%, var(--magenta) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.01em;
}

.editorial-subtitle {
  font-size: 13.5px;
  color: var(--text-secondary);
  border-left: 2.5px solid var(--border-highlight);
  padding-left: 10px;
  margin-top: 5px;
}

/* ========================================================================
   UNIFIED RESPONSIVE MEDIA QUERY (PLACED AT THE BOTTOM FOR CASCADE ORDER)
   ======================================================================== */
@media (max-width: 768px) {
  html, body {
    overflow: hidden;
    height: 100%;
    margin: 0;
    padding: 0;
  }

  .app-container {
    height: 100vh;
    height: 100dvh;
    width: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }
  
  .top-header {
    height: 60px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(10, 10, 16, 0.9);
  }
  
  .brand-group {
    display: flex;
    align-items: center;
    gap: 6px;
  }
  
  .brand-logo {
    width: 24px;
    height: 24px;
    font-size: 13px;
  }

  .brand-title {
    font-size: 14px;
  }

  .brand-tagline {
    display: none;
  }

  .header-actions {
    display: flex;
    align-items: center;
    width: auto;
    gap: 8px;
  }

  .header-sync-status {
    padding: 0;
    width: 36px;
    height: 36px;
    justify-content: center;
    border-radius: 50%;
    gap: 0;
  }

  .header-sync-status .shopify-icon-svg {
    width: 16px;
    height: 16px;
  }

  .header-sync-status .status-dot {
    display: none;
  }

  .header-sync-status .status-text {
    display: none;
  }

  .global-dropdown-menu {
    top: 50px;
    right: 16px;
    width: 200px;
  }
  
  .main-content {
    padding: 12px 16px;
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    width: 100%;
    box-sizing: border-box;
  }

  .app-screen.active {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
    max-width: 100%;
    height: 100%;
    overflow: hidden;
    box-sizing: border-box;
  }

  .gallery-wrapper {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
    max-width: 100%;
    height: 100%;
    width: 100%;
    overflow: hidden;
    box-sizing: border-box;
  }

  .gallery-header {
    margin-bottom: 12px;
    text-align: center;
  }

  .gallery-header h2 {
    font-size: 19px;
  }

  .gallery-header p {
    font-size: 12px;
  }

  /* Horizontal scrolling filter/niche bars on mobile */
  .gallery-filter-bar,
  .gallery-niche-bar {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    width: auto;
    margin: 0 -16px 12px -16px;
    padding: 0 16px;
  }

  .gallery-niche-bar {
    margin-bottom: 16px;
  }

  .gallery-filter-bar::-webkit-scrollbar,
  .gallery-niche-bar::-webkit-scrollbar {
    display: none;
  }

  .filter-pill,
  .niche-pill {
    padding: 8px 14px;
    font-size: 11px;
    flex-shrink: 0;
    white-space: nowrap;
  }
  
  .gallery-grid {
    display: grid;
    grid-template-columns: 1fr;
    grid-auto-rows: max-content;
    gap: 16px;
    padding-top: 8px;
    padding-bottom: 30px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
  }

  /* Force card width limit to prevent horizontal cutoff */
  .component-card {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  .builder-controls-card,
  .battle-card,
  .score-circle-container {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
  
  /* Modal responsive stacking */
  .modal-overlay {
    padding: 0;
    align-items: flex-end;
    background: rgba(0, 0, 0, 0.65);
  }
  
  .modal-content {
    height: 92vh;
    border-radius: 24px 24px 0 0;
    transform: translate3d(0, 100%, 0);
    margin: 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
    transition: transform 0.45s cubic-bezier(0.25, 1, 0.5, 1);
  }

  .modal-overlay[aria-hidden="false"] .modal-content {
    transform: translate3d(0, 0, 0);
  }

  .modal-header {
    height: 56px;
    padding: 0 16px;
  }

  .modal-title {
    font-size: 15px;
  }

  .modal-niche-badge {
    font-size: 7.5px;
  }
  
  .modal-body {
    grid-template-columns: 1fr;
    grid-template-rows: 320px 1fr;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    height: calc(100% - 56px);
  }
  
  .modal-preview-column {
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
    padding: 12px;
  }
  
  .modal-controls-column {
    padding: 16px;
    height: auto;
    overflow-y: visible;
    gap: 16px;
  }
  
  .device-frame.mode-tablet {
    width: 100%;
    max-width: 320px;
    height: 100%;
    max-height: 220px;
    border-width: 6px;
    border-radius: 12px;
  }

  .device-frame.mode-mobile {
    width: 140px;
    height: 100%;
    max-height: 230px;
    border-width: 6px;
    border-radius: 12px;
  }

  /* Scale Dynamic Island on mobile screen */
  .device-frame.mode-mobile::before {
    width: 40px;
    height: 8px;
    top: 3px;
    border-radius: 4px;
  }

  .code-card {
    min-height: 200px;
  }

  .code-card .code-header {
    height: auto;
    flex-direction: column;
    align-items: stretch;
    padding: 8px 12px;
    gap: 8px;
  }

  .code-tabs {
    width: 100%;
    justify-content: space-around;
    height: auto;
    border-bottom: none;
  }

  .code-tab-btn {
    line-height: 28px;
    padding: 0 8px;
    font-size: 11px;
  }

  .modal-action-buttons {
    width: 100%;
    justify-content: space-between;
    gap: 12px;
  }

  .modal-action-buttons .btn-sm {
    flex: 1;
    justify-content: center;
    height: 44px;
    font-size: 11px;
    border-radius: 12px;
  }
  
  /* Builder mobile */
  .builder-layout {
    grid-template-columns: 1fr;
    gap: 16px;
    height: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1 1 auto;
    min-height: 0;
  }
  
  .builder-controls-card {
    height: auto;
    padding: 16px;
    overflow-y: visible;
  }

  .builder-output-pane {
    height: auto;
    min-height: 250px;
  }

  /* Battle mobile */
  .battle-cards-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .battle-card {
    padding: 16px;
  }

  .score-circle-container {
    flex-direction: column;
    text-align: center;
    padding: 16px;
  }

  .exa-search-row {
    flex-direction: column;
    gap: 8px;
  }
  .exa-search-row button {
    width: 100%;
  }
  .exa-results-grid {
    display: grid;
    grid-template-columns: 1fr !important;
    grid-auto-rows: max-content;
  }

  /* Brand Experience mobile overrides */
  #brand-experience-view {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding-top: 24px;
    flex: 1;
    min-height: 0;
  }

  .brand-experience-header {
    margin-top: 0;
    margin-bottom: 12px;
    text-align: left;
  }

  .brand-vault-title {
    font-size: 19px;
    margin-bottom: 2px;
  }

  .brand-vault-subtitle {
    font-size: 11.5px;
    border-left: 2px solid var(--border-highlight);
    padding-left: 6px;
  }

  .macro-categories-container {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    width: auto;
    margin: 0 -16px 12px -16px;
    padding: 0 16px;
  }

  .macro-categories-container::-webkit-scrollbar {
    display: none;
  }

  .macro-category-btn {
    padding: 8px 14px;
    font-size: 11px;
    flex-shrink: 0;
    white-space: nowrap;
  }

  .brand-cards-grid {
    grid-template-columns: 1fr !important;
    gap: 16px;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    flex: 1 1 auto;
    min-height: 0;
    padding-bottom: 100px;
  }

  .brand-card-item {
    height: auto !important;
    min-height: 0;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
}

/* ========================================================================
   PALMA BRAND SANDBOX SYSTEM (Inspired By Isolated View)
   ======================================================================== */
.brand-experience-header {
  margin-bottom: 16px;
  margin-top: 4px;
  flex-shrink: 0;
  text-align: left;
}

.brand-vault-title {
  font-family: var(--font-title), sans-serif;
  font-weight: 800;
  font-size: 24px;
  background: linear-gradient(135deg, var(--text-primary) 30%, var(--magenta) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.02em;
  margin: 0 0 4px 0;
}

.brand-vault-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
  border-left: 2px solid var(--border-highlight);
  padding-left: 8px;
}
.macro-categories-container {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.macro-category-btn {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-family: var(--font-title);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  transition: var(--transition-apple);
  white-space: nowrap;
}

.macro-category-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
}

.macro-category-btn.active {
  background: var(--bg-niche-active);
  border-color: var(--border-niche-active);
  color: var(--color-niche-active);
  box-shadow: var(--shadow-niche-active);
}

.brand-pills-carousel-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
  margin: 8px 0 24px 0;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.brand-pills-carousel-wrapper::-webkit-scrollbar {
  display: none;
}

.brand-pills-carousel {
  display: flex;
  gap: 8px;
  padding: 4px 0;
}

.brand-pill {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 8px 18px;
  border-radius: var(--radius-full);
  font-family: var(--font-title);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-transform: uppercase;
  transition: var(--transition-apple);
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  outline: none;
}

.brand-pill:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
}

/* Dynamic active pills depending on selected active brand */
.brand-pill.active[data-brand="rhode"] {
  background: #27272a !important;
  border-color: #27272a !important;
  color: #f4f4f5 !important;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.brand-pill.active[data-brand="summer-fridays"] {
  background: #b09e8f !important;
  border-color: #b09e8f !important;
  color: #fdfbf7 !important;
  box-shadow: 0 4px 12px rgba(176, 158, 143, 0.2);
}
.brand-pill.active[data-brand="rare-beauty"] {
  background: #b56576 !important;
  border-color: #b56576 !important;
  color: #fbf8f7 !important;
  box-shadow: 0 4px 12px rgba(181, 101, 118, 0.2);
}
.brand-pill.active[data-brand="fenty-skin"] {
  background: #d0a370 !important;
  border-color: #d0a370 !important;
  color: #0f0e0d !important;
  box-shadow: 0 4px 12px rgba(208, 163, 112, 0.2);
}

.palma-sandbox-container {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px 0 40px 0;
}

/* Realistic Smartphone Frame Mockup with Brand Variables */
.palma-phone-frame {
  width: 375px;
  height: 780px;
  background: var(--sb-bg, #08080c);
  border: 12px solid #1c1c22;
  border-radius: 40px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255,255,255,0.05);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.4s ease;
}

/* Notch camera indicator */
.phone-notch {
  position: absolute;
  top: 0;
  left: 50%;
  width: 120px;
  height: 20px;
  background: #1c1c22;
  border-bottom-left-radius: 14px;
  border-bottom-right-radius: 14px;
  transform: translateX(-50%);
  z-index: 1010;
  pointer-events: none;
}

.phone-status-bar {
  height: 26px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 11px;
  font-weight: 500;
  color: var(--sb-text, #71717a);
  opacity: 0.6;
  z-index: 1005;
  flex-shrink: 0;
  pointer-events: none;
  margin-top: 4px;
  background: transparent;
  transition: color 0.4s ease;
}

/* The isolated iframe screen container */
.phone-screen-iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
  flex-grow: 1;
  z-index: 100;
}

/* --- Brand Specific Variables for Sandbox Driving --- */
#palma-phone-sandbox[data-active-brand="summer-fridays"] {
  --sb-bg: #fdfbf7;
  --sb-text: #4a3e3d;
  --sb-accent: #d4a373;
  --sb-radius: 16px;
  --sb-font: 'Playfair Display', serif;
  border-color: #d4a373;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.45), 0 0 25px rgba(212, 163, 115, 0.25);
}

#palma-phone-sandbox[data-active-brand="rhode"] {
  --sb-bg: #f4f4f5;
  --sb-text: #18181b;
  --sb-accent: #27272a;
  --sb-radius: 10px;
  --sb-font: 'Outfit', sans-serif;
  border-color: #27272a;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.45), 0 0 25px rgba(39, 39, 42, 0.2);
}

#palma-phone-sandbox[data-active-brand="rare-beauty"] {
  --sb-bg: #fbf8f7;
  --sb-text: #3d262a;
  --sb-accent: #b56576;
  --sb-radius: 14px;
  --sb-font: 'Playfair Display', serif;
  border-color: #b56576;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.45), 0 0 25px rgba(181, 101, 118, 0.25);
}

#palma-phone-sandbox[data-active-brand="fenty-skin"] {
  --sb-bg: #0f0e0d;
  --sb-text: #fafaff;
  --sb-accent: #d0a370;
  --sb-radius: 6px;
  --sb-font: 'Outfit', sans-serif;
  border-color: #d0a370;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.45), 0 0 25px rgba(208, 163, 112, 0.3);
}

#palma-phone-sandbox[data-active-brand="jacquemus"] {
  --sb-bg: #faf8f5;
  --sb-text: #1c1917;
  --sb-accent: #1c1917;
  --sb-radius: 0px;
  --sb-font: 'Playfair Display', serif;
  border-color: #1c1917;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.45), 0 0 25px rgba(28, 25, 23, 0.15);
}

#palma-phone-sandbox[data-active-brand="skims"] {
  --sb-bg: #f2ece4;
  --sb-text: #4a3b32;
  --sb-accent: #4a3b32;
  --sb-radius: 16px;
  --sb-font: 'Outfit', sans-serif;
  border-color: #4a3b32;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.45), 0 0 25px rgba(74, 59, 50, 0.2);
}

#palma-phone-sandbox[data-active-brand="celine"] {
  --sb-bg: #ffffff;
  --sb-text: #000000;
  --sb-accent: #000000;
  --sb-radius: 0px;
  --sb-font: 'Playfair Display', serif;
  border-color: #000000;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.45), 0 0 25px rgba(0, 0, 0, 0.15);
}

#palma-phone-sandbox[data-active-brand="khaite"] {
  --sb-bg: #0a0a0a;
  --sb-text: #f5f5f5;
  --sb-accent: #ffffff;
  --sb-radius: 2px;
  --sb-font: 'Playfair Display', serif;
  border-color: #ffffff;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.45), 0 0 25px rgba(255, 255, 255, 0.15);
}

#palma-phone-sandbox[data-active-brand="mejuri"] {
  --sb-bg: #faf9f6;
  --sb-text: #1c1c1c;
  --sb-accent: #d4af37;
  --sb-radius: 8px;
  --sb-font: 'Outfit', sans-serif;
  border-color: #d4af37;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.45), 0 0 25px rgba(212, 175, 55, 0.25);
}

#palma-phone-sandbox[data-active-brand="cartier"] {
  --sb-bg: #fdfcfb;
  --sb-text: #111111;
  --sb-accent: #b31b1b;
  --sb-radius: 4px;
  --sb-font: 'Playfair Display', serif;
  border-color: #b31b1b;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.45), 0 0 25px rgba(179, 27, 27, 0.25);
}

#palma-phone-sandbox[data-active-brand="messika"] {
  --sb-bg: #0b0f19;
  --sb-text: #f1f5f9;
  --sb-accent: #c5a880;
  --sb-radius: 12px;
  --sb-font: 'Outfit', sans-serif;
  border-color: #c5a880;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.45), 0 0 25px rgba(197, 168, 128, 0.25);
}

#palma-phone-sandbox[data-active-brand="tiffany"] {
  --sb-bg: #ffffff;
  --sb-text: #0a2240;
  --sb-accent: #81d8d0;
  --sb-radius: 10px;
  --sb-font: 'Outfit', sans-serif;
  border-color: #81d8d0;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.45), 0 0 25px rgba(129, 216, 208, 0.3);
}

/* Extra active pills depending on selected active brand */
.brand-pill.active[data-brand="jacquemus"] {
  background: #1c1917 !important;
  border-color: #1c1917 !important;
  color: #faf8f5 !important;
  box-shadow: 0 4px 12px rgba(28, 25, 23, 0.15);
}
.brand-pill.active[data-brand="skims"] {
  background: #4a3b32 !important;
  border-color: #4a3b32 !important;
  color: #f2ece4 !important;
  box-shadow: 0 4px 12px rgba(74, 59, 50, 0.2);
}
.brand-pill.active[data-brand="celine"] {
  background: #000000 !important;
  border-color: #000000 !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.brand-pill.active[data-brand="khaite"] {
  background: #ffffff !important;
  border-color: #ffffff !important;
  color: #0a0a0a !important;
  box-shadow: 0 4px 12px rgba(255,255,255,0.25);
}
.brand-pill.active[data-brand="mejuri"] {
  background: #d4af37 !important;
  border-color: #d4af37 !important;
  color: #faf9f6 !important;
  box-shadow: 0 4px 12px rgba(212,175,55,0.25);
}
.brand-pill.active[data-brand="cartier"] {
  background: #b31b1b !important;
  border-color: #b31b1b !important;
  color: #fdfcfb !important;
  box-shadow: 0 4px 12px rgba(179,27,27,0.2);
}
.brand-pill.active[data-brand="messika"] {
  background: #c5a880 !important;
  border-color: #c5a880 !important;
  color: #0b0f19 !important;
  box-shadow: 0 4px 12px rgba(197,168,128,0.2);
}
.brand-pill.active[data-brand="tiffany"] {
  background: #81d8d0 !important;
  border-color: #81d8d0 !important;
  color: #0a2240 !important;
  box-shadow: 0 4px 12px rgba(129, 216, 208, 0.25);
}

/* --- BRANDS CARDS GRID DIRECTORY --- */
#brand-experience-view {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex-grow: 1;
  padding-top: 32px;
}

.brand-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  padding: 16px 0 40px 0;
  width: 100%;
  overflow-y: auto;
  flex-grow: 1;
  -webkit-overflow-scrolling: touch;
}

.brand-card-item {
  background: var(--bg-glass-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05);
  transition: border-color 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s cubic-bezier(0.16, 1, 0.3, 1), transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  height: auto;
  box-sizing: border-box;
}

.brand-card-item:hover {
  border-color: var(--border-active);
  box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.2), var(--shadow-glow);
  transform: translateY(-4px);
}

.brand-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand-card-logo-img {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  object-fit: contain;
  background: #ffffff;
  padding: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.brand-card-logo-placeholder {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 16px;
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.brand-card-niche-badge {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.brand-card-title {
  font-family: var(--font-title);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: -0.01em;
}

.brand-card-desc {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-secondary);
  margin: 0;
  flex-grow: 1;
}

.brand-card-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
}

.btn-brand-enter {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 44px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-title);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: var(--transition-apple);
  outline: none;
}

.brand-card-item:hover .btn-brand-enter {
  background: var(--accent-gradient);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(236, 72, 153, 0.2);
}

/* --- DEDICATED BRAND STUDIO VIEW --- */
#brand-studio-view {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  background: var(--bg-void);
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: background-color 0.4s ease, color 0.4s ease;
  font-family: var(--font-body), 'Plus Jakarta Sans', sans-serif;
}

.studio-header {
  height: 64px;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-glass);
  border-bottom: 1px solid var(--border-subtle);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 100;
  flex-shrink: 0;
  transition: background-color 0.4s ease, border-color 0.4s ease;
}

.studio-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-studio-back-btn {
  height: 40px;
  padding: 0 16px;
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-family: var(--font-title);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: var(--transition-apple);
  outline: none;
}

.btn-studio-back-btn:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text-primary);
  border-color: var(--border-active);
}

.btn-studio-back-btn:active {
  transform: scale(0.96);
}

.studio-header-divider {
  color: var(--text-muted);
  font-size: 16px;
  opacity: 0.5;
}

.studio-brand-title {
  font-family: var(--sb-font, var(--font-title));
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: -0.01em;
}

.studio-header-right {
  display: flex;
  align-items: center;
}

.studio-viewport-control {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  display: flex;
  padding: 2px;
  position: relative;
  z-index: 10;
}

.studio-viewport-btn {
  height: 36px;
  padding: 0 14px;
  background: transparent;
  border: none;
  border-radius: calc(var(--radius-md) - 2px);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-apple);
  display: flex;
  align-items: center;
  outline: none;
  font-family: var(--font-body), sans-serif;
  z-index: 2;
}

.studio-viewport-btn.active {
  background: var(--bg-indicator, rgba(255,255,255,0.06));
  color: var(--text-primary);
  box-shadow: var(--shadow-indicator);
  border: var(--border-indicator, none);
}

.studio-stats-bar {
  background: #08080c;
  color: #DFD7CD;
  padding: 8px 24px;
  font-family: var(--font-mono), monospace;
  font-size: 11px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
  overflow-x: auto;
  scrollbar-width: none;
  white-space: nowrap;
}

.studio-stats-bar::-webkit-scrollbar {
  display: none;
}

.stats-divider {
  opacity: 0.2;
}

.studio-body-layout {
  flex-grow: 1;
  display: flex;
  height: calc(100vh - 100px);
  width: 100%;
  overflow: hidden;
}

.studio-sidebar {
  width: 320px;
  flex-shrink: 0;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
  box-sizing: border-box;
  transition: background-color 0.4s ease, border-color 0.4s ease;
}

.studio-sidebar::-webkit-scrollbar {
  width: 4px;
}
.studio-sidebar::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: 2px;
}

.studio-sidebar-card {
  background: var(--bg-glass-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: background-color 0.4s ease, border-color 0.4s ease;
}

.studio-sidebar-card.dark-card {
  background: rgba(0,0,0,0.15);
  border-color: rgba(255,255,255,0.03);
}

.studio-sidebar-heading {
  font-family: var(--font-title);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin: 0 0 6px 0;
}

.studio-nav-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.studio-nav-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: var(--transition-apple);
  outline: none;
}

.studio-nav-item:hover {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
}

.studio-nav-item.active {
  background: var(--bg-pill-active);
  border-color: var(--border-pill-active);
  color: var(--color-pill-active);
  font-weight: 600;
  box-shadow: var(--shadow-pill-active);
}

.studio-nav-badge {
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.studio-nav-item.active .studio-nav-badge {
  border-color: transparent;
  background: var(--color-pill-active);
  color: var(--bg-void);
}

.studio-card-heading {
  font-family: var(--font-title);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.studio-card-text {
  font-size: 11px;
  line-height: 1.45;
  color: var(--text-secondary);
  margin: 0;
}

.studio-btn-primary {
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-gradient);
  border: none;
  border-radius: var(--radius-sm);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: var(--transition-apple);
  outline: none;
  width: 100%;
}

.studio-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(236,72,153,0.3);
}

.studio-btn-primary:active {
  transform: translateY(0);
}

.studio-preview-pane {
  flex-grow: 1;
  background: var(--bg-void);
  padding: 24px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow-y: auto;
  box-sizing: border-box;
  transition: background-color 0.4s ease;
}

.studio-preview-pane::-webkit-scrollbar {
  width: 4px;
}
.studio-preview-pane::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: 2px;
}

.studio-showcase-card {
  width: 100%;
  max-width: 1200px;
  background: var(--bg-glass-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 4px 30px rgba(0,0,0,0.1);
  box-sizing: border-box;
  transition: background-color 0.4s ease, border-color 0.4s ease;
}

.studio-showcase-header {
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
  transition: border-color 0.4s ease;
}

.studio-showcase-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.studio-concept-badge {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-pill-active);
  color: var(--color-pill-active);
  border: 1px solid var(--border-pill-active);
}

.studio-concept-title {
  font-family: var(--sb-font, var(--font-title));
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.studio-btn-secondary {
  height: 36px;
  padding: 0 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: var(--transition-apple);
  outline: none;
}

.studio-btn-secondary:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text-primary);
  border-color: var(--border-active);
}

.studio-btn-secondary:active {
  transform: scale(0.96);
}

.studio-iframe-container {
  flex-grow: 1;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  background: rgba(0,0,0,0.05);
  padding: 24px 16px;
  box-sizing: border-box;
  min-height: 520px;
  position: relative;
}

.studio-iframe {
  border: none;
  background: transparent;
  height: 520px;
  transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s;
}

.studio-iframe.desktop-mode {
  width: 100%;
  box-shadow: none;
}

.studio-iframe.mobile-mode {
  width: 375px;
  max-width: 100%;
  background: var(--sb-bg, #08080c);
  border-radius: var(--sb-radius, 12px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0,0,0,0.1);
  height: 667px; /* iPhone 8 height style preview */
}

/* Responsive Styles for Brand Studio */
@media (max-width: 991px) {
  .studio-body-layout {
    flex-direction: column;
    height: auto;
    overflow: visible;
  }
  
  .studio-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
    height: auto;
    max-height: 300px;
  }
  
  .studio-preview-pane {
    height: auto;
    overflow: visible;
    padding: 16px;
  }
}

/* BRAND DIRECTORY MOBILE CALIBRATION (FULL DETAIL CARDS) */
@media (max-width: 768px) {
  .brand-cards-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-auto-rows: max-content !important;
    gap: 16px !important;
    padding: 16px 0 120px 0 !important; /* Ensure last card is fully scrollable past navigation */
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    height: 100% !important; /* Bind height to parent viewport to allow scrolling */
  }
  
  .brand-card-item {
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    gap: 16px !important;
    padding: 20px !important; /* Matches standard catalog spacing */
    height: auto !important; /* Height is auto to naturally show the entire card without clipping any elements */
    min-height: 240px !important; /* Set a premium minimum height to maintain a beautiful box ratio */
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important; /* Encapsulate strictly inside the card */
    background: var(--bg-glass-card) !important;
    border: 1px solid var(--border-subtle) !important;
    border-radius: var(--radius-lg) !important;
    flex-shrink: 0 !important;
  }

  .brand-card-header {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
  }

  .brand-card-logo-img {
    width: 44px !important;
    height: 44px !important;
    display: block !important;
  }

  .brand-card-logo-placeholder {
    width: 44px !important;
    height: 44px !important;
  }

  .brand-card-niche-badge {
    display: inline-block !important;
    font-size: 9px !important;
    padding: 4px 8px !important;
  }

  .brand-card-title {
    display: block !important;
    font-family: var(--font-title) !important;
    font-size: 18px !important;
    font-weight: 700 !important;
    color: var(--text-primary) !important;
    margin: 0 !important;
    letter-spacing: -0.01em !important;
  }

  .brand-card-desc {
    display: block !important;
    font-size: 12.5px !important;
    line-height: 1.5 !important;
    color: var(--text-secondary) !important;
    margin: 0 !important;
    flex-grow: 1 !important;
  }

  .brand-card-footer {
    display: flex !important;
    align-items: center !important;
    margin-top: auto !important; /* Pull to bottom inside the fixed height box */
    width: 100% !important;
  }

  .btn-brand-enter {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
    height: 44px !important;
    background: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid var(--border-subtle) !important;
    border-radius: var(--radius-md) !important;
    color: var(--text-primary) !important;
    font-family: var(--font-title) !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
  }
}

