/* ========================================================
   GREENLIGHTCUT - LUXURY 3D GLASS & TOUCH NEON DESIGN SYSTEM
   ======================================================== */

:root {
  --bg-core: #060A0D;
  --bg-surface: #0B1116;
  --bg-surface-elevated: #101920;
  
  --neon-green: #00FFA3;
  --neon-green-glow: rgba(0, 255, 163, 0.4);
  --neon-green-dim: rgba(0, 255, 163, 0.15);
  --neon-emerald: #05DF72;
  --neon-cyan: #00F0FF;
  --neon-purple: #9D4EDD;
  --neon-gold: #FFB703;
  --danger-red: #FF3366;

  --glass-bg: rgba(13, 20, 26, 0.7);
  --glass-bg-hover: rgba(18, 28, 36, 0.85);
  --glass-border: rgba(0, 255, 163, 0.2);
  --glass-border-strong: rgba(0, 255, 163, 0.5);
  --glass-shadow: 0 12px 40px -8px rgba(0, 0, 0, 0.8);
  --glass-inset-glow: inset 0 1px 1px 0 rgba(255, 255, 255, 0.12), inset 0 0 20px rgba(0, 255, 163, 0.05);

  --text-primary: #F0FDF4;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  
  --font-arabic: 'Tajawal', sans-serif;
  --font-latin: 'Outfit', sans-serif;
  --font-code: 'Fira Code', monospace;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --transition-fast: 0.12s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Base Resets */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
  -webkit-font-smoothing: antialiased;
}

body.dark-theme {
  background-color: var(--bg-core);
  color: var(--text-primary);
  font-family: var(--font-arabic), var(--font-latin);
  min-height: 100vh;
  overflow: hidden;
  position: relative;
  touch-action: manipulation;
}

/* Ambient Lighting Mesh */
.ambient-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.25;
}

.glow-top-left {
  width: 550px;
  height: 550px;
  background: radial-gradient(circle, var(--neon-green) 0%, rgba(5, 223, 114, 0) 70%);
  top: -150px;
  right: -150px;
}

.glow-bottom-right {
  width: 650px;
  height: 650px;
  background: radial-gradient(circle, var(--neon-cyan) 0%, rgba(0, 240, 255, 0) 70%);
  bottom: -200px;
  left: -200px;
}

.ambient-grid-overlay {
  position: fixed;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: 0;
}

/* App Root Shell */
.app-root {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
}

/* Glass Panels */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow), var(--glass-inset-glow);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-normal);
}

.glass-panel:hover {
  border-color: rgba(0, 255, 163, 0.35);
}

/* Top Navigation Bar */
.top-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 20px;
  margin: 8px 12px 0 12px;
  border-radius: var(--radius-lg);
  flex-shrink: 0;
  gap: 16px;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-brand-wrap {
  position: relative;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: #0d1217;
  border: 1.5px solid rgba(0, 255, 163, 0.4);
  box-shadow: 0 0 20px rgba(0, 255, 163, 0.25), inset 0 0 10px rgba(0, 255, 163, 0.15);
  overflow: hidden;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.logo-brand-wrap:hover {
  transform: scale(1.05);
  border-color: var(--neon-green);
  box-shadow: 0 0 28px rgba(0, 255, 163, 0.5), inset 0 0 15px rgba(0, 255, 163, 0.3);
}

.app-official-logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
}

.logo-pulse-glow {
  position: absolute;
  inset: -50%;
  background: radial-gradient(circle, rgba(0, 255, 163, 0.3) 0%, transparent 70%);
  opacity: 0.6;
  pointer-events: none;
  animation: logoPulse 3s infinite ease-in-out;
}

@keyframes logoPulse {
  0%, 100% { opacity: 0.4; transform: scale(0.9); }
  50% { opacity: 0.8; transform: scale(1.1); }
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-family: var(--font-latin);
  font-weight: 900;
  font-size: 1.05rem;
  letter-spacing: 0.5px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 4px;
}

.brand-accent {
  background: linear-gradient(135deg, var(--neon-green) 0%, var(--neon-cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-tagline {
  display: block;
  font-size: 0.68rem;
  color: var(--text-secondary);
}

.offline-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 255, 163, 0.1);
  border: 1px solid rgba(0, 255, 163, 0.3);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
}

.status-radar-green {
  width: 8px;
  height: 8px;
  background: var(--neon-green);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--neon-green);
  animation: pulse-dot 2s infinite ease-out;
}

@keyframes pulse-dot {
  0% { transform: scale(0.9); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.7; }
  100% { transform: scale(0.9); opacity: 1; }
}

/* Studio Nav Tabs Switcher */
.studio-nav-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.45);
  padding: 4px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-normal);
}

.nav-tab:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

.nav-tab.active {
  background: linear-gradient(135deg, rgba(0, 255, 163, 0.25) 0%, rgba(5, 223, 114, 0.1) 100%);
  border: 1px solid var(--neon-green);
  color: var(--neon-green);
  box-shadow: 0 0 16px var(--neon-green-glow);
}

.tab-badge {
  font-size: 0.62rem;
  opacity: 0.75;
  padding: 2px 6px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: var(--radius-full);
}

/* Nav Right Actions */
.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-glass-icon {
  display: flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(145deg, rgba(40,40,40,0.8), rgba(20,20,20,0.9));
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 
    inset 1px 1px 2px rgba(255,255,255,0.2),
    inset -1px -1px 4px rgba(0,0,0,0.5),
    0 4px 6px rgba(0,0,0,0.4);
  color: var(--text-primary);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.btn-glass-icon:hover {
  transform: translateY(-2px);
  box-shadow: 
    inset 1px 1px 2px rgba(255,255,255,0.3),
    inset -1px -1px 4px rgba(0,0,0,0.5),
    0 6px 12px rgba(0, 255, 163, 0.3);
  border-color: var(--neon-green);
  color: var(--neon-green);
}

.btn-glass-icon:active {
  transform: translateY(1px);
  box-shadow: 
    inset 2px 2px 5px rgba(0,0,0,0.6),
    0 2px 3px rgba(0,0,0,0.3);
}

.btn-neon-cta {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #00FFA3 0%, #00B4D8 100%);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 
    inset 2px 2px 4px rgba(255,255,255,0.5),
    inset -2px -2px 6px rgba(0,0,0,0.3),
    0 6px 15px rgba(0, 255, 163, 0.4);
  color: #060A0D;
  font-weight: 900;
  font-family: inherit;
  font-size: 0.9rem;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-shadow: 0px 1px 1px rgba(255,255,255,0.4);
  transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.btn-neon-cta:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 
    inset 2px 2px 4px rgba(255,255,255,0.6),
    inset -2px -2px 6px rgba(0,0,0,0.3),
    0 10px 20px rgba(0, 255, 163, 0.6);
}

.btn-neon-cta:active {
  transform: translateY(2px);
  box-shadow: inset 3px 3px 8px rgba(0,0,0,0.4);
}

/* Master Workspace Container */
.master-workspace {
  flex: 1;
  padding: 8px 12px 12px 12px;
  overflow: hidden;
  display: flex;
}

.studio-section {
  display: none;
  width: 100%;
  height: 100%;
}

.studio-section.active {
  display: flex;
  animation: fadeInStudio 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInStudio {
  from { opacity: 0; transform: scale(0.99); }
  to { opacity: 1; transform: scale(1); }
}

/* ========================================================
   STUDIO 1: VIDEO EDITING STUDIO LAYOUT
   ======================================================== */
.video-layout {
  display: grid;
  grid-template-columns: 270px 1fr;
  grid-template-rows: 1fr 220px;
  gap: 10px;
  width: 100%;
  height: 100%;
}

.video-layout > * {
  min-width: 0;
  min-height: 0;
}

/* Sidebar Panels */
.sidebar-panel {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
}

.sidebar-panel::-webkit-scrollbar {
  width: 4px;
}
.sidebar-panel::-webkit-scrollbar-thumb {
  background: rgba(0, 255, 163, 0.2);
  border-radius: 4px;
}

.panel-header {
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 8px;
}

.panel-header h3 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--neon-green);
}

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

