@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Playfair+Display:ital,wght@0,500;0,600;0,700;1,500&display=swap');

:root {
  --primary-color: #5d5fef;
  --primary-hover: #4a4ce0;
  --primary-light: #eff0ff;
  --bg-app: #f4f5f8;
  --bg-card: #ffffff;
  --border-color: #e5e7eb;
  --border-subtle: #f0f1f4;
  --text-main: #111827;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-serif: 'Playfair Display', Georgia, serif;
  --radius-lg: 18px;
  --radius-md: 10px;
  --radius-sm: 6px;
  --radius-pill: 9999px;
  --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.02);
  --shadow-floating: 0 12px 36px rgba(93, 95, 239, 0.18);
  --shadow-dropdown: 0 16px 40px rgba(0, 0, 0, 0.12);
  --transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

input, textarea, [contenteditable="true"], .ad-phone-number {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

canvas, img {
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
  user-drag: none;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-main);
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ============================================================
   TOP AD / SPONSOR BANNER (HIGH-IMPACT MONETIZATION SLOT)
   ============================================================ */
:root {
  --ad-banner-height: 44px;
}

.top-ad-banner {
  height: var(--ad-banner-height);
  background: linear-gradient(90deg, #070913 0%, #17112c 25%, #241604 50%, #17112c 75%, #070913 100%);
  background-size: 200% 100%;
  animation: adGradientShift 14s ease infinite;
  border-bottom: 1.5px solid rgba(245, 158, 11, 0.45);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6), 0 0 15px rgba(245, 158, 11, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 105;
  flex-shrink: 0;
  width: 100%;
  padding: 0 16px;
  position: relative;
  overflow: hidden;
}

@keyframes adGradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.ad-shimmer-sweep {
  position: absolute;
  top: 0;
  left: -100%;
  width: 40%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 235, 140, 0.18), rgba(255, 255, 255, 0.35), rgba(255, 235, 140, 0.18), transparent);
  transform: skewX(-25deg);
  animation: adShimmerSweep 6s infinite cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

@keyframes adShimmerSweep {
  0% { left: -100%; }
  35% { left: 160%; }
  100% { left: 160%; }
}

.ad-banner-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  max-width: 1440px;
  position: relative;
  z-index: 2;
  height: 100%;
}

.ad-badge-group {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25) 0%, rgba(212, 175, 55, 0.12) 100%);
  border: 1px solid rgba(245, 158, 11, 0.65);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.25);
  flex-shrink: 0;
}

.ad-pulse-beacon {
  position: relative;
  width: 8px;
  height: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.beacon-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
}

.beacon-ping {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.6);
  animation: beaconPingAnim 1.8s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes beaconPingAnim {
  0% { transform: scale(1); opacity: 0.9; }
  100% { transform: scale(3.2); opacity: 0; }
}

.ad-badge-text {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: #fde047;
  text-transform: uppercase;
  text-shadow: 0 0 8px rgba(253, 224, 71, 0.4);
}

/* Continuous Infinite Marquee Ticker (Crystal-Clear Contrast & Smooth Motion) */
.ad-marquee-wrapper {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  mask-image: linear-gradient(90deg, transparent 0%, #000 24px, #000 calc(100% - 24px), transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 24px, #000 calc(100% - 24px), transparent 100%);
  cursor: default;
}

.ad-marquee-track {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  will-change: transform;
  animation: adMarqueeScroll 26s linear infinite;
}

.ad-marquee-wrapper:hover .ad-marquee-track {
  animation-play-state: paused;
}

@keyframes adMarqueeScroll {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-50%, 0, 0); }
}

.ad-marquee-item {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 12.5px;
  font-weight: 600;
  color: #ffffff !important;
  letter-spacing: 0.25px;
  padding-right: 36px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  user-select: none;
}

.ad-tag {
  background: rgba(245, 158, 11, 0.22);
  color: #fde047;
  font-size: 10px;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: 4px;
  border: 1px solid rgba(245, 158, 11, 0.45);
  letter-spacing: 0.5px;
}

.ad-text-main {
  color: #ffffff !important;
  font-weight: 700;
}

.ad-sep {
  color: rgba(245, 158, 11, 0.7);
  font-weight: 800;
}

.ad-hl {
  color: #fde047 !important;
  font-weight: 700;
  text-shadow: 0 0 10px rgba(253, 224, 71, 0.35);
}

.ad-text-sub {
  color: #e2e8f0 !important;
  font-weight: 500;
}

/* Call to Action Buttons */
.ad-banner-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.ad-btn-call {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 13px;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #050811;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  border: none;
  outline: none;
  transition: var(--transition);
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.4);
  letter-spacing: 0.3px;
  animation: ctaPulse 3s infinite ease-in-out;
}

@keyframes ctaPulse {
  0%, 100% { box-shadow: 0 2px 10px rgba(245, 158, 11, 0.4); }
  50% { box-shadow: 0 0 16px rgba(245, 158, 11, 0.85); transform: translateY(-1px); }
}

.ad-btn-call:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 4px 18px rgba(245, 158, 11, 0.8);
  filter: brightness(1.12);
}

.ad-btn-wa {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  outline: none;
  transition: var(--transition);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.35);
}

.ad-btn-wa:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.6);
  filter: brightness(1.1);
}

.ad-btn-copy {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #e2e8f0;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  transition: var(--transition);
}

.ad-btn-copy:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(253, 224, 71, 0.6);
  color: #ffffff;
}

.ad-call-short {
  display: none;
}

.ad-call-full {
  display: inline;
}

.desktop-only {
  display: inline-flex;
  align-items: center;
}

@media (max-width: 768px) {
  .desktop-only {
    display: none !important;
  }
  .top-ad-banner {
    height: 38px;
    min-height: 38px;
    padding: 0 8px;
  }
  .ad-banner-inner {
    gap: 8px;
  }
  .ad-badge-group {
    padding: 2px 7px;
  }
  .ad-badge-text {
    font-size: 8.5px;
    letter-spacing: 0.5px;
  }
  .ad-marquee-item {
    font-size: 11.5px;
    padding-right: 24px;
    gap: 7px;
  }
  .ad-banner-actions {
    gap: 5px;
  }
  .ad-btn-call, .ad-btn-wa {
    padding: 4px 8px;
    font-size: 10px;
  }
  .ad-call-full {
    display: none;
  }
  .ad-call-short {
    display: inline;
  }
  .ad-btn-copy {
    display: none !important;
  }
}

@media (max-width: 480px) {
  .top-ad-banner {
    padding: 0 6px;
    height: 36px;
    min-height: 36px;
  }
  .ad-badge-text {
    display: none;
  }
  .ad-badge-group {
    padding: 3px 5px;
    gap: 0;
  }
  .ad-marquee-item {
    font-size: 10.5px;
    padding-right: 18px;
    gap: 6px;
  }
  .ad-tag {
    font-size: 9px;
    padding: 1px 4px;
  }
  .ad-btn-call, .ad-btn-wa {
    padding: 3px 6px;
    font-size: 9.5px;
    gap: 3px;
  }
}

/* ============================================================
   TOP NAVBAR
   ============================================================ */
.navbar {
  height: 60px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 100;
  flex-shrink: 0;
}

.studio-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: default;
  user-select: none;
}

.brand-diamond-icon {
  color: #6366f1;
  filter: drop-shadow(0 2px 8px rgba(99, 102, 241, 0.4));
}

.brand-title {
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 1.2px;
  color: #0f172a;
}

.brand-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(99, 102, 241, 0.12);
  color: #4f46e5;
  letter-spacing: 0.5px;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 15px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-color);
  background: #ffffff;
  color: #1e293b;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.header-action-btn:hover {
  border-color: #6366f1;
  color: #6366f1;
  background: #f8fafc;
  transform: translateY(-1px);
}

.header-action-btn.active {
  background: #eff6ff;
  border-color: #3b82f6;
  color: #2563eb;
}

.header-action-btn.btn-highlight {
  background: #0f172a;
  border-color: #0f172a;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.18);
}

.header-action-btn.btn-highlight:hover {
  background: #1e293b;
  transform: translateY(-1px);
}

.header-action-btn.btn-quadview {
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
  border-color: #4338ca;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.25);
}

