/* ============================================
   Luminary AI Music Video — Main Stylesheet
   Sibling to Luminary AI Video
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=DM+Sans:wght@300;400;500&display=swap');

/* ---- Variables ---- */
:root {
    --bg:           #0a0a0f;
    --bg2:          #111118;
    --bg3:          #1a1a24;
    --border:       #2a2a38;
    --border2:      #3a3a50;
    --accent:       #6c63ff;
    --accent2:      #a78bfa;
    --accent-glow:  rgba(108,99,255,0.25);
    --success:      #22c55e;
    --danger:       #ef4444;
    --warning:      #f59e0b;
    --text:         #e8e8f0;
    --text2:        #9898b0;
    --text3:        #5a5a78;
    --radius:       12px;
    --radius-sm:    8px;
    --radius-lg:    20px;
    --shadow:       0 4px 24px rgba(0,0,0,0.4);
    --shadow-lg:    0 8px 48px rgba(0,0,0,0.6);
    --font-head:    'Syne', sans-serif;
    --font-body:    'DM Sans', sans-serif;
    --nav-h:        64px;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; overflow-x: hidden; width: 100%; }
body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 0.95rem;
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    width: 100%;
    position: relative;
}
a { color: var(--accent2); text-decoration: none; }
a:hover { color: var(--text); }
img, video { max-width: 100%; display: block; }
button { font-family: var(--font-body); cursor: pointer; border: none; }

/* ---- Navbar ---- */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    height: var(--nav-h);
    overflow: visible;
    background: rgba(10,10,15,0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 2rem;
    gap: 2rem;
}
.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--text);
    font-family: var(--font-head);
    font-weight: 800;
    font-size: 1rem;
    letter-spacing: -0.02em;
    text-decoration: none;
    flex-shrink: 0;
}
.nav-logo-img {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 0 0 16px var(--accent-glow);
}
.nav-logo-fallback {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    box-shadow: 0 0 16px var(--accent-glow);
    flex-shrink: 0;
}
.nav-logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}
.nav-logo-title { font-size: 0.95rem; font-weight: 800; color: var(--text); }
.nav-logo-sub   { font-size: 0.65rem; font-weight: 400; color: var(--text3); letter-spacing: 0.04em; }
.nav-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex: 1;
}
.nav-link {
    color: var(--text2);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.4rem 0.85rem;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
    text-decoration: none;
}
.nav-link:hover, .nav-link.active { color: var(--text); background: var(--bg3); }
.nav-user {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: auto;
}
.nav-username { font-weight: 600; color: var(--text2); font-size: 0.85rem; }

/* ---- Hamburger ---- */
.nav-hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 2rem;
    height: 2rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 310;
    flex-shrink: 0;
}
.nav-hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text2);
    border-radius: 2px;
    transition: all 0.25s ease;
    transform-origin: center;
}
.nav-hamburger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.is-open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-hamburger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---- Auth Pages ---- */
.auth-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(108,99,255,0.08) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 20%, rgba(167,139,250,0.06) 0%, transparent 50%),
        var(--bg);
}
.auth-container {
    width: 100%;
    max-width: 420px;
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.auth-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow-lg);
}
.auth-logo {
    text-align: center;
    margin-bottom: 2rem;
}
.auth-logo a {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}
.auth-logo-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    box-shadow: 0 0 32px var(--accent-glow);
    margin: 0 auto 0.5rem;
}
.auth-logo-name {
    font-family: var(--font-head);
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--text);
}
.auth-logo-sub { font-size: 0.75rem; color: var(--text3); }
.auth-card h1 {
    font-family: var(--font-head);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 0.4rem;
}
.auth-sub { color: var(--text2); margin-bottom: 1.5rem; font-size: 0.9rem; }
.auth-link { text-align: center; margin-top: 1.5rem; color: var(--text2); font-size: 0.9rem; }

/* ---- Forms ---- */
.form-stack { display: flex; flex-direction: column; gap: 1rem; }
.form-group { display: flex; flex-direction: column; gap: 0.4rem; }
.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text2);
    letter-spacing: 0.02em;
}
.form-group input,
.form-group textarea,
.form-group select {
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 0.95rem;
    padding: 0.7rem 1rem;
    width: 100%;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    resize: vertical;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}
.char-count { font-size: 0.75rem; color: var(--text3); text-align: right; }

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.65rem 1.25rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    font-family: var(--font-body);
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
    text-decoration: none;
    white-space: nowrap;
}
.btn-primary {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 0 20px var(--accent-glow);
}
.btn-primary:hover {
    background: #7c74ff;
    color: #fff;
    box-shadow: 0 0 32px var(--accent-glow);
    transform: translateY(-1px);
}
.btn-ghost {
    background: transparent;
    border-color: var(--border2);
    color: var(--text2);
}
.btn-ghost:hover { background: var(--bg3); color: var(--text); }
.btn-danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-full  { width: 100%; }
.btn-large { padding: 0.85rem 1.5rem; font-size: 1rem; }
.btn-sm    { padding: 0.4rem 0.85rem; font-size: 0.8rem; }

