:root {
    --bg-base: #06070a;
    --bg-surface: #0b0d12;
    --bg-elevated: #11141b;
    --bg-glass: rgba(15, 18, 25, 0.68);

    --accent-primary: #b9a7ff;
    --accent-secondary: #8cc8ff;
    --accent-soft: rgba(185, 167, 255, 0.12);

    --text-main: #f7f7fb;
    --text-muted: #9499aa;
    --text-dim: #686d7d;

    --border-subtle: rgba(255, 255, 255, 0.075);
    --border-highlight: rgba(185, 167, 255, 0.28);

    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 22px;
    --radius-xl: 28px;

    --shadow-soft: 0 16px 50px rgba(0, 0, 0, 0.28);
    --shadow-deep: 0 30px 90px rgba(0, 0, 0, 0.55);
    --transition: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Inter', 'Geist', -apple-system, sans-serif; }

body { background-color: var(--bg-base); color: var(--text-main); min-height: 100vh; overflow-x: hidden; -webkit-font-smoothing: antialiased; }

/* --- Cinematic Modal Gateway --- */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(3, 4, 7, 0.85); backdrop-filter: blur(40px); -webkit-backdrop-filter: blur(40px); display: flex; align-items: center; justify-content: center; z-index: 1000; opacity: 1; transition: opacity var(--transition); overflow: hidden; }

.modal-glow { position: absolute; width: 600px; height: 600px; background: radial-gradient(circle, rgba(184, 167, 255, 0.15) 0%, transparent 70%); top: 50%; left: 50%; transform: translate(-50%, -50%); pointer-events: none; z-index: 0; }

.modal-card { position: relative; z-index: 1; background: rgba(11, 13, 18, 0.6); border: 1px solid var(--border-highlight); padding: 48px 40px; border-radius: var(--radius-lg); width: 100%; max-width: 420px; box-shadow: 0 40px 80px rgba(0,0,0,0.9), inset 0 0 20px rgba(0,0,0,0.5); overflow: hidden; }

.modal-card::before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 1px; background: linear-gradient(90deg, transparent, var(--accent-primary), transparent); opacity: 0.8; box-shadow: 0 2px 10px var(--accent-primary); }

.modal-header { text-align: center; margin-bottom: 32px; }
.modal-title { font-size: 28px; font-weight: 700; color: var(--text-main); letter-spacing: 6px; margin-bottom: 8px; font-family: 'Geist', sans-serif; text-shadow: 0 0 20px rgba(255,255,255,0.2); }
.modal-subtitle { font-size: 10px; color: var(--accent-primary); letter-spacing: 4px; font-weight: 600; opacity: 0.8; }

.auth-tabs { display: flex; gap: 4px; margin-bottom: 32px; background: rgba(0,0,0,0.4); padding: 4px; border-radius: var(--radius-sm); border: 1px solid var(--border-subtle); }
.auth-tab { flex: 1; background: transparent; border: none; padding: 10px; color: var(--text-muted); font-size: 11px; font-weight: 600; cursor: pointer; border-radius: 4px; transition: var(--transition); letter-spacing: 1px; text-transform: uppercase; }
.auth-tab.active { background: rgba(184, 167, 255, 0.1); color: var(--accent-primary); box-shadow: 0 2px 8px rgba(0,0,0,0.4); border: 1px solid rgba(184, 167, 255, 0.25); text-shadow: 0 0 8px rgba(184, 167, 255, 0.5); }

.input-group { margin-bottom: 20px; display: flex; flex-direction: column; gap: 8px; }
.input-group label { font-size: 10px; font-weight: 700; color: var(--text-muted); letter-spacing: 2px; }

.cinematic-input { width: 100%; background: rgba(0,0,0,0.5); border: 1px solid var(--border-subtle); color: var(--text-main); padding: 16px; border-radius: var(--radius-sm); font-size: 13px; outline: none; transition: var(--transition); letter-spacing: 1px; font-family: 'Geist', monospace; box-shadow: inset 0 2px 10px rgba(0,0,0,0.5); }
.cinematic-input:focus { border-color: var(--accent-primary); background: rgba(184, 167, 255, 0.05); box-shadow: 0 0 15px rgba(184, 167, 255, 0.15), inset 0 2px 10px rgba(0,0,0,0.5); }
.cinematic-input::placeholder { color: rgba(133, 138, 154, 0.3); letter-spacing: 0.5px; }