.header-action-btn.btn-quadview:hover {
  background: linear-gradient(135deg, #312e81 0%, #4338ca 100%);
  border-color: #6366f1;
  color: #ffffff;
  transform: translateY(-1px);
}

.btn-action-quad {
  background: linear-gradient(135deg, #1e1b4b 0%, #3730a3 100%);
  color: #ffffff;
  border: 1px solid #4f46e5;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(67, 56, 202, 0.2);
}

.btn-action-quad:hover {
  background: linear-gradient(135deg, #312e81 0%, #4338ca 100%);
  color: #ffffff;
  border-color: #6366f1;
}

.swatches-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  margin: 12px 0 6px 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.header-icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: #ffffff;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.header-icon-btn:hover {
  border-color: #0f172a;
  color: #0f172a;
  background: #f8fafc;
}

/* ============================================================
   MAIN LAYOUT WORKSPACE
   ============================================================ */
.workspace {
  flex: 1;
  display: flex;
  height: calc(100vh - 60px - var(--ad-banner-height, 42px));
  position: relative;
  overflow: hidden;
  min-height: 0;
}

/* Left Dock */
.dock-left {
  width: 56px;
  background: var(--bg-card);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 0;
  gap: 6px;
  z-index: 40;
  flex-shrink: 0;
}

.dock-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  transition: var(--transition);
}

.dock-icon-btn:hover {
  background: #f3f4f6;
  color: var(--text-main);
}

.dock-icon-btn.active {
  background: var(--primary-light);
  color: var(--primary-color);
}

.dock-icon-btn svg {
  width: 20px;
  height: 20px;
}

.dock-spacer {
  flex: 1;
}

/* Environment Shelf / Drawer */
.env-drawer {
  width: 280px;
  background: var(--bg-card);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  z-index: 30;
  transition: var(--transition);
  flex-shrink: 0;
}

.env-drawer.collapsed {
  width: 0;
  overflow: hidden;
  border-right: none;
}

.drawer-header {
  padding: 16px 16px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
}

.drawer-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.drawer-actions {
  display: flex;
  gap: 8px;
}

.icon-btn-sm {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: #ffffff;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.icon-btn-sm:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.env-grid {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.env-sphere-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: var(--transition);
  background: #f3f4f6;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.env-sphere-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.env-sphere-item:hover {
  transform: scale(1.08);
  border-color: var(--primary-color);
}

.env-sphere-item.active {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(93, 95, 239, 0.3);
}

.lock-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 16px;
  height: 16px;
  background: rgba(0, 0, 0, 0.65);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 9px;
}

/* ============================================================
   CENTER 3D VIEWPORT
   ============================================================ */
.viewport-center {
  flex: 1;
  position: relative;
  background: #f8f9fc;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  overflow: hidden;
}

.canvas-card {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-lg);
  background: #ffffff;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

#canvas-container {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
}

#canvas-container canvas {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* Canvas Watermark in bottom left */
.canvas-watermark {
  position: absolute;
  bottom: 22px;
  left: 24px;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 20;
  pointer-events: none;
  user-select: none;
  mix-blend-mode: difference;
  transition: opacity 0.2s ease;
}

.watermark-brand {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.5px;
}

.watermark-pill {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 700;
  color: #ffffff;
  padding: 1px 6px;
  border: 1px solid #ffffff;
  border-radius: 4px;
  line-height: 1.2;
}

/* Fullscreen Button in top right of card */
.canvas-fullscreen-btn {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(229, 231, 235, 0.8);
  color: #4b5563;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 25;
  transition: var(--transition);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.canvas-fullscreen-btn:hover {
  background: #ffffff;
  color: var(--primary-color);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Floating Vertical Toolbar on the right side of the canvas card */
.floating-vertical-toolbar {
  position: absolute;
  top: 50%;
  right: 18px;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(229, 231, 235, 0.9);
  border-radius: 20px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  z-index: 25;
}

.tool-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: #4b5563;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.tool-btn:hover {
  background: #f3f4f6;
  color: var(--primary-color);
}

.tool-btn.active {
  background: var(--primary-light);
  color: var(--primary-color);
}

/* ============================================================
   WELCOME SCREEN OVERLAY
   ============================================================ */
.welcome-overlay {
  position: absolute;
  inset: 0;
  background: #ffffff;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.welcome-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  display: none !important;
}

.welcome-close-btn {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #f3f4f6;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: var(--transition);
}

.welcome-close-btn:hover {
  background: #e5e7eb;
  color: var(--text-main);
  transform: rotate(90deg);
}

.welcome-visual {
  position: relative;
  width: 220px;
  height: 180px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.floating-gems-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  animation: floatAnim 4s ease-in-out infinite;
}

@keyframes floatAnim {
  0%,
  100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-8px) rotate(1deg);
  }
}

.welcome-title {
  font-family: var(--font-serif);
  font-size: 40px;
  font-weight: 600;
  color: #111827;
  letter-spacing: -0.5px;
  margin-bottom: 24px;
  text-align: center;
}

.welcome-title span {
  font-family: var(--font-sans);
  color: var(--primary-color);
  font-style: normal;
}

.dropzone-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 32px;
  border-radius: var(--radius-pill);
  background: #ffffff;
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-main);
  cursor: pointer;
  margin-bottom: 30px;
  transition: var(--transition);
}

.dropzone-btn:hover {
  border-color: var(--primary-color);
  box-shadow: 0 6px 20px rgba(93, 95, 239, 0.12);
}

.samples-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.samples-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.samples-row {
  display: flex;
  gap: 14px;
}

.sample-card-btn {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  border: 2px solid var(--border-color);
  background: #ffffff;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.sample-card-btn:hover {
  border-color: var(--primary-color);
  color: #ffffff;
  background: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(93, 95, 239, 0.25);
}

.sample-card-btn svg {
  width: 26px;
  height: 26px;
}

.watermark-logo {
  position: absolute;
  bottom: 24px;
  left: 24px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  color: #111827;
}

.watermark-badge {
  font-family: var(--font-sans);
  font-size: 11px;
  padding: 2px 5px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
}

/* ============================================================
   RIGHT INSPECTOR / TWEAKPANE SIDEBAR
   ============================================================ */
.inspector-right {
  width: 320px;
  background: var(--bg-card);
  border-left: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  z-index: 30;
  flex-shrink: 0;
  overflow: hidden;
}

.inspector-header {
  height: 48px;
  padding: 0 16px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.inspector-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.inspector-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 8px 12px 30px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Inspector Section Cards */
.inspector-section-card {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: #ffffff;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.section-card-title {
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Component Target Picker Card */
.target-picker-card {
  background: #f8fafc;
  border-color: #e2e8f0;
}

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

.target-card-title {
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
}

.target-lock-badge {
  font-size: 10px;
  font-weight: 600;
  color: #6366f1;
  background: rgba(99, 102, 241, 0.1);
  padding: 2px 7px;
  border-radius: 4px;
}

.active-target-banner {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.active-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
  animation: pulseDot 2s infinite ease-in-out;
  flex-shrink: 0;
}

@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.7; }
}

.active-target-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.active-target-label {
  font-size: 10px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.active-target-name {
  font-size: 12px;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-deselect-target {
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  background: #f1f5f9;
  color: #475569;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-deselect-target:hover {
  background: #e2e8f0;
  color: #0f172a;
}

/* Component Chips */
.component-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.comp-chip {
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #334155;
  cursor: pointer;
  transition: var(--transition);
}

.comp-chip:hover {
  border-color: #6366f1;
  color: #4f46e5;
  background: #f8fafc;
}

.comp-chip.active {
  background: #4f46e5;
  border-color: #4f46e5;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.25);
}

.picker-tip-box {
  font-size: 11px;
  line-height: 1.4;
  color: #64748b;
  background: #f1f5f9;
  padding: 7px 10px;
  border-radius: 6px;
}

/* Surface Finish Toggle */
.finish-ctrl-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Model Switcher */
.model-switcher-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.model-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #1e293b;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.model-btn:hover {
  border-color: #6366f1;
  background: #f8fafc;
}

.model-btn.active {
  border-color: #4f46e5;
  background: #eff6ff;
  color: #312e81;
}

.model-btn-icon {
  font-size: 14px;
}

/* Functional Env Grid on Left */
.env-section-title {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin: 12px 0 8px;
}

.env-grid-functional,
.gem-env-grid-functional {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.env-card-item,
.gem-card-item {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #ffffff;
  padding: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: var(--transition);
}

.env-card-item:hover,
.gem-card-item:hover {
  border-color: #6366f1;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.env-card-item.active,
.gem-card-item.active {
  border-color: #4f46e5;
  background: #f5f3ff;
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.3);
}

.env-card-sphere {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: inset 0 2px 6px rgba(255, 255, 255, 0.8), 0 3px 8px rgba(0, 0, 0, 0.1);
}

.env-card-name {
  font-size: 10px;
  font-weight: 600;
  color: #1e293b;
  text-align: center;
  line-height: 1.2;
}

.studio-lighting-controls {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px;
}

/* Accordion Foldouts */
.foldout {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: #ffffff;
  overflow: hidden;
  transition: var(--transition);
}

.foldout-header {
  padding: 9px 12px;
  background: #fbfbfc;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  transition: var(--transition);
}

.foldout-header:hover {
  background: #f4f5f8;
}

.foldout-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
}

.foldout-indicator {
  color: var(--text-muted);
  font-family: monospace;
  font-size: 13px;
}

.foldout-right {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 11px;
}

.foldout-content {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-top: 1px solid var(--border-subtle);
}

.foldout.collapsed .foldout-content {
  display: none !important;
}

/* Configurator Sub-Tabs (:r1p:-tab-*) */
.config-tabs-nav {
  display: flex;
  background: #f1f2f6;
  border-radius: 8px;
  padding: 3px;
  gap: 3px;
  margin-bottom: 4px;
}

.config-tab-btn {
  flex: 1;
  padding: 6px 2px;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  color: #6b7280;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
}

.config-tab-btn:hover {
  color: #111827;
}

.config-tab-btn.active {
  background: #ffffff;
  color: #111827;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.config-subpanel {
  display: none;
}

.config-subpanel.active {
  display: block;
}

/* Control Rows */
.ctrl-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ctrl-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
}

