/* Catppuccin Mocha palette */
:root {
    --base: #1e1e2e;
    --mantle: #181825;
    --crust: #11111b;
    --surface0: #313244;
    --surface1: #45475a;
    --surface2: #585b70;
    --overlay0: #6c7086;
    --overlay1: #7f849c;
    --text: #cdd6f4;
    --subtext0: #a6adc8;
    --subtext1: #bac2de;
    --lavender: #b4befe;
    --blue: #89b4fa;
    --sapphire: #74c7ec;
    --green: #a6e3a1;
    --yellow: #f9e2af;
    --peach: #fab387;
    --red: #f38ba8;
    --mauve: #cba6f7;
    --pink: #f5c2e7;
    --rosewater: #f5e0dc;
    --radius: 10px;
    --radius-sm: 6px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.3), 0 2px 4px rgba(0,0,0,0.2);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.4);
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background: var(--base);
    color: var(--text);
    font-family: 'Segoe UI', 'DejaVu Sans', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: var(--blue); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--sapphire); text-decoration: none; }

/* ── Navbar ─────────────────────────────── */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    height: 56px;
    background: var(--mantle);
    border-bottom: 1px solid var(--surface0);
    position: sticky;
    top: 0;
    z-index: 50;
}

.nav-brand {
    font-size: 18px;
    font-weight: 800;
    color: var(--lavender);
    letter-spacing: -0.5px;
    flex-shrink: 0;
}
.nav-brand:hover { text-decoration: none; color: var(--blue); }

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 36px;
    height: 36px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px 6px;
    border-radius: var(--radius-sm);
    transition: background var(--transition);
}
.nav-toggle:hover { background: var(--surface0); }
.nav-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text);
    border-radius: 1px;
    transition: transform var(--transition), opacity var(--transition);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-user-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-email {
    color: var(--subtext0);
    font-size: 13px;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-action { display: inline; }

/* ── Badges ─────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}
.badge-pro {
    background: linear-gradient(135deg, var(--mauve), var(--pink));
    color: var(--crust);
}

/* ── Container ──────────────────────────── */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

/* ── Buttons ────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid var(--surface1);
    border-radius: var(--radius-sm);
    background: var(--surface0);
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
}
.btn:hover { background: var(--surface1); text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-xs { padding: 4px 10px; font-size: 12px; }

.btn-primary {
    background: var(--blue);
    color: var(--crust);
    border-color: var(--blue);
    font-weight: 600;
}
.btn-primary:hover { background: var(--sapphire); border-color: var(--sapphire); box-shadow: 0 2px 12px rgba(137,180,250,0.25); }

.btn-accent {
    background: var(--mauve);
    color: var(--crust);
    border-color: var(--mauve);
    font-weight: 600;
}
.btn-accent:hover { background: var(--pink); border-color: var(--pink); box-shadow: 0 2px 12px rgba(203,166,247,0.25); }

.btn-upgrade {
    background: linear-gradient(135deg, var(--mauve), var(--pink));
    color: var(--crust);
    border: none;
    font-weight: 700;
    font-size: 13px;
    padding: 6px 14px;
    letter-spacing: 0.2px;
}
.btn-upgrade:hover { box-shadow: 0 2px 16px rgba(203,166,247,0.35); filter: brightness(1.08); }

.btn-danger {
    background: transparent;
    color: var(--red);
    border-color: rgba(243, 139, 168, 0.3);
}
.btn-danger:hover { background: var(--red); color: var(--crust); border-color: var(--red); }

.btn-ghost {
    background: transparent;
    border-color: transparent;
    color: var(--subtext0);
}
.btn-ghost:hover { background: var(--surface0); color: var(--text); transform: none; }

/* ── Inputs ─────────────────────────────── */
input[type="text"],
input[type="email"],
input[type="password"],
select,
textarea {
    width: 100%;
    padding: 10px 14px;
    background: var(--crust);
    border: 1px solid var(--surface1);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    transition: border-color var(--transition), box-shadow var(--transition);
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--lavender);
    box-shadow: 0 0 0 3px rgba(180, 190, 254, 0.12);
}
textarea { resize: vertical; min-height: 44px; }

.input-sm {
    width: auto;
    padding: 6px 10px;
    font-size: 13px;
}