.auth-submit-btn { width: 100%; margin-top: 12px; padding: 16px; font-size: 12px; letter-spacing: 3px; text-transform: uppercase; }
.auth-submit-btn:hover { box-shadow: 0 0 25px rgba(255,255,255,0.2); }

.modal-footer { margin-top: 32px; text-align: center; border-top: 1px solid var(--border-subtle); padding-top: 16px; }
.modal-footer p { font-size: 10px; color: var(--text-muted); opacity: 0.4; font-family: monospace; letter-spacing: 1px; text-transform: uppercase; }

/* Anamorphic Background Elements */
.anamorphic-bg { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; overflow: hidden; }
.flare { position: absolute; filter: blur(120px); opacity: 0.15; border-radius: 50%; }
.flare-1 { background: var(--accent-primary); width: 800px; height: 300px; top: -150px; left: 20%; transform: rotate(-15deg); }
.flare-2 { background: var(--accent-secondary); width: 600px; height: 250px; bottom: -100px; right: 10%; transform: rotate(15deg); opacity: 0.1; }
.light-streak { position: absolute; top: 30%; left: -10%; width: 120%; height: 1px; background: linear-gradient(90deg, transparent, rgba(184, 167, 255, 0.3), transparent); filter: blur(2px); transform: rotate(-5deg); opacity: 0.5; }

/* Navigation */
.navbar { display: flex; justify-content: space-between; align-items: center; padding: 24px 48px; border-bottom: 1px solid var(--border-subtle); background: rgba(7, 8, 12, 0.6); backdrop-filter: blur(20px); position: sticky; top: 0; z-index: 100; }
.nav-brand { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 14px; letter-spacing: 2px; color: var(--text-main); }
.nav-brand svg { color: var(--accent-primary); }
.nav-links { display: flex; gap: 32px; }
.nav-links a { color: var(--text-muted); text-decoration: none; font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: 1px; transition: var(--transition); }
.nav-links a:hover, .nav-links a.active { color: var(--text-main); }

/* Hero Section */
.hero { text-align: center; padding: 100px 24px 80px; max-width: 800px; margin: 0 auto; }
.hero-label { font-size: 11px; color: var(--accent-primary); letter-spacing: 3px; font-weight: 600; margin-bottom: 24px; }
.hero-title { font-size: 56px; font-weight: 700; letter-spacing: -2px; margin-bottom: 16px; color: var(--text-main); line-height: 1.1; }
.hero-subtitle { font-size: 16px; color: var(--text-muted); line-height: 1.5; margin-bottom: 40px; font-weight: 400; }
.hero-actions { display: flex; gap: 16px; justify-content: center; margin-bottom: 32px; }
.hero-trust { font-size: 12px; color: var(--text-muted); opacity: 0.6; }

/* Buttons */
.btn-primary { background: var(--text-main); color: var(--bg-base); border: 1px solid var(--text-main); padding: 12px 28px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; cursor: pointer; transition: var(--transition); letter-spacing: 0.5px; }
.btn-primary:hover { background: transparent; color: var(--text-main); }
.btn-primary.outline { background: transparent; color: var(--text-main); border-color: var(--border-highlight); }
.btn-primary.outline:hover { background: var(--text-main); color: var(--bg-base); }
.btn-secondary { background: var(--bg-surface); color: var(--text-main); border: 1px solid var(--border-subtle); padding: 12px 28px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 500; cursor: pointer; transition: var(--transition); }
.btn-secondary:hover { border-color: var(--border-highlight); background: var(--bg-elevated); }
.btn-text { background: transparent; color: var(--text-muted); border: none; font-size: 13px; font-weight: 500; cursor: pointer; padding: 12px; transition: var(--transition); }
.btn-text:hover { color: var(--text-main); }

/* Workspace Container */
.workspace-container { max-width: 1100px; margin: 0 auto 100px; padding: 0 24px; }

