/* ==========================================================================
   VERA TrueView — Apple iOS 18 Liquid Glass Design System & Styles
   ========================================================================== */

:root {
  /* Color Palette - Obsidian Dark, Liquid Violet, Amber, Electric Cyan */
  --bg-core: #07070a;
  --bg-surface: rgba(18, 18, 24, 0.72);
  --bg-surface-elevated: rgba(28, 28, 38, 0.82);
  --bg-glass: rgba(255, 255, 255, 0.05);
  --bg-glass-active: rgba(255, 255, 255, 0.12);
  
  --border-glass: rgba(255, 255, 255, 0.12);
  --border-glass-light: rgba(255, 255, 255, 0.18);
  --border-accent: rgba(139, 92, 246, 0.45);

  --text-primary: #ffffff;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --text-accent: #c084fc;
  
  --accent-purple: #8b5cf6;
  --accent-cyan: #38bdf8;
  --accent-amber: #f59e0b;
  --accent-emerald: #10b981;
  --accent-rose: #f43f5e;
  
  --glow-purple: 0 0 35px rgba(139, 92, 246, 0.25);
  --glow-amber: 0 0 35px rgba(245, 158, 11, 0.25);
  --glow-cyan: 0 0 35px rgba(56, 189, 248, 0.25);
  
  --radius-xs: 8px;
  --radius-sm: 14px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --radius-pill: 9999px;
  
  --shadow-subtle: 0 4px 20px rgba(0, 0, 0, 0.4);
  --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.55);
  --shadow-elevated: 0 20px 50px rgba(0, 0, 0, 0.7);

  --font-display: 'Outfit', -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
  --font-ui: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  --font-mono: 'Space Mono', monospace;

  --spring-bounce: cubic-bezier(0.175, 0.885, 0.32, 1.275);
  --spring-smooth: cubic-bezier(0.16, 1, 0.3, 1);
}

/* Base Reset & Typography */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-core);
  font-family: var(--font-ui);
  color: var(--text-primary);
  user-select: none;
  -webkit-font-smoothing: antialiased;
}

/* Ambient Ring Light Glow Effect around the entire screen edge */
.ambient-ring-light {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  opacity: 0;
  box-shadow: inset 0 0 100px 40px rgba(255, 220, 180, 0.85);
  transition: opacity 0.5s var(--spring-smooth), box-shadow 0.5s ease;
}

.ambient-ring-light.active {
  opacity: 1;
}

/* Application Shell Layout */
.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  position: relative;
  background: radial-gradient(circle at 50% 15%, rgba(139, 92, 246, 0.12) 0%, transparent 60%),
              radial-gradient(circle at 80% 80%, rgba(56, 189, 248, 0.08) 0%, transparent 50%),
              #07070a;
}

/* ==========================================================================
   Header & Dynamic Island (Apple iOS 18 Design)
   ========================================================================== */
.top-nav {
  position: absolute;
  top: 14px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 16px;
  z-index: 50;
  pointer-events: none;
}

/* Dynamic Island Container */
.dynamic-island {
  pointer-events: auto;
  position: relative;
  background: rgba(10, 10, 15, 0.88);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-glass), var(--glow-purple);
  cursor: pointer;
  transition: all 0.4s var(--spring-smooth);
  overflow: hidden;
}

.island-collapsed {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 6px 16px 6px 12px;
  height: 38px;
}

.island-leading {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 12px var(--accent-emerald);
  animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.island-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  color: #fff;
  text-transform: uppercase;
}

.island-trailing {
  display: flex;
  align-items: center;
  gap: 8px;
}

.island-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(139, 92, 246, 0.25);
  color: var(--text-accent);
  padding: 2px 7px;
  border-radius: 6px;
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.island-sound-wave {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 12px;
}

.island-sound-wave span {
  width: 2px;
  background: var(--accent-cyan);
  border-radius: 1px;
  height: 100%;
  animation: sound-bounce 1.2s infinite ease-in-out alternate;
}
.island-sound-wave span:nth-child(2) { animation-delay: 0.2s; height: 60%; }
.island-sound-wave span:nth-child(3) { animation-delay: 0.4s; height: 80%; }

@keyframes sound-bounce {
  0% { transform: scaleY(0.3); }
  100% { transform: scaleY(1); }
}

