/* ============================================
   MediaLives.com — Design System v2.0
   Premium AI Development Platform
   ============================================ */

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

:root {
    /* Surfaces */
    --bg-0: #09090b;
    --bg-1: #0c0c0f;
    --bg-2: #131316;
    --bg-3: #1a1a1f;
    --bg-4: #222228;
    --bg-hover: rgba(255,255,255,0.03);
    --bg-active: rgba(255,255,255,0.05);

    /* Borders */
    --border-subtle: rgba(255,255,255,0.06);
    --border-default: rgba(255,255,255,0.08);
    --border-strong: rgba(255,255,255,0.12);
    --border-accent: rgba(110,231,183,0.25);

    /* Text */
    --text-primary: #f4f4f5;
    --text-secondary: #a1a1aa;
    --text-tertiary: #71717a;
    --text-muted: #52525b;

    /* Accent - Emerald/Teal gradient system */
    --accent: #6EE7B7;
    --accent-hover: #5EDBA8;
    --accent-muted: rgba(110,231,183,0.15);
    --accent-subtle: rgba(110,231,183,0.08);
    --accent-glow: rgba(110,231,183,0.2);

    /* Secondary accents */
    --blue: #60A5FA;
    --blue-muted: rgba(96,165,250,0.15);
    --purple: #A78BFA;
    --purple-muted: rgba(167,139,250,0.15);
    --amber: #FBBF24;
    --amber-muted: rgba(251,191,36,0.15);
    --red: #F87171;
    --red-muted: rgba(248,113,113,0.12);

    /* Typography */
    --font-display: 'Sora', system-ui, sans-serif;
    --font-body: 'DM Sans', system-ui, sans-serif;
    --font-mono: 'Geist Mono', 'SF Mono', monospace;

    /* Spacing */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.5);
    --shadow-glow: 0 0 40px rgba(110,231,183,0.08);
}

body {
    font-family: var(--font-body);
    background: var(--bg-0);
    color: var(--text-primary);
    overflow-x: hidden;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================
   SCROLLBAR
   ============================ */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ============================
   LOGO COMPONENT
   ============================ */
.logo-mark {
    width: 42px; height: 42px;
    background: linear-gradient(135deg, rgba(110,231,183,0.12), rgba(59,130,246,0.12));
    border: 1px solid var(--border-accent);
    border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    position: relative;
    transition: all 0.3s ease;
}
.logo-mark::after {
    content: '';
    position: absolute; inset: -1px;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(110,231,183,0.15), rgba(59,130,246,0.15));
    opacity: 0;
    transition: opacity 0.3s;
    z-index: -1;
    filter: blur(8px);
}
.logo-mark:hover::after { opacity: 1; }

.logo-mark-sm { width: 34px; height: 34px; }
.logo-mark-sm svg { width: 18px; height: 18px; }

.logo-text {
    font-family: var(--font-display);
    font-size: 22px; font-weight: 600;
    letter-spacing: -0.5px;
    color: var(--text-primary);
}
.logo-text em {
    font-style: normal;
    background: linear-gradient(135deg, var(--accent), var(--blue));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}
.logo-text-sm { font-size: 17px; }

/* ============================
   LOGIN / REGISTER VIEW
   ============================ */
.login-view {
    min-height: 100vh;
    display: flex;
    position: relative;
    overflow: hidden;
}

/* Ambient background */
.login-bg {
    position: absolute; inset: 0;
    pointer-events: none;
    overflow: hidden;
}
.grid-overlay {
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: radial-gradient(ellipse 70% 70% at 30% 50%, black 0%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse 70% 70% at 30% 50%, black 0%, transparent 70%);
}
.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    animation: orbFloat 20s ease-in-out infinite;
}
.orb-1 {
    width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(110,231,183,0.07) 0%, transparent 70%);
    top: -10%; left: -5%;
    animation-duration: 25s;
}
.orb-2 {
    width: 500px; height: 500px;
    background: radial-gradient(circle, rgba(59,130,246,0.05) 0%, transparent 70%);
    bottom: -15%; right: 10%;
    animation-duration: 30s;
    animation-delay: -5s;
}
.orb-3 {
    width: 300px; height: 300px;
    background: radial-gradient(circle, rgba(167,139,250,0.04) 0%, transparent 70%);
    top: 40%; right: 30%;
    animation-duration: 22s;
    animation-delay: -10s;
}
@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -20px) scale(1.05); }
    50% { transform: translate(-20px, 30px) scale(0.95); }
    75% { transform: translate(15px, 15px) scale(1.02); }
}

/* Left panel */
.login-left {
    flex: 1;
    display: flex; flex-direction: column;
    justify-content: space-between;
    padding: 48px 64px;
    position: relative; z-index: 1;
    min-height: 100vh;
}
.login-content {
    flex: 1;
    display: flex; flex-direction: column;
    justify-content: center;
    max-width: 560px;
}

.login-logo {
    display: flex; align-items: center; gap: 14px;
    margin-bottom: 64px;
}

.login-headline {
    font-family: var(--font-display);
    font-size: 54px; font-weight: 700;
    line-height: 1.08;
    letter-spacing: -2.5px;
    color: var(--text-primary);
    margin-bottom: 24px;
}
.headline-accent {
    background: linear-gradient(135deg, var(--accent) 0%, var(--blue) 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-sub {
    font-size: 17px; line-height: 1.7;
    color: var(--text-secondary);
    max-width: 460px;
    margin-bottom: 48px;
}

.login-metrics {
    display: flex; align-items: center; gap: 0;
    margin-bottom: 40px;
    padding: 20px 28px;
    background: var(--bg-2);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
}
.metric { flex: 1; text-align: center; }
.metric-value {
    font-family: var(--font-mono);
    font-size: 24px; font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}
.metric-label {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 4px;
    letter-spacing: 0.3px;
}
.metric-divider {
    width: 1px; height: 36px;
    background: var(--border-default);
}

.login-features {
    display: flex; flex-wrap: wrap; gap: 8px;
}
.feature-pill {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 8px 14px;
    font-size: 13px; font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-2);
    border: 1px solid var(--border-subtle);
    border-radius: 100px;
    transition: all 0.2s;
}
.feature-pill:hover {
    border-color: var(--border-accent);
    color: var(--accent);
}
.feature-pill svg {
    opacity: 0.6;
    flex-shrink: 0;
}

.login-footer-note {
    font-size: 12px;
    color: var(--text-muted);
    letter-spacing: 0.3px;
}

/* Right panel - Form */
.login-right {
    width: 480px;
    display: flex; align-items: center; justify-content: center;
    padding: 48px 40px;
    position: relative; z-index: 1;
    border-left: 1px solid var(--border-subtle);
    background: rgba(12,12,15,0.6);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
}

.login-card {
    width: 100%;
    max-width: 380px;
}

.card-header { margin-bottom: 32px; }
.card-title {
    font-family: var(--font-display);
    font-size: 24px; font-weight: 600;
    letter-spacing: -0.5px;
    margin-bottom: 8px;
}
.card-sub {
    font-size: 14px;
    color: var(--text-tertiary);
}

.tab-switch {
    display: flex;
    position: relative;
    background: var(--bg-3);
    border-radius: var(--radius-md);
    padding: 3px;
    margin-bottom: 28px;
}
.tab-switch button {
    flex: 1;
    padding: 10px 16px;
    font-family: var(--font-body);
    font-size: 13px; font-weight: 500;
    background: transparent;
    color: var(--text-tertiary);
    border: none;
    border-radius: calc(var(--radius-md) - 2px);
    cursor: pointer;
    transition: color 0.25s;
    position: relative; z-index: 1;
}
.tab-switch button.active {
    color: var(--text-primary);
}
.tab-indicator {
    position: absolute;
    top: 3px; left: 3px;
    width: calc(50% - 3px);
    height: calc(100% - 6px);
    background: var(--bg-4);
    border-radius: calc(var(--radius-md) - 2px);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
}

.form-group { margin-bottom: 16px; }
.form-label {
    display: block;
    font-size: 13px; font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}
.form-input {
    width: 100%; padding: 11px 14px;
    background: var(--bg-3);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 14px;
    transition: all 0.2s;
    outline: none;
}
.form-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-subtle);
}
.form-input::placeholder { color: var(--text-muted); }