/* Drop Zone */
.upload-zone { border: 1px dashed var(--border-highlight); background: rgba(11, 13, 18, 0.4); border-radius: var(--radius-lg); padding: 80px 24px; text-align: center; transition: var(--transition); cursor: pointer; backdrop-filter: blur(10px); }
.upload-zone:hover, .upload-zone.drag-over { border-color: var(--accent-primary); background: var(--bg-surface); box-shadow: 0 0 20px rgba(184, 167, 255, 0.1); }
.upload-inner { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.upload-inner svg { color: var(--text-muted); margin-bottom: 12px; transition: var(--transition); }
.upload-zone:hover svg { color: var(--accent-primary); transform: translateY(-4px); }
.upload-inner h3 { font-size: 13px; font-weight: 700; letter-spacing: 2px; color: var(--text-main); }
.upload-inner p { font-size: 14px; color: var(--text-muted); }
.upload-inner span { font-size: 11px; color: var(--text-muted); opacity: 0.6; letter-spacing: 1px; margin-bottom: 16px; }

/* Workspace Panel */
.panel-layout { display: grid; grid-template-columns: 1fr 340px; gap: 24px; }
.control-card, .info-card, .preview-card, .action-card { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: 24px; margin-bottom: 24px; }
.flex-row { display: flex; gap: 32px; justify-content: space-between; }

.section-label { font-size: 10px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 2px; margin-bottom: 20px; display: block; }
.slider-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.slider-header label { font-size: 11px; font-weight: 700; color: var(--text-muted); letter-spacing: 1.5px; }
.val-badge { font-family: 'Geist', monospace; font-size: 14px; color: var(--accent-primary); font-weight: 500; }

.cinematic-slider { -webkit-appearance: none; width: 100%; background: transparent; margin-bottom: 16px; }
.cinematic-slider:focus { outline: none; }
.cinematic-slider::-webkit-slider-runnable-track { width: 100%; height: 2px; background: var(--border-highlight); border-radius: 1px; cursor: pointer; }
.cinematic-slider::-webkit-slider-thumb { height: 16px; width: 16px; border-radius: 50%; background: var(--text-main); -webkit-appearance: none; margin-top: -7px; cursor: pointer; transition: var(--transition); border: 2px solid var(--bg-base); box-shadow: 0 0 10px rgba(184, 167, 255, 0.2); }
.cinematic-slider::-webkit-slider-thumb:hover { transform: scale(1.3); background: var(--accent-primary); }

.preset-row { display: flex; gap: 8px; flex-wrap: wrap; }
.preset-row button { background: transparent; border: 1px solid var(--border-subtle); color: var(--text-muted); padding: 6px 12px; border-radius: 4px; font-size: 11px; cursor: pointer; transition: var(--transition); font-family: monospace; }
.preset-row button:hover { border-color: var(--border-highlight); color: var(--text-main); }
.preset-row button.active { background: var(--border-subtle); color: var(--text-main); border-color: var(--accent-primary); }

/* --- Cinematic Select Dropdowns --- */
select.cinematic-select {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    /* Safely encoded SVG with explicit 16x16 dimensions */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23B8A7FF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 16px center !important;
    background-size: 16px 16px !important;
    padding-right: 48px;
    cursor: pointer;
}

/* Arrow turns Blue and flips when clicked/focused */
select.cinematic-select:focus,
select.cinematic-select:active {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238CC8FF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='18 15 12 9 6 15'%3E%3C/polyline%3E%3C/svg%3E") !important;
}

/* Style the actual dropdown list popup */
select.cinematic-select option {
    background-color: var(--bg-elevated);
    color: var(--text-main);
    font-family: 'Geist', 'Inter', monospace;
    font-weight: 500;
    padding: 12px;
}

.format-settings, .loudness-settings { flex: 1; }
.format-toggles { display: flex; gap: 16px; margin-bottom: 16px; }
.format-toggles label { font-size: 12px; color: var(--text-main); display: flex; align-items: center; gap: 6px; cursor: pointer; }
.format-toggles input { accent-color: var(--accent-primary); }
.advanced-formats select { background: var(--bg-elevated); color: var(--text-muted); border: 1px solid var(--border-subtle); padding: 6px 10px; border-radius: 4px; font-size: 11px; margin-right: 8px; outline: none; margin-bottom: 8px;}

.toggle-wrap { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--text-main); margin-bottom: 12px; }
.switch { position: relative; display: inline-block; width: 36px; height: 20px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider.round { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: var(--bg-elevated); border: 1px solid var(--border-subtle); transition: .3s; border-radius: 20px; }
.slider.round:before { position: absolute; content: ""; height: 12px; width: 12px; left: 3px; bottom: 3px; background-color: var(--text-muted); transition: .3s; border-radius: 50%; }
input:checked + .slider.round { border-color: var(--accent-primary); }
input:checked + .slider.round:before { transform: translateX(16px); background-color: var(--accent-primary); }

.info-grid { display: grid; grid-template-columns: 80px 1fr; gap: 12px; font-size: 12px; margin-bottom: 24px; align-items: center;}
.info-grid span { color: var(--text-muted); }
.info-grid strong { color: var(--text-main); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: monospace;}
.editable-name { border-bottom: 1px dashed var(--border-highlight); outline: none; padding-bottom: 2px; cursor: text; }

.mini-waveform { display: flex; align-items: center; justify-content: space-between; height: 24px; opacity: 0.5; }
.mini-waveform .bar { width: 2px; background: var(--accent-primary); border-radius: 1px; height: 100%; animation: wf 1.5s infinite ease-in-out alternate; }
.mini-waveform .bar:nth-child(even) { animation-delay: 0.3s; height: 60%; }
@keyframes wf { 0% { transform: scaleY(0.3); } 100% { transform: scaleY(1); } }

.preview-flow { display: flex; flex-direction: column; gap: 8px; font-family: monospace; font-size: 12px; }
.flow-item { display: flex; justify-content: space-between; padding: 6px 0; color: var(--text-muted); border-bottom: 1px solid rgba(255,255,255,0.02); }
.flow-item strong { color: var(--text-main); }
.flow-item.highlight strong { color: var(--accent-primary); font-size: 13px; }
.flow-arrow { text-align: center; color: var(--border-highlight); font-size: 10px; margin: -2px 0; }

.action-card { display: flex; justify-content: space-between; align-items: center; border: none; background: transparent; padding: 0; }

.status-panel { text-align: center; padding: 80px 24px; }
.status-loader { width: 200px; height: 2px; background: var(--bg-elevated); margin: 0 auto 32px; border-radius: 1px; overflow: hidden; position: relative; }
.loader-bar { position: absolute; left: 0; top: 0; height: 100%; width: 50%; background: var(--accent-primary); animation: load 1.5s infinite ease-in-out; }
@keyframes load { 0% { transform: translateX(-100%); } 100% { transform: translateX(200%); } }
#status-title { font-size: 14px; font-weight: 700; letter-spacing: 2px; margin-bottom: 32px; color: var(--text-main); }
.status-steps { display: inline-flex; flex-direction: column; gap: 12px; text-align: left; }
.status-steps .step { font-size: 12px; color: var(--text-muted); opacity: 0.5; transition: var(--transition); }
.status-steps .step.active { opacity: 1; color: var(--accent-primary); font-weight: 500; }

.result-panel { text-align: center; padding: 64px 24px; background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); }
.result-icon { width: 48px; height: 48px; border: 1px solid var(--border-highlight); color: var(--accent-primary); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 20px; margin: 0 auto 24px; box-shadow: 0 0 20px rgba(184, 167, 255, 0.1); }
.result-panel h3 { font-size: 16px; font-weight: 700; letter-spacing: 2px; margin-bottom: 32px; }
.asset-display { background: var(--bg-base); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: 24px; margin-bottom: 32px; display: inline-block; min-width: 300px;}
.asset-display span { display: block; font-size: 10px; color: var(--text-muted); letter-spacing: 2px; text-transform: uppercase; margin-bottom: 8px; }
.asset-display strong { font-size: 28px; font-family: monospace; color: var(--text-main); letter-spacing: 1px;}
.result-actions { display: flex; gap: 16px; justify-content: center; align-items: center; }