/* Expanded Dynamic Island */
.island-expanded {
  display: none;
  padding: 16px 20px;
  min-width: 320px;
  flex-direction: column;
  gap: 12px;
}

.dynamic-island.expanded {
  border-radius: var(--radius-md);
}

.dynamic-island.expanded .island-collapsed {
  display: none;
}

.dynamic-island.expanded .island-expanded {
  display: flex;
}

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

.tag-live {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--accent-cyan);
  letter-spacing: 0.05em;
}

.expanded-header h4 {
  font-size: 0.95rem;
  font-weight: 600;
}

.fps-pill {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  background: rgba(16, 185, 129, 0.2);
  color: var(--accent-emerald);
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.expanded-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.metric-chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xs);
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.metric-lbl {
  font-size: 0.6rem;
  color: var(--text-muted);
  font-weight: 600;
}

.metric-val {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Quick Action Glass Buttons (Top Right) */
.top-actions {
  pointer-events: auto;
  position: absolute;
  right: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.glass-icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--bg-surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s var(--spring-smooth);
  position: relative;
}

.glass-icon-btn:hover {
  background: var(--bg-glass-active);
  color: var(--text-primary);
  border-color: var(--border-glass-light);
  transform: translateY(-1px);
}

.glass-icon-btn:active {
  transform: scale(0.92);
}

.glass-icon-btn.active {
  color: var(--accent-purple);
  border-color: var(--accent-purple);
  background: rgba(139, 92, 246, 0.15);
  box-shadow: 0 0 16px rgba(139, 92, 246, 0.35);
}

.glass-icon-btn svg {
  width: 18px;
  height: 18px;
}

.btn-dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-amber);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.glass-icon-btn.active .btn-dot {
  opacity: 1;
}

/* Aspect Ratio Selector Pill */
.aspect-ratio-selector {
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--bg-surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-pill);
  padding: 2px 4px;
}

.aspect-chip {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.2s ease;
}

.aspect-chip:hover {
  color: #fff;
}

.aspect-chip.active {
  background: rgba(139, 92, 246, 0.3);
  color: var(--text-accent);
  border: 1px solid rgba(139, 92, 246, 0.4);
}

/* ==========================================================================
   Viewport Stage & Optical Frame (Non-Overlapping Flex Layout)
   ========================================================================== */
.viewport-stage {
  flex: 1;
  min-height: 280px;
  height: 100%;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 16px 8px 16px;
  position: relative;
  overflow: hidden;
  z-index: 10;
  box-sizing: border-box;
}

.optical-frame {
  position: relative;
  width: 100%;
  max-width: 820px;
  height: 100%;
  max-height: 520px;
  min-height: 240px;
  background: #020205;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-glass-light);
  box-shadow: var(--shadow-elevated), 0 0 80px rgba(0, 0, 0, 0.9);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: max-width 0.3s var(--spring-smooth), max-height 0.3s var(--spring-smooth);
}

/* Aspect Ratio Modifiers */
.optical-frame.aspect-9-16 {
  max-width: 320px;
  max-height: 540px;
  width: 100%;
  height: 100%;
  aspect-ratio: 9 / 16;
}

.optical-frame.aspect-4-3 {
  max-width: 720px;
  max-height: 540px;
  width: 100%;
  height: 100%;
  aspect-ratio: 4 / 3;
}

.optical-frame.aspect-1-1 {
  max-width: 500px;
  max-height: 500px;
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
}

.optical-frame.aspect-16-9 {
  max-width: 920px;
  max-height: 520px;
  width: 100%;
  height: 100%;
  aspect-ratio: 16 / 9;
}

.optical-frame.aspect-fit {
  width: 100%;
  height: 100%;
  max-width: 960px;
  max-height: 540px;
}

/* Frame Resize Corner Handle */
.frame-resize-handle {
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-glass);
  border-radius: 6px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: nwse-resize;
  z-index: 28;
  transition: all 0.2s ease;
}

.frame-resize-handle svg {
  width: 14px;
  height: 14px;
}

.frame-resize-handle:hover {
  color: var(--accent-cyan);
  border-color: var(--accent-cyan);
}

/* Video & Canvas Elements */
#webcam-source {
  display: none; /* Ingest stream processed through WebGL canvas */
}

#gl-canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

#hud-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
}