.tool-group-title {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.quick-add-grid, .transform-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.btn-tool-action, .btn-transform {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: linear-gradient(180deg, rgba(50,50,50,0.9) 0%, rgba(20,20,20,1) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 
    inset 0 1px 2px rgba(255,255,255,0.2),
    0 4px 6px rgba(0,0,0,0.6);
  padding: 8px;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.btn-tool-action:hover, .btn-transform:hover {
  background: linear-gradient(180deg, rgba(60,60,60,1) 0%, rgba(30,30,30,1) 100%);
  border-color: var(--neon-green);
  color: var(--neon-green);
  transform: translateY(-2px);
  box-shadow: 
    inset 0 1px 2px rgba(255,255,255,0.3),
    0 6px 10px rgba(0,255,163,0.3);
}

.btn-tool-action:active, .btn-transform:active {
  transform: translateY(1px);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.8);
}

.speed-presets {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}

.lut-chips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
  gap: 8px;
  max-height: 250px;
  overflow-y: auto;
  padding-right: 4px;
}
.lut-chips-grid::-webkit-scrollbar { width: 4px; }
.lut-chips-grid::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 4px; }

.speed-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.72rem;
  cursor: pointer;
  transition: var(--transition-fast);
}

.lut-chip {
  position: relative;
  height: 70px;
  background-color: #222;
  background-image: url('https://picsum.photos/100/100?random=1');
  background-size: cover;
  background-position: center;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  overflow: hidden;
  transition: var(--transition-fast);
  padding: 0;
  display: flex;
  align-items: flex-end;
}

.lut-chip span.filter-name {
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  width: 100%;
  text-align: center;
  font-size: 0.65rem;
  padding: 4px 2px;
  font-family: var(--font-arabic);
  backdrop-filter: blur(2px);
}

.lut-chip:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

.speed-btn.active, .lut-chip.active {
  border-color: var(--neon-green);
  color: var(--neon-green);
  font-weight: 700;
}
.lut-chip.active span.filter-name {
  color: var(--neon-green);
}

.slider-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.72rem;
  color: var(--text-secondary);
}

input[type="range"] {
  flex: 1;
  accent-color: var(--neon-green);
  cursor: pointer;
  touch-action: manipulation;
}

/* Video Stage Panel */
.video-stage-panel {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  padding: 10px;
  gap: 8px;
  overflow: hidden;
}

.stage-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 6px;
}

.aspect-ratio-selector {
  display: flex;
  align-items: center;
  gap: 6px;
}

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

.aspect-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  padding: 4px 8px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  cursor: pointer;
}

.aspect-btn.active {
  background: rgba(0, 255, 163, 0.15);
  border-color: var(--neon-green);
  color: var(--neon-green);
}

.timecode-display {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-code);
  font-size: 0.82rem;
}

.time-current {
  color: var(--neon-green);
  font-weight: 700;
}

.fps-badge {
  background: rgba(0, 240, 255, 0.15);
  color: var(--neon-cyan);
  font-size: 0.62rem;
  padding: 2px 5px;
  border-radius: 4px;
}

/* Video Viewport Wrapper */
.video-viewport-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  border-radius: var(--radius-sm);
  border: 1px dashed rgba(255, 255, 255, 0.08);
  position: relative;
  overflow: hidden;
  touch-action: none;
  min-height: 0;
}

.video-screen {
  position: relative;
  background: #030608;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.9), 0 0 15px rgba(0, 255, 163, 0.15);
  border: 1px solid rgba(0, 255, 163, 0.25);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  max-height: 100%;
}

.video-screen.ratio-9-16 {
  aspect-ratio: 9 / 16;
  height: 100%;
  width: auto;
}

.video-screen.ratio-16-9 {
  aspect-ratio: 16 / 9;
  width: 100%;
  height: auto;
}

.video-screen.ratio-1-1 {
  aspect-ratio: 1 / 1;
  height: 100%;
  width: auto;
}

#video-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.screen-overlay-elements {
  position: absolute;
  inset: 0;
  pointer-events: auto;
}

/* Draggable Screen Overlays (Touch Enabled) */
.touch-screen-layer {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  border: 1px dashed var(--neon-green);
  padding: 4px 8px;
  border-radius: 6px;
  cursor: grab;
  touch-action: none;
}

.touch-screen-layer:active {
  cursor: grabbing;
  border-color: #FFFFFF;
  box-shadow: 0 0 15px var(--neon-green);
}

.drag-handle-pill {
  font-size: 0.55rem;
  background: var(--neon-green);
  color: #060A0D;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 3px;
  pointer-events: none;
}

.touch-screen-layer .text-content {
  color: #FFFFFF;
  font-weight: 800;
  font-size: 0.85rem;
  outline: none;
}

.touch-screen-layer .sticker-content {
  color: var(--neon-cyan);
  font-family: var(--font-latin);
  font-weight: 800;
  font-size: 0.75rem;
}

/* GreenlightCut Primary Action Bar */
.glc-action-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 4px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.cap-act-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.72rem;
  cursor: pointer;
  transition: var(--transition-fast);
}

.cap-act-btn:hover {
  background: rgba(0, 255, 163, 0.15);
  border-color: var(--neon-green);
  color: var(--neon-green);
}

.cap-act-btn.btn-danger:hover {
  background: rgba(255, 51, 102, 0.2);
  border-color: var(--danger-red);
  color: var(--danger-red);
}

.cap-act-btn .act-icon {
  font-size: 0.95rem;
}

/* Transport Controls */
.transport-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding-top: 2px;
}

.t-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.85rem;
  transition: var(--transition-fast);
}

.t-btn:hover {
  background: rgba(0, 255, 163, 0.15);
  border-color: var(--neon-green);
  color: var(--neon-green);
}

.t-btn-play {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--neon-green);
  border: none;
  color: #060A0D;
  font-size: 1.05rem;
  box-shadow: 0 0 20px var(--neon-green-glow);
}

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

/* ========================================================
   TOUCH DRAGGABLE TIMELINE PANEL (GreenlightCut Style Engine)
   ======================================================== */
.timeline-container-panel {
  grid-column: 1 / -1;
  grid-row: 2;
  display: flex;
  flex-direction: column;
  padding: 8px 12px;
  overflow: hidden;
}

.timeline-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.track-count-badge, .snap-badge {
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-left: 12px;
}

.timeline-zoom {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.timeline-scroll-box {
  flex: 1;
  position: relative;
  overflow-x: auto;
  overflow-y: hidden;
  background: rgba(0, 0, 0, 0.45);
  border-radius: var(--radius-sm);
  margin-top: 6px;
  touch-action: none;
}

/* Draggable Timeline Ruler */
.timeline-ruler {
  height: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  padding-right: 140px;
  font-family: var(--font-code);
  font-size: 0.65rem;
  color: var(--text-muted);
  cursor: col-resize;
  touch-action: none;
  background: rgba(255, 255, 255, 0.02);
}

.ruler-tick {
  width: 60px;
  border-right: 1px solid rgba(255, 255, 255, 0.15);
  height: 12px;
  padding-right: 4px;
  flex-shrink: 0;
}

/* Red/Neon Touch-Draggable Playhead */
.timeline-playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 140px;
  width: 2px;
  z-index: 20;
  pointer-events: auto;
  touch-action: none;
}

.playhead-touch-handle {
  position: absolute;
  top: 0;
  left: -14px;
  width: 30px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  touch-action: none;
}

.playhead-touch-handle:active {
  cursor: grabbing;
}

.handle-cap {
  width: 14px;
  height: 14px;
  background: var(--neon-green);
  clip-path: polygon(50% 100%, 0% 0%, 100% 0%);
  box-shadow: 0 0 12px var(--neon-green);
}