input[type="color"] {
    width: 48px;
    height: 36px;
    padding: 3px;
    background: var(--crust);
    border: 1px solid var(--surface1);
    border-radius: var(--radius-sm);
    cursor: pointer;
}

input[type="range"] {
    width: 100%;
    accent-color: var(--lavender);
    height: 6px;
}

/* ── Auth Pages ─────────────────────────── */
.auth-card {
    max-width: 420px;
    margin: 60px auto;
    background: var(--mantle);
    border: 1px solid var(--surface0);
    border-radius: var(--radius);
    padding: 36px;
    box-shadow: var(--shadow-lg);
}

.auth-card h1, .auth-card h2 {
    font-size: 22px;
    margin-bottom: 24px;
    color: var(--lavender);
    text-align: center;
    font-weight: 700;
}

.auth-card .editor-field { margin-bottom: 16px; }

.auth-card .btn {
    width: 100%;
    margin-top: 8px;
    padding: 12px;
    font-size: 15px;
}

.auth-card p {
    margin-top: 16px;
    text-align: center;
    font-size: 14px;
    color: var(--subtext0);
}

.auth-error {
    background: rgba(243, 139, 168, 0.08);
    border: 1px solid rgba(243, 139, 168, 0.3);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    margin-bottom: 16px;
    color: var(--red);
    font-size: 13px;
}

.auth-success {
    background: rgba(166, 227, 161, 0.08);
    border: 1px solid rgba(166, 227, 161, 0.3);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    margin-bottom: 16px;
    color: var(--green);
    font-size: 13px;
}

.verify-card {
    max-width: 480px;
    margin: 60px auto;
    background: var(--mantle);
    border: 1px solid var(--surface0);
    border-radius: var(--radius);
    padding: 40px;
    text-align: center;
    box-shadow: var(--shadow-lg);
}
.verify-card h2 {
    font-size: 22px;
    color: var(--yellow);
    margin-bottom: 12px;
}
.verify-card p {
    color: var(--subtext0);
    font-size: 15px;
}

/* ── Dashboard ──────────────────────────── */
.dashboard { padding-top: 8px; }

.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.dashboard-header h1 {
    font-size: 26px;
    font-weight: 700;
    color: var(--text);
}

.new-project-form {
    display: flex;
    align-items: center;
    gap: 8px;
}
.new-project-form input[type="text"] { width: 200px; }

.limit-notice {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--yellow);
    font-size: 14px;
    flex-wrap: wrap;
}

.tier-info {
    background: var(--mantle);
    border: 1px solid var(--surface0);
    border-radius: var(--radius-sm);
    padding: 10px 16px;
    margin-bottom: 20px;
    font-size: 13px;
    color: var(--subtext0);
    line-height: 1.7;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.project-card {
    background: var(--mantle);
    border: 1px solid var(--surface0);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}
.project-card:hover {
    border-color: var(--surface2);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.project-thumb {
    aspect-ratio: 16/9;
    background: var(--crust);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.project-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-info {
    padding: 14px 16px 4px;
}
.project-info h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2px;
}
.project-date {
    font-size: 12px;
    color: var(--overlay0);
}

.project-actions {
    display: flex;
    gap: 6px;
    padding: 10px 16px 14px;
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
    color: var(--overlay0);
}
.empty-state h2 {
    font-size: 20px;
    margin-bottom: 8px;
    color: var(--subtext0);
}
.empty-state p { font-size: 15px; }

/* ── Editor ─────────────────────────────── */
.editor-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: var(--mantle);
    border-bottom: 1px solid var(--surface0);
    position: sticky;
    top: 56px;
    z-index: 40;
}

.editor-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.toolbar-right {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

/* ── Tabs ───────────────────────────────── */
.editor-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--surface0);
    background: var(--mantle);
    padding: 0 16px;
}

.tab {
    padding: 10px 20px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--subtext0);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: color var(--transition), border-color var(--transition);
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
}
.tab:hover { color: var(--text); }
.tab.active {
    color: var(--lavender);
    border-bottom-color: var(--lavender);
}

.tab-panel { padding: 16px; }

/* ── Editor Split Layout ────────────────── */
.editor-split {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 16px;
}