.form-error {
    background: var(--red-muted);
    border: 1px solid rgba(248,113,113,0.2);
    color: var(--red);
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-size: 13px;
    margin-bottom: 12px;
}

.btn-primary {
    width: 100%; padding: 12px 20px;
    background: var(--accent);
    color: var(--bg-0);
    font-family: var(--font-body);
    font-size: 14px; font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 8px;
    display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-primary:hover {
    background: var(--accent-hover);
    box-shadow: 0 0 20px var(--accent-glow);
    transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }

/* Google Sign-In Button */
.auth-divider {
    display: flex; align-items: center; gap: 16px;
    margin: 20px 0;
}
.auth-divider::before, .auth-divider::after {
    content: ""; flex: 1; height: 1px;
    background: var(--border-default);
}
.auth-divider span {
    font-size: 12px; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.5px; font-weight: 500;
}

.btn-google {
    width: 100%; padding: 11px 20px;
    background: var(--bg-3);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 10px;
    font-family: var(--font-body);
    font-size: 14px; font-weight: 500;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s;
}
.btn-google:hover {
    background: var(--bg-4);
    border-color: var(--border-strong);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}
.btn-google:active { transform: translateY(0); }
.btn-google svg { flex-shrink: 0; }

.login-terms {
    margin-top: 24px;
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
}
.login-terms a {
    color: var(--text-tertiary);
    text-decoration: none;
    transition: color 0.2s;
}
.login-terms a:hover { color: var(--accent); }

/* ============================
   DASHBOARD VIEW
   ============================ */
.body-dashboard { overflow: hidden; }
.body-login .dashboard-view { display: none; }

.dashboard-view {
    display: none;
    height: 100vh;
    height: 100dvh;
    grid-template-columns: 272px 1fr;
}
.dashboard-view.active { display: grid; }

/* Sidebar */
.sidebar {
    background: var(--bg-1);
    border-right: 1px solid var(--border-subtle);
    display: flex; flex-direction: column;
    overflow: hidden;
}

.sidebar-top {
    padding: 14px 16px 12px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex; flex-direction: row; align-items: center; justify-content: space-between;
}
.sidebar-logo {
    display: flex; align-items: center; gap: 10px;
}

.btn-new-project {
    width: 30px; height: 30px;
    background: transparent;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-secondary);
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}
.btn-new-project:hover {
    background: var(--accent-subtle);
    border-color: var(--accent);
    color: var(--accent);
}

/* Project selector */
.sidebar-projects-section {
    padding: 0 0 4px;
    border-bottom: 1px solid var(--border-subtle);
}
.sidebar-projects { padding: 0 8px 6px; }
.project-item {
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s;
    margin-bottom: 1px;
    display: flex; align-items: center; gap: 8px;
}
.project-item:hover { background: var(--bg-hover); }
.project-item.active {
    background: var(--accent-subtle);
}
.project-item-icon {
    width: 26px; height: 26px;
    border-radius: 6px;
    background: var(--bg-2);
    display: flex; align-items: center; justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
}
.project-item.active .project-item-icon {
    background: rgba(110,231,183,0.15);
}
.project-item-info { min-width: 0; flex: 1; }
.project-item-name {
    font-size: 13px; font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis;
}
.project-item-meta {
    font-size: 10px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    display: flex; gap: 6px; align-items: center;
}
.project-lang-badge {
    font-size: 9px;
    padding: 1px 5px;
    border-radius: 3px;
    background: var(--bg-2);
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Conversations header with new chat button */
.sidebar-chats-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 18px 8px;
}
.sidebar-chats-header .sidebar-section-label {
    padding: 0;
}
.btn-new-chat {
    width: 22px; height: 22px;
    background: transparent;
    border: 1px solid var(--border-default);
    border-radius: 4px;
    cursor: pointer;
    color: var(--text-muted);
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
    padding: 0;
}
.btn-new-chat:hover {
    background: var(--accent-subtle);
    border-color: var(--accent);
    color: var(--accent);
}

.sidebar-chats-section {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}
.sidebar-section-label {
    font-size: 11px; font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 12px 18px 8px;
}

.sidebar-chats { padding: 0 8px; }
.chat-item {
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s;
    margin-bottom: 1px;
}
.chat-item:hover { background: var(--bg-hover); }
.chat-item.active {
    background: var(--accent-subtle);
}
.chat-item-title {
    font-size: 13px; font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis;
}
.chat-item-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 3px;
    font-family: var(--font-mono);
    display: flex; justify-content: space-between;
}