/* Eye Contact Indicator */
.eye-contact-target {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  z-index: 20;
  pointer-events: none;
  opacity: 0.85;
  transition: opacity 0.3s ease;
}

.target-ring {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--accent-cyan);
  box-shadow: 0 0 15px var(--accent-cyan);
  animation: target-radar 2.4s infinite;
}

@keyframes target-radar {
  0% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.15); opacity: 1; box-shadow: 0 0 22px var(--accent-cyan); }
  100% { transform: scale(0.9); opacity: 0.7; }
}

.target-dot {
  position: absolute;
  top: 6px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
}

.target-label {
  font-size: 0.58rem;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent-cyan);
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(10px);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(56, 189, 248, 0.3);
  letter-spacing: 0.06em;
}

/* Live Split Scissor Wipe Divider */
.split-wipe-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 4px;
  cursor: ew-resize;
  z-index: 25;
  display: none; /* Enabled in Split mode */
  touch-action: none;
}

.split-wipe-divider.active {
  display: block;
}

.divider-line {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 14px rgba(255, 255, 255, 0.9), 0 0 30px var(--accent-purple);
}

.divider-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(20, 20, 30, 0.9);
  backdrop-filter: blur(20px);
  border: 2px solid #ffffff;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6), 0 0 20px rgba(139, 92, 246, 0.6);
  cursor: ew-resize;
}

.divider-handle svg {
  width: 18px;
  height: 18px;
}

.split-badges {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 30px;
  pointer-events: none;
  white-space: nowrap;
}

.badge-side {
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(12px);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-glass);
}

.left-badge { color: var(--accent-amber); border-color: rgba(245, 158, 11, 0.4); }
.right-badge { color: var(--accent-cyan); border-color: rgba(56, 189, 248, 0.4); }

/* Quick Status Pill inside Viewport */
.viewport-quick-stats {
  position: absolute;
  bottom: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
  z-index: 15;
}

.mode-indicator-pill, .orientation-level-pill {
  background: rgba(12, 12, 18, 0.75);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-pill);
  padding: 5px 12px;
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: var(--shadow-subtle);
  letter-spacing: 0.04em;
}

.mode-indicator-pill .indicator-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-purple);
  box-shadow: 0 0 8px var(--accent-purple);
}

.orientation-level-pill svg {
  width: 13px;
  height: 13px;
  color: var(--accent-emerald);
}

/* Camera Ingest / Permission Banner Overlay */
.camera-prompt-overlay {
  position: absolute;
  inset: 0;
  background: rgba(6, 6, 10, 0.88);
  backdrop-filter: blur(24px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 40;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.camera-prompt-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.prompt-card {
  max-width: 440px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 36px 28px;
}

.prompt-icon-bubble {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.25), rgba(56, 189, 248, 0.25));
  border: 1px solid var(--border-glass-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 0 30px rgba(139, 92, 246, 0.4);
}

.prompt-icon-bubble svg {
  width: 32px;
  height: 32px;
}

.prompt-card h2 {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.25;
}

.prompt-card p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.prompt-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  margin-top: 8px;
}

.prompt-privacy {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.prompt-privacy svg {
  width: 14px;
  height: 14px;
  color: var(--accent-emerald);
}

/* ==========================================================================
   Bottom Controls & iOS Liquid Glass Dock (Non-Overlapping & Collapsible)
   ========================================================================== */
.bottom-dock-container {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 16px 12px 16px;
  z-index: 30;
  flex-shrink: 0; /* Does not squish preview */
  background: linear-gradient(to top, rgba(7, 7, 10, 0.95) 0%, rgba(7, 7, 10, 0.6) 80%, transparent 100%);
}

/* Drawer Collapse Toggle Bar */
.drawer-collapse-bar {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-bottom: 6px;
}

.drawer-toggle-btn {
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-pill);
  padding: 3px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.68rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.drawer-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.handle-pill {
  width: 24px;
  height: 3px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
}

.drawer-toggle-btn svg {
  width: 13px;
  height: 13px;
  transition: transform 0.3s ease;
}

.bottom-dock-container.collapsed .drawer-toggle-btn svg {
  transform: rotate(180deg);
}

/* Mode Segmented Bar */
.mode-segmented-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(14, 14, 20, 0.85);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-pill);
  padding: 4px;
  box-shadow: var(--shadow-subtle);
  margin-bottom: 8px;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}