/* ── Slide List / Presenter List ────────── */
.slide-list,
.presenter-list {
    background: var(--mantle);
    border: 1px solid var(--surface0);
    border-radius: var(--radius);
    padding: 8px;
    overflow-y: auto;
    max-height: calc(100vh - 220px);
}

.slide-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    color: var(--subtext0);
    transition: background var(--transition);
    -webkit-tap-highlight-color: transparent;
}
.slide-item:hover { background: var(--surface0); }
.slide-item.active {
    background: var(--surface0);
    color: var(--text);
    border: 1px solid var(--surface1);
}

.slide-item img {
    width: 64px;
    height: 36px;
    object-fit: cover;
    border-radius: 4px;
    background: var(--crust);
    flex-shrink: 0;
}

.slide-item small {
    color: var(--overlay0);
    display: block;
    font-size: 11px;
}

.color-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 0 2px var(--surface0);
}

/* ── Slide Editor ───────────────────────── */
.slide-editor,
.presenter-editor {
    background: var(--mantle);
    border: 1px solid var(--surface0);
    border-radius: var(--radius);
    padding: 20px;
}

.slide-preview {
    margin-bottom: 16px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--crust);
    aspect-ratio: 16/9;
    display: flex;
    align-items: center;
    justify-content: center;
}
.slide-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* ── Fields ─────────────────────────────── */
.editor-field {
    margin-bottom: 14px;
}
.editor-field label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: var(--subtext0);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.word-count {
    display: block;
    text-align: right;
    font-size: 11px;
    color: var(--overlay0);
    margin-top: 4px;
}

.field-group {
    margin-bottom: 20px;
}
.field-group h3 {
    font-size: 13px;
    font-weight: 700;
    color: var(--lavender);
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--surface0);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.editor-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

/* ── GIF Settings ──────────────────────── */
.gif-settings {
    margin-top: 24px;
    padding: 20px;
    border-top: 1px solid var(--surface0);
    background: var(--mantle);
    border-radius: 0 0 var(--radius) var(--radius);
}
.gif-settings h3 {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 12px;
}

/* ── Data Tables ────────────────────────── */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table th {
    text-align: left;
    padding: 10px 12px;
    background: var(--surface0);
    color: var(--subtext0);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--surface1);
}
.data-table th:first-child { border-radius: var(--radius-sm) 0 0 0; }
.data-table th:last-child { border-radius: 0 var(--radius-sm) 0 0; }

.data-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--surface0);
    color: var(--text);
}

.data-table tr:hover td {
    background: rgba(69, 71, 90, 0.3);
}

.data-table td:last-child {
    text-align: right;
    white-space: nowrap;
}

.data-table td .btn + .btn { margin-left: 4px; }

/* ── Voices Section ─────────────────────── */
.voices-section {
    margin-bottom: 32px;
}
.voices-section h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 12px;
}

.filter-row {
    display: flex;
    gap: 12px;
    align-items: end;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.filter-row label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    color: var(--subtext0);
    font-weight: 600;
}

.status-text {
    font-size: 13px;
    color: var(--overlay0);
    margin-top: 8px;
}

/* ── Modal ──────────────────────────────── */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    backdrop-filter: blur(8px);
    padding: 16px;
}

.modal-content {
    background: var(--mantle);
    border: 1px solid var(--surface1);
    border-radius: var(--radius);
    padding: 28px 32px;
    min-width: 340px;
    max-width: 480px;
    width: 100%;
    box-shadow: var(--shadow-lg);
}

.modal-content h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 16px;
}

.modal-content p {
    color: var(--subtext0);
    font-size: 14px;
    margin-bottom: 16px;
}

.modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 20px;
    flex-wrap: wrap;
}

/* ── Progress Bar ───────────────────────── */
.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--surface0);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--blue), var(--mauve));
    border-radius: 3px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Payment Page ───────────────────────── */
.payment-card {
    max-width: 480px;
    margin: 60px auto;
    background: var(--mantle);
    border: 1px solid var(--surface0);
    border-radius: var(--radius);
    padding: 40px;
    text-align: center;
    box-shadow: var(--shadow-lg);
}
.payment-card h2 {
    font-size: 22px;
    color: var(--green);
    margin-bottom: 12px;
}
.payment-card p {
    color: var(--subtext0);
    font-size: 15px;
    margin-bottom: 20px;
}