/* Sidebar bottom */
.sidebar-bottom {
    padding: 12px 14px;
    border-top: 1px solid var(--border-subtle);
}
.sidebar-stats {
    display: flex; gap: 2px;
    margin-bottom: 12px;
    background: var(--bg-2);
    border-radius: var(--radius-md);
    padding: 10px 6px;
}
.stat-block {
    flex: 1;
    text-align: center;
    display: flex; flex-direction: column; gap: 2px;
}
.stat-val {
    font-family: var(--font-mono);
    font-size: 14px; font-weight: 600;
    color: var(--accent);
}
.stat-lbl {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-user {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    transition: background 0.15s;
}
.sidebar-user:hover { background: var(--bg-hover); }

.user-avatar {
    width: 32px; height: 32px;
    background: linear-gradient(135deg, var(--accent-muted), var(--blue-muted));
    border: 1px solid var(--border-accent);
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 600;
    color: var(--accent);
    flex-shrink: 0;
}
.user-info { flex: 1; min-width: 0; }
.user-name {
    font-size: 13px; font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis;
}
.user-balance {
    font-size: 11px;
    font-family: var(--font-mono);
    color: var(--text-tertiary);
}

.btn-logout {
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.2s;
    flex-shrink: 0;
}
.btn-logout:hover {
    background: var(--red-muted);
    color: var(--red);
}

/* ============================
   CHAT MAIN
   ============================ */
.chat-main {
    display: flex; flex-direction: column;
    background: var(--bg-0);
    position: relative;
    overflow: hidden;
    min-width: 0;
}

.chat-header {
    padding: 14px 24px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex; align-items: center; justify-content: space-between;
    background: var(--bg-0);
    flex-shrink: 0;
}
.chat-title {
    font-family: var(--font-display);
    font-size: 15px; font-weight: 600;
    letter-spacing: -0.3px;
}
.chat-header-badges {
    display: flex; gap: 6px;
}
.badge {
    font-family: var(--font-mono);
    font-size: 10px; padding: 3px 8px;
    border-radius: 100px;
    font-weight: 500;
    letter-spacing: 0.2px;
}
.badge-green { background: var(--accent-subtle); color: var(--accent); border: 1px solid var(--accent-muted); }
.badge-blue { background: var(--blue-muted); color: var(--blue); border: 1px solid rgba(96,165,250,0.2); }
.badge-orange { background: var(--amber-muted); color: var(--amber); border: 1px solid rgba(251,191,36,0.2); }

/* Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex; flex-direction: column; gap: 2px;
}

.message {
    display: flex; gap: 12px;
    max-width: 80%;
    animation: msgIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 8px 0;
}
@keyframes msgIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.message-user { align-self: flex-end; flex-direction: row-reverse; }

.message-avatar {
    width: 30px; height: 30px;
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
}
.message-avatar-ai {
    background: linear-gradient(135deg, var(--accent-muted), var(--blue-muted));
    border: 1px solid var(--border-accent);
}
.message-avatar-ai svg {
    width: 16px; height: 16px;
}
.message-avatar-user {
    background: var(--bg-3);
    border: 1px solid var(--border-default);
    font-size: 12px; font-weight: 600;
    color: var(--text-secondary);
}

.message-content {
    padding: 12px 16px;
    border-radius: var(--radius-lg);
    font-size: 14px; line-height: 1.65;
    overflow-x: hidden;
    overflow-wrap: break-word;
    word-break: break-word;
    min-width: 0;
}
.message-ai .message-content {
    background: var(--bg-2);
    border: 1px solid var(--border-subtle);
    border-top-left-radius: var(--radius-sm);
    color: var(--text-primary);
}
.message-user .message-content {
    background: linear-gradient(135deg, rgba(110,231,183,0.12), rgba(59,130,246,0.12));
    border: 1px solid var(--border-accent);
    border-top-right-radius: var(--radius-sm);
    color: var(--text-primary);
}
.message-meta {
    display: flex; align-items: center; gap: 8px;
    margin-top: 6px;
    font-family: var(--font-mono);
    font-size: 11px; color: var(--text-muted);
    padding: 0 4px;
}
.model-tag {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 8px;
    border-radius: 100px;
    font-size: 10px; font-weight: 600;
    letter-spacing: 0.2px;
}
.model-haiku { background: var(--accent-subtle); color: var(--accent); }
.model-sonnet { background: var(--blue-muted); color: var(--blue); }
.model-opus { background: var(--purple-muted); color: var(--purple); }
.model-boost { background: linear-gradient(135deg, rgba(245,158,11,0.15), rgba(239,68,68,0.15)); color: #f59e0b; }

.code-block {
    background: var(--bg-1);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    margin: 10px 0;
    font-family: var(--font-mono);
    font-size: 12px;
    overflow-x: auto;
    color: var(--text-secondary);
    line-height: 1.65;
    max-width: 100%;
    word-break: break-word;
    white-space: pre-wrap;
}

/* Typing indicator */
.typing-indicator { display: flex; gap: 5px; padding: 4px 0; }
.typing-dot {
    width: 6px; height: 6px;
    background: var(--accent);
    border-radius: 50%;
    animation: typingPulse 1.4s infinite ease-in-out;
}
.typing-dot:nth-child(2) { animation-delay: 0.15s; }
.typing-dot:nth-child(3) { animation-delay: 0.3s; }
@keyframes typingPulse {
    0%, 80%, 100% { opacity: 0.25; transform: scale(0.8); }
    40% { opacity: 1; transform: scale(1); }
}

/* Input area */
.chat-input-area {
    padding: 16px 24px 20px;
    background: var(--bg-0);
    flex-shrink: 0;
}
.chat-input-wrapper {
    display: flex; align-items: flex-end; gap: 10px;
    background: var(--bg-2);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: 6px 6px 6px 18px;
    transition: all 0.25s;
}
.chat-input-wrapper:focus-within {
    border-color: rgba(110,231,183,0.3);
    box-shadow: 0 0 0 3px var(--accent-subtle), var(--shadow-glow);
}
.chat-input {
    flex: 1; background: transparent;
    border: none; outline: none;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 14px;
    resize: none;
    min-height: 24px; max-height: 140px;
    padding: 8px 0;
    line-height: 1.5;
}
.chat-input::placeholder { color: var(--text-muted); }

.btn-send {
    width: 38px; height: 38px;
    background: var(--accent);
    border: none;
    border-radius: calc(var(--radius-lg) - 4px);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
    color: var(--bg-0);
}
.btn-send:hover:not(:disabled) {
    background: var(--accent-hover);
    box-shadow: 0 0 16px var(--accent-glow);
}
.btn-send:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.chat-input-meta {
    display: flex; align-items: center; justify-content: space-between;
    margin-top: 8px; padding: 0 4px;
}
.input-hint {
    font-size: 11px;
    color: var(--text-muted);
}
.session-cost {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-tertiary);
    letter-spacing: 0.2px;
}

/* Welcome state */
.welcome-state {
    flex: 1;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 20px 20px 40px;
    text-align: center;
    position: relative;
}
.welcome-glow {
    position: absolute;
    width: 300px; height: 300px;
    background: radial-gradient(circle, var(--accent-subtle) 0%, transparent 70%);
    border-radius: 50%;
    filter: blur(60px);
    pointer-events: none;
    top: 50%; left: 50%;
    transform: translate(-50%, -60%);
}
.welcome-icon-wrap {
    width: 72px; height: 72px;
    background: linear-gradient(135deg, rgba(110,231,183,0.1), rgba(59,130,246,0.1));
    border: 1px solid var(--border-accent);
    border-radius: 20px;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 24px;
    position: relative;
}
.welcome-title {
    font-family: var(--font-display);
    font-size: 26px; font-weight: 700;
    letter-spacing: -0.8px;
    margin-bottom: 10px;
    position: relative;
}
.welcome-sub {
    font-size: 15px; color: var(--text-secondary);
    max-width: 520px; line-height: 1.5;
    position: relative;
}
.welcome-grid {
    display: flex; flex-wrap: wrap; gap: 8px;
    margin-top: 28px;
    max-width: 640px; width: 100%;
    justify-content: center;
    position: relative;
}
.welcome-chip {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 16px;
    background: var(--bg-2);
    border: 1px solid var(--border-subtle);
    border-radius: 100px;
    cursor: pointer;
    transition: all 0.25s;
    font-family: var(--font-body);
    font-size: 13px; font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
}
.welcome-chip:hover {
    border-color: var(--border-accent);
    background: var(--bg-3);
    color: var(--accent);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}
.welcome-chip svg {
    color: var(--accent);
    opacity: 0.7;
    flex-shrink: 0;
}
.welcome-chip:hover svg {
    opacity: 1;
}

/* ============================
   PROFILE PANEL
   ============================ */