.playhead-line {
  position: absolute;
  top: 18px;
  bottom: 0;
  left: 0;
  width: 2px;
  background: var(--neon-green);
  box-shadow: 0 0 8px var(--neon-green);
  pointer-events: none;
}

/* Multi Tracks Stack */
.timeline-tracks-stack {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 4px 0;
  position: relative;
}

.track-row {
  display: flex;
  height: 36px;
  align-items: center;
}

.track-header {
  width: 140px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 6px;
  font-size: 0.72rem;
  height: 100%;
}

.btn-track-mute {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.75rem;
}

.track-lane {
  flex: 1;
  position: relative;
  height: 100%;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 6px;
  margin-right: 6px;
  touch-action: none;
}

/* Touch Draggable Timeline Clips */
.timeline-clip {
  position: absolute;
  top: 2px;
  bottom: 2px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: grab;
  border: 1px solid rgba(255, 255, 255, 0.25);
  overflow: hidden;
  touch-action: none;
  transition: box-shadow 0.15s ease;
}

.timeline-clip:active {
  cursor: grabbing;
}

.timeline-clip.active-clip {
  border-color: #FFFFFF !important;
  box-shadow: 0 0 15px var(--neon-green);
  z-index: 5;
}

.clip-video {
  background: linear-gradient(90deg, rgba(0, 255, 163, 0.3) 0%, rgba(5, 223, 114, 0.18) 100%);
  border-color: var(--neon-green);
}

.clip-text {
  background: linear-gradient(90deg, rgba(0, 240, 255, 0.3) 0%, rgba(0, 180, 216, 0.18) 100%);
  border-color: var(--neon-cyan);
}

.clip-overlay {
  background: linear-gradient(90deg, rgba(157, 78, 221, 0.3) 0%, rgba(123, 44, 191, 0.18) 100%);
  border-color: var(--neon-purple);
}

.clip-audio {
  background: linear-gradient(90deg, rgba(255, 183, 3, 0.3) 0%, rgba(251, 133, 0, 0.18) 100%);
  border-color: var(--neon-gold);
}

/* Clip Trim Handles (Left and Right) */
.clip-trim-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 12px;
  background: rgba(255, 255, 255, 0.4);
  cursor: col-resize;
  touch-action: none;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
}

.clip-trim-handle::after {
  content: '';
  width: 2px;
  height: 12px;
  background: #000000;
  border-radius: 1px;
}

.clip-trim-handle.handle-left {
  left: 0;
  border-radius: 4px 0 0 4px;
}

.clip-trim-handle.handle-right {
  right: 0;
  border-radius: 0 4px 4px 0;
}

.clip-trim-handle:hover, .clip-trim-handle:active {
  background: var(--neon-green);
}

/* ========================================================
   STUDIO 2: PHOTO & DESIGN CANVAS LAYOUT
   ======================================================== */
.photo-layout {
  display: grid;
  grid-template-columns: 270px 1fr 270px;
  gap: 10px;
  width: 100%;
  height: 100%;
}

.photo-layout > * {
  min-width: 0;
  min-height: 0;
}

.canvas-presets-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 5px;
}

.canvas-preset-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.72rem;
  text-align: right;
  cursor: pointer;
  transition: var(--transition-fast);
}

.canvas-preset-btn.active {
  border-color: var(--neon-green);
  background: rgba(0, 255, 163, 0.14);
  color: var(--neon-green);
  font-weight: 700;
}

.add-elements-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.btn-element-add {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.68rem;
  cursor: pointer;
}

.btn-element-add:hover {
  background: rgba(0, 255, 163, 0.1);
  border-color: var(--glass-border);
}

.btn-element-add .elem-icon {
  font-size: 1.2rem;
}

.photo-stage-panel {
  display: flex;
  flex-direction: column;
  padding: 10px;
  gap: 8px;
  overflow: hidden;
}

.canvas-dimensions-info {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.canvas-dimensions-info strong {
  color: var(--neon-green);
}

.zoom-indicator {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-right: 6px;
}

.btn-glass-sm {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.72rem;
  cursor: pointer;
}

.btn-glass-sm:hover {
  background: rgba(0, 255, 163, 0.15);
  border-color: var(--neon-green);
  color: var(--neon-green);
}

.photo-canvas-viewport {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  border-radius: var(--radius-sm);
  border: 1px dashed rgba(255, 255, 255, 0.08);
  position: relative;
  overflow: hidden;
  touch-action: none;
}

.photo-artboard {
  position: relative;
  width: 420px;
  height: 420px;
  background: #080D11;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.9), 0 0 20px rgba(0, 255, 163, 0.15);
  border: 1px solid rgba(0, 255, 163, 0.3);
  border-radius: var(--radius-md);
  overflow: hidden;
  touch-action: none;
  transition: width 0.3s ease, height 0.3s ease;
}

.canvas-layer-item {
  position: absolute;
  cursor: grab;
  touch-action: none;
}

.canvas-layer-item:active {
  cursor: grabbing;
}

.item-bg {
  inset: 0;
  pointer-events: none;
}

.bg-gradient-mesh {
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 70% 30%, rgba(0, 255, 163, 0.25) 0%, transparent 60%),
              radial-gradient(circle at 20% 80%, rgba(0, 240, 255, 0.2) 0%, transparent 60%),
              #060A0D;
}

.cyber-avatar-box {
  width: 140px;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-glass-frame {
  width: 110px;
  height: 110px;
  background: rgba(13, 20, 26, 0.65);
  backdrop-filter: blur(15px);
  border: 2px solid var(--neon-green);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 25px var(--neon-green-glow);
}

.avatar-emoji {
  font-size: 3rem;
}

.neon-3d-text {
  font-family: var(--font-latin);
  font-size: 1.6rem;
  font-weight: 900;
  color: #FFFFFF;
  text-shadow: 0 0 10px var(--neon-green), 0 0 25px var(--neon-green);
  letter-spacing: 1px;
}

.neon-3d-sub {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--neon-cyan);
}

.floating-3d-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 255, 163, 0.2);
  border: 1px solid var(--neon-green);
  padding: 5px 10px;
  border-radius: var(--radius-full);
  box-shadow: 0 0 15px var(--neon-green-glow);
}

.badge-caption {
  font-family: var(--font-latin);
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--neon-green);
}

/* Layers Stack Sidebar */
.layers-panel {
  display: flex;
  flex-direction: column;
}

.layers-blend-bar {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(0, 0, 0, 0.3);
  padding: 8px;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
}

.glass-select {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
  padding: 5px 8px;
  border-radius: 4px;
  font-family: inherit;
}

.layers-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
  overflow-y: auto;
  padding: 4px 0;
}

.layer-card {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.layer-card.active {
  border-color: var(--neon-green);
  background: rgba(0, 255, 163, 0.14);
}

.layer-vis-btn, .layer-lock-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.8rem;
}

.layer-thumb {
  font-size: 1rem;
}

.layer-meta {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.layer-title {
  font-size: 0.75rem;
  font-weight: 700;
}

.layer-sub {
  font-size: 0.62rem;
  color: var(--text-muted);
}

.layers-footer-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 5px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 6px;
}

.btn-layer-tool {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  padding: 5px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.72rem;
  cursor: pointer;
}

/* ========================================================
   STUDIO 3: GARAGEBAND & LOGIC PRO MUSIC WORKSTATION
   ======================================================== */