.section-title { font-size: 14px; font-weight: 700; letter-spacing: 2px; color: var(--text-main); margin-bottom: 32px; padding-bottom: 16px; border-bottom: 1px solid var(--border-subtle); }
.tools-section, .history-section { max-width: 1100px; margin: 0 auto 100px; padding: 0 24px; }
.tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; }
.tool-card { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: 24px; position: relative; transition: var(--transition); }
.tool-card svg { color: var(--accent-primary); margin-bottom: 16px; }
.tool-card h4 { font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.tool-card p { font-size: 12px; color: var(--text-muted); line-height: 1.5; }
.tool-card.active-tool { border-color: var(--border-highlight); background: var(--bg-elevated); }
.tool-card.coming-soon { opacity: 0.4; }
.tool-card.coming-soon span { position: absolute; top: 24px; right: 24px; font-size: 9px; font-weight: 700; letter-spacing: 1px; color: var(--text-muted); text-transform: uppercase; border: 1px solid var(--border-subtle); padding: 4px 8px; border-radius: 4px; }

.about-card { background: var(--bg-surface); border: 1px solid var(--border-subtle); padding: 32px; border-radius: var(--radius-md); }
.about-content h3 { font-size: 18px; margin-bottom: 16px; color: var(--text-main); }
.about-content p { font-size: 13px; line-height: 1.6; color: var(--text-muted); margin-bottom: 12px; }
.about-content p strong, .about-content p em { color: var(--accent-primary); font-style: normal; }

.history-list { display: flex; flex-direction: column; gap: 16px; }
.history-item { background: var(--bg-surface); border: 1px solid var(--border-subtle); padding: 20px 24px; border-radius: var(--radius-md); display: flex; justify-content: space-between; align-items: center; transition: var(--transition); }
.history-item:hover { border-color: var(--border-highlight); background: var(--bg-elevated); }
.hist-info { display: flex; flex-direction: column; gap: 6px; }
.hist-name { font-size: 14px; font-weight: 500; }
.hist-meta { font-size: 11px; color: var(--text-muted); font-family: monospace; }
.hist-actions { display: flex; align-items: center; gap: 16px; }
.status-lbl { font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; }
.status-lbl.completed { color: var(--accent-primary); }
.status-lbl.processing { color: var(--accent-secondary); }

.hidden { display: none !important; opacity: 0; pointer-events: none; }
#toast-container { position: fixed; bottom: 32px; right: 32px; display: flex; flex-direction: column; gap: 12px; z-index: 9999; }
.toast { background: var(--bg-elevated); color: var(--text-main); border: 1px solid var(--border-highlight); padding: 16px 24px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 500; box-shadow: 0 10px 30px rgba(0,0,0,0.5); }

@media (max-width: 900px) {
    .panel-layout { grid-template-columns: 1fr; }
    .flex-row { flex-direction: column; gap: 24px; }
    .navbar { padding: 20px; }
    .nav-links { display: none; }
    .hero-title { font-size: 40px; }
    .result-actions { flex-direction: column; }
    .history-item { flex-direction: column; align-items: flex-start; gap: 16px; }
    .hist-actions { width: 100%; justify-content: space-between; }
}

/* =========================================================
   MODERN 2026 UI OVERRIDES
   Keeps existing HTML/JS selectors intact.
   ========================================================= */

html {
    scroll-behavior: smooth;
}

body {
    background:
        radial-gradient(circle at 50% -10%, rgba(185,167,255,.075), transparent 34rem),
        radial-gradient(circle at 90% 75%, rgba(140,200,255,.045), transparent 30rem),
        var(--bg-base);
    line-height: 1.5;
}

button,
input,
select {
    -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 3px;
}

/* Background */
.anamorphic-bg {
    opacity: .8;
}

.flare {
    filter: blur(140px);
    opacity: .11;
}

.light-streak {
    opacity: .28;
}

/* Navigation */
.navbar {
    min-height: 72px;
    padding: 16px clamp(18px, 4vw, 48px);
    border-bottom: 1px solid rgba(255,255,255,.065);
    background: rgba(6,7,10,.68);
    backdrop-filter: blur(24px) saturate(140%);
    -webkit-backdrop-filter: blur(24px) saturate(140%);
}

.nav-brand {
    gap: 10px;
    font-size: 13px;
    letter-spacing: 1.5px;
}

.nav-brand svg {
    filter: drop-shadow(0 0 10px rgba(185,167,255,.35));
}

.nav-links {
    gap: clamp(16px, 3vw, 32px);
}

.nav-links a {
    position: relative;
    padding: 10px 0;
    font-size: 11px;
}

.nav-links a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 3px;
    width: 100%;
    height: 1px;
    transform: scaleX(0);
    transform-origin: center;
    background: var(--accent-primary);
    box-shadow: 0 0 12px rgba(185,167,255,.7);
    transition: transform var(--transition);
}