/* ---- Alerts ---- */
.alert {
    padding: 0.85rem 1.1rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
}
.alert-success { background: rgba(34,197,94,0.1);  border-color: rgba(34,197,94,0.3);  color: #4ade80; }
.alert-error   { background: rgba(239,68,68,0.1);  border-color: rgba(239,68,68,0.3);  color: #f87171; }
.alert-warning { background: rgba(245,158,11,0.1); border-color: rgba(245,158,11,0.3); color: #fbbf24; }
.alert-info    { background: rgba(108,99,255,0.1); border-color: rgba(108,99,255,0.3); color: var(--accent2); }

/* ---- Main content ---- */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2.5rem 2rem;
}

/* ---- Page header ---- */
.page-header { margin-bottom: 2rem; }
.page-header h1 {
    font-family: var(--font-head);
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    margin-bottom: 0.25rem;
}
.page-header p { color: var(--text2); }

/* ---- Cards ---- */
.card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
}
.card-title {
    font-family: var(--font-head);
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    letter-spacing: -0.02em;
}

/* ---- Pipeline Progress ---- */
.pipeline {
    display: flex;
    align-items: center;
    gap: 0;
    margin: 1.5rem 0;
}
.pipeline-step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    position: relative;
}
.pipeline-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 14px;
    left: 50%;
    width: 100%;
    height: 2px;
    background: var(--border);
    z-index: 0;
}
.pipeline-step.done:not(:last-child)::after   { background: var(--accent); }
.pipeline-step.active:not(:last-child)::after { background: var(--border); }
.pipeline-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: var(--bg3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    position: relative;
    z-index: 1;
    transition: all 0.3s;
}
.pipeline-step.done .pipeline-dot {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    box-shadow: 0 0 12px var(--accent-glow);
}
.pipeline-step.active .pipeline-dot {
    border-color: var(--accent);
    background: var(--bg2);
    color: var(--accent2);
    box-shadow: 0 0 12px var(--accent-glow);
    animation: pulse-dot 1.5s ease-in-out infinite;
}
.pipeline-step.failed .pipeline-dot {
    background: var(--danger);
    border-color: var(--danger);
    color: #fff;
}
@keyframes pulse-dot {
    0%, 100% { box-shadow: 0 0 12px var(--accent-glow); }
    50%       { box-shadow: 0 0 24px rgba(108,99,255,0.5); }
}
.pipeline-label {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text3);
    text-align: center;
    letter-spacing: 0.01em;
    white-space: nowrap;
}
.pipeline-step.done .pipeline-label   { color: var(--accent2); }
.pipeline-step.active .pipeline-label { color: var(--text); }
.pipeline-step.failed .pipeline-label { color: var(--danger); }

/* ---- Upload Zone ---- */
.upload-zone {
    border: 2px dashed var(--border2);
    border-radius: var(--radius);
    padding: 2.5rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    background: rgba(108,99,255,0.02);
}
.upload-zone:hover, .upload-zone.drag-over {
    border-color: var(--accent);
    background: rgba(108,99,255,0.06);
}
.upload-zone-icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.upload-zone h3 {
    font-family: var(--font-head);
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
}
.upload-zone p   { font-size: 0.85rem; color: var(--text2); }
.upload-zone-hint { font-size: 0.75rem; color: var(--text3); margin-top: 0.5rem; }

.upload-file-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-top: 1rem;
}
.upload-file-icon { font-size: 1.75rem; flex-shrink: 0; }
.upload-file-details { flex: 1; min-width: 0; }
.upload-file-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.upload-file-meta { font-size: 0.75rem; color: var(--text3); margin-top: 0.15rem; }