.mode-segmented-bar::-webkit-scrollbar {
  display: none;
}

.seg-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-ui);
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s var(--spring-smooth);
  white-space: nowrap;
}

.seg-btn svg {
  width: 14px;
  height: 14px;
}

.seg-btn:hover {
  color: var(--text-primary);
}

.seg-btn.active {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3), 0 0 15px rgba(255, 255, 255, 0.1);
}

/* Interactive Glass Drawer */
.glass-dock-drawer {
  width: 100%;
  max-width: 740px;
  background: rgba(16, 16, 24, 0.92);
  backdrop-filter: blur(32px) saturate(200%);
  -webkit-backdrop-filter: blur(32px) saturate(200%);
  border: 1px solid var(--border-glass-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-glass), 0 0 50px rgba(0, 0, 0, 0.7);
  padding: 10px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.3s var(--spring-smooth);
  max-height: 400px;
  overflow: hidden;
}

/* Collapsed State for Drawer */
.bottom-dock-container.collapsed .glass-dock-drawer {
  max-height: 72px;
  padding: 8px 16px;
}

.bottom-dock-container.collapsed .drawer-tabs,
.bottom-dock-container.collapsed .tab-content {
  display: none !important;
}

/* Drawer Tab Switchers */
.drawer-tabs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

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

.tab-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  padding: 4px 12px;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.tab-chip svg {
  width: 14px;
  height: 14px;
}

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

.tab-chip.active {
  background: rgba(139, 92, 246, 0.15);
  border-color: rgba(139, 92, 246, 0.4);
  color: var(--text-accent);
}

/* Tab Content Containers */
.tab-content {
  display: none;
  animation: fadeIn 0.25s ease;
}

.tab-content.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Tab 1: Focal Length Dial & Shaders */
.focal-dial-wrapper {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.focal-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.focal-title-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.focal-headline {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: #ffffff;
}

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

.focal-badge-large {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
}

.focal-presets-row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.focal-pill {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 6px 4px;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s var(--spring-smooth);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.focal-pill small {
  font-family: var(--font-ui);
  font-size: 0.6rem;
  font-weight: 500;
  color: var(--text-muted);
}

.focal-pill:hover {
  background: var(--bg-glass-active);
  border-color: var(--border-glass-light);
}

.focal-pill.active {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.3), rgba(56, 189, 248, 0.2));
  border-color: var(--accent-purple);
  box-shadow: 0 0 16px rgba(139, 92, 246, 0.3);
}

.focal-pill.active small {
  color: var(--text-accent);
}

/* Sliders */
.slider-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.75rem;
}

.slider-label {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--text-secondary);
  font-weight: 600;
  min-width: 125px;
}

.slider-label svg {
  width: 13px;
  height: 13px;
}

.apple-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.12);
  outline: none;
}

.apple-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  transition: transform 0.15s ease;
}

.apple-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.slider-val {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-accent);
  min-width: 48px;
  text-align: right;
}

/* Tab 2: Studio Lighting Grid */
.lighting-controls-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.light-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

.light-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 700;
}

.light-title svg {
  width: 15px;
  height: 15px;
  color: var(--accent-amber);
}

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

.color-temp-selector {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}

.temp-chip {
  padding: 4px 2px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-glass);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  font-size: 0.62rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.temp-chip.active {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--chip-glow);
  color: #fff;
  box-shadow: 0 0 10px var(--chip-glow);
}

/* iOS Toggle Switch */
.ios-switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 22px;
}

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

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

.ios-switch .slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.ios-switch input:checked + .slider {
  background-color: var(--accent-emerald);
}

.ios-switch input:checked + .slider:before {
  transform: translateX(16px);
}

/* Tab 3: Symmetry Mode */
.symmetry-dashboard {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sym-modes-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.sym-card-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  color: var(--text-primary);
  transition: all 0.2s var(--spring-smooth);
}

.sym-icon svg {
  width: 18px;
  height: 18px;
  color: var(--accent-purple);
}

.sym-name {
  font-size: 0.74rem;
  font-weight: 700;
}

.sym-card-btn small {
  font-size: 0.6rem;
  color: var(--text-muted);
}