.nav-links a:hover::after,
.nav-links a.active::after {
    transform: scaleX(1);
}

/* Hero */
.hero {
    width: min(900px, 100%);
    padding: clamp(72px, 10vw, 120px) 20px clamp(56px, 8vw, 90px);
}

.hero-label {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 20px;
    padding: 7px 11px;
    border: 1px solid var(--border-subtle);
    border-radius: 999px;
    background: rgba(185,167,255,.055);
    font-size: 9px;
    letter-spacing: 2.5px;
}

.hero-title {
    max-width: 780px;
    margin-inline: auto;
    font-size: clamp(38px, 6vw, 68px);
    letter-spacing: clamp(-1.8px, -.12vw, -3px);
    line-height: .98;
    text-wrap: balance;
}

.hero-subtitle {
    max-width: 620px;
    margin: 20px auto 34px;
    font-size: clamp(14px, 1.7vw, 16px);
    text-wrap: balance;
}

.hero-actions {
    flex-wrap: wrap;
    gap: 10px;
}

/* Buttons */
.btn-primary,
.btn-secondary,
.btn-text {
    min-height: 44px;
}

.btn-primary,
.btn-secondary {
    position: relative;
    overflow: hidden;
}

.btn-primary::before,
.btn-secondary::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, transparent 25%, rgba(255,255,255,.12), transparent 75%);
    transform: translateX(-120%);
    transition: transform .6s ease;
}