/* ── Admin Stats ────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    margin-top: 8px;
}

.stat-card {
    background: var(--mantle);
    border: 1px solid var(--surface0);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    transition: border-color var(--transition);
}
.stat-card:hover { border-color: var(--surface1); }

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--lavender);
    line-height: 1;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--subtext0);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ── Responsive: Tablet ────────────────── */
@media (max-width: 900px) {
    .editor-split {
        grid-template-columns: 160px 1fr;
    }
    .toolbar-right .btn {
        padding: 5px 10px;
        font-size: 12px;
    }
    .nav-email { max-width: 140px; }
}

/* ── Responsive: Mobile ────────────────── */
@media (max-width: 640px) {
    /* Navbar: hamburger menu */
    .navbar {
        padding: 0 16px;
        height: 52px;
        position: sticky;
        top: 0;
    }
    .nav-brand { font-size: 16px; }
    .nav-toggle {
        display: flex;
        order: 1;
    }
    .nav-right {
        display: none;
        position: absolute;
        top: 52px;
        left: 0;
        right: 0;
        background: var(--mantle);
        border-bottom: 1px solid var(--surface0);
        flex-direction: column;
        align-items: stretch;
        padding: 12px 16px;
        gap: 8px;
        box-shadow: var(--shadow-md);
        z-index: 100;
    }
    .navbar.open .nav-right { display: flex; }
    .navbar.open .nav-toggle span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
    .navbar.open .nav-toggle span:nth-child(2) { opacity: 0; }
    .navbar.open .nav-toggle span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

    .nav-user-info {
        padding: 8px 0;
        border-bottom: 1px solid var(--surface0);
        margin-bottom: 4px;
    }
    .nav-email {
        max-width: none;
        font-size: 14px;
    }
    .nav-action { display: block; }
    .nav-right .btn {
        width: 100%;
        justify-content: center;
        padding: 12px;
        font-size: 14px;
    }
    .nav-right .btn-upgrade {
        padding: 12px;
        font-size: 14px;
    }
    .nav-right .badge { align-self: flex-start; }

    /* Container */
    .container { padding: 16px; }

    /* Dashboard */
    .dashboard-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    .dashboard-header h1 { font-size: 22px; }
    .new-project-form {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    .new-project-form input[type="text"] { width: 100%; }
    .new-project-form .btn { padding: 12px; justify-content: center; }
    .project-grid { grid-template-columns: 1fr; gap: 12px; }
    .project-actions { flex-wrap: wrap; }
    .project-actions .btn { flex: 1; min-width: 0; justify-content: center; }
    .limit-notice {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    .limit-notice .btn { text-align: center; justify-content: center; }
    .tier-info { font-size: 12px; padding: 10px 14px; }

    /* Editor toolbar */
    .editor-toolbar {
        top: 52px;
        padding: 8px 12px;
        gap: 6px;
    }
    .editor-title { font-size: 13px; }
    .toolbar-right {
        gap: 4px;
        flex-wrap: wrap;
    }
    .toolbar-right .btn {
        font-size: 11px;
        padding: 5px 8px;
    }

    /* Editor tabs */
    .editor-tabs {
        padding: 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .editor-tabs::-webkit-scrollbar { display: none; }
    .tab {
        padding: 10px 16px;
        font-size: 13px;
        flex-shrink: 0;
    }
    .tab-panel { padding: 12px; }

    /* Editor split: stack vertically */
    .editor-split {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .slide-list, .presenter-list {
        max-height: none;
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
        gap: 6px;
        padding: 8px;
        scrollbar-width: none;
    }
    .slide-list::-webkit-scrollbar,
    .presenter-list::-webkit-scrollbar { display: none; }

    .slide-item {
        flex-shrink: 0;
        flex-direction: column;
        min-width: 80px;
        text-align: center;
        padding: 8px 6px;
        gap: 4px;
    }
    .slide-item img { width: 72px; height: 40px; }
    .slide-item small { font-size: 10px; }

    .slide-editor, .presenter-editor { padding: 14px; }
    .slide-preview { margin-bottom: 12px; }

    /* GIF settings */
    .gif-settings { padding: 14px; }

    /* Voice tables: card layout on mobile */
    .data-table,
    .data-table thead,
    .data-table tbody,
    .data-table th,
    .data-table td,
    .data-table tr {
        display: block;
    }
    .data-table thead { display: none; }
    .data-table tr {
        background: var(--mantle);
        border: 1px solid var(--surface0);
        border-radius: var(--radius-sm);
        margin-bottom: 8px;
        padding: 12px;
    }
    .data-table td {
        padding: 3px 0;
        border: none;
        text-align: left;
        font-size: 13px;
    }
    .data-table td:last-child {
        text-align: left;
        margin-top: 8px;
        display: flex;
        gap: 6px;
    }
    .data-table td::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 11px;
        color: var(--subtext0);
        text-transform: uppercase;
        letter-spacing: 0.3px;
        margin-right: 8px;
    }

    .filter-row {
        flex-direction: column;
        gap: 8px;
    }
    .filter-row label { width: 100%; }
    .filter-row .input-sm { width: 100%; }
    .filter-row .btn { width: 100%; justify-content: center; }

    /* Modal */
    .modal { padding: 16px; align-items: flex-end; }
    .modal-content {
        min-width: auto;
        max-width: none;
        width: 100%;
        padding: 24px 20px;
        border-radius: var(--radius) var(--radius) 0 0;
        margin: 0;
    }

    /* Share modal */
    .share-add-row { flex-direction: column; }
    .share-select { width: 100%; }
    .share-modal { max-width: none; }

    /* Auth */
    .auth-card {
        margin: 20px 0;
        padding: 28px 20px;
        border-radius: var(--radius);
        box-shadow: none;
        border: 1px solid var(--surface0);
    }
    .auth-card h1, .auth-card h2 { font-size: 20px; }

    .verify-card {
        margin: 20px 0;
        padding: 28px 20px;
        box-shadow: none;
    }
    .payment-card {
        margin: 20px 0;
        padding: 28px 20px;
        box-shadow: none;
    }

    /* Admin stats */
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .stat-card { padding: 16px 12px; }
    .stat-value { font-size: 26px; }
}

/* ── Very small screens ─────────────────── */
@media (max-width: 380px) {
    .container { padding: 12px; }
    .toolbar-right .btn { font-size: 10px; padding: 4px 6px; }
    .slide-item { min-width: 68px; }
    .slide-item img { width: 60px; height: 34px; }
    .project-info { padding: 10px 12px 4px; }
    .project-actions { padding: 8px 12px 12px; }
}

/* ── Scrollbar ──────────────────────────── */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--surface1);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--surface2);
}