.profile-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}
.profile-overlay.active { display: flex; justify-content: center; align-items: flex-start; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

.profile-panel {
    width: 520px; max-width: 95vw;
    max-height: 90vh; overflow-y: auto;
    background: var(--bg-1);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    margin-top: 5vh;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s cubic-bezier(0.16,1,0.3,1);
}

.profile-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex; align-items: center;
}
.profile-back {
    display: flex; align-items: center; gap: 8px;
    background: transparent; border: none; cursor: pointer;
    color: var(--text-secondary); font-family: var(--font-body);
    font-size: 13px; font-weight: 500;
    transition: color 0.2s;
}
.profile-back:hover { color: var(--accent); }

.profile-body { padding: 32px 24px; }

.profile-avatar-section {
    display: flex; flex-direction: column; align-items: center;
    margin-bottom: 32px;
}
.profile-avatar-img {
    width: 72px; height: 72px; border-radius: 50%;
    border: 2px solid var(--border-accent);
    margin-bottom: 14px;
}
.profile-avatar-big {
    width: 72px; height: 72px; border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-muted), var(--blue-muted));
    border: 2px solid var(--border-accent);
    display: flex; align-items: center; justify-content: center;
    font-size: 28px; font-weight: 700; color: var(--accent);
    margin-bottom: 14px;
}
.profile-name {
    font-family: var(--font-display); font-size: 22px; font-weight: 700;
    letter-spacing: -0.5px; margin-bottom: 4px;
}
.profile-email {
    font-size: 14px; color: var(--text-tertiary);
}
.profile-badge-google {
    display: inline-flex; align-items: center; gap: 6px;
    margin-top: 10px; padding: 4px 12px;
    background: var(--bg-3); border: 1px solid var(--border-default);
    border-radius: 100px; font-size: 11px; color: var(--text-secondary);
}

.profile-section {
    margin-bottom: 28px;
}
.profile-section h3 {
    font-family: var(--font-display); font-size: 14px; font-weight: 600;
    color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.5px;
    margin-bottom: 14px; padding-bottom: 8px;
    border-bottom: 1px solid var(--border-subtle);
}
.profile-field {
    margin-bottom: 14px;
}
.profile-field label {
    display: block; font-size: 12px; font-weight: 500;
    color: var(--text-tertiary); margin-bottom: 5px;
}
.profile-field select.form-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center;
    padding-right: 36px; cursor: pointer;
}

/* Language Picker */
.lang-picker { position: relative; }
.lang-picker-btn {
    width: 100%; padding: 10px 14px;
    background: var(--bg-2); border: 1px solid var(--border-default);
    border-radius: var(--radius-md); cursor: pointer;
    display: flex; align-items: center; gap: 10px;
    font-family: var(--font-body); font-size: 14px; color: var(--text-primary);
    transition: all 0.15s;
}
.lang-picker-btn:hover { border-color: var(--border-strong); background: var(--bg-3); }
.lang-picker-btn:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-muted); }
.lang-picker.open .lang-picker-btn { border-color: var(--accent); }
.lang-flag { display: flex; align-items: center; flex-shrink: 0; }
.lang-flag-img { border-radius: 2px; object-fit: cover; display: block; box-shadow: 0 0 0 1px rgba(255,255,255,0.1); }
.lang-name { flex: 1; text-align: left; }
.lang-chevron { transition: transform 0.2s; color: var(--text-muted); flex-shrink: 0; }
.lang-picker.open .lang-chevron { transform: rotate(180deg); }

.lang-dropdown {
    display: none; position: absolute; left: 0; right: 0;
    bottom: calc(100% + 6px);
    background: var(--bg-1); border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    max-height: 280px; overflow-y: auto; z-index: 100;
    padding: 4px;
}
.lang-picker.open .lang-dropdown { display: block; animation: slideUp 0.15s ease; }

.lang-dropdown-search {
    width: calc(100% - 8px); margin: 4px; padding: 8px 10px;
    background: var(--bg-2); border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    font-family: var(--font-body); font-size: 13px; color: var(--text-primary);
    outline: none;
}
.lang-dropdown-search:focus { border-color: var(--accent); }
.lang-dropdown-search::placeholder { color: var(--text-muted); }

.lang-option {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px; border-radius: var(--radius-sm);
    cursor: pointer; font-size: 14px; color: var(--text-secondary);
    transition: all 0.1s;
}
.lang-option:hover { background: var(--bg-3); color: var(--text-primary); }
.lang-option.active { background: var(--accent-muted); color: var(--accent); font-weight: 500; }
.lang-option .lang-flag-img { width: 20px; height: 15px; }
.lang-option-hidden { display: none; }

/* Scrollbar for dropdown */
.lang-dropdown::-webkit-scrollbar { width: 5px; }
.lang-dropdown::-webkit-scrollbar-track { background: transparent; }
.lang-dropdown::-webkit-scrollbar-thumb { background: var(--border-default); border-radius: 10px; }
.lang-dropdown::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }

.profile-stats-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.profile-stat {
    background: var(--bg-2); border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md); padding: 14px;
    display: flex; flex-direction: column; gap: 4px;
}
.profile-stat-label {
    font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.3px;
}
.profile-stat-value {
    font-family: var(--font-mono); font-size: 16px; font-weight: 600; color: var(--text-primary);
}
.profile-stat-value.accent { color: var(--accent); }

.btn-danger-outline {
    display: block; width: 100%; padding: 10px; text-align: center;
    background: transparent; border: 1px solid var(--red-muted);
    border-radius: var(--radius-md); color: var(--red);
    font-family: var(--font-body); font-size: 13px; font-weight: 500;
    text-decoration: none; cursor: pointer; transition: all 0.2s;
}
.btn-danger-outline:hover {
    background: var(--red-muted); border-color: rgba(248,113,113,0.3);
}

.profile-danger-section { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--border-subtle); }

/* ============================
   HEADER PREVIEW LINK
   ============================ */
/* Header action buttons container (DOWNLOAD + PREVIEW) */
.chat-header-actions {
    display: flex; align-items: center; gap: 6px;
    margin-left: auto;
}
.btn-header-action {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 11px; font-weight: 700;
    letter-spacing: 1px;
    text-decoration: none;
    text-transform: uppercase;
    transition: all 0.2s;
    white-space: nowrap;
    cursor: pointer;
    border: 1px solid transparent;
    line-height: 1;
}
.btn-header-action svg { flex-shrink: 0; }
.btn-preview-action {
    background: rgba(110,231,183,0.12);
    border-color: var(--accent);
    color: var(--accent);
}
.btn-preview-action:hover {
    background: var(--accent);
    color: var(--bg-0);
    box-shadow: 0 0 16px var(--accent-glow);
}
.btn-download {
    background: rgba(99,102,241,0.10);
    border-color: rgba(129,140,248,0.4);
    color: #a5b4fc;
}
.btn-download:hover {
    background: #6366f1;
    color: #fff;
    border-color: #6366f1;
    box-shadow: 0 0 16px rgba(99,102,241,0.3);
}
.btn-download.loading {
    pointer-events: none; opacity: 0.6;
}
.btn-download.loading span::after {
    content: '...';
    animation: dotPulse 1.2s infinite;
}
@keyframes dotPulse { 0%,20%{content:'.'} 40%{content:'..'} 60%,100%{content:'...'} }