/* ---- Scene Cards (jobs sidebar) ---- */
.scene-list { display: flex; flex-direction: column; gap: 0.5rem; }
.scene-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}
.scene-num {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: var(--bg);
    border: 1px solid var(--border2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text3);
    flex-shrink: 0;
}
.scene-item.done .scene-num    { background: rgba(34,197,94,0.15);  border-color: rgba(34,197,94,0.3);  color: #4ade80; }
.scene-item.active .scene-num  { background: rgba(108,99,255,0.15); border-color: var(--accent);        color: var(--accent2); animation: pulse-dot 1.5s ease-in-out infinite; }
.scene-item.failed .scene-num  { background: rgba(239,68,68,0.15);  border-color: rgba(239,68,68,0.3);  color: #f87171; }
.scene-info { flex: 1; min-width: 0; }
.scene-time { font-size: 0.72rem; color: var(--text3); }
.scene-energy {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 99px;
    flex-shrink: 0;
}
.energy-low    { background: rgba(108,99,255,0.12); color: var(--accent2); }
.energy-medium { background: rgba(245,158,11,0.12); color: #fbbf24; }
.energy-high   { background: rgba(239,68,68,0.12);  color: #f87171; }

/* ---- Job list (recent jobs) ---- */
.job-list { display: flex; flex-direction: column; gap: 0.65rem; }
.job-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.85rem;
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: border-color 0.2s;
    cursor: pointer;
    text-decoration: none;
}
.job-item:hover { border-color: var(--border2); }
.job-icon { font-size: 1.5rem; flex-shrink: 0; }
.job-info { flex: 1; min-width: 0; }
.job-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.job-meta  { font-size: 0.72rem; color: var(--text3); margin-top: 0.15rem; }
.job-badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: 99px;
    flex-shrink: 0;
}
.badge-complete   { background: rgba(34,197,94,0.15);  color: #4ade80; }
.badge-queued     { background: rgba(108,99,255,0.15); color: var(--accent2); }
.badge-analyzing  { background: rgba(108,99,255,0.15); color: var(--accent2); }
.badge-prompting  { background: rgba(108,99,255,0.15); color: var(--accent2); }
.badge-generating { background: rgba(245,158,11,0.15); color: #fbbf24; }
.badge-stitching  { background: rgba(245,158,11,0.15); color: #fbbf24; }
.badge-failed     { background: rgba(239,68,68,0.15);  color: #f87171; }

/* ---- Dashboard layout ---- */
.dash-main { max-width: 1200px; margin: 0 auto; padding: 2rem; }
.dash-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 2rem;
    align-items: start;
}
.dash-left  { display: flex; flex-direction: column; gap: 1.5rem; }
.dash-right {
    position: sticky;
    top: calc(var(--nav-h) + 1rem);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* ---- Spinner ---- */
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border2);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Empty state ---- */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text3);
}
.empty-state-icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.empty-state p { font-size: 0.88rem; }

/* ---- Video grid (library) ---- */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}
.video-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color 0.2s, transform 0.2s;
}
.video-card:hover { border-color: var(--border2); transform: translateY(-2px); }
.video-thumb {
    position: relative;
    aspect-ratio: 16/9;
    background: var(--bg3);
    overflow: hidden;
}
.video-thumb video, .video-thumb img { width: 100%; height: 100%; object-fit: cover; }
.video-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}
.video-thumb:hover .video-overlay { opacity: 1; }
.btn-play {
    width: 48px;
    height: 48px;
    background: rgba(255,255,255,0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #111;
    font-size: 1.1rem;
    text-decoration: none;
    transition: transform 0.2s;
}
.btn-play:hover { transform: scale(1.1); color: #111; }
.video-info { padding: 1rem; }
.video-title { font-size: 0.9rem; font-weight: 600; color: var(--text); margin-bottom: 0.35rem; }
.video-meta  { font-size: 0.75rem; color: var(--text3); margin-bottom: 0.75rem; }
.video-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* ---- Slim footer ---- */
.slim-footer {
    border-top: 1px solid var(--border);
    margin-top: 3rem;
    padding: 1.25rem 2rem;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text3);
}
.slim-footer a { color: var(--text3); }
.slim-footer a:hover { color: var(--accent2); }

/* ---- Responsive ---- */
@media (max-width: 900px) {
    .nav-links    { display: none; }
    .nav-username { display: none; }
    .nav-hamburger { display: flex; }
    .nav-links.is-open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg2);
        border-bottom: 1px solid var(--border);
        padding: 0.75rem 1.25rem 1.25rem;
        gap: 0;
        z-index: 300;
        box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    }
    .nav-links.is-open .nav-link {
        padding: 0.75rem 0;
        border-bottom: 1px solid rgba(255,255,255,0.05);
        width: 100%;
    }
    .dash-layout { grid-template-columns: 1fr; }
    .dash-right  { position: static; }
}
@media (max-width: 640px) {
    .dash-main    { padding: 1rem; }
    .auth-card    { padding: 1.75rem 1.25rem; }
    .main-content { padding: 1.5rem 1rem; }
    .video-grid   { grid-template-columns: 1fr; }
    .form-group input { font-size: 16px; }
}

/* ============================================
   MOBILE — Full treatment
   ============================================ */

/* Bottom tab bar */
.mobile-tabs {
    display: none;
}