* {
    scrollbar-width: thin;
    scrollbar-color: var(--surface1) transparent;
}

/* ── Permission Badges ─────────────────── */
.badge-perm {
    background: var(--surface0);
    color: var(--subtext0);
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: 6px;
}

/* ── Share Modal ───────────────────────── */
.share-modal { max-width: 520px; }

.share-add-row {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}
.share-input {
    flex: 1;
    min-width: 0;
}
.share-select {
    width: auto;
    min-width: 110px;
}

.share-list {
    margin: 12px 0;
    max-height: 200px;
    overflow-y: auto;
}
.share-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text);
}
.share-item:hover { background: var(--surface0); }
.share-item span:first-child { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }

.share-public-toggle {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--surface0);
}
.share-public-toggle label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text);
    cursor: pointer;
}
.share-public-toggle input[type="checkbox"] {
    width: auto;
    accent-color: var(--green);
}
.share-link {
    margin-top: 8px;
}
.share-link input {
    font-size: 12px;
    color: var(--subtext0);
    background: var(--crust);
    cursor: text;
}

.error-text {
    color: var(--red);
    font-size: 13px;
    margin-bottom: 8px;
}

/* ── Collab: Connected Users ──────────── */
.collab-users {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-right: 8px;
}
.collab-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    box-shadow: 0 0 4px rgba(0,0,0,0.3);
    transition: transform var(--transition);
}
.collab-dot:hover { transform: scale(1.4); }

.collab-user-count {
    font-size: 11px;
    color: var(--subtext0);
    margin-left: 2px;
}