/* ============================
   STREAMING STATUS
   ============================ */
.stream-status {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 12px; color: var(--text-secondary);
    font-family: var(--font-body);
    font-weight: 500;
    padding: 8px 12px;
    margin-bottom: 6px;
    background: rgba(110,231,183,0.04);
    border-left: 2px solid var(--accent);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.stream-status .dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--accent);
    animation: pulse-dot 1.2s ease-in-out infinite;
}
.stream-status.phase-deploying { border-left-color: #f59e0b; }
.stream-status.phase-deploying .dot { background: #f59e0b; }
@keyframes pulse-dot {
    0%, 100% { opacity: 0.2; transform: scale(0.85); }
    50% { opacity: 1; transform: scale(1.1); }
}

/* ============================
   FILE ACTIVITY (during streaming)
   ============================ */
.file-activity {
    display: flex; flex-direction: column; gap: 4px;
    margin: 8px 0;
    padding: 10px 12px;
    background: var(--bg-1);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
}
.file-item {
    display: flex; align-items: center; gap: 8px;
    font-size: 12px; font-family: var(--font-mono);
    color: var(--text-secondary);
    padding: 4px 0;
}
.file-item.writing { color: var(--accent); }
.file-item.done { color: var(--text-tertiary); }
.file-spinner {
    width: 14px; height: 14px;
    border: 2px solid rgba(110,231,183,0.2);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================
   ARTIFACT BLOCKS (Claude-like)
   ============================ */
.artifact-block {
    margin: 8px 0;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: border-color 0.3s;
    cursor: pointer;
}
.artifact-block:hover { border-color: var(--border-accent); }
.artifact-block.done { border-color: rgba(110,231,183,0.2); }
.artifact-header {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 14px;
    background: var(--bg-1);
    user-select: none;
}
.artifact-icon { flex-shrink: 0; width: 14px; height: 14px; display: flex; align-items: center; }
.artifact-name {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.artifact-status {
    font-size: 11px;
    color: var(--text-tertiary);
    font-family: var(--font-mono);
    white-space: nowrap;
}
.artifact-chevron {
    flex-shrink: 0;
    color: var(--text-tertiary);
    transition: transform 0.2s;
}
.artifact-block.expanded .artifact-chevron { transform: rotate(180deg); }
.artifact-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}
.artifact-block.expanded .artifact-body {
    max-height: 60vh;
    overflow-y: auto;
}
.artifact-code {
    padding: 12px 14px;
    margin: 0;
    font-family: var(--font-mono);
    font-size: 11px;
    line-height: 1.55;
    color: var(--text-secondary);
    background: var(--bg-0);
    white-space: pre-wrap;
    word-break: break-word;
    border-top: 1px solid var(--border-default);
}
/* Writing state pulse */
.artifact-block:not(.done) .artifact-header {
    background: linear-gradient(90deg, var(--bg-1) 0%, rgba(110,231,183,0.04) 50%, var(--bg-1) 100%);
    background-size: 200% 100%;
    animation: shimmer 2s ease-in-out infinite;
}
@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============================
   INTERACTIVE QUESTIONS (ASK blocks)
   ============================ */
.ask-block {
    margin: 10px 0;
}
.ask-question {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 500;
}
.ask-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.ask-btn {
    padding: 8px 16px;
    font-size: 13px;
    font-family: var(--font-main);
    color: var(--text-primary);
    background: var(--bg-1);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    line-height: 1.3;
}
.ask-btn:hover {
    border-color: var(--accent);
    background: rgba(110,231,183,0.06);
    color: var(--accent);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(110,231,183,0.15);
}
.ask-btn:active {
    transform: translateY(0);
}
.ask-btn.selected {
    border-color: var(--accent);
    background: rgba(110,231,183,0.12);
    color: var(--accent);
    font-weight: 600;
}
/* History: answered questions are faded and disabled */
.ask-answered .ask-btn {
    opacity: 0.6;
    pointer-events: none;
}
.ask-answered .ask-btn.selected {
    opacity: 1;
}
/* History: unanswered questions stay active */
.ask-pending .ask-btn {
    cursor: pointer;
}

/* ============================
   COLLAPSIBLE CODE BLOCKS (markdown)
   ============================ */
.code-collapse {
    margin: 8px 0;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    overflow: hidden;
}
.code-toggle {
    display: flex; align-items: center; gap: 6px;
    width: 100%;
    padding: 8px 12px;
    background: var(--bg-1);
    border: none;
    color: var(--text-secondary);
    font-size: 12px;
    font-family: var(--font-mono);
    cursor: pointer;
    transition: background 0.2s;
}
.code-toggle:hover { background: rgba(255,255,255,0.04); }
.code-toggle svg { transition: transform 0.2s; }
.code-collapse.open .code-toggle svg { transform: rotate(90deg); }
.code-body {
    max-height: 0; overflow: hidden;
    transition: max-height 0.3s ease;
}
.code-collapse.open .code-body { max-height: 2000px; }
.code-body pre {
    padding: 12px 14px;
    margin: 0;
    font-family: var(--font-mono);
    font-size: 12px;
    line-height: 1.6;
    color: var(--text-secondary);
    background: var(--bg-0);
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ============================
   INLINE CODE & HEADERS
   ============================ */
.inline-code {
    background: rgba(255,255,255,0.06);
    padding: 1px 5px;
    border-radius: 3px;
    font-family: var(--font-mono);
    font-size: 0.88em;
}
.msg-h {
    font-family: var(--font-heading);
    font-weight: 600;
    margin: 12px 0 4px;
    color: var(--text-primary);
}
h3.msg-h { font-size: 15px; }
h4.msg-h { font-size: 13px; color: var(--text-secondary); }

/* ============================
   DEPLOY BANNER
   ============================ */
.deploy-banner {
    display: flex; align-items: center; gap: 12px;
    margin-top: 10px;
    padding: 10px 14px;
    background: linear-gradient(135deg, rgba(110,231,183,0.08), rgba(59,130,246,0.08));
    border: 1px solid var(--border-accent);
    border-radius: var(--radius-md);
}
.btn-preview {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 14px;
    background: var(--accent);
    color: var(--bg-0);
    font-family: var(--font-body);
    font-size: 13px; font-weight: 600;
    border: none; border-radius: var(--radius-sm);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-preview:hover {
    background: var(--accent-hover);
    box-shadow: 0 0 16px var(--accent-glow);
    transform: translateY(-1px);
}
.deploy-files {
    font-size: 12px;
    color: var(--text-tertiary);
    font-family: var(--font-mono);
}

/* ============================
   MOBILE MENU
   ============================ */
.mobile-menu-btn {
    display: none;
    width: 36px; height: 36px;
    align-items: center; justify-content: center;
    background: transparent;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s;
    flex-shrink: 0;
}
.mobile-menu-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-strong);
}
.sidebar-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
    z-index: 998;
}
.sidebar-overlay.active { display: block; }

/* ============================
   UTILITIES
   ============================ */
.hidden { display: none !important; }

/* ============================
   RESPONSIVE
   ============================ */
@media (max-width: 1100px) {
    .login-left { padding: 40px; }
    .login-headline { font-size: 42px; }
    .login-right { width: 440px; }
}
@media (max-width: 768px) {
    /* LOGIN */
    .login-view { flex-direction: column; }
    .login-left {
        padding: 32px 24px;
        min-height: auto;
    }
    .login-content { max-width: 100%; }
    .login-headline { font-size: 32px; letter-spacing: -1.5px; }
    .login-right {
        width: 100%;
        border-left: none;
        border-top: 1px solid var(--border-subtle);
        padding: 32px 24px;
    }
    .login-metrics { flex-wrap: wrap; }
    .login-footer-note { display: none; }

    /* DASHBOARD MOBILE */
    .dashboard-view { grid-template-columns: 1fr; }
    .sidebar {
        display: none;
        position: fixed; inset: 0; z-index: 999;
        width: 100%; max-width: 320px;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    .sidebar.mobile-open {
        display: flex;
        transform: translateX(0);
    }
    .sidebar-overlay {
        display: none;
        position: fixed; inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 998;
    }
    .sidebar-overlay.active { display: block; }

    /* Mobile hamburger */
    .mobile-menu-btn {
        display: flex !important;
    }

    /* Chat header compact */
    .chat-header {
        padding: 10px 12px;
    }
    /* Action buttons: icon-only on mobile */
    .chat-header-actions { gap: 4px; }
    .btn-header-action {
        padding: 7px;
        font-size: 0; letter-spacing: 0; gap: 0;
    }
    .btn-header-action span { display: none; }
    .btn-header-action svg { width: 16px; height: 16px; }

    /* Welcome state — pushed up, not dead center */
    .welcome-state {
        justify-content: flex-start;
        padding: 8vh 16px 10px;
        gap: 0;
    }
    .welcome-glow { display: none; }
    .welcome-title { font-size: 20px; margin-bottom: 6px; }
    .welcome-sub { font-size: 13px; max-width: 320px; line-height: 1.5; }

    /* Chips — wrap naturally on mobile */
    .welcome-grid {
        margin-top: 20px;
        gap: 6px;
        justify-content: center;
        max-width: 100%;
    }
    .welcome-chip {
        font-size: 12px;
        padding: 8px 12px;
    }

    /* Input area compact + safe for mobile browser chrome */
    .chat-input-area { padding: 10px 12px calc(14px + env(safe-area-inset-bottom, 0px)); }
    .chat-input-wrapper { padding: 4px 4px 4px 14px; }
    .chat-input { font-size: 14px; }
    .chat-input-meta { margin-top: 6px; }

    /* Messages — compact */
    .chat-messages { padding: 10px 8px; gap: 0; }
    .message { max-width: 95%; min-width: 0; padding: 4px 0; }
    .message-content { padding: 10px 12px; font-size: 13px; line-height: 1.55; }
    .message-avatar { width: 26px; height: 26px; }
    .message-avatar-ai svg { width: 14px; height: 14px; }
    .message-meta { font-size: 10px; margin-top: 4px; }
    .code-block { font-size: 11px; padding: 10px 12px; }
}

/* ============================
   PAGE LOAD ANIMATIONS
   ============================ */
.login-logo { animation: fadeUp 0.6s ease-out both; animation-delay: 0.1s; }
.login-headline { animation: fadeUp 0.6s ease-out both; animation-delay: 0.2s; }
.login-sub { animation: fadeUp 0.6s ease-out both; animation-delay: 0.3s; }
.login-metrics { animation: fadeUp 0.6s ease-out both; animation-delay: 0.4s; }
.login-features { animation: fadeUp 0.6s ease-out both; animation-delay: 0.5s; }
.login-card { animation: fadeUp 0.6s ease-out both; animation-delay: 0.3s; }

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Create Project Modal */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex; align-items: center; justify-content: center;
    animation: fadeIn 0.15s ease;
}
.modal-panel {
    background: var(--bg-1);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    width: 90%; max-width: 440px;
    animation: fadeUp 0.2s ease;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid var(--border-subtle);
}
.modal-header h3 {
    font-size: 16px; font-weight: 600;
    color: var(--text-primary); margin: 0;
}
.modal-close {
    background: none; border: none; cursor: pointer;
    font-size: 22px; color: var(--text-muted);
    padding: 0 4px; line-height: 1;
    transition: color 0.15s;
}
.modal-close:hover { color: var(--text-primary); }
.modal-body {
    padding: 22px;
}
.modal-body .form-field {
    margin-bottom: 18px;
}
.modal-body .form-field label {
    display: block;
    font-size: 12px; font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase; letter-spacing: 0.5px;
    margin-bottom: 8px;
}
.stack-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}
.stack-option {
    padding: 12px;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    cursor: pointer;
    text-align: center;
    transition: all 0.15s;
}
.stack-option:hover {
    border-color: var(--border-strong);
    background: var(--bg-hover);
}
.stack-option.active {
    border-color: var(--accent);
    background: rgba(110,231,183,0.08);
}
.stack-icon { font-size: 22px; display: block; margin-bottom: 4px; }
.stack-name { font-size: 13px; font-weight: 600; color: var(--text-primary); display: block; }
.stack-desc { font-size: 11px; color: var(--text-muted); display: block; margin-top: 2px; }
.btn-create-project {
    width: 100%; margin-top: 6px;
}
.btn-create-project:disabled {
    opacity: 0.5; cursor: not-allowed;
}

/* Stack choice buttons */
.stack-choice-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.btn-stack-choice {
    padding: 10px 14px;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    background: transparent;
    cursor: pointer;
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 13px; font-weight: 600;
    display: flex; align-items: center; justify-content: center; gap: 7px;
    transition: all 0.2s;
}
.btn-stack-choice:hover {
    border-color: var(--border-strong);
    color: var(--text-primary);
    background: var(--bg-hover);
}
.btn-stack-choice.active {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(110,231,183,0.08);
}
.btn-stack-choice svg { flex-shrink: 0; }

/* AI suggestion area */
.ai-suggestion-area {
    margin-top: -6px;
    margin-bottom: 14px;
}
.ai-suggestion-hint {
    display: flex; align-items: center; gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
    padding: 8px 0;
}
.ai-suggestion-hint svg { flex-shrink: 0; opacity: 0.5; }
.ai-suggestion-result {
    padding: 12px 14px;
    background: rgba(110,231,183,0.06);
    border: 1px solid rgba(110,231,183,0.2);
    border-radius: var(--radius-md);
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.5;
}
.ai-suggestion-result .suggested-stack {
    display: inline-flex; align-items: center; gap: 5px;
    font-weight: 700;
    color: var(--accent);
}
.ai-suggestion-loading {
    display: flex; align-items: center; gap: 8px;
    padding: 12px 14px;
    font-size: 12px;
    color: var(--text-muted);
}
.ai-suggestion-loading .dot-pulse {
    display: inline-flex; gap: 3px;
}
.ai-suggestion-loading .dot-pulse span {
    width: 5px; height: 5px;
    border-radius: 50%;
    background: var(--accent);
    animation: dotPulse 1.2s infinite ease-in-out;
}
.ai-suggestion-loading .dot-pulse span:nth-child(2) { animation-delay: 0.2s; }
.ai-suggestion-loading .dot-pulse span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dotPulse {
    0%, 80%, 100% { opacity: 0.2; transform: scale(0.8); }
    40% { opacity: 1; transform: scale(1); }
}

/* Textarea in modal */
.modal-body textarea.form-input {
    resize: vertical;
    min-height: 60px;
    max-height: 120px;
    font-size: 13px;
    line-height: 1.4;
}
/* ============================
   SUPER POWER BOOST
   ============================ */
.boost-toggle {
    display: inline-flex; align-items: center; gap: 6px;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}
.boost-toggle input { display: none; }

/* Switch track */
.boost-switch {
    position: relative;
    width: 28px; height: 16px;
    background: var(--border-default);
    border-radius: 10px;
    transition: background 0.3s;
    flex-shrink: 0;
}
.boost-knob {
    position: absolute;
    top: 2px; left: 2px;
    width: 12px; height: 12px;
    background: var(--text-muted);
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.boost-toggle input:checked ~ .boost-switch {
    background: linear-gradient(135deg, #f59e0b, #ef4444, #ec4899);
}
.boost-toggle input:checked ~ .boost-switch .boost-knob {
    left: 14px;
    background: #fff;
    box-shadow: 0 0 6px rgba(245,158,11,0.6);
}

/* Label */
.boost-label {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    transition: color 0.3s;
}
.boost-toggle input:checked ~ .boost-label {
    background: linear-gradient(90deg, #f59e0b, #ef4444, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Micro loader */
.boost-loader {
    display: none;
    width: 12px; height: 12px;
    border: 2px solid transparent;
    border-top-color: #f59e0b;
    border-right-color: #ef4444;
    border-radius: 50%;
    animation: boostSpin 0.6s linear infinite;
}
.boost-loader.visible { display: inline-block; }
@keyframes boostSpin {
    to { transform: rotate(360deg); }
}

/* Confirmed flash */
.boost-confirmed {
    display: none;
    font-size: 12px;
    animation: boostFlashIn 0.4s ease;
}
.boost-confirmed.visible { display: inline-block; }
@keyframes boostFlashIn {
    0% { opacity: 0; transform: scale(0.3); }
    50% { opacity: 1; transform: scale(1.4); }
    100% { transform: scale(1); }
}

/* Chat border glow when boost active */
.chat-input-wrapper.boost-active {
    border-color: #f59e0b !important;
    box-shadow: 0 0 0 1px rgba(245,158,11,0.3), 0 0 20px rgba(245,158,11,0.15), 0 0 40px rgba(239,68,68,0.08);
    animation: boostBorderPulse 2s ease-in-out infinite;
}
@keyframes boostBorderPulse {
    0%, 100% {
        border-color: #f59e0b;
        box-shadow: 0 0 0 1px rgba(245,158,11,0.3), 0 0 20px rgba(245,158,11,0.15);
    }
    33% {
        border-color: #ef4444;
        box-shadow: 0 0 0 1px rgba(239,68,68,0.3), 0 0 20px rgba(239,68,68,0.15);
    }
    66% {
        border-color: #ec4899;
        box-shadow: 0 0 0 1px rgba(236,72,153,0.3), 0 0 20px rgba(236,72,153,0.15);
    }
}

/* Truncated artifact indicator */
.artifact-block.truncated .artifact-header {
    border-color: rgba(245,158,11,0.3);
}
.artifact-block.truncated .artifact-name {
    color: #f59e0b;
}

/* Thinking phase for boost mode */
.phase-thinking .dot {
    background: #f59e0b !important;
    box-shadow: 0 0 8px rgba(245,158,11,0.5);
}
.phase-thinking span {
    color: #f59e0b;
}

/* Compaction notice */
.compaction-notice {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 14px;
    font-size: 12px;
    color: var(--text-muted);
    background: var(--bg-2);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    animation: fadeUp 0.3s ease;
}
.compaction-notice svg {
    flex-shrink: 0;
    opacity: 0.6;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ============================================
   PROJECT PICKER MODAL
   ============================================ */
.picker-panel { max-width: 480px; }
.picker-subtitle {
    font-size: 13px; color: var(--text-muted);
    margin: 0 0 16px; line-height: 1.5;
}
.picker-projects {
    display: flex; flex-direction: column; gap: 6px;
    max-height: 280px; overflow-y: auto;
    padding-right: 4px;
}
.picker-project-card {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 14px;
    background: var(--bg-2);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s;
}
.picker-project-card:hover {
    border-color: var(--accent);
    background: rgba(110,231,183,0.06);
}
.picker-project-icon {
    font-size: 20px; flex-shrink: 0;
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-3); border-radius: 8px;
}
.picker-project-info { flex: 1; min-width: 0; }
.picker-project-name {
    font-family: var(--font-display);
    font-size: 14px; font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.picker-project-meta {
    font-size: 11px; color: var(--text-muted);
    margin-top: 2px;
    display: flex; gap: 8px;
}
.picker-project-meta .lang-tag {
    font-family: var(--font-mono);
    text-transform: uppercase;
    font-size: 10px; font-weight: 600;
    letter-spacing: 0.5px;
    color: var(--accent);
}
.picker-divider {
    display: flex; align-items: center; gap: 12px;
    margin: 14px 0;
    color: var(--text-muted); font-size: 12px;
}
.picker-divider::before, .picker-divider::after {
    content: ''; flex: 1; height: 1px;
    background: var(--border-subtle);
}
.btn-picker-new {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; padding: 12px;
    background: transparent;
    border: 1px dashed var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: 13px; font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}
.btn-picker-new:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(110,231,183,0.06);
}

/* ============================================
   BILLING & RECHARGE
   ============================================ */

/* Low Balance Banner */
.low-balance-banner {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 14px;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: var(--radius-sm);
    font-size: 12px;
    color: #f59e0b;
    margin-bottom: 6px;
    animation: fadeUp 0.3s ease;
}
.low-balance-banner svg { flex-shrink: 0; }
.low-balance-btn {
    background: rgba(245, 158, 11, 0.2);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #f59e0b;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-body);
    margin-left: auto;
}
.low-balance-btn:hover { background: rgba(245, 158, 11, 0.3); }
.low-balance-dismiss {
    background: none; border: none; color: rgba(245, 158, 11, 0.5);
    cursor: pointer; font-size: 14px; padding: 0 2px; line-height: 1;
}

/* No Credits Overlay */
.no-credits-overlay {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; gap: 10px;
    padding: 28px 20px;
    text-align: center;
    animation: fadeUp 0.4s ease;
}
.no-credits-icon { color: var(--text-muted); opacity: 0.5; }
.no-credits-overlay h3 {
    font-family: var(--font-heading);
    font-size: 16px; font-weight: 600;
    color: var(--text-primary); margin: 0;
}
.no-credits-overlay p {
    font-size: 13px; color: var(--text-secondary); margin: 0;
    max-width: 280px;
}
.no-credits-overlay .btn-primary {
    margin-top: 6px;
    padding: 10px 24px;
    font-size: 13px;
}

/* Recharge Modal */
.recharge-panel { max-width: 440px; }
.recharge-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0 0 16px 0;
}

.recharge-packages {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.recharge-pkg {
    position: relative;
    display: flex; flex-direction: column;
    align-items: center; gap: 4px;
    padding: 16px 8px;
    background: var(--bg-2);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-body);
}
.recharge-pkg:hover { border-color: var(--text-muted); background: var(--bg-3); }
.recharge-pkg.selected {
    border-color: var(--accent);
    background: rgba(110, 231, 183, 0.08);
    box-shadow: 0 0 0 1px var(--accent);
}
.recharge-pkg.popular { border-color: rgba(110, 231, 183, 0.3); }

.pkg-badge {
    position: absolute; top: -8px; left: 50%; transform: translateX(-50%);
    background: var(--accent); color: var(--bg-1);
    font-size: 9px; font-weight: 700; letter-spacing: 0.03em;
    padding: 2px 8px; border-radius: 10px; white-space: nowrap;
}
.pkg-amount {
    font-family: var(--font-heading);
    font-size: 20px; font-weight: 700;
    color: var(--text-primary);
}
.pkg-credits {
    font-size: 11px; color: var(--text-muted); font-weight: 500;
}

.btn-recharge {
    width: 100%;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px;
    font-size: 14px;
}
.btn-recharge:disabled {
    opacity: 0.5; cursor: not-allowed;
}

.recharge-secure {
    display: flex; align-items: center; gap: 6px;
    font-size: 11px; color: var(--text-muted);
    margin-top: 12px;
    text-align: center;
    justify-content: center;
}
.recharge-secure svg { flex-shrink: 0; opacity: 0.5; }

/* Inline topup button in sidebar */
.btn-topup-inline {
    width: 16px; height: 16px;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(110, 231, 183, 0.15);
    border: 1px solid rgba(110, 231, 183, 0.3);
    color: var(--accent);
    font-size: 11px; font-weight: 700; line-height: 1;
    border-radius: 4px;
    cursor: pointer; transition: all 0.2s;
    padding: 0; margin-left: 2px;
    flex-shrink: 0;
}
.btn-topup-inline:hover { background: rgba(110, 231, 183, 0.3); transform: scale(1.1); }

/* Small recharge button in profile */
.btn-recharge-sm {
    background: rgba(110, 231, 183, 0.15);
    border: 1px solid rgba(110, 231, 183, 0.3);
    color: var(--accent);
    font-size: 10px; font-weight: 600;
    padding: 2px 8px; border-radius: 4px;
    cursor: pointer; transition: all 0.2s;
    font-family: var(--font-body);
    margin-left: 8px;
}
.btn-recharge-sm:hover { background: rgba(110, 231, 183, 0.25); }

/* Payment Toast */
.payment-toast {
    position: fixed; top: 20px; right: 20px;
    display: flex; align-items: center; gap: 10px;
    padding: 14px 20px;
    border-radius: var(--radius);
    font-size: 14px; font-weight: 500;
    z-index: 10000;
    transform: translateX(120%);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
    font-family: var(--font-body);
}
.payment-toast.visible { transform: translateX(0); }
.payment-toast.success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #10b981;
    backdrop-filter: blur(12px);
}
.payment-toast.pending {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #f59e0b;
    backdrop-filter: blur(12px);
}

/* Responsive */
@media (max-width: 480px) {
    .recharge-packages { grid-template-columns: repeat(2, 1fr); }
    .recharge-panel { max-width: 100%; margin: 0 12px; }
    .payment-toast { left: 12px; right: 12px; top: auto; bottom: 20px; }
}
/* Hamburger Menu + Dropdown */
.header-menu-wrap { position: relative; }
.btn-header-menu {
    background: rgba(255,255,255,0.06) !important;
    border-color: rgba(255,255,255,0.1) !important;
    color: rgba(255,255,255,0.5) !important;
    padding: 6px 8px !important; min-width: 0 !important;
}
.btn-header-menu:hover { background: rgba(255,255,255,0.1) !important; color: #fff !important; }

.header-dropdown {
    position: absolute; top: calc(100% + 6px); right: 0; z-index: 200;
    background: #1a1a2e; border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px; min-width: 200px; padding: 4px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    animation: hdFadeIn 0.15s ease;
}
@keyframes hdFadeIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
.header-dropdown.hidden { display: none; }

.header-dropdown-item {
    display: flex; align-items: center; gap: 10px; width: 100%;
    padding: 10px 14px; border: none; background: none; cursor: pointer;
    font-family: 'DM Sans', sans-serif; font-size: 13px; color: rgba(255,255,255,0.75);
    border-radius: 8px; transition: background 0.15s;
}
.header-dropdown-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
.header-dropdown-item svg { opacity: 0.5; flex-shrink: 0; }
.header-dropdown-item:hover svg { opacity: 1; }
.hdi-danger { color: rgba(248,113,113,0.8); }
.hdi-danger:hover { background: rgba(248,113,113,0.1); color: #f87171; }
.hdi-danger svg { stroke: currentColor; }

/* Download modal overlay */
.dl-modal-overlay {
    position: fixed; inset: 0; z-index: 999; background: rgba(0,0,0,0.6);
    display: flex; align-items: center; justify-content: center;
    animation: hdFadeIn 0.15s ease;
}
.dl-modal {
    background: #14142b; border: 1px solid rgba(110,231,183,0.15);
    border-radius: 16px; padding: 28px; max-width: 420px; width: 90%;
    text-align: center;
}
.dl-modal h3 { font-family: 'Sora', sans-serif; font-size: 16px; color: #fff; margin-bottom: 8px; }
.dl-modal p { font-size: 13px; color: rgba(255,255,255,0.55); margin-bottom: 20px; line-height: 1.5; }
.dl-modal-btns { display: flex; gap: 10px; justify-content: center; }
.dl-modal-btn {
    padding: 10px 22px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.1);
    font-family: 'DM Sans', sans-serif; font-size: 13px; font-weight: 600;
    cursor: pointer; transition: all 0.2s;
}
.dl-btn-primary {
    background: linear-gradient(135deg, rgba(110,231,183,0.15), rgba(59,130,246,0.15));
    border-color: rgba(110,231,183,0.3); color: #6ee7b7;
}
.dl-btn-primary:hover { border-color: #6ee7b7; background: rgba(110,231,183,0.2); }
.dl-btn-secondary { background: rgba(255,255,255,0.04); color: rgba(255,255,255,0.6); }
.dl-btn-secondary:hover { background: rgba(255,255,255,0.08); color: #fff; }
.dl-progress { margin-top: 16px; display: none; }
.dl-progress-bar {
    height: 4px; border-radius: 2px; background: rgba(255,255,255,0.06); overflow: hidden;
}
.dl-progress-fill {
    height: 100%; width: 0%; border-radius: 2px;
    background: linear-gradient(90deg, #6ee7b7, #3b82f6);
    transition: width 0.5s ease;
}
.dl-progress-text {
    font-family: 'Geist Mono', monospace; font-size: 11px;
    color: rgba(255,255,255,0.4); margin-top: 8px;
}

@media (max-width: 768px) {
    .btn-header-menu { padding: 7px !important; }
    .header-dropdown { right: -10px; min-width: 180px; }
}