.ctrl-input-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  justify-content: flex-end;
}

.slider-range {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: #e5e7eb;
  outline: none;
  -webkit-appearance: none;
}

.slider-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--primary-color);
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.slider-num {
  width: 44px;
  font-size: 11px;
  padding: 3px 5px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  text-align: right;
  color: var(--text-main);
  background: #f9fafb;
}

.select-dropdown {
  width: 100%;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  font-size: 12px;
  color: var(--text-main);
  background: #ffffff;
  outline: none;
  cursor: pointer;
}

.btn-action-full {
  width: 100%;
  padding: 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: #f3f4f6;
  color: var(--text-main);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.btn-action-full:hover {
  background: var(--primary-color);
  color: #ffffff;
  border-color: var(--primary-color);
}

/* Material Preset Swatches */
.swatches-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-top: 6px;
}

.swatch-btn {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  cursor: pointer;
  position: relative;
  transition: var(--transition);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.swatch-btn:hover {
  transform: scale(1.08);
}

.swatch-btn.active {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(93, 95, 239, 0.4);
}

/* Extreme Right Tab Dock */
.dock-right {
  width: 48px;
  background: var(--bg-card);
  border-left: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 0;
  gap: 8px;
  z-index: 40;
  flex-shrink: 0;
}

.tab-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.tab-icon-btn:hover {
  background: #f3f4f6;
  color: var(--text-main);
}

.tab-icon-btn.active {
  background: var(--primary-light);
  color: var(--primary-color);
}

.tab-icon-btn.badge-v {
  background: #3b82f6;
  color: #ffffff;
}

.tab-icon-btn.badge-m {
  background: #f59e0b;
  color: #ffffff;
}

.tab-icon-btn.badge-e {
  background: #a855f7;
  color: #ffffff;
}

.inspector-right.collapsed {
  width: 0 !important;
  overflow: hidden;
  border-left: none;
}

/* ============================================================
   MODALS
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  width: 440px;
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-dropdown);
  position: relative;
  transform: scale(0.95);
  transition: var(--transition);
}

.modal-overlay.active .modal-card {
  transform: scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.share-input-box {
  display: flex;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.share-input-box input {
  flex: 1;
  padding: 10px 14px;
  border: none;
  font-size: 13px;
  outline: none;
}

.share-input-box button {
  padding: 0 16px;
  background: var(--primary-color);
  color: #ffffff;
  border: none;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

/* Loading Spinner */
.loading-badge {
  position: absolute;
  top: 20px;
  left: 20px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  z-index: 30;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.loading-badge.active {
  opacity: 1;
}

.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid #5d5fef;
  border-bottom-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ============================================================
   TRIPO AI-STYLE CENTERED 3D VIEWPORT LOADER
   ============================================================ */
.tripo-loader-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 120;
  background: rgba(8, 11, 22, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
  border-radius: inherit;
}

.tripo-loader-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.tripo-loader-card {
  background: linear-gradient(135deg, rgba(20, 24, 42, 0.94) 0%, rgba(12, 15, 28, 0.97) 100%);
  border: 1px solid rgba(212, 175, 55, 0.24);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(99, 102, 241, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  padding: 28px 32px;
  text-align: center;
  width: 90%;
  max-width: 380px;
  transform: scale(0.94);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.tripo-loader-overlay.active .tripo-loader-card {
  transform: scale(1);
}

.tripo-icon-wrapper {
  width: 60px;
  height: 60px;
  margin: 0 auto 14px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tripo-icon-pulse-ring,
.tripo-icon-pulse-ring-outer {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1.5px solid rgba(212, 175, 55, 0.4);
  animation: tripoRingPulse 2.4s cubic-bezier(0.2, 0.8, 0.2, 1) infinite;
  pointer-events: none;
}

.tripo-icon-pulse-ring-outer {
  inset: -14px;
  border-color: rgba(99, 102, 241, 0.3);
  animation-delay: 0.6s;
}

.tripo-diamond-svg {
  width: 42px;
  height: 42px;
  filter: drop-shadow(0 0 12px rgba(212, 175, 55, 0.45));
  animation: tripoDiamondFloat 3s ease-in-out infinite alternate;
}

.tripo-loader-title {
  font-size: 16px;
  font-weight: 700;
  color: #f8fafc;
  letter-spacing: 0.4px;
  margin: 0 0 6px;
  font-family: inherit;
}

.tripo-loader-stage {
  font-size: 13px;
  color: #94a3b8;
  margin: 0 0 16px;
  line-height: 1.4;
  min-height: 18px;
}

.tripo-progress-wrapper {
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
  margin-bottom: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.tripo-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #d4af37 0%, #6366f1 50%, #38bdf8 100%);
  border-radius: 999px;
  transition: width 0.25s cubic-bezier(0.1, 0.7, 0.1, 1);
  position: relative;
}

.tripo-progress-glow {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 24px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0) 100%);
  filter: blur(2px);
}

.tripo-progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  margin-bottom: 16px;
}

.tripo-meta-pct {
  font-weight: 700;
  color: #f5d061;
  font-feature-settings: 'tnum';
}

.tripo-meta-sub {
  color: #64748b;
  font-size: 11px;
}

.tripo-loader-brand {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  color: #94a3b8;
  letter-spacing: 0.8px;
}

.tripo-brand-dot {
  width: 6px;
  height: 6px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 6px #10b981;
}

@keyframes tripoRingPulse {
  0% {
    transform: scale(0.9);
    opacity: 0.8;
  }
  100% {
    transform: scale(1.4);
    opacity: 0;
  }
}

@keyframes tripoDiamondFloat {
  0% {
    transform: translateY(0px) rotate(0deg);
  }
  100% {
    transform: translateY(-4px) rotate(3deg);
  }
}

/* ============================================================
   ADVANCED JEWELRY STUDIO & DRAWER STYLES
   ============================================================ */
.drawer-panel {
  display: none;
  flex-direction: column;
  height: 100%;
  width: 100%;
  min-height: 0;
  flex: 1 1 0;
  overflow: hidden;
}

.drawer-panel.active {
  display: flex;
}

.panel-content-scroll {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
}

.beta-tag {
  font-size: 8px;
  font-weight: 700;
  padding: 1px 3px;
  border-radius: 3px;
  background: #6366f1;
  color: #ffffff;
  margin-top: 1px;
}

.pro-tag {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: linear-gradient(135deg, #a855f7 0%, #6366f1 100%);
  color: #ffffff;
  margin-left: 6px;
}

.dock-icon-btn.badge-gem-env {
  color: #3b82f6;
}

.dock-icon-btn.badge-gem-env.active {
  background: rgba(59, 130, 246, 0.12);
  color: #2563eb;
}

/* Gem Env Grid matching Image 1 */
.gem-env-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 16px;
  overflow-y: auto;
  flex: 1;
}

.gem-sphere-item {
  aspect-ratio: 1;
  border-radius: 50%;
  position: relative;
  cursor: pointer;
  border: 2px solid transparent;
  transition: var(--transition);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  background: #ffffff;
}

.gem-sphere-item canvas,
.gem-sphere-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.gem-sphere-item:hover {
  transform: scale(1.08);
}

.gem-sphere-item.active {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
}

.gem-lock-badge {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #ffffff;
  font-size: 13px;
}

.gem-lock-badge::after {
  content: '💎';
  position: absolute;
  bottom: 2px;
  right: 2px;
  font-size: 8px;
}

/* Poses Grid */
.poses-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.pose-card-btn {
  display: flex;
  flex-direction: column;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: #ffffff;
  text-align: left;
  cursor: pointer;
  transition: var(--transition);
}

.pose-card-btn:hover {
  border-color: var(--primary-color);
  background: #f8fafc;
}

.pose-card-btn.active {
  border-color: var(--primary-color);
  background: rgba(93, 95, 239, 0.08);
}

.pose-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
}

.pose-desc {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Button Group Toggles */
.btn-group-toggle {
  display: flex;
  background: #f1f2f6;
  border-radius: 8px;
  padding: 3px;
  gap: 3px;
}

.btn-toggle {
  flex: 1;
  padding: 6px 4px;
  font-size: 11px;
  font-weight: 600;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}

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

.btn-toggle.active {
  background: #ffffff;
  color: var(--text-main);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.btn-action-primary {
  width: 100%;
  padding: 9px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--primary-color);
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-action-primary:hover {
  background: var(--primary-hover);
}

/* CAD Dropzone */
.cad-dropzone {
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: #f8fafc;
  cursor: pointer;
  transition: var(--transition);
}

.cad-dropzone:hover {
  border-color: var(--primary-color);
  background: #f0f4ff;
}

.detection-badge {
  margin-top: 10px;
  padding: 8px 12px;
  background: #ecfdf5;
  border: 1px solid #10b981;
  border-radius: var(--radius-sm);
  color: #065f46;
  font-size: 11px;
  font-weight: 600;
}

.detection-badge.hidden {
  display: none;
}

/* Selected Part Box */
.selected-part-box {
  padding: 10px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 6px;
}

.part-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
}

.part-type {
  font-size: 11px;
  color: var(--text-secondary);
}

.input-text-full {
  width: 100%;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  font-size: 12px;
  outline: none;
}

.textarea-code {
  width: 100%;
  height: 80px;
  padding: 8px;
  font-family: monospace;
  font-size: 11px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  resize: none;
  outline: none;
  background: #f9fafb;
}

/* -------------------------------------------------------------
 * Pose Badges & Duo Sections
 * ------------------------------------------------------------- */
.poses-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.pose-header-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.pose-badge-duo {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 4px;
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  color: #ffffff;
  letter-spacing: 0.4px;
}

/* -------------------------------------------------------------
 * Studio Backdrops Grid
 * ------------------------------------------------------------- */
.backdrop-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 8px;
}

.backdrop-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: #ffffff;
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
}

