*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #f4f6fb; --surface: #ffffff; --surface2: #eef0f7; --surface3: #e4e7f2;
  --border: #dde1ef; --accent: #fe2c55; --accent2: #0bbdb7;
  --text: #1a1b2e; --muted: #7c83a0; --success: #1db863; --error: #e8334a;
  --r: 10px;
}
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: var(--bg); color: var(--text); height: 100vh; overflow: hidden; display: flex; flex-direction: column; font-size: 13px; }

/* ─── LANDING ─────────────────────────────────────────────── */
.landing { flex: 1; display: flex; align-items: center; justify-content: space-between; padding: 40px 60px; gap: 40px; position: relative; overflow: hidden; }
.landing-bg { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.landing-grid { position: absolute; inset: 0; background-image: linear-gradient(rgba(0,0,0,0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(0,0,0,0.05) 1px, transparent 1px); background-size: 44px 44px; }
.landing-blob { position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.12; animation: blobFloat 8s ease-in-out infinite; }
.blob1 { width: 500px; height: 500px; background: var(--accent); top: -150px; left: -100px; animation-delay: 0s; }
.blob2 { width: 400px; height: 400px; background: var(--accent2); bottom: -120px; right: 200px; animation-delay: -3s; }
.blob3 { width: 300px; height: 300px; background: #7c3aed; top: 50%; right: -80px; animation-delay: -5s; }
@keyframes blobFloat { 0%,100% { transform: translate(0,0) scale(1); } 33% { transform: translate(20px,-20px) scale(1.05); } 66% { transform: translate(-15px,15px) scale(0.97); } }

.landing-content { flex: 1; max-width: 620px; position: relative; z-index: 1; }
.landing-badge { display: inline-flex; align-items: center; gap: 6px; background: rgba(254,44,85,0.12); border: 1px solid rgba(254,44,85,0.3); color: var(--accent); font-size: 12px; font-weight: 600; padding: 5px 12px; border-radius: 20px; margin-bottom: 22px; letter-spacing: 0.3px; }
.landing-title { font-size: 52px; font-weight: 900; line-height: 1.1; color: var(--text); margin-bottom: 18px; letter-spacing: -1px; }
.landing-gradient { background: linear-gradient(135deg, var(--accent), var(--accent2)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.landing-sub { font-size: 16px; color: var(--muted); line-height: 1.65; margin-bottom: 36px; }

.landing-features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 36px; }
.lf-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px; transition: border-color 0.2s, background 0.2s; }
.lf-card:hover { border-color: rgba(254,44,85,0.4); background: rgba(254,44,85,0.05); }
.lf-icon { font-size: 20px; margin-bottom: 6px; }
.lf-title { font-size: 12px; font-weight: 700; color: var(--text); margin-bottom: 3px; }
.lf-desc { font-size: 11px; color: var(--muted); line-height: 1.45; }

.landing-cta { }
.landing-input-wrap { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.landing-input { background: var(--surface); border: 1px solid var(--border); color: var(--text); padding: 13px 18px; border-radius: 12px; font-size: 15px; width: 260px; transition: border-color 0.15s; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
.landing-input:focus { outline: none; border-color: var(--accent); }
.btn-cta { display: flex; align-items: center; gap: 8px; background: linear-gradient(135deg, var(--accent), #ff6b35); color: #fff; border: none; padding: 13px 24px; border-radius: 12px; font-size: 15px; font-weight: 700; cursor: pointer; transition: opacity 0.15s, transform 0.15s; white-space: nowrap; }
.btn-cta:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-cta:active { transform: translateY(0); }
.landing-hint-text { font-size: 12px; color: var(--muted); }

/* Phone mockup */
.landing-preview { position: relative; z-index: 1; flex-shrink: 0; }
.phone-mockup { width: 220px; height: 420px; background: #1a1a28; border-radius: 36px; border: 2px solid rgba(0,0,0,0.15); box-shadow: 0 40px 80px rgba(0,0,0,0.22), 0 0 0 1px rgba(0,0,0,0.06), inset 0 1px 0 rgba(255,255,255,0.1); position: relative; overflow: hidden; transform: perspective(800px) rotateY(-8deg) rotateX(2deg); transition: transform 0.4s ease; }
.phone-mockup:hover { transform: perspective(800px) rotateY(-4deg) rotateX(1deg); }
.phone-mockup-screen { width: 100%; height: 100%; position: relative; overflow: hidden; }
.pm-video-bg { position: absolute; inset: 0; background: linear-gradient(160deg, #1e3a5f 0%, #0d1b2a 40%, #2d1b4e 100%); }
.pm-video-bg::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, transparent 50%); }
.pm-text-block { position: absolute; bottom: 90px; left: 14px; right: 14px; }
.pm-tag { display: inline-block; background: var(--accent); color: #fff; font-size: 9px; font-weight: 700; padding: 3px 8px; border-radius: 20px; margin-bottom: 6px; }
.pm-title { font-size: 18px; font-weight: 900; color: #fff; text-shadow: 0 2px 8px rgba(0,0,0,0.8); margin-bottom: 2px; }
.pm-sub { font-size: 12px; color: var(--accent2); font-weight: 600; text-shadow: 0 2px 6px rgba(0,0,0,0.8); }
.pm-music { position: absolute; bottom: 60px; left: 14px; right: 14px; font-size: 9px; color: rgba(255,255,255,0.6); }
.pm-actions { position: absolute; right: 10px; bottom: 100px; display: flex; flex-direction: column; gap: 12px; }
.pm-btn { background: rgba(255,255,255,0.15); backdrop-filter: blur(8px); color: #fff; font-size: 8px; font-weight: 600; padding: 6px 8px; border-radius: 8px; text-align: center; white-space: nowrap; }
/* Animated gradient shimmer on phone */
.phone-mockup::before { content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%; background: conic-gradient(from 180deg, transparent 60%, rgba(254,44,85,0.15) 70%, rgba(37,244,238,0.15) 80%, transparent 90%); animation: phoneGlow 6s linear infinite; z-index: 0; pointer-events: none; }
@keyframes phoneGlow { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* ─── TOPBAR ─────────────────────────────────────────────── */
.topbar { height: 52px; background: var(--surface); border-bottom: 1px solid var(--border); display: flex; align-items: center; padding: 0 16px; gap: 16px; flex-shrink: 0; z-index: 100; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
.topbar-logo { font-size: 16px; font-weight: 800; background: linear-gradient(135deg, var(--accent), var(--accent2)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; white-space: nowrap; }
.topbar-center { display: flex; gap: 8px; align-items: center; }
.topbar-center input { background: var(--surface2); border: 1px solid var(--border); color: var(--text); padding: 7px 12px; border-radius: 7px; font-size: 13px; width: 240px; }
.topbar-center input:focus { outline: none; border-color: var(--accent); }
.topbar-actions { display: flex; gap: 8px; align-items: center; margin-left: auto; }
.project-title { font-weight: 600; color: var(--muted); max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ─── BUTTONS ────────────────────────────────────────────── */
.btn { background: var(--surface2); border: 1px solid var(--border); color: var(--text); padding: 8px 14px; border-radius: 7px; cursor: pointer; font-size: 13px; transition: all 0.12s; white-space: nowrap; }
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn-primary:hover { background: #e0254b; color: #fff; }
.btn-ghost { background: transparent; border-color: var(--border); }
.btn-render { background: linear-gradient(135deg, var(--accent), #ff6b35); border: none; color: #fff; font-weight: 700; padding: 8px 20px; border-radius: 7px; cursor: pointer; transition: opacity 0.12s; }
.btn-render:hover { opacity: 0.88; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-icon { display: flex; align-items: center; gap: 4px; }
.w-full { width: 100%; }

/* ─── EDITOR LAYOUT ──────────────────────────────────────── */
.editor { flex: 1; display: flex; overflow: hidden; }

/* ─── VIDEO PANEL (LEFT) ─────────────────────────────────── */
.video-panel { width: 180px; background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; flex-shrink: 0; }
.video-panel-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.video-list { flex: 1; overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 6px; }

.upload-drop { border: 2px dashed var(--border); border-radius: 8px; padding: 20px 10px; text-align: center; cursor: pointer; color: var(--muted); transition: border-color 0.15s; }
.upload-drop:hover, .upload-drop.drag-over { border-color: var(--accent); color: var(--text); }
.upload-drop span { font-size: 22px; display: block; margin-bottom: 6px; }
.upload-drop p { font-size: 12px; margin-bottom: 3px; }
.upload-drop small { font-size: 10px; }

.vitem { display: flex; gap: 8px; align-items: center; background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; padding: 6px; cursor: pointer; transition: border-color 0.12s; position: relative; }
.vitem:hover { border-color: var(--muted); }
.vitem.active { border-color: var(--accent2); background: rgba(11,189,183,0.08); }
.vitem.vitem-selected { border-color: #7c3aed; background: rgba(124,58,237,0.08); }
.vitem-check { position: absolute; top: 3px; left: 3px; z-index: 2; cursor: pointer; opacity: 0; transition: opacity 0.1s; }
.vitem:hover .vitem-check, .vitem-selected .vitem-check { opacity: 1; }
.vitem-check input[type=checkbox] { width: 14px; height: 14px; accent-color: #7c3aed; cursor: pointer; }
.vitem-thumb { width: 44px; height: 78px; border-radius: 5px; overflow: hidden; background: #000; position: relative; flex-shrink: 0; }
.vitem-thumb video { width: 100%; height: 100%; object-fit: cover; }
.vitem-num { position: absolute; top: 2px; left: 3px; background: rgba(0,0,0,0.7); color: #fff; font-size: 9px; padding: 0 3px; border-radius: 3px; }
.vitem-status { position: absolute; bottom: 2px; right: 2px; width: 8px; height: 8px; border-radius: 50%; }
.vitem-info { flex: 1; min-width: 0; }
.vitem-name { font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vitem-meta { font-size: 10px; color: var(--muted); margin-top: 2px; display: flex; gap: 4px; }
.vitem-del { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 14px; padding: 0 2px; position: absolute; top: 4px; right: 4px; opacity: 0; transition: opacity 0.1s; }
.vitem:hover .vitem-del { opacity: 1; }
.vitem-del:hover { color: var(--error); }

.status-pending { background: var(--muted); }
.status-processing { background: var(--accent2); }
.status-done { background: var(--success); }
.status-error { background: var(--error); }

/* ─── PREVIEW AREA (CENTER) ──────────────────────────────── */
.preview-area { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding: 16px; gap: 12px; overflow-y: auto; background: var(--bg); }

.phone-wrap { display: flex; flex-direction: column; align-items: center; gap: 10px; }

.phone-frame { background: #1a1a28; border-radius: 32px; border: 3px solid #2a2a40; padding: 8px; box-shadow: 0 0 0 1px #3a3a55, 0 20px 60px rgba(0,0,0,0.25); }
.phone-screen { width: 240px; height: 426px; border-radius: 24px; overflow: hidden; position: relative; background: #000; }
.phone-screen video { width: 100%; height: 100%; object-fit: cover; display: block; }
.text-layer { position: absolute; inset: 0; pointer-events: none; }
.text-overlay { pointer-events: all; user-select: none; cursor: move; padding: 2px 4px; border-radius: 3px; line-height: 1.2; }
.text-overlay.selected { outline: 2px dashed var(--accent2); }
.phone-placeholder { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 13px; pointer-events: none; }

.playback-controls { display: flex; align-items: center; gap: 10px; }
.play-btn { background: var(--surface2); border: 1px solid var(--border); color: var(--text); width: 36px; height: 36px; border-radius: 50%; cursor: pointer; font-size: 14px; transition: all 0.12s; display: flex; align-items: center; justify-content: center; }
.play-btn:hover { border-color: var(--accent); color: var(--accent); }
.time-display { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.mute-orig-toggle { display: flex; align-items: center; gap: 5px; cursor: pointer; font-size: 12px; color: var(--muted); }
.mute-orig-toggle input { accent-color: var(--accent); }

/* Trim bar */
.trim-bar { width: 100%; max-width: 360px; }
.trim-label { font-size: 11px; color: var(--muted); margin-bottom: 6px; }
.trim-track { height: 24px; background: var(--surface2); border-radius: 4px; position: relative; border: 1px solid var(--border); cursor: pointer; }
.trim-filled { position: absolute; top: 0; bottom: 0; background: rgba(37,244,238,0.2); border: 1px solid var(--accent2); border-radius: 3px; pointer-events: none; }
.trim-handle { position: absolute; top: -3px; bottom: -3px; width: 10px; margin-left: -5px; background: var(--accent2); border-radius: 3px; cursor: ew-resize; z-index: 2; }
.trim-handle:hover { background: #fff; }
.trim-playhead { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--accent); pointer-events: none; z-index: 3; }
.trim-times { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); margin-top: 4px; }
.trim-time-input { background: var(--surface2); border: 1px solid var(--border); color: var(--text); padding: 3px 6px; border-radius: 5px; font-size: 12px; width: 52px; text-align: center; }
.trim-time-input:focus { outline: none; border-color: var(--accent2); }
.trim-arrow { color: var(--muted); }
.trim-auto-row { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 11px; color: var(--muted); }
.trim-auto-label { white-space: nowrap; }
.render-concurrency-row { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 12px; color: var(--muted); }

/* ─── TOOLS PANEL (RIGHT) ────────────────────────────────── */
.tools-panel { width: 280px; background: var(--surface); border-left: 1px solid var(--border); display: flex; flex-direction: column; flex-shrink: 0; overflow: hidden; }
.tools-nav { display: flex; flex-direction: column; gap: 2px; padding: 8px; border-bottom: 1px solid var(--border); }
.tool-tab { background: none; border: none; color: var(--muted); padding: 8px 12px; border-radius: 6px; cursor: pointer; text-align: left; font-size: 13px; transition: all 0.12s; }
.tool-tab:hover { background: var(--surface2); color: var(--text); }
.tool-tab.active { background: var(--surface2); color: var(--text); font-weight: 600; }
.tool-content { display: none; flex: 1; overflow-y: auto; padding: 12px; }
.tool-content.active { display: block; }

/* Text tool */
.text-list { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; }
.tl-item { display: flex; align-items: center; gap: 8px; background: var(--surface2); border: 1px solid var(--border); border-radius: 7px; padding: 8px 10px; cursor: pointer; }
.tl-item:hover { border-color: var(--muted); }
.tl-item.active { border-color: var(--accent2); }
.tl-preview { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.tl-del { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 16px; }
.tl-del:hover { color: var(--error); }

.text-editor { background: var(--surface2); border: 1px solid var(--border); border-radius: 9px; padding: 12px; margin-top: 8px; }
.te-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.te-row:last-child { margin-bottom: 0; }
.te-label { font-size: 11px; color: var(--muted); white-space: nowrap; min-width: 50px; }
.te-input { flex: 1; background: var(--bg); border: 1px solid var(--border); color: var(--text); padding: 6px 10px; border-radius: 6px; font-size: 13px; }
.te-input:focus { outline: none; border-color: var(--accent); }
.te-select { background: var(--bg); border: 1px solid var(--border); color: var(--text); padding: 5px 8px; border-radius: 6px; font-size: 12px; }
.te-presets { margin-top: 10px; border-top: 1px solid var(--border); padding-top: 10px; }
.te-preset-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin-top: 6px; }
.te-preset-btn { background: var(--surface2); border: 1px solid var(--border); color: var(--text); padding: 0; border-radius: 10px; cursor: pointer; transition: border-color 0.15s, transform 0.1s; display: flex; flex-direction: column; align-items: center; overflow: hidden; }
.te-preset-btn:hover { border-color: var(--accent); transform: scale(1.03); }
.te-preset-preview { display: flex; align-items: center; justify-content: center; width: 100%; height: 62px; font-size: 26px; font-weight: 900; background: #111; overflow: hidden; flex-shrink: 0; }
.te-preset-name { font-size: 10px; color: var(--muted); padding: 5px 6px; text-align: center; line-height: 1.3; word-break: break-word; }

/* Slider */
.slider { flex: 1; accent-color: var(--accent); cursor: pointer; }
input[type="color"] { width: 28px; height: 24px; border: 1px solid var(--border); border-radius: 5px; background: none; cursor: pointer; padding: 0; }
input[type="checkbox"] { accent-color: var(--accent2); width: 14px; height: 14px; cursor: pointer; }

/* Filters */
.filters-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.filter-card { background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; cursor: pointer; transition: border-color 0.12s; }
.filter-card:hover { border-color: var(--muted); }
.filter-card.active { border-color: var(--accent2); }
.filter-preview { height: 60px; background: linear-gradient(135deg, #c9d4f0 0%, #a8b8e8 50%, #8fa3d8 100%); }
.filter-name { font-size: 10px; text-align: center; padding: 4px; color: var(--muted); }
.filter-card.active .filter-name { color: var(--accent2); }

/* Adjust */
.adjust-list { display: flex; flex-direction: column; gap: 12px; }
.adj-row { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.adj-row span:first-child { min-width: 80px; }
.adj-row span:last-child { min-width: 28px; text-align: right; color: var(--text); }
.adj-check { gap: 12px; }

/* Speed */
.speed-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.speed-btn { background: var(--surface2); border: 1px solid var(--border); color: var(--muted); padding: 8px 14px; border-radius: 7px; cursor: pointer; font-size: 13px; font-weight: 600; transition: all 0.12s; }
.speed-btn:hover { border-color: var(--muted); color: var(--text); }
.speed-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Music */
.music-mode-tabs { display: flex; gap: 4px; margin-bottom: 10px; }
.mode-btn { background: none; border: 1px solid var(--border); color: var(--muted); padding: 5px 10px; border-radius: 5px; cursor: pointer; font-size: 12px; transition: all 0.12s; }
.mode-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.music-panel { display: flex; flex-direction: column; gap: 6px; }
.music-select-list { display: flex; flex-direction: column; gap: 5px; max-height: 200px; overflow-y: auto; }
.ms-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: var(--surface2); border: 1px solid var(--border); border-radius: 7px; cursor: pointer; font-size: 12px; transition: border-color 0.12s; }
.ms-item:hover { border-color: var(--muted); }
.ms-item.active { border-color: var(--accent2); background: rgba(11,189,183,0.08); }
.ms-icon { font-size: 14px; }
.ms-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.music-upload-row { margin-top: 8px; }
.current-music { background: var(--surface3); border: 1px solid var(--accent2); border-radius: 8px; padding: 10px; margin-top: 10px; }
.cm-label { font-size: 10px; color: var(--muted); margin-bottom: 3px; }
.cm-title { font-size: 13px; font-weight: 600; margin-bottom: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pix-search-row { display: flex; gap: 5px; margin-bottom: 8px; flex-wrap: wrap; }
.pix-search-row input, .pix-search-row select { flex: 1; background: var(--bg); border: 1px solid var(--border); color: var(--text); padding: 6px 8px; border-radius: 6px; font-size: 12px; min-width: 60px; }
.pix-results { display: flex; flex-direction: column; gap: 5px; max-height: 200px; overflow-y: auto; }
.pix-item { display: flex; align-items: center; gap: 8px; padding: 7px 10px; background: var(--surface2); border: 1px solid var(--border); border-radius: 7px; font-size: 12px; }
.pix-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ─── RENDER MODAL ───────────────────────────────────────── */
.modal-overlay { position: fixed; inset: 0; background: rgba(10,10,30,0.45); display: flex; align-items: center; justify-content: center; z-index: 999; }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 24px; width: 440px; max-height: 80vh; overflow-y: auto; }
.modal h3 { font-size: 18px; font-weight: 700; margin-bottom: 16px; }
.render-job-list { display: flex; flex-direction: column; gap: 6px; max-height: 280px; overflow-y: auto; margin-bottom: 16px; }
.rj-item { display: flex; align-items: center; gap: 10px; font-size: 13px; padding: 8px 10px; background: var(--surface2); border-radius: 7px; }
.rj-status { font-size: 14px; }
.rj-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rj-info { font-size: 11px; color: var(--error); max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
.render-overall { margin-bottom: 14px; }
.overall-bar-wrap { background: var(--surface2); border-radius: 20px; height: 6px; overflow: hidden; margin-bottom: 8px; }
.overall-bar { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent2)); transition: width 0.35s; border-radius: 20px; }
#render-summary { font-size: 13px; color: var(--muted); }
.render-downloads { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.dl-btn { display: block; background: var(--success); color: #fff; text-decoration: none; padding: 10px 14px; border-radius: 8px; font-size: 13px; font-weight: 600; text-align: center; }
.dl-btn:hover { opacity: 0.88; }

/* ─── BADGE / HINT ───────────────────────────────────────── */
.badge { background: var(--accent); color: #fff; font-size: 10px; padding: 1px 5px; border-radius: 20px; font-weight: 700; }
.hint { font-size: 11px; color: var(--muted); }

/* ─── TOAST ──────────────────────────────────────────────── */
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(16px); background: var(--surface); border: 1px solid var(--border); color: var(--text); padding: 10px 18px; border-radius: 9px; font-size: 13px; opacity: 0; transition: all 0.22s; pointer-events: none; z-index: 9999; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { border-color: var(--success); }
.toast.error { border-color: var(--error); }

/* Textarea */
.te-textarea { resize: vertical; min-height: 60px; font-family: inherit; line-height: 1.5; }
.te-row-col { flex-direction: column; align-items: flex-start; }
.te-row-col .te-label { margin-bottom: 4px; }
.te-row-col .te-input { width: 100%; }
.te-toggle { display:inline-flex; align-items:center; cursor:pointer; }
.te-toggle input { display:none; }
.te-toggle-track { width:36px; height:20px; background:#c8ccdc; border-radius:10px; position:relative; transition:background 0.2s; }
.te-toggle input:checked + .te-toggle-track { background:var(--accent); }
.te-toggle-thumb { position:absolute; top:2px; left:2px; width:16px; height:16px; background:#fff; border-radius:50%; transition:left 0.2s; }
.te-toggle input:checked + .te-toggle-track .te-toggle-thumb { left:18px; }

/* Batch mode */
.batch-tab { border-top: 1px solid var(--border); margin-top: 4px; padding-top: 10px; color: var(--accent2) !important; }
.batch-section { margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.batch-section:last-child { border-bottom: none; }
.batch-title { font-size: 12px; font-weight: 700; color: var(--text); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; }
.batch-textarea { width: 100%; background: var(--bg); border: 1px solid var(--border); color: var(--text); padding: 8px 10px; border-radius: 7px; font-size: 13px; font-family: inherit; line-height: 1.5; resize: vertical; }
.batch-textarea:focus { outline: none; border-color: var(--accent2); }
.batch-text-meta { margin-top: 4px; }
.batch-style-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 12px; color: var(--muted); }
.batch-filter-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }

/* ZIP button */
.zip-btn { background: linear-gradient(135deg, var(--accent2), #0099aa); color: #000; font-weight: 700; text-align: center; }
.zip-btn:hover { opacity: 0.88; }

/* ─── TOPBAR NAV ─────────────────────────────────────────── */
.topbar-nav { display: flex; gap: 4px; margin-left: auto; }
.nav-btn { background: transparent; border: 1px solid transparent; color: var(--muted); padding: 6px 12px; border-radius: 7px; cursor: pointer; font-size: 13px; transition: all 0.12s; }
.nav-btn:hover { color: var(--text); border-color: var(--border); }
.nav-btn.active { color: var(--text); background: var(--surface2); border-color: var(--border); }
.btn-analysis-link { background: transparent; border: none; color: var(--accent2); font-size: 13px; cursor: pointer; padding: 6px 0; margin-top: 8px; display: block; text-align: left; transition: opacity 0.15s; }
.btn-analysis-link:hover { opacity: 0.75; }

/* ─── ANALYSIS PAGE ──────────────────────────────────────── */
.analysis-page { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.analysis-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 32px 16px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.analysis-title { font-size: 22px; font-weight: 800; margin-bottom: 4px; }
.analysis-sub { font-size: 13px; color: var(--muted); max-width: 600px; line-height: 1.5; }
.analysis-body { display: flex; flex: 1; overflow: hidden; gap: 0; }
.analysis-left { width: 300px; flex-shrink: 0; border-right: 1px solid var(--border); padding: 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; background: var(--surface); }
.analysis-right { flex: 1; overflow-y: auto; padding: 16px; background: var(--bg); }
.an-section { display: flex; flex-direction: column; gap: 6px; }
.an-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); }
.an-hint { font-size: 11px; color: var(--muted); line-height: 1.5; }
.an-textarea { background: var(--bg); border: 1px solid var(--border); color: var(--text); padding: 10px 12px; border-radius: 8px; font-size: 13px; font-family: inherit; resize: vertical; width: 100%; line-height: 1.6; }
.an-textarea:focus { outline: none; border-color: var(--accent2); }
.an-sort-btns { display: flex; gap: 4px; flex-wrap: wrap; }
.an-sort-btn { background: var(--surface2); border: 1px solid var(--border); color: var(--muted); padding: 5px 10px; border-radius: 6px; font-size: 12px; cursor: pointer; transition: all 0.12s; }
.an-sort-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.an-errors { background: rgba(255,77,77,0.08); border: 1px solid rgba(255,77,77,0.25); border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.an-err-item { font-size: 11px; color: var(--error); }
.an-insights-box { background: var(--surface2); border: 1px solid var(--border); border-radius: 10px; padding: 14px; font-size: 13px; line-height: 1.7; margin-top: 10px; max-height: 300px; overflow-y: auto; }
.an-api-note { background: rgba(37,244,238,0.05); border: 1px solid rgba(37,244,238,0.15); border-radius: 10px; padding: 12px; }
.an-code { display: block; background: var(--bg); border: 1px solid var(--border); color: var(--accent2); font-family: monospace; font-size: 11px; padding: 6px 10px; border-radius: 5px; margin-top: 5px; word-break: break-all; }

/* Results */
.an-loading { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; height: 200px; color: var(--muted); }
.an-spinner { width: 36px; height: 36px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.an-results { display: flex; flex-direction: column; gap: 10px; }
.an-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 60px 20px; color: var(--muted); text-align: center; }
.an-empty-icon { font-size: 48px; }
.an-api-error { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 40px; color: var(--error); text-align: center; }
.an-card { display: flex; align-items: flex-start; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px; transition: border-color 0.15s; }
.an-card:hover { border-color: var(--accent2); }
.an-card-rank { font-size: 18px; font-weight: 900; color: var(--muted); min-width: 28px; text-align: center; padding-top: 2px; }
.an-card-cover { width: 60px; height: 106px; border-radius: 8px; background-size: cover; background-position: center; flex-shrink: 0; }
.an-card-cover-empty { background: var(--surface2); display: flex; align-items: center; justify-content: center; font-size: 24px; }
.an-card-info { flex: 1; min-width: 0; }
.an-card-source { font-size: 10px; font-weight: 700; color: var(--accent2); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.an-card-desc { font-size: 13px; color: var(--text); margin-bottom: 4px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.an-card-author { font-size: 11px; color: var(--muted); margin-bottom: 8px; }
.an-card-stats { display: flex; flex-wrap: wrap; gap: 8px; }
.an-stat { font-size: 12px; font-weight: 600; }
.an-stat-views { color: #a78bfa; }
.an-stat-likes { color: var(--accent); }
.an-stat-comments { color: var(--accent2); }
.an-card-link { flex-shrink: 0; background: var(--accent); color: #fff; text-decoration: none; padding: 8px 12px; border-radius: 8px; font-size: 12px; font-weight: 600; white-space: nowrap; align-self: center; transition: opacity 0.15s; }
.an-card-link:hover { opacity: 0.85; }

/* ─── TOPBAR USER ────────────────────────────────────────── */
.topbar-user { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.topbar-profile-btn { background: var(--surface2); border: 1px solid var(--border); color: var(--text); font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 7px; cursor: pointer; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: border-color 0.12s; }
.topbar-profile-btn:hover { border-color: var(--accent2); color: var(--accent2); }
.profile-divider { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); border-top: 1px solid var(--border); padding-top: 16px; margin-bottom: 12px; }
.pf-success { background: rgba(45,202,115,0.1); border: 1px solid rgba(45,202,115,0.3); color: var(--success); padding: 10px 14px; border-radius: 8px; font-size: 13px; }

/* ─── LOGIN SCREEN ───────────────────────────────────────── */
.login-screen { position: fixed; inset: 0; background: var(--bg); display: flex; align-items: center; justify-content: center; z-index: 9000; }
.login-bg { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.login-card { position: relative; z-index: 1; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 40px 36px; width: 380px; box-shadow: 0 20px 60px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06); }
.login-logo { font-size: 40px; text-align: center; margin-bottom: 12px; }
.login-title { font-size: 20px; font-weight: 800; text-align: center; margin-bottom: 6px; }
.login-sub { font-size: 13px; color: var(--muted); text-align: center; margin-bottom: 28px; }
.login-form { display: flex; flex-direction: column; gap: 16px; }
.login-field { display: flex; flex-direction: column; gap: 5px; }
.login-label { font-size: 12px; font-weight: 600; color: var(--muted); }
.login-input { background: var(--surface2); border: 1px solid var(--border); color: var(--text); padding: 11px 14px; border-radius: 10px; font-size: 14px; transition: border-color 0.15s; width: 100%; }
.login-input:focus { outline: none; border-color: var(--accent); }
.login-error { background: rgba(255,77,77,0.1); border: 1px solid rgba(255,77,77,0.3); color: var(--error); padding: 10px 14px; border-radius: 8px; font-size: 13px; }

/* ─── ADMIN PAGE ─────────────────────────────────────────── */
.admin-page { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.admin-body { display: flex; flex: 1; overflow: hidden; }
.admin-left { width: 300px; flex-shrink: 0; border-right: 1px solid var(--border); padding: 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; background: var(--surface); }
.admin-right { flex: 1; overflow-y: auto; padding: 20px; background: var(--bg); }
.admin-users-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.admin-user-list { display: flex; flex-direction: column; gap: 8px; }
.au-item { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; transition: border-color 0.15s; }
.au-item:hover { border-color: var(--border); }
.au-me { border-color: rgba(37,244,238,0.3); background: rgba(37,244,238,0.04); }
.au-avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--surface3); display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 700; color: var(--text); flex-shrink: 0; }
.au-admin { background: linear-gradient(135deg, var(--accent), #ff6b35); color: #fff; }
.au-info { flex: 1; min-width: 0; }
.au-name { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.au-username { font-size: 11px; color: var(--muted); margin-top: 2px; }
.au-badge-admin { background: rgba(254,44,85,0.15); color: var(--accent); font-size: 10px; font-weight: 700; padding: 1px 7px; border-radius: 20px; }
.au-badge-me { background: rgba(37,244,238,0.15); color: var(--accent2); font-size: 10px; padding: 1px 7px; border-radius: 20px; }
.au-actions { display: flex; gap: 5px; flex-shrink: 0; }
.au-del-btn { color: var(--error) !important; border-color: rgba(255,77,77,0.3) !important; }
.au-del-btn:hover { background: rgba(255,77,77,0.1) !important; }

/* Scrollbar */
::-webkit-scrollbar { width: 4px; } ::-webkit-scrollbar-thumb { background: #c8ccdc; border-radius: 10px; }

/* My Projects section on landing */
.my-projects-section { margin-top: 28px; width: 100%; max-width: 680px; }
.my-projects-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.my-projects-title { font-size: 14px; font-weight: 700; color: var(--text); }
.my-projects-hint { font-size: 11px; color: var(--muted); }
.my-projects-list { display: flex; flex-direction: column; gap: 8px; }
.mp-item { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 16px; cursor: pointer; transition: border-color 0.15s, background 0.15s; box-shadow: 0 1px 4px rgba(0,0,0,0.05); }
.mp-item:hover { border-color: var(--accent2); background: rgba(11,189,183,0.05); }
.mp-icon { font-size: 20px; flex-shrink: 0; }
.mp-info { flex: 1; min-width: 0; }
.mp-name { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-meta { font-size: 11px; color: var(--muted); margin-top: 2px; }
.mp-status-done { color: #4ade80; }
.mp-status-processing { color: var(--accent); }
.mp-timer { font-size: 11px; color: var(--error); font-weight: 600; flex-shrink: 0; }
.mp-del { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 16px; padding: 4px; border-radius: 6px; flex-shrink: 0; }
.mp-del:hover { color: var(--error); background: rgba(255,77,77,0.1); }
.music-page { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.music-lib-body { display: flex; gap: 0; flex: 1; overflow: hidden; }
.music-lib-upload { width: 280px; flex-shrink: 0; border-right: 1px solid var(--border); padding: 20px; background: var(--surface); display: flex; flex-direction: column; gap: 6px; }
.music-lib-list-wrap { flex: 1; overflow-y: auto; padding: 20px; background: var(--bg); }
.music-lib-list { display: flex; flex-direction: column; gap: 8px; }
.ml-item { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; }
.ml-item-title { flex: 1; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ml-item-meta { font-size: 11px; color: var(--muted); }
.ml-del { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 16px; padding: 4px; }
.ml-del:hover { color: var(--error); }
.ml-play { background: none; border: 1px solid var(--border); color: var(--text); cursor: pointer; font-size: 13px; padding: 5px 10px; border-radius: 6px; }
.ml-play:hover { border-color: var(--accent2); }

/* ─── MOBILE RESPONSIVE ──────────────────────────────────────── */
@media (max-width: 768px) {
  body { overflow: auto; }

  /* Topbar */
  .topbar { padding: 0 10px; gap: 8px; height: 48px; flex-wrap: nowrap; }
  .topbar-logo { font-size: 13px; white-space: nowrap; }
  .topbar-actions { gap: 4px; }
  .topbar-actions .btn-ghost.btn-back-home { font-size: 12px; padding: 6px 8px; }
  .project-title { display: none; }
  .btn-render { font-size: 12px; padding: 6px 12px; }
  .apply-all-btn, #apply-all-btn { display: none; }
  .topbar-nav { gap: 2px; }
  .nav-btn { font-size: 11px; padding: 5px 8px; }
  .topbar-user { gap: 5px; }
  .topbar-profile-btn { font-size: 12px; padding: 5px 8px; max-width: 100px; }

  /* Landing */
  .landing { flex-direction: column; padding: 20px 16px; align-items: center; text-align: center; gap: 24px; }
  .landing-preview { display: none; }
  .landing-content { max-width: 100%; }
  .landing-title { font-size: 32px; }
  .landing-sub { font-size: 14px; margin-bottom: 24px; }
  .landing-features { grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 24px; }
  .landing-input-wrap { flex-direction: column; align-items: stretch; }
  .landing-input { width: 100%; }
  .btn-cta { width: 100%; justify-content: center; }
  .my-projects-section { max-width: 100%; }

  /* Login */
  .login-card { width: 90vw; padding: 28px 20px; }
  .login-title { font-size: 17px; }

  /* Editor layout — stack vertically */
  .editor { flex-direction: column; overflow: auto; height: auto; }

  /* Video panel — horizontal strip */
  .video-panel { width: 100%; height: auto; border-right: none; border-bottom: 1px solid var(--border); flex-direction: column; }
  .video-list { flex-direction: row; overflow-x: auto; padding: 6px 8px; gap: 6px; flex: unset; max-height: none; }
  .vitem { min-width: 72px; flex-direction: column; gap: 4px; padding: 4px; }
  .vitem-thumb { width: 40px; height: 70px; }
  .vitem-info { display: none; }
  .vitem-del { opacity: 1; }
  .upload-drop { min-width: 70px; padding: 10px 6px; font-size: 11px; }
  .upload-drop span { font-size: 18px; }
  .upload-drop p, .upload-drop small { display: none; }
  .video-panel-head { padding: 6px 10px; }

  /* Preview area */
  .preview-area { padding: 10px; gap: 8px; }
  .phone-screen { width: 180px; height: 320px; }
  .phone-frame { padding: 5px; }

  /* Tools panel — full width at bottom */
  .tools-panel { width: 100%; border-left: none; border-top: 1px solid var(--border); max-height: 380px; }
  .tools-nav { flex-direction: row; overflow-x: auto; flex-wrap: nowrap; padding: 6px 8px; gap: 4px; border-bottom: 1px solid var(--border); }
  .tool-tab { white-space: nowrap; font-size: 12px; padding: 6px 10px; }

  /* Modals */
  .modal { width: 92vw; padding: 16px; }
  .modal-overlay { align-items: flex-end; padding-bottom: 0; }
  .modal { border-radius: 16px 16px 0 0; max-height: 85vh; }

  /* Analysis page */
  .analysis-body { flex-direction: column; }
  .analysis-left { width: 100%; border-right: none; border-bottom: 1px solid var(--border); max-height: 260px; }
  .analysis-header { padding: 14px 16px 10px; }
  .analysis-title { font-size: 17px; }

  /* Admin page */
  .admin-body { flex-direction: column; }
  .admin-left { width: 100%; border-right: none; border-bottom: 1px solid var(--border); }

  /* Music page */
  .music-lib-body { flex-direction: column; }
  .music-lib-upload { width: 100%; border-right: none; border-bottom: 1px solid var(--border); }

  /* Batch */
  .batch-filter-grid { grid-template-columns: repeat(3, 1fr); }

  /* My projects */
  .mp-item { padding: 10px 12px; gap: 8px; }
  .mp-name { font-size: 12px; }

  /* Trim bar */
  .trim-bar { max-width: 100%; }
}

@media (max-width: 420px) {
  .landing-features { grid-template-columns: 1fr 1fr; }
  .landing-title { font-size: 26px; }
  .nav-btn { font-size: 10px; padding: 4px 6px; }
  .topbar-logo { display: none; }
  .phone-screen { width: 150px; height: 267px; }
  .tools-panel { max-height: 340px; }
  .te-preset-grid { grid-template-columns: repeat(2, 1fr); }
}