.sym-card-btn.active {
  background: rgba(139, 92, 246, 0.2);
  border-color: var(--accent-purple);
  box-shadow: 0 0 16px rgba(139, 92, 246, 0.3);
}

.sym-metrics-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-sm);
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.sym-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-label {
  font-size: 0.6rem;
  color: var(--text-muted);
  font-weight: 600;
}

.stat-value {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-primary);
}

.stat-sub {
  font-size: 0.58rem;
  color: var(--accent-emerald);
}

.stat-bar-track {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  margin-top: 2px;
  overflow: hidden;
}

.stat-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-purple), var(--accent-cyan));
  border-radius: 2px;
}

/* Tab 4: Presets Carousel */
.presets-carousel {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px 0;
}

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

.preset-card {
  flex: 1;
  min-width: 90px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.preset-preview {
  width: 100%;
  height: 24px;
  border-radius: 6px;
}

.natural-grad { background: linear-gradient(135deg, #1e293b, #475569); }
.golden-grad { background: linear-gradient(135deg, #b45309, #f59e0b); }
.studio-grad { background: linear-gradient(135deg, #4338ca, #38bdf8); }
.velvet-grad { background: linear-gradient(135deg, #881337, #f43f5e); }
.noir-grad { background: linear-gradient(135deg, #000000, #94a3b8); }

.preset-card span {
  font-size: 0.68rem;
  font-weight: 700;
  white-space: nowrap;
}

.preset-card small {
  font-size: 0.58rem;
  color: var(--text-muted);
}

.preset-card.active {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.35);
  background: rgba(56, 189, 248, 0.1);
}

/* Bottom Actions & Big Shutter Button */
.dock-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 4px;
}

.glass-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s var(--spring-smooth);
}

.glass-btn:hover {
  background: var(--bg-glass-active);
  color: #fff;
  border-color: var(--border-glass-light);
}

.circle-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.btn-side-by-side {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 700;
  color: #ffffff;
}

.btn-side-by-side svg {
  width: 16px;
  height: 16px;
  color: var(--accent-purple);
}

/* Apple iOS Shutter Button */
.shutter-action-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.shutter-btn {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: transparent;
  border: 3.5px solid #ffffff;
  padding: 3.5px;
  cursor: pointer;
  transition: transform 0.15s var(--spring-bounce);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), 0 0 25px rgba(255, 255, 255, 0.2);
}

.shutter-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #ffffff;
  transition: all 0.15s ease;
}

.shutter-btn:hover .shutter-inner {
  background: #e2e8f0;
  transform: scale(0.96);
}

.shutter-btn:active {
  transform: scale(0.9);
}

.shutter-btn:active .shutter-inner {
  border-radius: 12px;
  transform: scale(0.82);
  background: var(--accent-rose);
}

.shutter-label {
  font-family: var(--font-display);
  font-size: 0.62rem;
  font-weight: 800;
  color: var(--text-secondary);
  letter-spacing: 0.06em;
}

/* General Buttons */
.btn-primary {
  background: linear-gradient(135deg, var(--accent-purple), #6366f1);
  color: #ffffff;
  border: none;
  padding: 12px 22px;
  border-radius: var(--radius-pill);
  font-family: var(--font-ui);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.4);
  transition: all 0.25s var(--spring-smooth);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 26px rgba(139, 92, 246, 0.6);
}

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

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border: 1px solid var(--border-glass-light);
  padding: 12px 22px;
  border-radius: var(--radius-pill);
  font-family: var(--font-ui);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.14);
}

/* ==========================================================================
   Modals & Sheets (Liquid Glass)
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s var(--spring-smooth);
}

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

.modal-sheet {
  width: 100%;
  max-width: 680px;
  background: rgba(18, 18, 26, 0.94);
  backdrop-filter: blur(40px);
  border: 1px solid var(--border-glass-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-elevated), var(--glow-purple);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px) scale(0.97);
  transition: all 0.3s var(--spring-smooth);
}

.modal-backdrop.active .modal-sheet {
  transform: translateY(0) scale(1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

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

.modal-badge {
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--accent-purple);
  letter-spacing: 0.08em;
}

.modal-header h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
}

.modal-close-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-glass);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.comparison-card-preview {
  width: 100%;
  background: #020204;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 280px;
}

#export-card-canvas {
  width: 100%;
  height: auto;
  max-height: 400px;
  object-fit: contain;
  display: block;
}

.comparison-card-details {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
}

.detail-box h4 {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--accent-amber);
  margin-bottom: 4px;
}

.detail-box h4 svg {
  width: 16px;
  height: 16px;
}

.detail-box p {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

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

.modal-footer-actions button {
  flex: 1;
}

/* Info Cards in Science Modal */
.info-content-scroller {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.info-card {
  display: flex;
  gap: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 14px;
}

.info-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-purple);
  flex-shrink: 0;
}

.info-body h4 {
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.info-body p {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: 68px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: rgba(20, 20, 30, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass-light);
  color: #fff;
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0,0,0,0.6), 0 0 20px rgba(139, 92, 246, 0.3);
  animation: toast-in 0.3s var(--spring-smooth), toast-out 0.3s ease 2.7s forwards;
  display: flex;
  align-items: center;
  gap: 8px;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-10px) scale(0.9); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toast-out {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(-10px) scale(0.9); }
}

/* ==========================================================================
   Responsive Adaptability (Android Mobile / iPhone / Tablet / Desktop)
   ========================================================================== */
@media (max-width: 768px) {
  .top-nav {
    top: 8px;
    padding: 0 8px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .top-actions {
    position: static;
    display: flex;
    align-items: center;
    gap: 4px;
  }

  .aspect-ratio-selector {
    padding: 2px;
    gap: 1px;
  }

  .aspect-chip {
    padding: 3px 6px;
    font-size: 0.6rem;
  }

  .glass-icon-btn {
    width: 32px;
    height: 32px;
  }

  .glass-icon-btn svg {
    width: 15px;
    height: 15px;
  }

  .island-collapsed {
    height: 32px;
    padding: 2px 10px;
    gap: 8px;
  }

  .island-title {
    font-size: 0.68rem;
  }

  .island-badge {
    font-size: 0.62rem;
    padding: 1px 5px;
  }

  .viewport-stage {
    padding: 50px 8px 6px 8px;
  }

  .optical-frame {
    border-radius: var(--radius-md);
    max-height: calc(100vh - 170px);
  }

  .bottom-dock-container {
    padding: 0 8px 8px 8px;
  }

  .mode-segmented-bar {
    padding: 3px;
    gap: 2px;
    margin-bottom: 4px;
  }

  .seg-btn {
    padding: 5px 9px;
    font-size: 0.68rem;
    gap: 4px;
  }

  .seg-btn svg {
    width: 13px;
    height: 13px;
  }

  .glass-dock-drawer {
    padding: 8px 12px;
    gap: 6px;
  }

  .drawer-tabs {
    gap: 4px;
    padding-bottom: 6px;
  }

  .tab-chip {
    padding: 3px 8px;
    font-size: 0.68rem;
  }

  .focal-presets-row {
    gap: 4px;
  }

  .focal-pill {
    padding: 4px 2px;
    font-size: 0.68rem;
  }

  .focal-pill small {
    font-size: 0.55rem;
  }

  .lighting-controls-grid {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .color-temp-selector {
    gap: 3px;
  }

  .temp-chip {
    font-size: 0.58rem;
    padding: 3px 2px;
  }

  .shutter-btn {
    width: 52px;
    height: 52px;
  }

  .btn-side-by-side {
    padding: 8px 12px;
    font-size: 0.72rem;
  }

  .circle-btn {
    width: 38px;
    height: 38px;
  }

  .modal-sheet {
    padding: 16px;
    border-radius: var(--radius-md);
  }

  .modal-footer-actions {
    flex-direction: column;
  }
}

/* Landscape Mobile & Low-Height Screens */
@media (max-height: 620px) {
  .viewport-stage {
    padding: 44px 8px 4px 8px;
  }

  .optical-frame {
    max-height: calc(100vh - 120px);
  }

  .bottom-dock-container .glass-dock-drawer {
    max-height: 60px;
    padding: 6px 12px;
  }

  .bottom-dock-container .drawer-tabs,
  .bottom-dock-container .tab-content {
    display: none !important;
  }
}

@media (min-width: 1024px) {
  .viewport-stage {
    padding: 60px 24px 10px 24px;
  }

  .optical-frame {
    max-width: 960px;
    max-height: 560px;
  }
}