.backdrop-card:hover {
  border-color: var(--primary-color);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
}

.backdrop-card.active {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(93, 95, 239, 0.25);
}

.backdrop-thumb {
  width: 100%;
  height: 52px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.backdrop-info {
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.backdrop-name {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.backdrop-sub {
  font-size: 10px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* -------------------------------------------------------------
 * Artisanal Surface Texture Selector
 * ------------------------------------------------------------- */
.texture-selector-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  margin-top: 8px;
}

.texture-card-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: #ffffff;
  text-align: left;
  cursor: pointer;
  transition: var(--transition);
}

.texture-card-btn:hover {
  border-color: var(--primary-color);
  background: #f8fafc;
}

.texture-card-btn.active {
  border-color: var(--primary-color);
  background: rgba(93, 95, 239, 0.08);
  box-shadow: 0 0 0 1px var(--primary-color);
}

.texture-icon-box {
  font-size: 18px;
  line-height: 1;
}

.texture-card-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.tex-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tex-sub {
  font-size: 10px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* -------------------------------------------------------------
 * Texture Color Panel (RGB & Live Customizer)
 * ------------------------------------------------------------- */
.texture-color-panel-box {
  padding: 12px;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

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

.color-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.color-picker-disc {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: 38px;
  height: 38px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transition: var(--transition);
}

.color-picker-disc::-webkit-color-swatch-wrapper {
  padding: 0;
}

.color-picker-disc::-webkit-color-swatch {
  border: none;
  border-radius: 50%;
}

.hex-badge-box {
  flex: 1;
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  gap: 4px;
}

.hex-hash {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
}

.hex-input-field {
  border: none;
  outline: none;
  font-family: monospace;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  width: 100%;
  background: transparent;
  text-transform: uppercase;
}

.rgb-slider-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rgb-slider-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rgb-label {
  font-size: 11px;
  font-weight: 800;
  width: 14px;
}

.rgb-label.rgb-r {
  color: #ef4444;
}

.rgb-label.rgb-g {
  color: #10b981;
}

.rgb-label.rgb-b {
  color: #3b82f6;
}

.slider-r {
  accent-color: #ef4444;
}

.slider-g {
  accent-color: #10b981;
}

.slider-b {
  accent-color: #3b82f6;
}

.rgb-val {
  font-size: 11px;
  font-family: monospace;
  font-weight: 600;
  color: var(--text-main);
  width: 26px;
  text-align: right;
}

/* ============================================================
   DEVELOPER CREDITS & OFFICIAL LICENSE STYLES (Made by Tabrej)
   ============================================================ */
.header-creator-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 8px;
  padding: 3px 10px;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.15), rgba(212, 175, 55, 0.05));
  border: 1px solid rgba(212, 175, 55, 0.40);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: #d4af37;
  cursor: pointer;
  transition: all 0.25s ease;
  user-select: none;
}

.header-creator-pill:hover {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.28), rgba(212, 175, 55, 0.12));
  border-color: #d4af37;
  box-shadow: 0 0 14px rgba(212, 175, 55, 0.35);
  transform: translateY(-1px);
}

.creator-by {
  font-size: 10px;
  color: var(--text-muted, #8e8e93);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.creator-name {
  color: #d4af37;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.btn-credits {
  background: rgba(212, 175, 55, 0.10) !important;
  border: 1px solid rgba(212, 175, 55, 0.35) !important;
  color: #d4af37 !important;
}

.btn-credits:hover {
  background: rgba(212, 175, 55, 0.22) !important;
  border-color: #d4af37 !important;
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.30) !important;
}

/* Inspector Credits Section Card */
.credits-section-card {
  background: linear-gradient(145deg, rgba(212, 175, 55, 0.08), rgba(20, 20, 25, 0.60)) !important;
  border: 1px solid rgba(212, 175, 55, 0.30) !important;
  padding: 14px 16px !important;
  margin-top: 14px;
}

.credits-card-inner {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

.credits-app-name {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: #ffffff;
}

.credits-pill-official {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 7px;
  background: #d4af37;
  color: #0b0b0d;
  border-radius: 4px;
  letter-spacing: 0.6px;
}

.credits-creator-row {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 2px;
}

.credits-creator-text {
  font-size: 12.5px;
  color: #f1f5f9;
}

.credits-creator-text strong {
  color: #d4af37;
  font-size: 13.5px;
  letter-spacing: 0.4px;
}

.credits-license-notice {
  margin: 0;
  font-size: 11px;
  line-height: 1.45;
  color: #94a3b8;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 7px;
}

/* Credits Modal Overlay & Dialog */
.credits-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity 0.25s ease;
}

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

.credits-modal-window {
  width: 90%;
  max-width: 480px;
  background: #111116;
  border: 1px solid rgba(212, 175, 55, 0.45);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7), 0 0 40px rgba(212, 175, 55, 0.2);
  overflow: hidden;
  animation: modalScaleUp 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalScaleUp {
  from {
    transform: scale(0.92) translateY(12px);
    opacity: 0;
  }
  to {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

.credits-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.credits-modal-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.credits-modal-title {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: #ffffff;
}

.credits-modal-close {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.2s;
}

.credits-modal-close:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.credits-modal-content {
  padding: 24px 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.credits-badge-glow {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.2px;
  color: #d4af37;
  padding: 4px 12px;
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 999px;
  margin-bottom: 12px;
}

.credits-headline {
  margin: 0 0 6px;
  font-size: 26px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.4px;
}

.credits-headline::after {
  content: '';
  display: block;
  width: 50px;
  height: 3px;
  background: linear-gradient(90deg, #d4af37, transparent);
  margin: 8px auto 0;
  border-radius: 2px;
}

.credits-subline {
  margin: 8px 0 18px;
  font-size: 12.5px;
  color: #94a3b8;
  line-height: 1.5;
  max-width: 380px;
}

.credits-license-box {
  width: 100%;
  background: rgba(212, 175, 55, 0.08);
  border: 1px solid rgba(212, 175, 55, 0.30);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 16px;
  text-align: left;
}

.license-box-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: #d4af37;
  letter-spacing: 0.6px;
  margin-bottom: 4px;
}

.license-box-desc {
  margin: 0;
  font-size: 12.5px;
  font-weight: 600;
  color: #f8fafc;
  line-height: 1.4;
}

.credits-features-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 18px;
  text-align: left;
}

.credits-feature-item {
  font-size: 11.5px;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.03);
  padding: 7px 12px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.credits-footer-text {
  font-size: 10.5px;
  color: #64748b;
  letter-spacing: 0.3px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 12px;
  width: 100%;
}

/* ============================================================
   FLOATING TRANSFORM & ROTATE GIMBAL TOOLBAR
   ============================================================ */
.canvas-transform-toolbar {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  box-shadow: 0 12px 28px -6px rgba(0, 0, 0, 0.65), 0 0 1px 1px rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  padding: 4px 6px;
  gap: 4px;
  z-index: 40;
  user-select: none;
}

.transform-tool-group,
.transform-scope-group,
.transform-history-group {
  display: flex;
  align-items: center;
  gap: 3px;
}

.toolbar-divider {
  width: 1px;
  height: 20px;
  background: rgba(255, 255, 255, 0.12);
  margin: 0 4px;
}

.t-btn, .t-scope-btn, .t-hist-btn {
  background: transparent;
  border: 1px solid transparent;
  color: #94a3b8;
  border-radius: 8px;
  padding: 5px 9px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
}

.t-btn:hover, .t-scope-btn:hover, .t-hist-btn:hover:not(:disabled) {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.08);
}

.t-btn.active {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.22) 0%, rgba(99, 102, 241, 0.22) 100%);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.25);
}