.btn-primary:hover::before,
.btn-secondary:hover::before {
    transform: translateX(120%);
}

/* Main workspace */
.workspace-container,
.tools-section,
.history-section {
    width: min(1160px, 100%);
}

.upload-zone {
    min-height: 270px;
    display: grid;
    place-items: center;
    padding: clamp(44px, 7vw, 80px) 20px;
    background:
        linear-gradient(180deg, rgba(255,255,255,.018), transparent),
        rgba(11,13,18,.48);
    box-shadow: var(--shadow-soft);
}

.upload-zone:hover,
.upload-zone.drag-over {
    transform: translateY(-2px);
    box-shadow: 0 20px 60px rgba(0,0,0,.3), 0 0 40px rgba(185,167,255,.07);
}

.upload-inner h3 {
    font-size: 12px;
}

.upload-inner p {
    max-width: 420px;
    line-height: 1.6;
}

/* Cards */
.control-card,
.info-card,
.preview-card,
.action-card,
.tool-card,
.about-card,
.history-item,
.result-panel {
    background:
        linear-gradient(180deg, rgba(255,255,255,.018), transparent 55%),
        var(--bg-surface);
    box-shadow: 0 12px 40px rgba(0,0,0,.14);
}

.control-card,
.info-card,
.preview-card {
    padding: clamp(18px, 3vw, 26px);
}

.control-card:hover,
.info-card:hover,
.preview-card:hover,
.tool-card:hover,
.history-item:hover {
    border-color: rgba(185,167,255,.18);
}

.panel-layout {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
    gap: 20px;
}

.flex-row {
    gap: clamp(20px, 4vw, 36px);
}

/* Inputs */
.cinematic-input,
select.cinematic-select {
    min-height: 48px;
    border-radius: 12px;
    background: rgba(0,0,0,.34);
    border-color: rgba(255,255,255,.08);
}

.cinematic-input:hover,
select.cinematic-select:hover {
    border-color: rgba(185,167,255,.18);
}

.cinematic-input:focus,
select.cinematic-select:focus {
    border-color: var(--accent-primary);
    box-shadow:
        0 0 0 3px rgba(185,167,255,.08),
        0 0 24px rgba(185,167,255,.08),
        inset 0 2px 10px rgba(0,0,0,.4);
}