/* ── Collab: Slide Locks ──────────────── */
.slide-item .lock-icon {
    font-size: 10px;
    color: var(--yellow);
    margin-left: auto;
}
.slide-item.locked { opacity: 0.7; }

.lock-banner {
    background: rgba(249, 226, 175, 0.08);
    border: 1px solid rgba(249, 226, 175, 0.2);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    margin-bottom: 12px;
    font-size: 13px;
    color: var(--yellow);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ── Settings Page ─────────────────────── */
.settings-card {
    max-width: 520px;
}

.settings-section {
    padding: 20px 0;
    border-bottom: 1px solid var(--surface0);
}
.settings-section:last-child { border-bottom: none; }
.settings-section h3 {
    font-size: 14px;
    font-weight: 700;
    color: var(--lavender);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.settings-section p {
    font-size: 13px;
    color: var(--subtext0);
    margin-bottom: 12px;
}

.settings-danger {
    border-bottom: none;
}
.settings-danger h3 { color: var(--red); }

.input-disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ── Footer ────────────────────────────── */
.site-footer {
    border-top: 1px solid var(--surface0);
    padding: 16px 24px;
    text-align: center;
    font-size: 12px;
    color: var(--overlay0);
}
.site-footer a {
    color: var(--subtext0);
    margin: 0 8px;
}
.site-footer a:hover { color: var(--text); }
.lang-picker {
    margin-top: 8px;
    display: flex;
    justify-content: center;
    gap: 4px;
    flex-wrap: wrap;
}
.lang-link {
    display: inline-block;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: var(--overlay0) !important;
    text-decoration: none;
    transition: all var(--transition);
}
.lang-link:hover { color: var(--text) !important; background: var(--surface0); }
.lang-link.active { color: var(--lavender) !important; background: var(--surface0); }

/* ── Legal Pages ───────────────────────── */
.legal-page {
    max-width: 720px;
    margin: 0 auto;
    padding: 32px 0;
}
.legal-page h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 24px;
}
.legal-page h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--lavender);
    margin-top: 28px;
    margin-bottom: 12px;
}
.legal-page p, .legal-page li {
    font-size: 14px;
    color: var(--subtext1);
    line-height: 1.7;
    margin-bottom: 10px;
}
.legal-page ul {
    padding-left: 24px;
    margin-bottom: 12px;
}

/* ── Import/Export Modal ───────────────── */
.ie-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--surface0);
    margin: -4px -32px 16px;
    padding: 0 32px;
}
.ie-hint {
    font-size: 13px;
    color: var(--subtext0);
    margin-bottom: 12px;
    line-height: 1.5;
}
.ie-textarea {
    width: 100%;
    min-height: 240px;
    max-height: 400px;
    padding: 12px;
    background: var(--crust);
    border: 1px solid var(--surface1);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 12px;
    font-family: 'DejaVu Sans Mono', 'Consolas', 'Courier New', monospace;
    line-height: 1.6;
    resize: vertical;
    white-space: pre-wrap;
    word-break: break-word;
}
.ie-textarea:focus {
    outline: none;
    border-color: var(--lavender);
    box-shadow: 0 0 0 3px rgba(180, 190, 254, 0.12);
}

@media (max-width: 640px) {
    .ie-tabs { margin: -4px -20px 12px; padding: 0 20px; }
    .ie-textarea { min-height: 180px; font-size: 11px; }
}

/* ── Welcome Hero ──────────────────────── */
.welcome-hero {
    position: relative;
    min-height: calc(100vh - 56px);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 40px 24px 60px;
}

.welcome-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.welcome-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.15;
    animation: welcome-float 12s ease-in-out infinite;
}
.welcome-orb-1 {
    width: 500px; height: 500px;
    background: var(--lavender);
    top: -10%; left: -5%;
    animation-delay: 0s;
}
.welcome-orb-2 {
    width: 400px; height: 400px;
    background: var(--mauve);
    bottom: -15%; right: -5%;
    animation-delay: -4s;
}
.welcome-orb-3 {
    width: 300px; height: 300px;
    background: var(--blue);
    top: 40%; left: 50%;
    animation-delay: -8s;
}

@keyframes welcome-float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -20px) scale(1.05); }
    66% { transform: translate(-20px, 15px) scale(0.95); }
}