.t-scope-btn {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 6px;
}

.t-scope-btn.active {
  background: rgba(255, 255, 255, 0.12);
  color: #f1f5f9;
  border-color: rgba(255, 255, 255, 0.25);
}

.t-hist-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* ============================================================
   INTERACTIVE SELECTION BADGE / VIEWPORT HUD
   ============================================================ */
.viewport-selection-badge {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(56, 189, 248, 0.45);
  border-radius: 24px;
  padding: 6px 14px;
  display: flex;
  align-items: center;
  gap: 9px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55), 0 0 15px rgba(56, 189, 248, 0.2);
  z-index: 38;
  animation: fadeInBadge 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInBadge {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.selection-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #38bdf8;
  box-shadow: 0 0 8px #38bdf8;
  animation: pulseDot 1.8s infinite ease-in-out;
}

@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.7; }
}

.selection-name {
  font-size: 12px;
  font-weight: 600;
  color: #f8fafc;
  letter-spacing: 0.2px;
}

.selection-close-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 12px;
  cursor: pointer;
  padding: 2px 5px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.selection-close-btn:hover {
  color: #f87171;
  background: rgba(248, 113, 113, 0.15);
}

.btn-action-cinematic:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

/* ============================================================
   MOBILE RESPONSIVE STUDIO ENGINE (NO DESKTOP MODE NEEDED)
   ============================================================ */

/* Mobile Drag Handle Bars, Close Buttons & Drawer Tabs - STRICTLY HIDDEN ON DESKTOP */
.mobile-drawer-handle-bar {
  display: none !important;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px 6px;
  background: #ffffff;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
  position: relative;
}

.mobile-drawer-tabs {
  display: none !important;
}

