/* video_studio/base.css — Editing Room editor styles (split from content_creation_factory.html
 * lines 27-364). The leading "}" that closed the :root block in the original monolith was
 * relocated to tokens.css when the :root block became self-contained for the dark reskin. */
        body { font-family: var(--font-body); background: var(--gradient-bg); color: var(--text-primary); min-height: 100vh; overflow: hidden; }
        .app-container { display: grid; grid-template-columns: 260px 1fr 300px; grid-template-rows: 48px 1fr 6px 440px; height: 100vh; gap: 1px; background: rgba(0,0,0,0.1); }
        .top-bar { grid-column: 1 / -1; background: var(--bg-card); display: flex; align-items: center; justify-content: space-between; padding: 0 1rem; border-bottom: 1px solid var(--border-light); box-shadow: var(--shadow-sm); }
        .top-bar-left { display: flex; align-items: center; gap: 1rem; }
        .back-btn { display: flex; align-items: center; gap: 0.5rem; color: var(--text-secondary); text-decoration: none; font-size: 0.85rem; padding: 0.4rem 0.75rem; border-radius: var(--radius-sm); transition: all 0.2s; }
        .back-btn:hover { color: var(--brand-primary); background: var(--bg-hover); }
        .project-title { display: flex; align-items: center; gap: 0.5rem; }
        .project-title input { background: transparent; border: 1px solid transparent; color: var(--text-primary); font-family: var(--font-display); font-size: 1rem; font-weight: 600; padding: 0.3rem 0.5rem; border-radius: var(--radius-sm); width: 220px; }
        .project-title input:hover, .project-title input:focus { border-color: var(--border-medium); background: var(--bg-input); outline: none; }
        .project-status { font-size: 0.65rem; padding: 0.2rem 0.5rem; border-radius: var(--radius-full); background: rgba(16, 185, 129, 0.15); color: var(--brand-accent); font-weight: 700; text-transform: uppercase; }
        .top-bar-center { display: flex; align-items: center; gap: 0.75rem; }
        .platform-select { display: flex; background: var(--bg-input); border-radius: var(--radius-full); padding: 0.2rem; }
        .platform-btn { padding: 0.35rem 0.7rem; border: none; background: transparent; color: var(--text-secondary); font-size: 0.75rem; border-radius: var(--radius-full); cursor: pointer; transition: all 0.2s; display: flex; align-items: center; gap: 0.3rem; }
        .platform-btn.active { background: var(--brand-primary); color: white; box-shadow: var(--shadow-sm); }
        .platform-btn:hover:not(.active) { background: var(--bg-hover); color: var(--text-primary); }
        .aspect-select { background: var(--bg-input); border: 1px solid var(--border-light); color: var(--text-primary); padding: 0.35rem 0.7rem; border-radius: var(--radius-full); font-size: 0.75rem; cursor: pointer; }
        .top-bar-right { display: flex; align-items: center; gap: 0.5rem; }
        .save-status { font-size: 0.75rem; color: var(--text-muted); display: flex; align-items: center; gap: 0.3rem; }
        .save-status.saved { color: var(--brand-accent); }
        .btn { display: flex; align-items: center; gap: 0.4rem; padding: 0.4rem 0.85rem; border: none; border-radius: var(--radius-sm); font-size: 0.8rem; font-weight: 600; cursor: pointer; transition: all 0.2s; }
        .btn-secondary { background: var(--bg-input); color: var(--text-primary); border: 1px solid var(--border-light); }
        .btn-secondary:hover { background: var(--bg-hover); border-color: var(--brand-primary); }
        .btn-primary { background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary)); color: white; box-shadow: var(--shadow-md); }
        .btn-primary:hover { transform: translateY(-1px); box-shadow: var(--shadow-lg); }
        .btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
        .left-panel { background: var(--bg-panel); display: flex; flex-direction: column; overflow: hidden; border-right: 1px solid var(--border-light); }
        .panel-header { padding: 0.75rem 1rem; border-bottom: 1px solid var(--border-light); background: var(--bg-card); }
        .panel-title { font-family: var(--font-display); font-size: 0.85rem; font-weight: 700; color: var(--text-primary); }
        .panel-content { flex: 1; overflow-y: auto; padding: 0.75rem; }
        .asset-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.6rem; }
        .asset-card { background: var(--bg-card); border-radius: var(--radius-md); overflow: hidden; cursor: pointer; transition: all 0.2s; border: 2px solid transparent; box-shadow: var(--shadow-sm); }
        .asset-card:hover { border-color: var(--brand-primary); box-shadow: var(--shadow-md); transform: translateY(-2px); }
        .asset-card.selected { border-color: var(--brand-primary); box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2); }
        .asset-thumbnail { aspect-ratio: 16/9; background: var(--bg-input); position: relative; overflow: hidden; }
        .asset-thumbnail img, .asset-thumbnail video { width: 100%; height: 100%; object-fit: cover; }
        .asset-duration { position: absolute; bottom: 0.25rem; right: 0.25rem; background: rgba(0,0,0,0.75); color: white; padding: 0.1rem 0.35rem; border-radius: var(--radius-sm); font-size: 0.6rem; font-weight: 600; }
        .asset-type-badge { position: absolute; top: 0.25rem; left: 0.25rem; padding: 0.1rem 0.35rem; border-radius: var(--radius-sm); font-size: 0.55rem; font-weight: 700; text-transform: uppercase; color: white; }
        .asset-type-badge.main_video { background: var(--track-main); }
        .asset-type-badge.main_audio { background: #1e40af; }
        .asset-type-badge.broll { background: var(--track-broll); }
        .asset-type-badge.audio_music { background: var(--track-audio-music); }
        .asset-type-badge.audio_voiceover { background: var(--track-audio-voice); }
        .asset-info { padding: 0.4rem 0.5rem; }
        .asset-name { font-size: 0.7rem; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .asset-source { font-size: 0.6rem; color: var(--text-muted); }
        .asset-delete-btn { position: absolute; top: 0.25rem; right: 0.25rem; width: 22px; height: 22px; background: rgba(239,68,68,0.9); border: none; border-radius: 4px; color: white; cursor: pointer; opacity: 0; transition: opacity 0.2s; display: flex; align-items: center; justify-content: center; font-size: 0.6rem; }
        .asset-card:hover .asset-delete-btn { opacity: 1; }
        .asset-delete-btn:hover { background: #dc2626; }
        .add-asset-btn { grid-column: 1 / -1; display: flex; align-items: center; justify-content: center; gap: 0.4rem; padding: 0.75rem; background: var(--bg-card); border: 2px dashed var(--border-medium); border-radius: var(--radius-md); color: var(--text-secondary); font-size: 0.75rem; font-weight: 600; cursor: pointer; transition: all 0.2s; }
        .add-asset-btn:hover { background: var(--bg-hover); border-color: var(--brand-primary); color: var(--brand-primary); }
        .center-panel { background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 1rem; }
        .preview-wrapper { position: relative; background: #000; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-xl), 0 0 60px rgba(124, 58, 237, 0.15); }
        /* Grid overlay */
        .grid-overlay { position: absolute; inset: 0; z-index: 5; pointer-events: none; display: none; }
        .grid-overlay.active { display: block; }
        .grid-overlay.thirds .grid-line-h, .grid-overlay.thirds .grid-line-v { position: absolute; background: rgba(255,255,255,0.2); }
        .grid-overlay.thirds .grid-line-h { left: 0; right: 0; height: 1px; }
        .grid-overlay.thirds .grid-line-v { top: 0; bottom: 0; width: 1px; }
        .grid-overlay.full { background-image: linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px); background-size: 10% 10%; }
        .grid-overlay.full .grid-line-h, .grid-overlay.full .grid-line-v { background: rgba(255,255,255,0.15); }
        /* Alignment guides */
        .align-guide { position: absolute; background: #ff4757; z-index: 6; pointer-events: none; display: none; }
        .align-guide-h { left: 0; right: 0; height: 1px; top: 50%; }
        .align-guide-v { top: 0; bottom: 0; width: 1px; left: 50%; }
        .preview-wrapper.aspect-16-9 { width: min(95%, 900px); aspect-ratio: 16/9; }
        .preview-wrapper.aspect-9-16 { height: min(95%, 550px); aspect-ratio: 9/16; }
        .preview-wrapper.aspect-1-1 { width: min(95%, 500px); aspect-ratio: 1/1; }
        .preview-wrapper.aspect-4-5 { height: min(95%, 550px); aspect-ratio: 4/5; }
        .preview-video { width: 100%; height: 100%; object-fit: contain; background: #000; }
        .preview-placeholder { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--text-muted); }
        .preview-placeholder i { font-size: 3rem; margin-bottom: 1rem; opacity: 0.4; color: #9A9A92; }
        .preview-placeholder p { font-size: 0.9rem; color: rgba(255,255,255,0.5); }
        .preview-controls { position: absolute; bottom: 1rem; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 0.5rem; background: rgba(0,0,0,0.85); padding: 0.4rem 0.6rem; border-radius: var(--radius-full); backdrop-filter: blur(10px); }
        .preview-btn { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; background: transparent; border: none; color: rgba(255,255,255,0.8); border-radius: 50%; cursor: pointer; transition: all 0.2s; }
        .preview-btn:hover { background: rgba(255,255,255,0.15); color: white; }
        .preview-btn.play-btn { width: 40px; height: 40px; background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary)); color: white; }
        .preview-btn.play-btn:hover { transform: scale(1.05); }
        .preview-time { color: rgba(255,255,255,0.8); font-size: 0.75rem; font-weight: 500; padding: 0 0.5rem; min-width: 70px; text-align: center; }
        .preview-broll { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; z-index: 2; }
        .preview-overlay { position: absolute; inset: 0; z-index: 3; background-size: cover; background-position: center; pointer-events: none; }
        .preview-text-layer { position: absolute; inset: 0; z-index: 10; display: flex; flex-direction: column; justify-content: center; align-items: center; pointer-events: none; padding: 2rem; }
        .preview-text-item { padding: 0.5rem 1.5rem; border-radius: 4px; text-align: center; max-width: 90%; opacity: 1 !important; }
        .preview-text-item.position-top { position: absolute; top: 8%; left: 50%; transform: translateX(-50%); }
        .preview-text-item.position-center { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); }
        .preview-text-item.position-bottom { position: absolute; bottom: 15%; left: 50%; transform: translateX(-50%); }
        .preview-text-item.style-title { font-size: 2.5rem; font-weight: 800; color: white; text-shadow: 2px 2px 8px rgba(0,0,0,0.8), 0 0 20px rgba(0,0,0,0.5); font-family: var(--font-display); letter-spacing: -0.02em; }
        .preview-text-item.style-subtitle { font-size: 1.5rem; font-weight: 600; color: white; text-shadow: 1px 1px 4px rgba(0,0,0,0.8); font-family: var(--font-display); }
        .preview-text-item.style-caption { font-size: 1rem; font-weight: 500; color: white; background: rgba(0,0,0,0.7); padding: 0.4rem 1rem; border-radius: 4px; }
        @keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
        .right-panel { background: var(--bg-panel); display: flex; flex-direction: column; overflow: hidden; border-left: 1px solid var(--border-light); }
        .properties-header { padding: 0.75rem 1rem; border-bottom: 1px solid var(--border-light); background: var(--bg-card); display: flex; align-items: center; justify-content: space-between; }
        .properties-title { font-family: var(--font-display); font-size: 0.85rem; font-weight: 700; color: var(--text-primary); }
        .properties-tabs { display: flex; gap: 0.25rem; }
        .properties-tab { padding: 0.3rem 0.6rem; border: none; background: transparent; color: var(--text-secondary); font-size: 0.7rem; font-weight: 600; border-radius: var(--radius-sm); cursor: pointer; transition: all 0.2s; }
        .properties-tab.active { background: var(--brand-primary); color: white; }
        .properties-tab:hover:not(.active) { background: var(--bg-hover); }
        .properties-content { flex: 1; overflow-y: auto; padding: 1rem; }
        .property-section { margin-bottom: 1.25rem; }
        .property-section-title { font-size: 0.7rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.6rem; }
        .property-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.6rem; }
        .property-label { font-size: 0.75rem; color: var(--text-secondary); }
        .property-input { width: 100px; background: var(--bg-card); border: 1px solid var(--border-light); color: var(--text-primary); padding: 0.35rem 0.5rem; border-radius: var(--radius-sm); font-size: 0.75rem; }
        .property-input:focus { outline: none; border-color: var(--brand-primary); }
        .property-slider { width: 100px; height: 4px; -webkit-appearance: none; background: var(--bg-input); border-radius: 2px; }
        .property-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; background: var(--brand-primary); border-radius: 50%; cursor: pointer; box-shadow: var(--shadow-sm); }
        .no-selection { text-align: center; padding: 2rem 1rem; color: var(--text-muted); }
        .no-selection i { font-size: 2rem; margin-bottom: 0.6rem; opacity: 0.4; }
        .no-selection p { font-size: 0.8rem; }
        /* Effects Panel */
        .effects-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.5rem; margin-bottom: 1rem; }
        .effect-card { background: var(--bg-card); border: 1px solid var(--border-light); border-radius: var(--radius-sm); padding: 0.6rem; cursor: pointer; transition: all 0.2s; text-align: center; }
        .effect-card:hover { border-color: var(--brand-primary); background: var(--bg-hover); }
        .effect-card.applied { border-color: var(--brand-accent); background: rgba(16, 185, 129, 0.1); }
        .effect-card i { font-size: 1.2rem; color: var(--brand-primary); margin-bottom: 0.3rem; display: block; }
        .effect-card span { font-size: 0.7rem; font-weight: 600; color: var(--text-primary); }
        .effect-params { background: var(--bg-panel-alt); border-radius: var(--radius-sm); padding: 0.75rem; margin-top: 0.75rem; }
        .effect-params-title { font-size: 0.7rem; font-weight: 700; color: var(--text-primary); margin-bottom: 0.5rem; display: flex; align-items: center; justify-content: space-between; }
        .effect-remove-btn { background: none; border: none; color: #ef4444; cursor: pointer; font-size: 0.7rem; padding: 0.2rem 0.4rem; border-radius: 4px; }
        .effect-remove-btn:hover { background: rgba(239, 68, 68, 0.1); }
        /* Transitions */
        .transition-indicator { position: absolute; top: 50%; transform: translateY(-50%); width: 16px; height: 28px; background: linear-gradient(135deg, #f59e0b, #f97316); border-radius: 4px; cursor: pointer; z-index: 5; display: flex; align-items: center; justify-content: center; border: 2px solid rgba(255,255,255,0.5); }
        .transition-indicator i { font-size: 0.5rem; color: white; }
        .transition-indicator:hover { transform: translateY(-50%) scale(1.1); box-shadow: 0 0 10px rgba(249, 115, 22, 0.5); }
        .transitions-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; }
        .transition-card { background: var(--bg-card); border: 2px solid var(--border-light); border-radius: var(--radius-md); padding: 0.75rem; cursor: pointer; transition: all 0.2s; text-align: center; }
        .transition-card:hover { border-color: var(--brand-primary); transform: translateY(-2px); }
        .transition-card.selected { border-color: var(--brand-primary); background: rgba(124, 58, 237, 0.05); }
        .transition-card i { font-size: 1.5rem; color: var(--brand-primary); margin-bottom: 0.4rem; display: block; }
        .transition-card span { font-size: 0.75rem; font-weight: 600; color: var(--text-primary); display: block; }
        .transition-card small { font-size: 0.65rem; color: var(--text-muted); }
        .transition-duration { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border-light); }
        .transition-duration label { font-size: 0.75rem; font-weight: 600; color: var(--text-primary); display: block; margin-bottom: 0.5rem; }
        .transition-duration input { width: 100%; }
        .modal.modal-sm { max-width: 500px; }
        /* Ripple & Trim */
        .timeline-tool-btn.ripple-active { background: var(--brand-accent); color: white; }
        .clip-trim-handle { position: absolute; top: 0; bottom: 0; width: 8px; cursor: col-resize; z-index: 10; }
        .clip-trim-handle:hover { background: rgba(255,255,255,0.3); }
        .clip-trim-handle.left { left: 0; border-radius: 6px 0 0 6px; }
        .clip-trim-handle.right { right: 0; border-radius: 0 6px 6px 0; }
        .clip-effect-badge { position: absolute; top: 2px; right: 2px; background: var(--brand-accent); color: white; font-size: 0.5rem; padding: 1px 4px; border-radius: 3px; }
        .timeline-container { grid-column: 1 / -1; background: var(--timeline-bg); border-top: 1px solid rgba(255,255,255,0.1); display: flex; flex-direction: column; }
        .timeline-toolbar { display: flex; align-items: center; justify-content: space-between; padding: 0.6rem 1rem 0.75rem 1rem; background: rgba(0,0,0,0.2); border-bottom: 1px solid rgba(255,255,255,0.08); }
        .timeline-tools { display: flex; align-items: center; gap: 0.75rem; }
        .timeline-tool-btn { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; background: transparent; border: none; color: rgba(255,255,255,0.6); border-radius: var(--radius-sm); cursor: pointer; transition: all 0.2s; font-size: 0.9rem; }
        .timeline-tool-btn:hover { background: rgba(255,255,255,0.1); color: white; }
        .timeline-tool-btn.active { background: var(--brand-primary); color: white; }
        .timeline-tool-btn.add-btn { width: auto; padding: 0 0.6rem; gap: 0.3rem; font-size: 0.75rem; }
        .timeline-tool-btn.add-btn span { font-weight: 600; }
        .toolbar-divider { width: 1px; height: 20px; background: rgba(255,255,255,0.2); margin: 0 0.4rem; }
        .timeline-zoom { display: flex; align-items: center; gap: 0.5rem; }
        .timeline-zoom i { color: rgba(255,255,255,0.5); font-size: 0.7rem; }
        .zoom-slider { width: 80px; height: 4px; -webkit-appearance: none; background: rgba(255,255,255,0.2); border-radius: 2px; }
        .zoom-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; background: var(--brand-primary); border-radius: 50%; cursor: pointer; }
        .timeline-content { flex: 1; display: flex; overflow: hidden; }
        .track-labels { width: 100px; background: rgba(0,0,0,0.2); border-right: 1px solid rgba(255,255,255,0.08); flex-shrink: 0; }
        .track-label-spacer { height: 22px; background: var(--timeline-ruler); border-bottom: 1px solid rgba(255,255,255,0.1); }
        .track-label { height: 55px; cursor: pointer; transition: all 0.2s; display: flex; align-items: center; gap: 0.5rem; padding: 0 0.75rem; border-bottom: 1px solid rgba(255,255,255,0.1); font-size: 0.75rem; color: rgba(255,255,255,0.8); margin-bottom: 2px; }
        .track-label-icon { width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; border-radius: 5px; font-size: 0.65rem; color: white; }
        .track-label-icon.main_video { background: var(--track-main); }
        .track-label-icon.main_audio { background: #1e40af; }
        .track-label-icon.broll { background: var(--track-broll); }
        .track-label-icon.overlay { background: var(--track-overlay); }
        .track-label-icon.audio_music { background: var(--track-audio-music); }
        .track-label-icon.audio_voiceover { background: var(--track-audio-voice); }
        .track-label-icon.text { background: var(--track-text); }
        .track-label.targeted { background: rgba(124, 58, 237, 0.3); border-left: 3px solid var(--brand-primary); }
        .track-label:hover { background: rgba(255,255,255,0.1); }
        .timeline-tracks { flex: 1; overflow-x: auto; overflow-y: hidden; position: relative; }
        .timeline-ruler { height: 22px; background: var(--timeline-ruler); position: sticky; top: 0; z-index: 10; display: flex; align-items: flex-end; border-bottom: 1px solid rgba(255,255,255,0.1); }
        .ruler-mark { position: absolute; bottom: 2px; font-size: 0.6rem; color: rgba(255,255,255,0.6); transform: translateX(-50%); }
        .ruler-mark::before { content: ''; position: absolute; bottom: 100%; left: 50%; width: 1px; height: 5px; background: rgba(255,255,255,0.3); }
        .tracks-container { position: relative; min-width: 100%; padding-bottom: 20px; }
        .track { height: 55px; background: var(--timeline-track); border-bottom: 1px solid rgba(255,255,255,0.1); position: relative; margin-bottom: 2px; }
        .track:hover { background: rgba(255,255,255,0.03); }
        .timeline-clip { position: absolute; top: 6px; height: 42px; box-sizing: border-box; border-radius: 6px; cursor: pointer; display: flex; align-items: center; padding: 0 0.6rem; font-size: 0.75rem; font-weight: 600; color: white; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; transition: all 0.15s; border: 1px solid rgba(0,0,0,0.55); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.12), var(--shadow-sm); }
        .timeline-clip:hover { filter: brightness(1.15); box-shadow: var(--shadow-md); }
        .timeline-clip.selected { box-shadow: 0 0 0 2px white, var(--shadow-lg); }
        .timeline-clip.main_video { background: linear-gradient(135deg, var(--track-main), #2563eb); }
        .timeline-clip.main_audio { background: linear-gradient(135deg, #1e40af, #1d4ed8); }
        .timeline-clip.broll { background: linear-gradient(135deg, var(--track-broll), #059669); }
        .timeline-clip.overlay { background: linear-gradient(135deg, var(--track-overlay), #d97706); }
        .timeline-clip.audio_music { background: linear-gradient(135deg, var(--track-audio-music), #db2777); }
        .timeline-clip.audio_voiceover { background: linear-gradient(135deg, var(--track-audio-voice), #8DC63F); }
        .timeline-clip.text { background: linear-gradient(135deg, var(--track-text), #ea580c); }
        .playhead { position: absolute; top: 0; bottom: 0; width: 2px; background: #ff4757; z-index: 20; pointer-events: none; }
        .playhead::before { content: ''; position: absolute; top: -2px; left: -7px; width: 16px; height: 16px; background: #ff4757; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); pointer-events: auto; cursor: col-resize; z-index: 21; }
        .playhead::after { content: ''; position: absolute; top: 0; bottom: 0; left: -10px; width: 22px; pointer-events: auto; cursor: col-resize; z-index: 21; }
        .empty-timeline { position: absolute; inset: 24px 0 0 0; display: flex; flex-direction: column; align-items: center; justify-content: center; color: rgba(255,255,255,0.4); pointer-events: none; }
        .empty-timeline i { font-size: 2rem; margin-bottom: 0.75rem; opacity: 0.5; }
        .empty-timeline p { font-size: 0.85rem; }
        .voice-command-bar { position: fixed; bottom: 460px; left: 50%; transform: translateX(-50%); cursor: move; display: flex; align-items: center; gap: 0.6rem; background: var(--bg-card); padding: 0.4rem 0.6rem 0.4rem 1rem; border-radius: var(--radius-full); box-shadow: var(--shadow-xl), 0 0 40px rgba(124, 58, 237, 0.15); z-index: 100; border: 1px solid var(--border-light); cursor: move; }
        .voice-input { width: 280px; background: var(--bg-input); border: none; padding: 0.5rem 0.85rem; border-radius: var(--radius-full); font-size: 0.85rem; color: var(--text-primary); }
        .voice-input:focus { outline: none; box-shadow: 0 0 0 2px var(--brand-primary); }
        .voice-input::placeholder { color: var(--text-muted); }
        .voice-btn { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary)); border: none; border-radius: 50%; color: white; cursor: pointer; transition: all 0.2s; }
        .voice-btn:hover { transform: scale(1.05); box-shadow: var(--shadow-md); }
        .voice-btn.recording { background: #ef4444; animation: pulse 1s infinite; }
        @keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); } 50% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); } }
        .modal-overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; z-index: 1000; opacity: 0; visibility: hidden; transition: all 0.3s; }
        .modal-overlay.active { opacity: 1; visibility: visible; }
        .modal { background: var(--bg-card); border-radius: var(--radius-lg); width: 90%; max-width: 800px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: var(--shadow-xl); transform: scale(0.9); transition: transform 0.3s; }
        .modal-overlay.active .modal { transform: scale(1); }
        .modal-header { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border-light); }
        .modal-title { font-family: var(--font-display); font-size: 1.1rem; font-weight: 700; color: var(--text-primary); }
        .modal-close { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; background: var(--bg-input); border: none; border-radius: var(--radius-sm); color: var(--text-secondary); cursor: pointer; transition: all 0.2s; }
        .modal-close:hover { background: #fee2e2; color: #ef4444; }
        .modal-tabs { display: flex; gap: 0.5rem; padding: 0.75rem 1.25rem; background: var(--bg-panel); border-bottom: 1px solid var(--border-light); }
        .modal-tab { padding: 0.5rem 1rem; border: none; background: transparent; color: var(--text-secondary); font-size: 0.85rem; font-weight: 600; border-radius: var(--radius-sm); cursor: pointer; transition: all 0.2s; display: flex; align-items: center; gap: 0.4rem; }
        .modal-tab.active { background: var(--bg-card); color: var(--brand-primary); box-shadow: var(--shadow-sm); }
        .modal-tab:hover:not(.active) { color: var(--text-primary); background: var(--bg-hover); }
        .modal-body { flex: 1; overflow-y: auto; padding: 1.25rem; }
        .modal-footer { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.25rem; border-top: 1px solid var(--border-light); background: var(--bg-panel); }
        .modal-footer-info { font-size: 0.8rem; color: var(--text-muted); }
        .modal-footer-actions { display: flex; gap: 0.5rem; }

 .library-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem; }
                .library-card { background: var(--bg-panel); border-radius: var(--radius-md); overflow: hidden; cursor: pointer; transition: all 0.2s; border: 2px solid transparent; position: relative; }
                .library-card:hover { border-color: var(--brand-primary); transform: translateY(-2px); box-shadow: var(--shadow-md); }
                .library-card.selected { border-color: var(--brand-primary); background: rgba(124, 58, 237, 0.05); }
                .library-card.selected::after { content: '\f00c'; font-family: 'Font Awesome 6 Free'; font-weight: 900; position: absolute; top: 0.5rem; right: 0.5rem; width: 24px; height: 24px; background: var(--brand-primary); color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.7rem; }
                .library-thumbnail { aspect-ratio: 16/9; background: var(--bg-input); position: relative; }
                .library-thumbnail video, .library-thumbnail img { width: 100%; height: 100%; object-fit: cover; }
                .library-thumbnail-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 1.5rem; }
                .library-duration { position: absolute; bottom: 0.4rem; right: 0.4rem; background: rgba(0,0,0,0.8); color: white; padding: 0.15rem 0.4rem; border-radius: 4px; font-size: 0.7rem; font-weight: 600; }
                .library-info { padding: 0.6rem 0.75rem; }
                .library-name { font-size: 0.8rem; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 0.2rem; }
                .library-meta { font-size: 0.7rem; color: var(--text-muted); }
                .upload-area { border: 2px dashed var(--border-medium); border-radius: var(--radius-lg); padding: 3rem 2rem; text-align: center; transition: all 0.2s; cursor: pointer; }
                .upload-area:hover, .upload-area.dragover { border-color: var(--brand-primary); background: rgba(124, 58, 237, 0.05); }
                .upload-area i { font-size: 3rem; color: var(--brand-primary); margin-bottom: 1rem; opacity: 0.7; }
                .upload-area h3 { font-family: var(--font-display); font-size: 1.1rem; font-weight: 700; color: var(--text-primary); margin-bottom: 0.5rem; }
                .upload-area p { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 1rem; }
                .upload-area input[type="file"] { display: none; }
                .upload-btn { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.6rem 1.25rem; background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary)); color: white; border: none; border-radius: var(--radius-sm); font-size: 0.85rem; font-weight: 600; cursor: pointer; transition: all 0.2s; }
                .upload-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
                .upload-progress { margin-top: 1.5rem; display: none; }
                .upload-progress.active { display: block; }
                .upload-file-info { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem; background: var(--bg-panel); border-radius: var(--radius-sm); margin-bottom: 0.75rem; }
                .upload-file-icon { width: 40px; height: 40px; background: rgba(124, 58, 237, 0.1); color: var(--brand-primary); border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; }
                .upload-file-details { flex: 1; }
                .upload-file-name { font-size: 0.85rem; font-weight: 600; color: var(--text-primary); }
                .upload-file-size { font-size: 0.75rem; color: var(--text-muted); }
                .upload-progress-bar { height: 6px; background: var(--bg-input); border-radius: 3px; overflow: hidden; }
                .upload-progress-fill { height: 100%; background: linear-gradient(90deg, var(--brand-primary), var(--brand-secondary)); border-radius: 3px; transition: width 0.3s; width: 0%; }
                .modal-loading { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 3rem; color: var(--text-muted); }
                .modal-loading i { font-size: 2rem; margin-bottom: 1rem; animation: spin 1s linear infinite; }
                @keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
                .modal-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 3rem; text-align: center; }
                .modal-empty i { font-size: 3rem; color: var(--text-muted); margin-bottom: 1rem; opacity: 0.5; }
                .modal-empty h3 { font-size: 1rem; font-weight: 600; color: var(--text-primary); margin-bottom: 0.5rem; }
                .modal-empty p { font-size: 0.85rem; color: var(--text-muted); }
                .toast-container { position: fixed; top: 1rem; right: 1rem; z-index: 2000; display: flex; flex-direction: column; gap: 0.5rem; }
                .toast { padding: 0.75rem 1rem; background: var(--bg-card); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 0.75rem; animation: slideIn 0.3s ease; max-width: 350px; }
                .toast.success { border-left: 4px solid var(--brand-accent); }
                .toast.error { border-left: 4px solid #ef4444; }
                .toast.info { border-left: 4px solid var(--brand-primary); }
                .toast i { font-size: 1rem; }
                .toast.success i { color: var(--brand-accent); }
                .toast.error i { color: #ef4444; }
                .toast.info i { color: var(--brand-primary); }
                .toast-message { flex: 1; font-size: 0.85rem; color: var(--text-primary); }
                @keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
                ::-webkit-scrollbar { width: 8px; height: 8px; }
                ::-webkit-scrollbar-track { background: rgba(0,0,0,0.1); }
                ::-webkit-scrollbar-thumb { background: rgba(124, 58, 237, 0.3); border-radius: 4px; }
                ::-webkit-scrollbar-thumb:hover { background: rgba(124, 58, 237, 0.5); }
                @media (max-width: 1200px) { .app-container { grid-template-columns: 200px 1fr 240px; } }
                @media (max-width: 900px) { .app-container { grid-template-columns: 1fr; grid-template-rows: 48px 300px 1fr 200px; } .left-panel, .right-panel { display: none; } .voice-command-bar { bottom: 220px; } }

                /* Voice Recorder Popup */
                .voice-recorder-popup {
                    display: none; position: fixed; bottom: 480px; left: 50%; transform: translateX(-50%);
                    background: var(--bg-card); border: 1px solid var(--border-light);
                    border-radius: var(--radius-lg); padding: 1.2rem 1.5rem;
                    box-shadow: var(--shadow-xl), 0 0 40px rgba(139, 92, 246, 0.2);
                    z-index: 200; min-width: 280px; text-align: center;
                }
                .voice-recorder-popup.active { display: block; }
                .voice-recorder-popup h3 { margin: 0 0 0.8rem 0; font-size: 0.95rem; color: var(--text-primary); }
                .voice-recorder-timer {
                    font-size: 1.8rem; font-weight: 700; font-family: monospace;
                    color: var(--text-primary); margin: 0.5rem 0;
                }
                .voice-recorder-timer.recording { color: #ef4444; }
                .voice-recorder-controls { display: flex; gap: 0.8rem; justify-content: center; margin-top: 1rem; }
                .voice-rec-btn {
                    width: 48px; height: 48px; border-radius: 50%; border: none; cursor: pointer;
                    display: flex; align-items: center; justify-content: center;
                    font-size: 1.1rem; color: white; transition: all 0.2s;
                }
                .voice-rec-btn:hover { transform: scale(1.08); }
                .voice-rec-btn.rec-start { background: linear-gradient(135deg, #ef4444, #dc2626); }
                .voice-rec-btn.rec-stop { background: linear-gradient(135deg, #6b7280, #4b5563); }
                .voice-rec-btn.rec-close { background: transparent; color: var(--text-muted); font-size: 0.9rem; width: 32px; height: 32px; }
                .voice-rec-btn.rec-start.pulse { animation: pulse 1s infinite; }
                .voice-recorder-status { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.5rem; }

                /* Draggable Overlay */
                .overlay-draggable { pointer-events: auto;
                    position: absolute; cursor: move; z-index: 4;
                    user-select: none; -webkit-user-select: none;
                }
                .overlay-draggable img {
                    display: block; width: 100%; height: 100%;
                    object-fit: contain; pointer-events: none;
                }
                .overlay-draggable.selected {
                    outline: 2px solid #8DC63F; outline-offset: 2px;
                }
                .overlay-draggable .resize-handle {
                    position: absolute; width: 12px; height: 12px;
                    background: #8DC63F; border: 2px solid white;
                    border-radius: 2px; z-index: 10; display: none;
                }
                .overlay-draggable.selected .resize-handle { display: block; }
                .overlay-draggable .resize-handle.nw { top: -6px; left: -6px; cursor: nw-resize; }
                .overlay-draggable .resize-handle.ne { top: -6px; right: -6px; cursor: ne-resize; }
                .overlay-draggable .resize-handle.sw { bottom: -6px; left: -6px; cursor: sw-resize; }
                .overlay-draggable .resize-handle.se { bottom: -6px; right: -6px; cursor: se-resize; }

                /* Timeline Resize Handle */
                .timeline-resize-handle {
                    grid-column: 1 / -1; height: 6px; cursor: row-resize;
                    background: rgba(124, 58, 237, 0.3); position: relative; z-index: 50;
                    transition: background 0.2s;
                }
                .timeline-resize-handle:hover, .timeline-resize-handle.active {
                    background: rgba(124, 58, 237, 0.7);
                }
                .timeline-resize-handle::after {
                    content: ''; position: absolute; left: 50%; top: 50%;
                    transform: translate(-50%, -50%);
                    width: 40px; height: 3px; border-radius: 2px;
                    background: rgba(255,255,255,0.4);
                }
                .timeline-resize-handle:hover::after { background: rgba(255,255,255,0.7); }