@media (max-width: 768px) {
    .mobile-tabs {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 300;
        background: rgba(10,10,15,0.97);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border-top: 1px solid var(--border);
        padding: 0.5rem 0 calc(0.5rem + env(safe-area-inset-bottom));
        justify-content: space-around;
        align-items: center;
    }
    .mobile-tab {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.2rem;
        padding: 0.4rem 1rem;
        text-decoration: none;
        color: var(--text3);
        transition: color 0.2s;
        flex: 1;
    }
    .mobile-tab.active,
    .mobile-tab:hover { color: var(--accent2); }
    .mobile-tab-icon  { font-size: 1.3rem; line-height: 1; }
    .mobile-tab-label {
        font-size: 0.65rem;
        font-weight: 600;
        letter-spacing: 0.03em;
        font-family: var(--font-body);
    }

    /* Page content padding above tab bar */
    .dash-main,
    .main-content {
        padding-bottom: calc(5rem + env(safe-area-inset-bottom)) !important;
    }
    .slim-footer {
        margin-bottom: calc(4rem + env(safe-area-inset-bottom));
    }
}

/* Navbar mobile */
@media (max-width: 900px) {
    .nav-hamburger { display: flex; }
    .nav-links     { display: none; }
    .nav-username  { display: none; }
}

@media (max-width: 768px) {
    .navbar {
        padding: 0 1rem;
        gap: 0.5rem;
        overflow: visible;
        min-height: var(--nav-h);
        height: auto;
        background: rgba(10,10,15,0.98);
    }
    .nav-user { gap: 0.5rem; }
    .nav-user .nav-link {
        font-size: 0.8rem;
        padding: 0.35rem 0.6rem;
    }
    .nav-logo-title { font-size: 0.85rem; }
    .nav-logo-sub   { display: none; }
    .nav-logo-img,
    .nav-logo-fallback { width: 28px; height: 28px; }

    /* Mobile nav dropdown */
    .nav-links.is-open {
        display: flex !important;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg2);
        border-bottom: 1px solid var(--border);
        padding: 0.75rem 1.25rem 1.25rem;
        z-index: 300;
        box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    }
    .nav-links.is-open .nav-link {
        padding: 0.75rem 0;
        border-bottom: 1px solid rgba(255,255,255,0.05);
        width: 100%;
        font-size: 1rem;
    }
    .nav-links.is-open .nav-link:last-child { border-bottom: none; }
}

/* Dashboard mobile */
@media (max-width: 900px) {
    .dash-layout { grid-template-columns: 1fr; }
    .dash-right  { position: static; }
}

@media (max-width: 768px) {
    .dash-main { padding: 1rem 0.75rem; }

    /* Upload zone — touch friendly */
    .upload-zone { padding: 2rem 1rem; }
    .upload-zone h3 { font-size: 1rem; }

    /* Style prompt */
    .form-group textarea { font-size: 16px; } /* prevent iOS zoom */
    .form-group input    { font-size: 16px; }

    /* Submit button */
    .btn-large { padding: 0.9rem 1rem; font-size: 0.95rem; }

    /* Card padding */
    .card { padding: 1.25rem; }

    /* Pipeline — compact on mobile */
    .pipeline { gap: 0; margin: 0.6rem 0 0.2rem; }
    .pipeline-dot {
        width: 22px;
        height: 22px;
        font-size: 0.65rem;
    }
    .pipeline-step:not(:last-child)::after { top: 11px; }
    .pipeline-label { font-size: 0.55rem; letter-spacing: 0; }

    /* Job items */
    .job-item { padding: 0.75rem; gap: 0.5rem; }
    .job-icon { font-size: 1.25rem; }
    .job-name { font-size: 0.82rem; }

    /* Queue badge — stack below pipeline */
    .job-badge { font-size: 0.68rem; padding: 0.15rem 0.45rem; }
}

@media (max-width: 480px) {
    /* Auth card */
    .auth-card { padding: 1.5rem 1.1rem; border-radius: var(--radius); }
    .auth-card h1 { font-size: 1.3rem; }
    .auth-logo-icon { width: 48px; height: 48px; font-size: 1.4rem; }

    /* Pipeline labels hidden on very small screens */
    .pipeline-label { display: none; }
    .pipeline-dot {
        width: 20px;
        height: 20px;
        font-size: 0.6rem;
    }
    .pipeline-step:not(:last-child)::after { top: 10px; }
}

/* iOS overflow fix */
html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

@media (max-width: 768px) {
    * { max-width: 100%; }
    .presets-scroll { max-width: none; }
    .dash-main,
    .main-content,
    .auth-container {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        overflow-x: hidden;
    }
    .card,
    .upload-zone,
    .job-item,
    .job-list,
    .scene-list {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    .slim-footer {
        width: 100%;
        box-sizing: border-box;
        overflow-x: hidden;
    }
}