.mobile-drag-pill {
  width: 42px;
  height: 5px;
  border-radius: 9999px;
  background: #cbd5e1;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.mobile-drawer-close-btn {
  margin-left: auto;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: #f1f5f9;
  color: #475569;
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.mobile-drawer-close-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

/* Mobile Screen Backdrop Overlay */
.mobile-sheet-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(10, 15, 28, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 110;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.mobile-sheet-backdrop.active {
  display: block;
  opacity: 1;
  pointer-events: auto;
}

/* Mobile Bottom Navigation Bar & Exclusive Controls - STRICTLY HIDDEN ON DESKTOP ONLY */
@media (min-width: 861px) {
  .mobile-bottom-nav,
  .mobile-more-trigger,
  .mobile-more-popover,
  .mobile-quick-island,
  .studio-shutter-flash {
    display: none !important;
  }
}

/* Responsive Media Query: Mobile & Small Tablets */
@media (max-width: 860px) {
  :root {
    --ad-banner-height: 40px;
  }

  html, body {
    height: 100%;
    height: 100dvh;
    overflow: hidden;
  }

  body {
    display: flex;
    flex-direction: column;
  }

  /* 1. Navbar Mobile Adaptation - Bespoke Luxury Atelier Layout */
  .navbar {
    height: 50px;
    padding: 0 10px;
    gap: 6px;
    flex-shrink: 0;
  }

  .studio-brand {
    gap: 6px;
  }

  .brand-diamond-icon {
    width: 18px;
    height: 18px;
  }

  .brand-title {
    font-size: 13px;
    letter-spacing: 0.8px;
  }

  .brand-badge {
    font-size: 9px;
    padding: 1px 5px;
  }

  .header-creator-pill {
    display: none;
  }

  .nav-actions {
    gap: 6px;
    align-items: center;
  }

  /* Cluttered desktop header actions hidden on mobile - collapsed into luxury '•••' menu */
  #header-btn-turntable,
  #header-btn-reset-view,
  #header-btn-open-link,
  .header-action-btn.btn-quadview,
  .header-action-btn.btn-credits {
    display: none !important;
  }

  .header-action-btn {
    padding: 6px 10px;
    font-size: 11px;
    gap: 4px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }

  .header-action-btn.btn-highlight {
    padding: 6px 12px;
    font-size: 11px;
  }

  .header-icon-btn {
    width: 32px;
    height: 32px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }

  /* Luxury Mobile Studio '•••' More Menu Trigger */
  .mobile-more-trigger {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(245, 158, 11, 0.3) !important;
    color: #fbbf24 !important;
    cursor: pointer;
    transition: all 0.15s ease;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-more-trigger:active {
    background: rgba(245, 158, 11, 0.25) !important;
    transform: scale(0.92);
  }

  /* Luxury Mobile More Popover */
  .mobile-more-popover {
    display: flex !important;
    position: fixed;
    top: 54px;
    right: 10px;
    background: rgba(13, 19, 34, 0.96) !important;
    backdrop-filter: blur(22px) !important;
    -webkit-backdrop-filter: blur(22px) !important;
    border: 1px solid rgba(245, 158, 11, 0.35) !important;
    border-radius: 14px;
    padding: 6px;
    flex-direction: column;
    gap: 3px;
    min-width: 216px;
    box-shadow: 0 16px 44px rgba(0, 0, 0, 0.78), 0 0 25px rgba(245, 158, 11, 0.12) !important;
    z-index: 250 !important;
    animation: popoverFadeIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  }

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

  .popover-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: #f1f5f9;
    font-size: 12.5px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    -webkit-tap-highlight-color: transparent;
  }

  .popover-item:active {
    background: rgba(245, 158, 11, 0.18);
    color: #fbbf24;
  }

  .popover-item svg {
    stroke: #fbbf24;
    flex-shrink: 0;
  }

  /* 2. Workspace & Full-Bleed 3D Viewport */
  .workspace {
    flex: 1 1 0;
    min-height: 0;
    height: auto;
    width: 100vw;
    position: relative;
    display: block;
    overflow: hidden;
    margin: 0;
    padding: 0;
  }

  /* Hide Static Desktop Docks */
  .dock-left,
  .dock-right {
    display: none !important;
  }

  /* Viewport takes 100% full screen on mobile */
  .viewport-center {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    padding: 0;
    margin: 0;
    z-index: 10;
  }

  .canvas-card {
    width: 100%;
    height: 100%;
    border-radius: 0;
    box-shadow: none;
    border: none;
  }

  #canvas-container {
    width: 100%;
    height: 100%;
  }

  /* Floating Gizmo / Transform Toolbar - Compact Mobile Pill */
  .canvas-transform-toolbar {
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    padding: 3px 5px;
    gap: 3px;
    max-width: 94vw;
    border-radius: 20px;
    background: rgba(13, 19, 34, 0.94);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(245, 158, 11, 0.25);
    z-index: 30;
  }

  .canvas-transform-toolbar .t-btn span,
  .canvas-transform-toolbar .t-scope-btn span,
  .canvas-transform-toolbar .t-hist-btn span {
    display: none;
  }

  .canvas-transform-toolbar .t-btn,
  .canvas-transform-toolbar .t-hist-btn {
    padding: 4px;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .canvas-transform-toolbar .t-scope-btn {
    padding: 4px 7px;
    font-size: 10px;
  }

  .canvas-transform-toolbar .toolbar-divider {
    height: 16px;
    margin: 0 2px;
  }

  /* Vertical Floating Camera Controls on Right - Dark Frosted Glass */
  .floating-vertical-toolbar {
    top: 50% !important;
    right: 8px !important;
    transform: translateY(-50%) !important;
    padding: 5px !important;
    gap: 6px !important;
    border-radius: 20px !important;
    background: rgba(10, 15, 28, 0.88) !important;
    backdrop-filter: blur(14px) !important;
    -webkit-backdrop-filter: blur(14px) !important;
    border: 1px solid rgba(245, 158, 11, 0.25) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5) !important;
    z-index: 25 !important;
  }

  .floating-vertical-toolbar .tool-btn {
    width: 32px !important;
    height: 32px !important;
    padding: 5px !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.08) !important;
    color: #f1f5f9 !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
  }

  .floating-vertical-toolbar .tool-btn:active {
    background: rgba(245, 158, 11, 0.25) !important;
    color: #fbbf24 !important;
    border-color: #fbbf24 !important;
  }

  .floating-vertical-toolbar .tool-btn svg {
    width: 15px !important;
    height: 15px !important;
    stroke: currentColor;
  }

  .canvas-fullscreen-btn {
    top: 8px;
    right: 8px;
    bottom: auto;
    width: 30px;
    height: 30px;
  }

  .canvas-watermark {
    bottom: 68px !important;
    left: 10px !important;
    transform: scale(0.8);
    transform-origin: bottom left;
    z-index: 20;
  }

  .viewport-selection-badge {
    bottom: 70px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    padding: 4px 10px;
    font-size: 11px;
    z-index: 25;
  }

  /* Studio Shutter Flash FX */
  .studio-shutter-flash {
    display: block !important;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ffffff;
    opacity: 0;
    pointer-events: none;
    z-index: 1000;
  }

  .studio-shutter-flash.flash-active {
    animation: shutterFlash 0.38s ease-out forwards;
  }

  /* Exclusive Mobile Quick-Customize Floating Island */
  .mobile-quick-island {
    display: block !important;
    position: absolute;
    bottom: calc(68px + env(safe-area-inset-bottom, 0px));
    left: 50%;
    transform: translateX(-50%);
    width: calc(100vw - 20px);
    max-width: 440px;
    z-index: 100;
    animation: islandSlideUp 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: auto;
  }

  .quick-island-glass {
    background: rgba(10, 15, 28, 0.94);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1.5px solid rgba(245, 158, 11, 0.4);
    border-radius: 18px;
    padding: 10px 12px 10px;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.7), 0 0 24px rgba(245, 158, 11, 0.15);
  }

  .quick-island-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
  }

  .quick-island-meta {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
  }

  .quick-island-beacon {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
    flex-shrink: 0;
    animation: beaconPulse 1.8s infinite;
  }

  .quick-island-name {
    font-size: 12px;
    font-weight: 600;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 170px;
  }

  .quick-island-badge {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 1.5px 6px;
    border-radius: 6px;
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
  }

  .quick-island-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
  }

  .quick-island-btn-palette {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 3px 8px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 12px;
    color: #f1f5f9;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    -webkit-tap-highlight-color: transparent;
  }

  .quick-island-btn-palette:active {
    background: rgba(245, 158, 11, 0.25);
    border-color: #fbbf24;
    color: #fbbf24;
  }

  .quick-island-btn-close {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  .quick-island-swatches-track {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 2px 2px;
  }

  .quick-island-swatches-track::-webkit-scrollbar {
    display: none;
  }

  .mob-quick-swatch {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px;
    -webkit-tap-highlight-color: transparent;
  }

  .mob-quick-swatch-circle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.22);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
    position: relative;
  }

  .mob-quick-swatch.active .mob-quick-swatch-circle {
    border-color: #fbbf24;
    transform: scale(1.12);
    box-shadow: 0 0 14px rgba(245, 158, 11, 0.7);
  }

  .mob-quick-swatch-label {
    font-size: 9.5px;
    color: #94a3b8;
    font-weight: 500;
    white-space: nowrap;
    max-width: 48px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mob-quick-swatch.active .mob-quick-swatch-label {
    color: #fbbf24;
    font-weight: 600;
  }

  /* 3. Mobile Bottom Sheets: Obsidian Atelier Dark Glass */
  .mobile-drawer-handle-bar {
    display: flex !important;
    background: #0d1322 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    padding: 10px 16px 8px !important;
    touch-action: none;
  }

  .mobile-drag-pill {
    background: rgba(245, 158, 11, 0.5) !important;
  }

  .mobile-drawer-close-btn {
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: #cbd5e1 !important;
  }

  .mobile-drawer-close-btn:active {
    background: rgba(245, 158, 11, 0.25) !important;
    color: #fbbf24 !important;
  }

  /* Mobile Drawer & Inspector Sub-Panel Segmented Navigation Tabs */
  .mobile-drawer-tabs {
    display: flex !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 6px;
    padding: 8px 12px;
    background: #070b14 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07) !important;
    flex-shrink: 0;
  }

  .mobile-drawer-tabs::-webkit-scrollbar {
    display: none;
  }

  .mob-drawer-tab {
    flex-shrink: 0;
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 600;
    color: #94a3b8 !important;
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
  }

  .mob-drawer-tab.active {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%) !important;
    color: #ffffff !important;
    border-color: #f59e0b !important;
    box-shadow: 0 2px 10px rgba(245, 158, 11, 0.35) !important;
  }

  .env-drawer,
  .inspector-right {
    position: fixed !important;
    bottom: calc(60px + env(safe-area-inset-bottom, 0px)) !important;
    left: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    height: calc(80vh - 60px - env(safe-area-inset-bottom, 0px)) !important;
    height: calc(80dvh - 60px - env(safe-area-inset-bottom, 0px)) !important;
    max-height: calc(85dvh - 60px - env(safe-area-inset-bottom, 0px)) !important;
    z-index: 140 !important;
    border-radius: 22px 22px 0 0 !important;
    background: linear-gradient(180deg, #0d1322 0%, #060913 100%) !important;
    box-shadow: 0 -16px 48px rgba(0, 0, 0, 0.8), 0 0 30px rgba(245, 158, 11, 0.08) !important;
    border: 1px solid rgba(245, 158, 11, 0.28) !important;
    border-bottom: none !important;
    transform: translateY(115%);
    transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1) !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    color: #f1f5f9 !important;
  }

  .env-drawer.mobile-open,
  .inspector-right.mobile-open {
    transform: translateY(0) !important;
  }

  /* Mobile Drawer Panels Flex Sizing - Essential for child scroll containers */
  .drawer-panel {
    display: none;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    flex: 1 1 0 !important;
    overflow: hidden !important;
    flex-direction: column !important;
  }

  .drawer-panel.active {
    display: flex !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    flex: 1 1 0 !important;
    overflow: hidden !important;
    flex-direction: column !important;
  }

  .drawer-panel .drawer-header {
    flex-shrink: 0 !important;
  }

  /* Smooth, Unrestricted Touch Scroll for All Drawer Content */
  .panel-content-scroll,
  .inspector-scroll {
    flex: 1 1 0 !important;
    min-height: 0 !important;
    height: 100% !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    touch-action: pan-y !important;
    overscroll-behavior-y: contain !important;
    padding: 12px 14px calc(75px + env(safe-area-inset-bottom, 0px)) !important;
  }

  .panel-content-scroll *,
  .inspector-scroll * {
    touch-action: pan-y;
  }

  /* Drawer Internal Styling - Obsidian & Champagne Gold */
  .env-drawer .panel-title,
  .inspector-right .inspector-title,
  .env-drawer .panel-section-title,
  .inspector-right .section-title {
    color: #fbbf24 !important;
  }

  .env-drawer .panel-header,
  .inspector-right .inspector-header {
    background: transparent !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  }

  .env-card-item,
  .gem-env-card,
  .pose-card-btn,
  .render-preset-btn {
    background: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid rgba(255, 255, 255, 0.09) !important;
    color: #e2e8f0 !important;
  }

  .env-card-item.active,
  .gem-env-card.active,
  .pose-card-btn.active,
  .render-preset-btn.active {
    background: rgba(245, 158, 11, 0.14) !important;
    border-color: #f59e0b !important;
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.25) !important;
  }

  .env-card-item span,
  .gem-env-card span,
  .pose-card-btn span {
    color: #cbd5e1 !important;
  }

  .inspector-right .mat-group {
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 12px;
    padding: 10px;
  }

  .inspector-right label,
  .inspector-right .inspector-label,
  .inspector-right .opt-label {
    color: #cbd5e1 !important;
  }

  .inspector-right .custom-select,
  .inspector-right .form-input,
  .inspector-right select {
    background: #0f172a !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: #f1f5f9 !important;
  }

  /* 4. Mobile Bottom Navigation Bar (Obsidian Glass + Champagne Gold Glow) */
  .mobile-bottom-nav {
    display: flex !important;
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: calc(60px + env(safe-area-inset-bottom, 0px)) !important;
    background: rgba(8, 12, 22, 0.96) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid rgba(245, 158, 11, 0.2) !important;
    z-index: 150 !important;
    align-items: center;
    justify-content: space-around;
    padding: 2px 4px max(2px, env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.6) !important;
  }

  .mobile-nav-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 9.5px;
    font-weight: 600;
    padding: 4px 1px;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    border-radius: 8px;
    min-width: 0;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-nav-btn span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    letter-spacing: -0.2px;
  }

  .mobile-nav-btn svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    transition: var(--transition);
  }

  .mobile-nav-btn:hover {
    color: #f1f5f9;
  }

  .mobile-nav-btn.active {
    color: #fbbf24 !important;
  }

  .mobile-nav-btn.active svg {
    transform: scale(1.1);
    stroke: #fbbf24 !important;
    filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.6)) !important;
  }

  .mobile-nav-btn.active::after {
    content: '';
    position: absolute;
    bottom: 2px;
    width: 14px;
    height: 2.5px;
    border-radius: 9999px;
    background: #fbbf24 !important;
    box-shadow: 0 0 8px #f59e0b !important;
  }

  /* 5. Touch Target Enhancements */
  .swatch-btn {
    width: 38px;
    height: 38px;
  }

  .swatches-grid {
    gap: 8px;
  }

  .env-grid-functional {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .env-card-item {
    padding: 8px;
  }

  .gem-env-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .poses-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  /* 6. Modals on Mobile */
  .credits-modal-window,
  .modal-share-window {
    width: 95vw !important;
    max-width: 440px !important;
    max-height: 88dvh !important;
    padding: 14px !important;
    border-radius: 16px !important;
    background: linear-gradient(180deg, #0d1322 0%, #060913 100%) !important;
    border: 1px solid rgba(245, 158, 11, 0.3) !important;
    color: #f1f5f9 !important;
  }

  .modal-share-body {
    padding: 10px 4px !important;
    max-height: calc(88dvh - 55px) !important;
  }

  .share-input-group {
    flex-wrap: wrap !important;
  }

  .share-url-input {
    width: 100% !important;
    min-width: 0 !important;
    font-size: 13px !important;
  }

  .share-action-buttons {
    width: 100% !important;
    display: flex;
    gap: 6px;
  }

  .share-action-buttons .btn-share-modal-action {
    flex: 1;
  }

  /* Prevent automatic iOS zooming on text input tap */
  input[type="text"], input[type="search"], textarea, select {
    font-size: 16px !important;
  }
}

/* Animations for Mobile Luxury UI */
@keyframes popoverFadeIn {
  from { opacity: 0; transform: translateY(-8px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes islandSlideUp {
  from { opacity: 0; transform: translate(-50%, 14px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

@keyframes beaconPulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

@keyframes shutterFlash {
  0% { opacity: 0.95; }
  50% { opacity: 0.4; }
  100% { opacity: 0; }
}

/* Extra Compact Phones (< 440px) */
@media (max-width: 440px) {
  .navbar {
    padding: 0 8px;
  }

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

  .header-action-btn.btn-highlight {
    padding: 5px 9px;
    font-size: 10.5px;
  }
}

/* ============================================================
   GLOBAL UTILITIES & OVERLAYS
   ============================================================ */
.hidden {
  display: none !important;
}

/* ============================================================
   LIVE SESSION SHARING & VIEW-ONLY PRESENTATION BANNER
   ============================================================ */

/* View-Only Banner: HIDDEN by default; only shown in shared view-only session */
.view-only-banner {
  display: none !important;
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 55;
  pointer-events: auto;
  align-items: center;
  gap: 12px;
  padding: 6px 14px;
  background: rgba(15, 23, 42, 0.94);
  border: 1px solid rgba(212, 175, 55, 0.65);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(212, 175, 55, 0.3);
  border-radius: 9999px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  animation: bannerFadeDown 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.view-only-banner.hidden {
  display: none !important;
}

@keyframes bannerFadeDown {
  from { opacity: 0; transform: translate(-50%, -12px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.view-only-badge {
  display: flex;
  align-items: center;
  gap: 8px;
}

.view-only-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #38bdf8;
  box-shadow: 0 0 10px #38bdf8;
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.35); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.view-only-text {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: #f8fafc;
  white-space: nowrap;
}

.btn-fork-session {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: linear-gradient(135deg, #d4af37 0%, #f59e0b 100%);
  color: #0f172a;
  border: none;
  font-size: 11.5px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 9999px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(212, 175, 55, 0.4);
}

.btn-fork-session:hover {
  transform: scale(1.05);
  box-shadow: 0 0 14px rgba(212, 175, 55, 0.7);
}

/* Navbar Share Live Button */
.header-action-btn.btn-share-live {
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid rgba(212, 175, 55, 0.45);
  color: #f5d061;
}

.header-action-btn.btn-share-live:hover {
  background: rgba(212, 175, 55, 0.25);
  border-color: #f5d061;
  color: #ffffff;
  box-shadow: 0 0 14px rgba(212, 175, 55, 0.35);
}

/* ============================================================
   LIVE SESSION SHARE MODAL DIALOG
   ============================================================ */
.modal-share-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 7, 18, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 1;
  transition: opacity 0.25s ease;
}

.modal-share-overlay.hidden {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.modal-share-window {
  width: 92%;
  max-width: 530px;
  max-height: 94vh;
  background: #111116;
  border: 1px solid rgba(212, 175, 55, 0.45);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.75), 0 0 40px rgba(212, 175, 55, 0.25);
  overflow: hidden;
  animation: modalScaleUp 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.modal-share-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
}

.modal-share-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-share-title {
  font-size: 14px;
  font-weight: 700;
  color: #f8fafc;
  letter-spacing: 0.5px;
}

.modal-share-close {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
  transition: color 0.2s ease;
}

.modal-share-close:hover {
  color: #ffffff;
}

.modal-share-body {
  padding: 14px 18px;
  overflow-y: auto;
  max-height: calc(94vh - 55px);
}


.share-modal-desc {
  font-size: 12.5px;
  color: #94a3b8;
  line-height: 1.5;
  margin-bottom: 16px;
}

.share-field-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: #cbd5e1;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.permission-selector-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.permission-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  background: rgba(15, 23, 42, 0.6);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
}

.permission-card:hover {
  border-color: rgba(212, 175, 55, 0.4);
  background: rgba(15, 23, 42, 0.85);
}

.permission-card.active {
  border-color: #d4af37;
  background: rgba(212, 175, 55, 0.12);
  box-shadow: 0 0 15px rgba(212, 175, 55, 0.18);
}

.perm-card-header {
  display: flex;
  align-items: center;
  gap: 6px;
}

.perm-icon {
  font-size: 15px;
}

.perm-title {
  font-size: 12px;
  font-weight: 700;
  color: #f8fafc;
}

.permission-card.active .perm-title {
  color: #f5d061;
}

.perm-desc {
  font-size: 11px;
  color: #94a3b8;
  line-height: 1.35;
  margin: 0;
}

.retention-badge {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 999px;
  margin-left: auto;
  letter-spacing: 0.05em;
}

.retention-badge.free {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.4);
}

.retention-badge.paid {
  background: rgba(212, 175, 55, 0.25);
  color: #fbbf24;
  border: 1px solid rgba(212, 175, 55, 0.5);
  box-shadow: 0 0 8px rgba(212, 175, 55, 0.2);
}

.share-uploading-box {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(212, 175, 55, 0.08);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 10px;
  padding: 12px 14px;
  margin-top: 14px;
  animation: pulseUpload 1.8s infinite ease-in-out;
}

@keyframes pulseUpload {
  0%, 100% { border-color: rgba(212, 175, 55, 0.3); background: rgba(212, 175, 55, 0.06); }
  50% { border-color: rgba(212, 175, 55, 0.7); background: rgba(212, 175, 55, 0.14); }
}

.share-spinner {
  width: 22px;
  height: 22px;
  border: 2.5px solid rgba(212, 175, 55, 0.25);
  border-top-color: #d4af37;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

.share-upload-text-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.share-upload-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.share-upload-title {
  font-size: 12.5px;
  font-weight: 700;
  color: #fef08a;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.share-upload-pct {
  font-size: 12px;
  font-weight: 800;
  color: #fbbf24;
  font-family: monospace;
  flex-shrink: 0;
}

.share-progress-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  overflow: hidden;
  margin: 3px 0;
}

.share-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #d4af37, #fef08a, #38bdf8);
  border-radius: 999px;
  transition: width 0.15s ease-out;
  box-shadow: 0 0 8px rgba(212, 175, 55, 0.4);
}

.share-upload-sub {
  font-size: 11px;
  color: #94a3b8;
  line-height: 1.3;
}


.share-input-group {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.share-url-input {
  flex: 1;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 9px 12px;
  font-family: monospace;
  font-size: 12px;
  color: #38bdf8;
  outline: none;
  cursor: text;
}

.share-url-input:focus {
  border-color: #d4af37;
  box-shadow: 0 0 8px rgba(212, 175, 55, 0.3);
}

.btn-copy-share {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #d4af37, #ca8a04);
  color: #0f172a;
  border: none;
  border-radius: 8px;
  padding: 0 16px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.btn-copy-share:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.share-qr-section {
  margin-top: 16px;
}

.share-qr-container {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 14px;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  text-align: left;
}

.share-qr-container canvas {
  background: #ffffff;
  padding: 6px;
  border-radius: 8px;
  display: block;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  flex-shrink: 0;
}

.qr-helper-text {
  font-size: 11.5px;
  color: #94a3b8;
  line-height: 1.4;
}

.share-security-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  font-size: 11px;
  color: #64748b;
}

.security-lock-icon {
  font-size: 13px;
}

.btn-create-share-link {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  background: linear-gradient(135deg, #d4af37 0%, #b8860b 50%, #996515 100%);
  color: #0b1120;
  border: 1px solid rgba(254, 240, 138, 0.4);
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: 0.3px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(212, 175, 55, 0.25);
  transition: all 0.2s ease;
}

.btn-create-share-link:hover:not(:disabled) {
  filter: brightness(1.12);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
}

.btn-create-share-link:active:not(:disabled) {
  transform: translateY(0);
}

.btn-create-share-link:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  filter: grayscale(0.2);
}

.btn-link-open-switch {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.btn-link-open-switch:hover {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.08);
}

.header-action-btn.btn-open-link {
  border-color: rgba(56, 189, 248, 0.35);
  color: #0284c7;
}

.header-action-btn.btn-open-link:hover {
  background: rgba(56, 189, 248, 0.08);
  border-color: #38bdf8;
  color: #0284c7;
}

.modal-open-link-window {
  max-width: 520px;
}

.open-url-input {
  color: #38bdf8 !important;
}

.btn-paste-share {
  background: linear-gradient(135deg, #0284c7, #0369a1) !important;
  color: #ffffff !important;
}

.btn-paste-share:hover {
  filter: brightness(1.15) !important;
}

@media (max-width: 640px) {
  .permission-selector-grid {
    grid-template-columns: 1fr;
  }
  .share-qr-container {
    flex-direction: column;
    text-align: center;
  }
}

/* -------------------------------------------------------------
 * Presentation / View-Only Mode State Styling
 * Locks material/mesh modification while keeping 3D orbit,
 * poses, lighting, and Photo/Video Shoot 100% active & unrestricted.
 * ------------------------------------------------------------- */
body.session-view-only #canvas-transform-toolbar {
  display: none !important;
}

body.session-view-only .view-only-banner {
  display: flex !important;
}

body.session-view-only #subpanel-metal,
body.session-view-only #subpanel-gem,
body.session-view-only #subpanel-ceramic,
body.session-view-only #subpanel-pearl {
  position: relative;
  pointer-events: none;
  opacity: 0.6;
  filter: grayscale(0.2);
}

body.session-view-only #subpanel-metal::before,
body.session-view-only #subpanel-gem::before,
body.session-view-only #subpanel-ceramic::before,
body.session-view-only #subpanel-pearl::before {
  content: "🔒 View-Only Mode — Click 'Duplicate & Edit' above to customize materials";
  display: block;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(212, 175, 55, 0.45);
  color: #fbbf24;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 500;
  text-align: center;
  margin-bottom: 12px;
  pointer-events: auto;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

/* Luxury Toast Notification */
.studio-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(15, 23, 42, 0.94);
  border: 1px solid rgba(212, 175, 55, 0.5);
  color: #f8fafc;
  padding: 10px 20px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 15px rgba(212, 175, 55, 0.2);
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 99999;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.studio-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* -------------------------------------------------------------
 * Desktop Recommendation / 60 FPS Video Recording Modal
 * ------------------------------------------------------------- */
.modal-record-confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 99998;
  background: rgba(4, 7, 14, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.25s ease-out;
}

.modal-record-confirm-window {
  background: linear-gradient(180deg, #111827 0%, #080d16 100%);
  border: 1px solid rgba(245, 158, 11, 0.35);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.85), 0 0 35px rgba(245, 158, 11, 0.15);
  border-radius: 20px;
  width: 100%;
  max-width: 460px;
  overflow: hidden;
  color: #f1f5f9;
  animation: modalScaleUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-record-confirm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-brand-badge {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.35);
  padding: 3px 8px;
  border-radius: 9999px;
  margin-right: 8px;
}

.modal-brand-title {
  font-size: 13px;
  font-weight: 600;
  color: #e2e8f0;
}

.modal-record-confirm-body {
  padding: 24px 22px;
  text-align: center;
}

.modal-hero-icon-box {
  width: 68px;
  height: 68px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.22) 0%, rgba(245, 158, 11, 0.02) 70%);
  border: 1px solid rgba(245, 158, 11, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-headline {
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 8px;
}

.modal-explanation {
  font-size: 13px;
  color: #94a3b8;
  line-height: 1.55;
  margin-bottom: 16px;
}

.modal-tip-pill {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 11.5px;
  color: #cbd5e1;
  line-height: 1.45;
  margin-bottom: 22px;
  text-align: left;
}

.modal-actions-row {
  display: flex;
  gap: 10px;
}

.btn-modal-cancel {
  flex: 1;
  padding: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-modal-cancel:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.btn-modal-proceed {
  flex: 2;
  padding: 12px 16px;
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  border: 1px solid #f59e0b;
  color: #ffffff;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 16px rgba(217, 119, 6, 0.4);
  transition: all 0.2s ease;
}

.btn-modal-proceed:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

/* ============================================================
   LINE-BY-LINE GEMSTONE LIST & DUAL PHOTOSHOOT ACTION BUTTONS
   ============================================================ */
.gem-tiles-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}

.gem-tile-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.18s ease;
  text-align: left;
  width: 100%;
  color: #f1f5f9;
  -webkit-tap-highlight-color: transparent;
}

.gem-tile-btn:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(245, 158, 11, 0.4);
  transform: translateX(2px);
}

.gem-tile-btn.active {
  background: rgba(245, 158, 11, 0.16) !important;
  border-color: #f59e0b !important;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.22);
}

.gem-tile-swatch {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4), inset 0 1px 2px rgba(255, 255, 255, 0.4);
  border: 1.5px solid rgba(255, 255, 255, 0.25);
}

.gem-tile-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.gem-tile-title {
  font-size: 12px;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gem-tile-sub {
  font-size: 10.5px;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gem-tile-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  letter-spacing: 0.3px;
  flex-shrink: 0;
}

.gem-tile-btn.active .gem-tile-badge {
  background: rgba(245, 158, 11, 0.3);
  color: #fbbf24;
}

/* Dual Action Buttons (Preview Live + Record Master) */
.shoot-action-section {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.section-micro-label {
  font-size: 11px;
  font-weight: 700;
  color: #38bdf8;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.dual-action-row {
  display: flex;
  gap: 8px;
  width: 100%;
}

.btn-action-preview {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 10px;
  border-radius: 9px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn-action-preview:hover {
  background: rgba(245, 158, 11, 0.22);
  border-color: #f59e0b;
}

.btn-action-preview.active {
  background: #f59e0b !important;
  color: #0b0f19 !important;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.4);
}

.btn-action-preview.btn-preview-cinematic {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.4);
  color: #38bdf8;
}

.btn-action-preview.btn-preview-cinematic:hover {
  background: rgba(56, 189, 248, 0.22);
  border-color: #38bdf8;
}

.btn-action-preview.btn-preview-cinematic.active {
  background: #38bdf8 !important;
  color: #0b0f19 !important;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.4);
}

.btn-action-record {
  flex: 1.35;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 9px;
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  border: none;
  color: #ffffff;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(217, 119, 6, 0.35);
  transition: all 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn-action-record:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(217, 119, 6, 0.5);
}

.btn-action-record.btn-record-cinematic {
  background: linear-gradient(135deg, #0284c7 0%, #6366f1 100%);
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.4);
}

.btn-action-record.btn-record-cinematic:hover {
  box-shadow: 0 6px 18px rgba(2, 132, 199, 0.55);
}