.welcome-content {
    position: relative;
    z-index: 1;
    max-width: 700px;
    width: 100%;
    text-align: center;
}

.welcome-title {
    font-size: 42px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -1.5px;
    line-height: 1.1;
    margin-bottom: 12px;
    animation: welcome-fade-up 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.welcome-subtitle {
    font-size: 17px;
    color: var(--subtext0);
    margin-bottom: 32px;
    line-height: 1.5;
    animation: welcome-fade-up 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both;
}

.welcome-step-label {
    display: inline-block;
    font-size: 13px;
    font-weight: 600;
    color: var(--lavender);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 16px;
    padding: 4px 16px;
    background: rgba(180, 190, 254, 0.08);
    border: 1px solid rgba(180, 190, 254, 0.15);
    border-radius: 20px;
    animation: welcome-fade-up 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
}

.welcome-step-enter {
    animation: welcome-step-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes welcome-step-pop {
    0% { transform: scale(0.9); opacity: 0.5; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes welcome-fade-up {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Demo editor mock */
.welcome-demo {
    animation: welcome-fade-up 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.3s both;
    margin-bottom: 32px;
}

.welcome-demo-inner {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 10px;
    background: var(--mantle);
    border: 1px solid var(--surface0);
    border-radius: var(--radius);
    padding: 14px;
    box-shadow: var(--shadow-lg), 0 0 80px rgba(180, 190, 254, 0.06);
    text-align: left;
    max-height: 340px;
    overflow: hidden;
}

/* Demo sidebar */
.wdemo-sidebar {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.wdemo-slide-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    color: var(--overlay0);
    opacity: 0;
    transform: translateX(-10px);
    transition: opacity 0.4s, transform 0.4s, background 0.2s;
}
.wdemo-slide-item.wdemo-slide-appear {
    opacity: 1;
    transform: translateX(0);
}
.wdemo-slide-item.wdemo-slide-active {
    background: var(--surface0);
    color: var(--text);
}

.wdemo-slide-thumb {
    width: 40px;
    height: 24px;
    background: var(--crust);
    border-radius: 3px;
    flex-shrink: 0;
    border: 1px solid var(--surface0);
}

/* Demo main area */
.wdemo-main {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.wdemo-preview {
    background: var(--crust);
    border-radius: var(--radius-sm);
    aspect-ratio: 16/9;
    max-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.wdemo-preview svg {
    width: 60%;
    height: auto;
    opacity: 0.7;
}

.wdemo-field {
    opacity: 0.4;
    transition: opacity 0.4s;
}
.wdemo-field.wdemo-field-active {
    opacity: 1;
}
.wdemo-field label {
    display: block;
    font-size: 9px;
    font-weight: 700;
    color: var(--subtext0);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 3px;
}

.wdemo-select {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 8px;
    background: var(--crust);
    border: 1px solid var(--surface1);
    border-radius: var(--radius-sm);
    font-size: 12px;
    color: var(--text);
}

.wdemo-select-flash {
    animation: wdemo-flash 0.3s ease;
}
@keyframes wdemo-flash {
    0%, 100% { background: var(--crust); }
    50% { background: var(--surface1); }
}

.wdemo-textarea {
    padding: 6px 8px;
    background: var(--crust);
    border: 1px solid var(--surface1);
    border-radius: var(--radius-sm);
    font-size: 11px;
    color: var(--text);
    min-height: 44px;
    max-height: 70px;
    overflow: hidden;
    line-height: 1.5;
    word-break: break-word;
}

.wdemo-cursor {
    color: var(--lavender);
    animation: wdemo-blink 0.6s step-end infinite;
    display: none;
    font-weight: 300;
}
@keyframes wdemo-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.wdemo-actions {
    display: flex;
    gap: 6px;
    opacity: 0;
    transform: translateY(5px);
    transition: opacity 0.3s, transform 0.3s;
}
.wdemo-actions.wdemo-actions-visible {
    opacity: 1;
    transform: translateY(0);
}

.wdemo-btn {
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 600;
    background: var(--surface0);
    color: var(--text);
    border: 1px solid var(--surface1);
    transition: all 0.3s;
}
.wdemo-btn-primary {
    background: var(--blue);
    color: var(--crust);
    border-color: var(--blue);
}
.wdemo-btn-glow {
    box-shadow: 0 0 16px rgba(137, 180, 250, 0.4);
}
.wdemo-btn-active {
    opacity: 0.7;
}
.wdemo-btn-ready {
    background: var(--green);
    color: var(--crust);
    border-color: var(--green);
    box-shadow: 0 0 20px rgba(166, 227, 161, 0.3);
    animation: wdemo-pulse-ready 1s ease-in-out infinite;
}
@keyframes wdemo-pulse-ready {
    0%, 100% { box-shadow: 0 0 12px rgba(166, 227, 161, 0.2); }
    50% { box-shadow: 0 0 24px rgba(166, 227, 161, 0.4); }
}

.wdemo-progress {
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.3s;
}
.wdemo-progress.wdemo-progress-visible {
    opacity: 1;
}
.wdemo-progress-bar {
    flex: 1;
    height: 4px;
    background: var(--surface0);
    border-radius: 2px;
    overflow: hidden;
}
.wdemo-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--blue), var(--mauve));
    border-radius: 2px;
    width: 0%;
    transition: width 0.05s linear;
}
.wdemo-progress-text {
    font-size: 10px;
    color: var(--overlay0);
    min-width: 28px;
    text-align: right;
}

/* CTA area */
.welcome-cta-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    animation: welcome-fade-up 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.4s both;
}
.welcome-cta-form {
    display: flex;
    align-items: center;
    gap: 8px;
}
.welcome-name-input {
    width: 200px !important;
}
.btn-cta {
    padding: 10px 24px;
    font-size: 15px;
}
.btn-cta-secondary {
    font-size: 13px;
}

.welcome-scroll-hint {
    margin-top: 28px;
    font-size: 12px;
    color: var(--overlay0);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    animation: welcome-fade-up 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.6s both;
}
.welcome-scroll-hint svg {
    animation: welcome-bounce 2s ease-in-out infinite;
}
@keyframes welcome-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(4px); }
}

/* ── Welcome Responsive: Tablet ───────── */
@media (max-width: 900px) {
    .welcome-title { font-size: 34px; }
    .welcome-subtitle { font-size: 15px; }
}

/* ── Welcome Responsive: Mobile ───────── */
@media (max-width: 640px) {
    .welcome-hero {
        min-height: calc(100vh - 52px);
        padding: 24px 16px 40px;
    }
    .welcome-title {
        font-size: 26px;
        letter-spacing: -1px;
    }
    .welcome-subtitle {
        font-size: 14px;
        margin-bottom: 24px;
    }
    .welcome-step-label {
        font-size: 11px;
        padding: 3px 12px;
    }
    .welcome-demo-inner {
        grid-template-columns: 1fr;
        max-height: 360px;
        padding: 10px;
    }
    .wdemo-sidebar {
        flex-direction: row;
        gap: 4px;
        overflow-x: auto;
    }
    .wdemo-slide-item {
        flex-shrink: 0;
        flex-direction: column;
        min-width: 56px;
        text-align: center;
        padding: 4px;
        gap: 2px;
    }
    .wdemo-slide-item span { font-size: 9px; }
    .wdemo-slide-thumb { width: 44px; height: 26px; }
    .wdemo-preview { max-height: 80px; }
    .wdemo-textarea {
        font-size: 10px;
        min-height: 36px;
        max-height: 56px;
    }
    .wdemo-btn { font-size: 10px; padding: 3px 8px; }
    .welcome-cta-form {
        flex-direction: column;
        width: 100%;
    }
    .welcome-name-input { width: 100% !important; }
    .btn-cta {
        width: 100%;
        justify-content: center;
        padding: 12px;
    }
    .welcome-orb-1 { width: 300px; height: 300px; }
    .welcome-orb-2 { width: 250px; height: 250px; }
    .welcome-orb-3 { width: 200px; height: 200px; }
}

@media (max-width: 380px) {
    .welcome-title { font-size: 22px; }
    .welcome-demo-inner { padding: 8px; }
    .wdemo-field label { font-size: 8px; }
}

/* ── Selection ──────────────────────────── */
::selection {
    background: var(--lavender);
    color: var(--crust);
}