/* Slider */
.cinematic-slider::-webkit-slider-runnable-track {
    height: 4px;
    background: linear-gradient(90deg, rgba(185,167,255,.42), var(--border-highlight));
    border-radius: 99px;
}

.cinematic-slider::-webkit-slider-thumb {
    width: 18px;
    height: 18px;
    margin-top: -7px;
    box-shadow: 0 0 0 4px rgba(185,167,255,.08), 0 0 18px rgba(185,167,255,.28);
}

/* Select */
select.cinematic-select {
    width: 100%;
}

/* Toggle */
.slider.round {
    background: rgba(255,255,255,.045);
}

input:checked + .slider.round {
    background: rgba(185,167,255,.10);
    box-shadow: 0 0 14px rgba(185,167,255,.12);
}

/* Preview / status */
.preview-flow {
    gap: 4px;
}

.flow-item {
    padding: 9px 0;
}

.status-panel {
    padding: clamp(54px, 8vw, 80px) 20px;
}

.result-panel {
    padding: clamp(42px, 7vw, 64px) 20px;
}

.asset-display {
    width: min(100%, 420px);
    min-width: 0;
    margin-bottom: 28px;
}

.asset-display strong {
    font-size: clamp(22px, 4vw, 28px);
    overflow-wrap: anywhere;
}

/* Tools */
.tools-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
}

.tool-card {
    min-height: 170px;
}

.tool-card:not(.coming-soon):hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-soft);
}

/* History */
.history-item {
    gap: 18px;
}

.hist-info {
    min-width: 0;
}

.hist-name,
.hist-meta {
    overflow-wrap: anywhere;
}

.hist-actions {
    flex-shrink: 0;
}

/* Toast */
#toast-container {
    width: min(380px, calc(100vw - 32px));
    right: 16px;
    bottom: 16px;
}

.toast {
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

/* Mobile / tablet */
@media (max-width: 900px) {
    .panel-layout {
        grid-template-columns: 1fr;
    }

    .navbar {
        padding: 14px 18px;
    }

    .hero {
        padding-top: 70px;
    }

    .hero-title {
        font-size: clamp(38px, 10vw, 52px);
    }

    .action-card {
        gap: 16px;
        flex-wrap: wrap;
    }
}

@media (max-width: 640px) {
    .navbar {
        min-height: 64px;
    }

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

    .hero {
        padding: 58px 16px 48px;
    }

    .hero-title {
        font-size: clamp(34px, 11vw, 46px);
    }

    .hero-subtitle {
        font-size: 14px;
        margin-bottom: 26px;
    }

    .hero-actions {
        width: 100%;
        flex-direction: column;
    }

    .hero-actions > button,
    .hero-actions > a {
        width: 100%;
    }

    .workspace-container,
    .tools-section,
    .history-section {
        padding-inline: 16px;
        margin-bottom: 64px;
    }

    .upload-zone {
        min-height: 230px;
        border-radius: 18px;
    }

    .upload-inner p {
        font-size: 13px;
    }

    .control-card,
    .info-card,
    .preview-card,
    .about-card {
        border-radius: 14px;
    }

    .flex-row {
        gap: 20px;
    }

    .format-toggles {
        flex-direction: column;
        gap: 10px;
    }

    .advanced-formats select {
        width: 100%;
        margin-right: 0;
    }

    .result-actions {
        width: 100%;
        flex-direction: column;
    }

    .result-actions > button,
    .result-actions > a {
        width: 100%;
    }

    .history-item {
        align-items: stretch;
        padding: 17px;
    }

    .hist-actions {
        width: 100%;
        justify-content: space-between;
    }

    .hist-actions button {
        min-height: 42px;
    }

    .section-title {
        margin-bottom: 22px;
    }
}

@media (max-width: 420px) {
    .hero-label {
        font-size: 8px;
        letter-spacing: 2px;
    }

    .hero-title {
        font-size: 32px;
    }

    .upload-zone {
        padding: 42px 16px;
    }

    .section-label {
        margin-bottom: 14px;
    }

    .slider-header {
        gap: 10px;
    }
}

/* Reduce motion for users who request it */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}