.music-layout-gb {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  background: #18191c;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* 1. Top Master Bar */
.gb-master-bar {
  height: 52px;
  background: linear-gradient(180deg, #383a3f 0%, #26272b 100%);
  border-bottom: 1px solid #141517;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  gap: 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 2px 8px rgba(0, 0, 0, 0.4);
  z-index: 20;
}

.gb-bar-left, .gb-bar-right, .gb-bar-mid-tools {
  display: flex;
  align-items: center;
  gap: 6px;
}

.gb-icon-btn {
  width: 32px;
  height: 30px;
  background: linear-gradient(180deg, #44474d 0%, #2d2f34 100%);
  border: 1px solid #1c1d20;
  border-radius: 5px;
  color: #d1d5db;
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 2px rgba(0,0,0,0.5);
  transition: all 0.1s;
}

.gb-icon-btn:hover {
  background: linear-gradient(180deg, #50545c 0%, #36393f 100%);
  color: #fff;
}

.gb-icon-btn.active {
  background: linear-gradient(180deg, #1b3d68 0%, #0d233e 100%);
  border-color: #3b82f6;
  color: #60a5fa;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.6), 0 0 8px rgba(59, 130, 246, 0.4);
}

/* Transport Controls */
.gb-transport-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.gb-t-btn {
  width: 34px;
  height: 32px;
  background: linear-gradient(180deg, #484b52 0%, #2c2e33 100%);
  border: 1px solid #161719;
  border-radius: 5px;
  color: #e5e7eb;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 2px 4px rgba(0,0,0,0.4);
}

.gb-t-btn:active {
  transform: translateY(1px);
}

.gb-btn-play.playing {
  background: linear-gradient(180deg, #166534 0%, #14532d 100%) !important;
  color: #4ade80 !important;
  border-color: #22c55e !important;
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.5) !important;
}

.gb-btn-rec.recording {
  background: linear-gradient(180deg, #991b1b 0%, #7f1d1d 100%) !important;
  color: #f87171 !important;
  border-color: #ef4444 !important;
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.6) !important;
}

.gb-t-btn.active {
  background: linear-gradient(180deg, #1e3a8a 0%, #172554 100%);
  border-color: #3b82f6;
  color: #93c5fd;
}

/* Apple LCD Display Center */
.gb-lcd-display {
  display: flex;
  align-items: center;
  background: #09131f;
  border: 1px solid #1e3a5f;
  border-radius: 6px;
  padding: 4px 12px;
  height: 36px;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.8), 0 1px 0 rgba(255, 255, 255, 0.1);
}

.lcd-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
}

.lcd-val {
  font-family: var(--font-code), 'SF Pro Display', sans-serif;
  font-size: 0.95rem;
  font-weight: 800;
  color: #38bdf8;
  text-shadow: 0 0 8px rgba(56, 189, 248, 0.7);
  letter-spacing: 1px;
}

.lcd-lbl {
  font-size: 0.55rem;
  font-weight: 700;
  color: #0284c7;
  letter-spacing: 0.5px;
}

.lcd-divider {
  width: 1px;
  height: 22px;
  background: #1e3a5f;
}

.gb-master-vol-box {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(0, 0, 0, 0.4);
  padding: 3px 8px;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.gb-master-vol-box input[type="range"] {
  width: 70px;
  height: 4px;
  accent-color: #38bdf8;
}

/* 2. Middle Multi-Track Arrange Area */
.gb-workspace-split {
  flex: 1;
  display: flex;
  min-height: 0;
  background: #1a1c20;
  border-bottom: 1px solid #111;
  overflow: hidden;
}

.gb-tracks-headers {
  width: 270px;
  background: #23252a;
  border-right: 1px solid #161719;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  user-select: none;
}

.gb-tracks-top-action {
  height: 28px;
  background: #2b2e35;
  border-bottom: 1px solid #1a1c20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
}

.btn-add-gb-track {
  background: transparent;
  border: none;
  color: #9ca3af;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-add-gb-track:hover {
  color: #38bdf8;
}

.gb-automation-btn {
  background: transparent;
  border: none;
  color: #eab308;
  font-size: 0.85rem;
  cursor: pointer;
}

.gb-track-headers-list {
  display: flex;
  flex-direction: column;
}

.gb-track-header-item {
  height: 48px;
  background: #202227;
  border-bottom: 1px solid #151618;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 4px 10px;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: all 0.1s;
}

.gb-track-header-item:hover {
  background: #282a30;
}

.gb-track-header-item.active {
  background: #2f323a;
  border-left-color: #38bdf8;
}

.tr-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #f3f4f6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tr-icon {
  font-size: 0.95rem;
}

.tr-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 3px;
}

.tr-btn {
  width: 18px;
  height: 16px;
  background: #374151;
  border: 1px solid #1f2937;
  border-radius: 3px;
  color: #9ca3af;
  font-size: 0.58rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.tr-btn.tr-mute.active {
  background: #3b82f6;
  color: #fff;
}

.tr-btn.tr-solo.active {
  background: #eab308;
  color: #000;
}

.tr-btn.tr-rec.active {
  background: #ef4444;
  color: #fff;
}

.tr-vol {
  flex: 1;
  height: 3px;
  accent-color: #38bdf8;
}

.tr-pan-knob {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #374151;
  border: 1px solid #1f2937;
  position: relative;
}

.tr-pan-knob::after {
  content: '';
  position: absolute;
  top: 1px;
  left: 6px;
  width: 2px;
  height: 5px;
  background: #38bdf8;
  border-radius: 1px;
}

/* Timeline Arrange Grid */
.gb-arrange-timeline {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: auto;
  overflow-y: auto;
  background: #151619;
}

.gb-bars-ruler {
  height: 28px;
  background: #1f2126;
  border-bottom: 1px solid #111;
  display: flex;
  position: sticky;
  top: 0;
  z-index: 10;
}

.ruler-bar-num {
  width: 70px;
  border-right: 1px solid #2d3036;
  color: #6b7280;
  font-size: 0.65rem;
  font-family: var(--font-code);
  font-weight: 700;
  padding: 4px 6px;
}

/* Playhead */
.gb-playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 20px;
  width: 1px;
  z-index: 15;
  pointer-events: none;
  transition: left 0.1s linear;
}

.gb-playhead-cap {
  position: absolute;
  top: 0;
  left: -6px;
  width: 13px;
  height: 14px;
  background: #e11d48;
  clip-path: polygon(0 0, 100% 0, 100% 70%, 50% 100%, 0 70%);
}

.gb-playhead-line {
  position: absolute;
  top: 14px;
  bottom: 0;
  left: 0;
  width: 1.5px;
  background: #e11d48;
  box-shadow: 0 0 6px #e11d48;
}

.gb-lanes-stack {
  display: flex;
  flex-direction: column;
}

.gb-track-lane {
  height: 48px;
  border-bottom: 1px solid #1c1d21;
  position: relative;
  background-image: linear-gradient(to right, #1f2126 1px, transparent 1px);
  background-size: 35px 48px;
}

.gb-track-lane.active-lane {
  background-color: rgba(56, 189, 248, 0.04);
}

.gb-midi-region {
  position: absolute;
  top: 6px;
  bottom: 6px;
  border-radius: 4px;
  padding: 4px 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: grab;
  box-shadow: 0 2px 6px rgba(0,0,0,0.5);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.region-green { background: linear-gradient(180deg, #15803d 0%, #166534 100%); border-color: #22c55e; }
.region-gold { background: linear-gradient(180deg, #b45309 0%, #92400e 100%); border-color: #f59e0b; }
.region-purple { background: linear-gradient(180deg, #6d28d9 0%, #5b21b6 100%); border-color: #8b5cf6; }
.region-red { background: linear-gradient(180deg, #b91c1c 0%, #991b1b 100%); border-color: #ef4444; }
.region-cyan { background: linear-gradient(180deg, #0369a1 0%, #075985 100%); border-color: #0284c7; }
.region-orange { background: linear-gradient(180deg, #c2410c 0%, #9a3412 100%); border-color: #f97316; }

.region-title {
  font-size: 0.65rem;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.midi-note-blocks {
  position: relative;
  height: 16px;
  width: 100%;
}

.m-note {
  position: absolute;
  height: 3px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 1px;
}

/* 3. Bottom Dock: Inspector & On-Screen Keyboard */
.gb-bottom-dock {
  height: 240px;
  display: flex;
  background: #1a1c20;
  border-top: 1px solid #111;
  min-height: 0;
}

/* Inspector Panel */
.gb-inspector-panel {
  width: 270px;
  background: #222429;
  border-right: 1px solid #141517;
  display: flex;
  flex-direction: column;
}

.gb-inspector-tabs {
  height: 30px;
  background: #2b2d34;
  border-bottom: 1px solid #18191c;
  display: flex;
}

.insp-tab {
  flex: 1;
  background: transparent;
  border: none;
  color: #9ca3af;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}

.insp-tab.active {
  color: #38bdf8;
  background: #222429;
  border-bottom-color: #38bdf8;
}

.gb-inspector-body {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
}

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

.insp-label-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.68rem;
  color: #d1d5db;
}

.gb-slider {
  accent-color: #38bdf8;
}

.insp-ticks {
  display: flex;
  justify-content: space-between;
  font-size: 0.58rem;
  color: #6b7280;
}

.insp-header-mini {
  font-size: 0.7rem;
  font-weight: 700;
  color: #38bdf8;
  margin-bottom: 2px;
}

.gb-plugins-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.plugin-item {
  background: #2a2d33;
  border: 1px solid #1a1b1e;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 0.68rem;
  color: #9ca3af;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.plugin-item.active {
  color: #f3f4f6;
  border-color: #38bdf8;
}

.pl-dot {
  color: #38bdf8;
  font-size: 0.75rem;
}

/* On-Screen Keyboard Window */
.gb-keyboard-window {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #18191c;
  min-width: 0;
}

.gb-win-header {
  height: 28px;
  background: linear-gradient(180deg, #37393f 0%, #292b30 100%);
  border-bottom: 1px solid #141517;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
}

.gb-mac-dots {
  display: flex;
  gap: 5px;
}

.dot-red, .dot-yellow, .dot-green {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot-red { background: #ef4444; }
.dot-yellow { background: #f59e0b; }
.dot-green { background: #10b981; }

.gb-win-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: #f3f4f6;
}

.gb-mini-keyboard-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.mini-nav-btn {
  background: #374151;
  border: 1px solid #1f2937;
  color: #9ca3af;
  border-radius: 3px;
  font-size: 0.6rem;
  padding: 2px 6px;
  cursor: pointer;
}

.mini-key-bar {
  width: 90px;
  height: 12px;
  background: #111827;
  border: 1px solid #374151;
  border-radius: 2px;
  position: relative;
}

.mini-octave-zone {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 30px;
  width: 30px;
  background: rgba(56, 189, 248, 0.6);
  border: 1px solid #38bdf8;
  border-radius: 1px;
}

/* Instrument Selector Bar (All 7 Instruments) */
.gb-instruments-bar {
  display: flex;
  gap: 4px;
  padding: 4px 8px;
  background: #202227;
  border-bottom: 1px solid #151618;
  overflow-x: auto;
}

.gb-inst-chip {
  background: #2a2d33;
  border: 1px solid #373a40;
  border-radius: 4px;
  color: #9ca3af;
  padding: 4px 10px;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.1s;
}

.gb-inst-chip:hover {
  color: #f3f4f6;
  background: #363940;
}

.gb-inst-chip.active {
  background: linear-gradient(180deg, #0284c7 0%, #0369a1 100%);
  border-color: #38bdf8;
  color: #fff;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
}

.chip-icon {
  font-size: 0.95rem;
}

/* Realistic 3D Multi-Octave Piano Bed */
.gb-keys-viewport {
  flex: 1;
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  background: #0d0e11;
  padding: 4px 4px 6px 4px;
}

.gb-piano-bed {
  display: flex;
  position: relative;
  flex: 1;
  min-width: 900px;
  height: 100%;
  background: #000;
  border-radius: 4px;
  box-shadow: inset 0 6px 12px rgba(0,0,0,0.8);
  user-select: none;
}

/* Authentic White Keys */
.gb-key-white {
  flex: 1;
  height: 100%;
  background: linear-gradient(180deg, #f8fafc 0%, #e2e8f0 85%, #cbd5e1 100%);
  border-right: 1px solid #94a3b8;
  border-bottom: 4px solid #64748b;
  border-radius: 0 0 5px 5px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 8px;
  color: #475569;
  font-family: var(--font-code);
  font-weight: 800;
  font-size: 0.75rem;
  cursor: pointer;
  position: relative;
  box-shadow: inset 0 2px 2px rgba(255,255,255,0.8), 0 3px 6px rgba(0,0,0,0.3);
  transition: transform 0.05s, background 0.05s;
}

.gb-key-white:active, .gb-key-white.key-pressed {
  background: linear-gradient(180deg, #bae6fd 0%, #38bdf8 100%) !important;
  color: #0369a1 !important;
  border-bottom-width: 1px !important;
  transform: translateY(3px) !important;
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.6) !important;
}

/* Authentic Black Keys */
.gb-key-black {
  position: absolute;
  width: 28px;
  height: 62%;
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 75%, #020617 100%);
  border: 1px solid #000;
  border-bottom: 4px solid #0f172a;
  border-radius: 0 0 4px 4px;
  z-index: 5;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 6px;
  color: #64748b;
  font-size: 0.58rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.2), 0 6px 10px rgba(0,0,0,0.9);
  transition: transform 0.05s, background 0.05s;
}

.gb-key-black:active, .gb-key-black.key-pressed {
  background: linear-gradient(180deg, #0284c7 0%, #0369a1 100%) !important;
  color: #e0f2fe !important;
  border-bottom-width: 1px !important;
  transform: translateY(2px) !important;
  box-shadow: 0 0 15px rgba(2, 132, 199, 0.8) !important;
}

.mixer-channels-stack {
  display: flex;
  align-items: center;
  justify-content: space-around;
  flex: 1;
}

.mixer-channel-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 4px 12px;
  border-radius: var(--radius-sm);
}

.chan-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 700;
}

.chan-buttons {
  display: flex;
  gap: 4px;
}

.chan-btn {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-secondary);
  font-size: 0.62rem;
  font-weight: 800;
  cursor: pointer;
}

.chan-fader-box {
  display: flex;
  align-items: center;
  gap: 6px;
}

.chan-db {
  font-family: var(--font-code);
  font-size: 0.65rem;
  color: var(--text-muted);
}

/* ========================================================
   MODAL & TOASTS
   ======================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-backdrop.hidden {
  display: none;
}

.modal-glass-card {
  width: 500px;
  max-width: 92vw;
  background: #0B1217;
  border: 1px solid var(--neon-green);
  box-shadow: 0 0 50px rgba(0, 255, 163, 0.25);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.modal-title-box {
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-title-box h3 {
  font-size: 1rem;
  color: var(--neon-green);
}

.btn-close-modal {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 1.1rem;
  cursor: pointer;
}

.export-setting-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.export-setting-group label {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.export-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip-option {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.72rem;
  cursor: pointer;
}

.chip-option.active {
  background: rgba(0, 255, 163, 0.2);
  border-color: var(--neon-green);
  color: var(--neon-green);
  font-weight: 700;
}

.export-render-box {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(0, 255, 163, 0.2);
  border-radius: var(--radius-sm);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.export-render-box.hidden {
  display: none;
}

.render-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.render-info strong {
  color: var(--neon-green);
}

.render-progress-track {
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
}

.render-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--neon-green) 0%, var(--neon-cyan) 100%);
  box-shadow: 0 0 15px var(--neon-green);
  transition: width 0.1s linear;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 10px;
}

/* Toast Notifications */
.toast-notification {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: rgba(13, 20, 26, 0.95);
  backdrop-filter: blur(15px);
  border: 1px solid var(--neon-green);
  box-shadow: 0 0 30px var(--neon-green-glow);
  padding: 8px 18px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 200;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

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

.toast-icon {
  font-size: 1rem;
}

.toast-message {
  font-size: 0.8rem;
  font-weight: 700;
  color: #FFFFFF;
}
/* --- Storyboard Mode (Windows Movie Maker Style) --- */
.storyboard-container {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px;
  overflow-x: auto;
  overflow-y: hidden;
  height: 100%;
  background: radial-gradient(circle at center, rgba(30,30,30,0.8), rgba(10,10,10,0.95));
}

.storyboard-box {
  flex: 0 0 160px;
  height: 120px;
  background: linear-gradient(145deg, #222, #111);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  box-shadow: 
    inset 0 0 10px rgba(0,0,0,0.8),
    0 5px 15px rgba(0,0,0,0.5);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s ease;
}

.storyboard-box:hover {
  transform: scale(1.05);
  border-color: var(--neon-cyan);
  box-shadow: 0 8px 25px rgba(0, 240, 255, 0.4);
}

.storyboard-box.active {
  border-color: var(--neon-green);
  box-shadow: 0 0 20px rgba(0, 255, 163, 0.5);
}

.storyboard-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.8;
}

.storyboard-title {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.7);
  color: white;
  font-size: 0.7rem;
  padding: 4px;
  text-align: center;
  font-family: var(--font-code);
}

.storyboard-transition {
  flex: 0 0 40px;
  height: 40px;
  background: linear-gradient(135deg, rgba(50,50,50,0.8), rgba(20,20,20,0.9));
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: inset 1px 1px 3px rgba(255,255,255,0.2), 0 2px 5px rgba(0,0,0,0.5);
  transition: transform 0.2s;
}

.storyboard-transition:hover {
  transform: scale(1.2);
  border-color: var(--neon-green);
  color: var(--neon-green);
}

.storyboard-transition.has-transition {
  background: linear-gradient(135deg, var(--neon-emerald), var(--neon-green));
  color: #000;
  border: none;
}

/* ========================================================
   AI MONTAGE ENGINE - MODAL & EFFECTS
   ======================================================== */

/* AI Modal Card */
.ai-modal-card {
  max-width: 520px !important;
  border: 1px solid rgba(0, 255, 163, 0.3) !important;
  box-shadow: 0 0 60px rgba(0, 255, 163, 0.15), 0 25px 80px rgba(0, 0, 0, 0.8) !important;
}

.ai-icon-pulse {
  animation: aiIconPulse 1.5s ease-in-out infinite;
}

@keyframes aiIconPulse {
  0%, 100% { transform: scale(1); filter: brightness(1); }
  50% { transform: scale(1.15); filter: brightness(1.4) drop-shadow(0 0 8px rgba(0, 255, 163, 0.6)); }
}

/* AI Status Text */
.ai-status-text {
  font-family: var(--font-primary);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--neon-green);
  text-align: center;
  margin-bottom: 16px;
  text-shadow: 0 0 12px rgba(0, 255, 163, 0.4);
  min-height: 24px;
  transition: all 0.3s ease;
}

/* AI Progress Bar */
.ai-progress-track {
  width: 100%;
  height: 10px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.ai-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #00FFA3, #00B4D8, #9D4EDD, #FF3366, #FFB703);
  background-size: 300% 100%;
  border-radius: 10px;
  transition: width 0.4s ease;
  animation: aiProgressShimmer 2s linear infinite;
  position: relative;
}

.ai-progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 30px;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5));
  border-radius: 10px;
  animation: aiProgressPulse 1s ease-in-out infinite;
}

@keyframes aiProgressShimmer {
  0% { background-position: 0% 0%; }
  100% { background-position: 300% 0%; }
}

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

.ai-progress-glow {
  position: absolute;
  top: -2px;
  left: 0;
  right: 0;
  bottom: -2px;
  border-radius: 12px;
  pointer-events: none;
  box-shadow: 0 0 15px rgba(0, 255, 163, 0.3);
}

.ai-progress-pct {
  text-align: center;
  font-family: var(--font-code);
  font-size: 1.4rem;
  font-weight: 900;
  color: #fff;
  margin-top: 8px;
  text-shadow: 0 0 15px rgba(0, 255, 163, 0.5);
}

/* AI Steps List */
.ai-steps-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 18px;
  max-height: 280px;
  overflow-y: auto;
  padding-right: 4px;
}

.ai-step-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  transition: all 0.3s ease;
  font-size: 0.82rem;
}

.ai-step-item.active {
  background: rgba(0, 255, 163, 0.08);
  border-color: rgba(0, 255, 163, 0.3);
  box-shadow: 0 0 12px rgba(0, 255, 163, 0.1);
}

.ai-step-item.active .step-icon {
  animation: stepIconBounce 0.6s ease infinite;
}

.ai-step-item.done {
  background: rgba(0, 255, 163, 0.05);
  border-color: rgba(0, 255, 163, 0.15);
  opacity: 0.75;
}

.ai-step-item.done .step-status {
  color: #00FFA3;
}

.step-icon {
  font-size: 1.1rem;
  min-width: 24px;
  text-align: center;
}

.step-text {
  flex: 1;
  color: var(--text-primary);
  font-weight: 600;
}

.step-status {
  font-size: 0.9rem;
  min-width: 24px;
  text-align: center;
}

@keyframes stepIconBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

/* AI Engine Badge */
.ai-engine-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  color: rgba(0, 255, 163, 0.7);
  font-family: var(--font-code);
}

.ai-engine-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #00FFA3;
  box-shadow: 0 0 8px #00FFA3;
  animation: aiDotPulse 1.2s ease-in-out infinite;
}

@keyframes aiDotPulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 4px #00FFA3; }
  50% { opacity: 0.5; box-shadow: 0 0 12px #00FFA3, 0 0 20px rgba(0, 255, 163, 0.3); }
}

/* AI Particles Canvas Layer */
.ai-particles-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* AI Button Glow Effect (active state) */
.btn-tool-action.ai-processing {
  pointer-events: none;
  opacity: 0.7;
  animation: aiBtnProcess 1s ease-in-out infinite;
}

@keyframes aiBtnProcess {
  0%, 100% { box-shadow: 0 0 5px rgba(0, 255, 163, 0.2); }
  50% { box-shadow: 0 0 20px rgba(0, 255, 163, 0.5), 0 0 40px rgba(0, 255, 163, 0.2); }
}

/* AI Success Flash */
.btn-tool-action.ai-success {
  animation: aiSuccessFlash 0.8s ease forwards;
}

@keyframes aiSuccessFlash {
  0% { background: rgba(0, 255, 163, 0.3); transform: scale(1); }
  30% { background: rgba(0, 255, 163, 0.5); transform: scale(1.05); }
  100% { background: initial; transform: scale(1); }
}

/* AI Complete Celebration Overlay */
.ai-celebration-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 99999;
  background: radial-gradient(circle at center, rgba(0, 255, 163, 0.08), transparent 70%);
  animation: celebrationFade 2s ease forwards;
}

@keyframes celebrationFade {
  0% { opacity: 0; }
  20% { opacity: 1; }
  100% { opacity: 0; }
}

/* ========================================================
   MOBILE TOOLS FAB & BACKDROP (Hidden on Desktop)
   ======================================================== */
.mobile-tools-fab {
  display: none;
}

.mobile-backdrop {
  display: none;
}

/* ========================================================
   MOBILE RESPONSIVE - COMPLETE REDESIGN
   ======================================================== */
@media screen and (max-width: 768px) {

  /* === BASE OVERRIDES === */
  body.dark-theme {
    overflow-y: auto;
    overflow-x: hidden;
  }

  .app-root {
    height: auto;
    min-height: 100vh;
    max-height: none;
    overflow: visible;
    padding-bottom: 64px;
  }

  /* Hide ambient decorations on mobile for performance */
  .ambient-glow,
  .ambient-grid-overlay {
    display: none;
  }

  /* === TOP NAV BAR → COMPACT MOBILE HEADER === */
  .top-nav-bar {
    flex-wrap: wrap;
    padding: 6px 10px;
    margin: 4px 6px 0 6px;
    border-radius: 12px;
    gap: 6px;
  }

  .nav-left {
    gap: 8px;
    flex: 1;
    min-width: 0;
  }

  .brand-logo {
    gap: 8px;
  }

  .logo-brand-wrap {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    flex-shrink: 0;
  }

  .brand-text {
    display: none;
  }

  .offline-badge {
    display: none;
  }

  /* === STUDIO NAV TABS → BOTTOM TAB BAR === */
  .studio-nav-tabs {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    border-radius: 0;
    padding: 4px 6px;
    background: rgba(6, 10, 13, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: none;
    border-top: 1px solid rgba(0, 255, 163, 0.15);
    justify-content: space-around;
    gap: 4px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.6);
  }

  .nav-tab {
    flex-direction: column;
    gap: 2px;
    padding: 6px 4px;
    border-radius: 10px;
    flex: 1;
    justify-content: center;
    font-size: 0.65rem;
    min-height: 50px;
  }

  .nav-tab .tab-3d-icon {
    font-size: 1.3rem;
  }

  .nav-tab .tab-title {
    font-size: 0.6rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 80px;
    text-align: center;
  }

  .nav-tab .tab-badge {
    display: none;
  }

  .nav-tab.active {
    box-shadow: 0 0 10px var(--neon-green-glow);
  }

  /* === NAV RIGHT ACTIONS → COMPACT === */
  .nav-right {
    gap: 6px;
  }

  .nav-right .btn-glass-icon {
    padding: 6px 10px;
    font-size: 0.75rem;
  }

  .nav-right .btn-glass-icon .btn-text {
    display: none;
  }

  .nav-right .btn-neon-cta {
    padding: 6px 10px;
    font-size: 0.72rem;
  }

  .nav-right .btn-neon-cta span:last-child {
    display: none;
  }

  .nav-right .btn-neon-cta .icon {
    margin: 0;
  }

  /* === MOBILE FAB BUTTON === */
  .mobile-tools-fab {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    bottom: 74px;
    right: 14px;
    z-index: 9998;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00FFA3, #00B4D8);
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 20px rgba(0, 255, 163, 0.5), 0 8px 30px rgba(0, 0, 0, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
  }

  .mobile-tools-fab:active {
    transform: scale(0.92);
  }

  .mobile-tools-fab .fab-icon {
    font-size: 1.4rem;
  }

  .mobile-tools-fab.fab-active {
    background: linear-gradient(135deg, #FF3366, #9D4EDD);
  }

  .mobile-tools-fab.fab-active .fab-icon::after {
    content: '✕';
  }

  .mobile-tools-fab.fab-active .fab-icon {
    font-size: 0;
  }

  .mobile-tools-fab.fab-active .fab-icon::after {
    font-size: 1.4rem;
  }

  /* === MOBILE BACKDROP === */
  .mobile-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9990;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }

  .mobile-backdrop.visible {
    opacity: 1;
    pointer-events: auto;
  }

  /* === MASTER WORKSPACE === */
  .master-workspace {
    padding: 4px 6px 8px 6px;
    overflow: visible;
  }

  .studio-section.active {
    flex-direction: column;
  }

  /* ========================================================
     VIDEO LAYOUT - MOBILE STACK
     ======================================================== */
  .video-layout {
    display: flex !important;
    flex-direction: column !important;
    gap: 6px;
    height: auto;
    min-height: calc(100vh - 140px);
  }

  /* === SIDEBAR → SLIDE DRAWER === */
  .video-layout > .sidebar-panel {
    position: fixed;
    top: 0;
    right: -100%;
    width: 85%;
    max-width: 340px;
    height: 100vh;
    z-index: 9995;
    border-radius: 0;
    margin: 0;
    padding: 16px 12px;
    transition: right 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: rgba(6, 10, 13, 0.97);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-left: 1px solid rgba(0, 255, 163, 0.2);
  }

  .video-layout > .sidebar-panel.drawer-open {
    right: 0;
  }

  /* Sidebar tool grids - bigger buttons for touch */
  .quick-add-grid,
  .transform-actions-grid {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
  }

  .btn-tool-action,
  .btn-transform {
    padding: 12px 6px;
    font-size: 0.75rem;
    min-height: 48px;
    flex-direction: column;
    text-align: center;
    gap: 4px;
    border-radius: 10px;
  }

  .btn-tool-action .action-icon,
  .btn-transform .action-icon {
    font-size: 1.2rem;
  }

  .tool-group-title {
    font-size: 0.8rem;
    font-weight: 700;
    padding: 6px 0 2px 0;
    color: var(--neon-green);
  }

  /* Speed presets mobile */
  .speed-presets {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .speed-btn {
    padding: 10px 8px;
    font-size: 0.8rem;
    min-height: 42px;
  }

  /* LUT filters grid - larger on mobile */
  .lut-chips-grid {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
    max-height: 300px;
  }

  .lut-chip {
    height: 80px;
    border-radius: 10px;
  }

  /* Sliders mobile - larger hit area */
  .slider-row {
    font-size: 0.8rem;
    padding: 4px 0;
  }

  input[type="range"] {
    height: 20px;
  }

  /* === VIDEO STAGE PANEL === */
  .video-stage-panel {
    grid-column: unset;
    grid-row: unset;
    padding: 6px;
    gap: 6px;
    flex: none;
  }

  .stage-header {
    flex-wrap: wrap;
    gap: 6px;
  }

  .aspect-ratio-selector {
    gap: 4px;
    flex-wrap: wrap;
  }

  .aspect-btn {
    padding: 6px 10px;
    font-size: 0.75rem;
    min-height: 32px;
  }

  .timecode-display {
    font-size: 0.75rem;
  }

  /* Video viewport - full width */
  .video-viewport-wrapper {
    min-height: 200px;
    max-height: 45vh;
    border-radius: 10px;
  }

  .video-screen {
    border-radius: 8px;
  }

  /* Action bar - horizontal scroll */
  .glc-action-bar {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 6px;
    padding: 6px 2px;
    flex-wrap: nowrap;
    justify-content: flex-start;
  }

  .cap-act-btn {
    padding: 8px 12px;
    font-size: 0.72rem;
    flex-shrink: 0;
    min-height: 44px;
    min-width: 60px;
    border-radius: 10px;
  }

  .cap-act-btn .act-icon {
    font-size: 1.1rem;
  }

  /* Transport controls - bigger */
  .transport-controls {
    gap: 10px;
    padding: 6px 0;
  }

  .t-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    font-size: 1rem;
  }

  .t-btn-play {
    width: 52px;
    height: 52px;
    font-size: 1.3rem;
  }

  /* ========================================================
     TIMELINE - MOBILE (Fixed Height)
     ======================================================== */
  .timeline-container-panel {
    grid-column: unset;
    grid-row: unset;
    padding: 6px 8px;
    flex: none;
    min-height: 160px;
    max-height: 200px;
  }

  .timeline-toolbar {
    flex-wrap: wrap;
    gap: 4px;
    padding-bottom: 4px;
  }

  .timeline-toolbar .btn-glass-sm {
    padding: 6px 10px;
    font-size: 0.72rem;
    min-height: 32px;
  }

  .timeline-zoom {
    display: none;
  }

  .timeline-scroll-box {
    touch-action: pan-x;
    -webkit-overflow-scrolling: touch;
  }

  .track-header {
    width: 80px;
    font-size: 0.62rem;
    padding: 0 4px;
  }

  .track-row {
    height: 40px;
  }

  .timeline-clip {
    font-size: 0.65rem;
    padding: 0 6px;
    min-width: 50px;
  }

  .clip-trim-handle {
    width: 16px;
  }

  .ruler-tick {
    width: 50px;
  }

  /* Storyboard mobile */
  .storyboard-container {
    padding: 10px;
    gap: 8px;
  }

  .storyboard-box {
    flex: 0 0 130px;
    height: 100px;
    border-radius: 10px;
  }

  /* ========================================================
     PHOTO STUDIO - MOBILE STACK
     ======================================================== */
  .photo-layout {
    display: flex !important;
    flex-direction: column !important;
    gap: 6px;
    height: auto;
  }

  .photo-layout > .sidebar-panel {
    position: fixed;
    top: 0;
    right: -100%;
    width: 85%;
    max-width: 340px;
    height: 100vh;
    z-index: 9995;
    border-radius: 0;
    margin: 0;
    padding: 16px 12px;
    transition: right 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: rgba(6, 10, 13, 0.97);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-left: 1px solid rgba(0, 255, 163, 0.2);
  }

  .photo-layout > .sidebar-panel.drawer-open {
    right: 0;
  }

  .photo-stage-panel {
    order: -1;
    padding: 6px;
  }

  .photo-canvas-viewport {
    min-height: 280px;
    max-height: 50vh;
  }

  .photo-artboard {
    width: 100% !important;
    max-width: 320px;
    height: auto !important;
    aspect-ratio: 1/1;
  }

  .canvas-presets-grid {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }

  .canvas-preset-btn {
    padding: 10px;
    font-size: 0.78rem;
    min-height: 42px;
  }

  .add-elements-grid {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 6px;
  }

  .btn-element-add {
    padding: 10px 6px;
    font-size: 0.72rem;
    min-height: 48px;
    border-radius: 10px;
  }

  .btn-element-add .elem-icon {
    font-size: 1.3rem;
  }

  /* Layers panel mobile */
  .layers-panel {
    max-height: 300px;
  }

  .layer-card {
    padding: 10px 12px;
    gap: 10px;
  }

  .layers-footer-actions {
    gap: 6px;
  }

  .btn-layer-tool {
    padding: 8px;
    font-size: 0.78rem;
    min-height: 38px;
  }

  /* ========================================================
     MUSIC DAW - MOBILE STACK
     ======================================================== */
  .music-layout-gb {
    height: auto;
    min-height: calc(100vh - 140px);
  }

  .gb-master-bar {
    flex-wrap: wrap;
    height: auto;
    padding: 6px 8px;
    gap: 6px;
  }

  .gb-lcd-display {
    order: -1;
    width: 100%;
    justify-content: center;
  }

  .gb-workspace-split {
    flex-direction: column;
    overflow: visible;
  }

  .gb-tracks-headers {
    width: 100%;
    flex-direction: row;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-right: none;
    border-bottom: 1px solid #161719;
  }

  .gb-tracks-top-action {
    display: none;
  }

  .gb-track-headers-list {
    flex-direction: row;
  }

  .gb-track-header-item {
    height: auto;
    min-width: 120px;
    flex-shrink: 0;
    padding: 6px 10px;
    border-left: none;
    border-bottom: 3px solid transparent;
  }

  .gb-track-header-item.active {
    border-bottom-color: #38bdf8;
    border-left-color: transparent;
  }

  .gb-arrange-timeline {
    min-height: 150px;
  }

  .gb-bottom-dock {
    flex-direction: column;
    height: auto;
  }

  .gb-inspector-panel {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid #141517;
    max-height: 200px;
  }

  .gb-keyboard-window {
    min-height: 180px;
  }

  /* Piano keys - touch friendly */
  .gb-keys-viewport {
    height: 160px;
  }

  .gb-icon-btn {
    width: 36px;
    height: 34px;
    font-size: 0.9rem;
  }

  .gb-t-btn {
    width: 38px;
    height: 36px;
    font-size: 1rem;
  }

  /* Instrument chips - touch friendly */
  .gb-inst-chip {
    padding: 8px 12px;
    font-size: 0.78rem;
    min-height: 38px;
  }

  /* ========================================================
     MODALS - MOBILE OPTIMIZED
     ======================================================== */
  .modal-backdrop {
    align-items: flex-end;
    padding: 0;
  }

  .modal-glass-card {
    max-width: 100% !important;
    width: 100% !important;
    border-radius: 16px 16px 0 0 !important;
    max-height: 85vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .modal-body {
    padding: 12px;
  }

  .modal-footer {
    padding: 12px;
    flex-wrap: wrap;
    gap: 8px;
  }

  /* AI Modal mobile */
  .ai-modal-card {
    max-width: 100% !important;
  }

  .ai-steps-list {
    max-height: 200px;
  }

  .ai-step-item {
    padding: 10px 12px;
    font-size: 0.85rem;
  }

  .ai-progress-pct {
    font-size: 1.6rem;
  }

  /* Export modal mobile */
  .export-chips {
    flex-wrap: wrap;
    gap: 6px;
  }

  .chip-option {
    flex: 1;
    min-width: 120px;
    padding: 10px;
    font-size: 0.75rem;
    text-align: center;
  }

  /* ========================================================
     TOAST - MOBILE POSITION
     ======================================================== */
  .toast-notification {
    bottom: 74px !important;
    left: 10px !important;
    right: 10px !important;
    width: auto !important;
    max-width: none !important;
    font-size: 0.82rem;
    border-radius: 12px;
  }

  /* ========================================================
     GENERAL TOUCH IMPROVEMENTS
     ======================================================== */

  /* All buttons minimum touch target */
  button {
    min-height: 36px;
  }

  /* Scrollbars - thin on mobile */
  ::-webkit-scrollbar {
    width: 3px;
    height: 3px;
  }

  ::-webkit-scrollbar-thumb {
    background: rgba(0, 255, 163, 0.15);
    border-radius: 3px;
  }

  /* Panel headers mobile */
  .panel-header h3 {
    font-size: 0.95rem;
  }

  .panel-header {
    padding-bottom: 10px;
  }

  /* Glass panels on mobile */
  .glass-panel {
    border-radius: 10px;
  }

  /* Font scale up for readability */
  .tool-group-title {
    font-size: 0.82rem;
  }

}

/* Video Touch Resize Aspect Ratio Handle */
.video-resize-handle-mobile {
  position: absolute;
  bottom: 12px;
  right: 12px;
  width: 44px;
  height: 44px;
  background: rgba(0, 255, 163, 0.85);
  border: 2px solid #FFFFFF;
  color: #060A0D;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 900;
  cursor: se-resize;
  z-index: 100;
  box-shadow: 0 0 15px rgba(0, 255, 163, 0.6);
  user-select: none;
  touch-action: none;
  transition: transform 0.2s ease;
}

.video-resize-handle-mobile:active {
  transform: scale(0.9);
  background: #00FFA3;
}


/* ========================================================
   SMALL PHONES (< 390px) - Extra Compact
   ======================================================== */
@media screen and (max-width: 390px) {
  .top-nav-bar {
    padding: 4px 6px;
    margin: 2px 4px 0 4px;
  }

  .logo-brand-wrap {
    width: 30px;
    height: 30px;
  }

  .nav-tab {
    min-height: 46px;
    padding: 4px 2px;
  }

  .nav-tab .tab-3d-icon {
    font-size: 1.1rem;
  }

  .nav-tab .tab-title {
    font-size: 0.55rem;
    max-width: 60px;
  }

  .video-viewport-wrapper {
    min-height: 180px;
    max-height: 38vh;
  }

  .quick-add-grid,
  .transform-actions-grid {
    grid-template-columns: 1fr 1fr;
  }

  .t-btn-play {
    width: 46px;
    height: 46px;
  }

  .mobile-tools-fab {
    width: 46px;
    height: 46px;
    bottom: 68px;
    right: 10px;
  }

  .timeline-container-panel {
    min-height: 130px;
  }
}

/* ========================================================
   TABLET (769px - 1024px) - Optional Optimization
   ======================================================== */
@media screen and (min-width: 769px) and (max-width: 1024px) {
  .video-layout {
    grid-template-columns: 220px 1fr;
  }

  .photo-layout {
    grid-template-columns: 200px 1fr 200px;
  }

  .sidebar-panel {
    padding: 10px;
  }

  .btn-tool-action,
  .btn-transform {
    padding: 6px;
    font-size: 0.7rem;
  }
}

