/* ============================================
   AI Musicana — ChatGPT Dark Mode UI
   Precise match to ChatGPT's interface
   Brand accent: #8b5cf6 (purple)
   ============================================ */

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

:root {
    --bg: #212121;
    --bg-sidebar: #171717;
    --bg-chat: #212121;
    --bg-message-ai: #2f2f2f;
    --bg-card: #2f2f2f;
    --bg-input: #2f2f2f;
    --bg-hover: #2f2f2f;
    --bg-hover-light: #3a3a3a;
    --border: rgba(255,255,255,0.08);
    --border-input: rgba(255,255,255,0.12);
    --text: #ececec;
    --text-secondary: #b4b4b4;
    --text-muted: #8e8e8e;
    --accent: #8b5cf6;
    --accent-hover: #7c3aed;
    --accent-soft: rgba(139, 92, 246, 0.15);
    --accent-glow: rgba(139, 92, 246, 0.3);
    --success: #22c55e;
    --error: #ef4444;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --max-width: 48rem;
    --sidebar-width: 260px;

    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 16px;
    line-height: 1.5;
}

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

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

#app {
    display: flex;
    height: 100vh;
}

/* ============================================
   Scrollbar — thin, subtle, ChatGPT-style
   ============================================ */

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

* {
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}

/* ============================================
   Sidebar — ChatGPT dark sidebar (#171717)
   ============================================ */

.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-right: none;
}

.sidebar-top {
    padding: 12px;
}

.new-chat-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: transparent;
    border: none;
    border-radius: 10px;
    color: var(--text);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
}

.new-chat-btn:hover { background: var(--bg-hover); }

.new-chat-btn svg { opacity: 0.7; }

.sidebar-history {
    flex: 1;
    overflow-y: auto;
    padding: 4px 8px;
}

.history-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    padding: 12px 12px 6px;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.history-item {
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 0.875rem;
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 1px;
    transition: background 0.15s, color 0.15s;
}

.history-item:hover { background: var(--bg-hover); color: var(--text); }
.history-item.active { background: var(--bg-hover); color: var(--text); }

.sidebar-bottom {
    padding: 8px 12px 12px;
    border-top: 1px solid var(--border);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    margin-bottom: 4px;
    border-radius: 10px;
    transition: background 0.15s;
}

.sidebar-user:hover { background: var(--bg-hover); }

.sidebar-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent-soft);
    flex-shrink: 0;
}

.sidebar-user-name { font-size: 0.85rem; font-weight: 500; color: var(--text); }
.sidebar-user-tier { font-size: 0.7rem; color: var(--text-muted); text-transform: capitalize; }

.sidebar-settings-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: none;
    border: none;
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.sidebar-settings-btn:hover { background: var(--bg-hover); color: var(--text); }

/* ============================================
   Main Content
   ============================================ */

.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--bg);
}

/* Header — minimal, ChatGPT-style */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    flex-shrink: 0;
    background: var(--bg);
    height: 48px;
}

.menu-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    display: none;
    transition: background 0.15s;
}

.menu-btn:hover { background: var(--bg-hover); }

.header-title {
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text);
}

.header-logo { font-size: 1.1rem; }

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.model-badge, .usage-badge {
    background: transparent;
    color: var(--text-secondary);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    border: 1px solid var(--border);
    transition: background 0.15s, color 0.15s;
}

.model-badge:hover, .usage-badge:hover { background: var(--bg-hover); color: var(--text); }

/* ============================================
   Chat Area
   ============================================ */

.chat-area {
    flex: 1;
    overflow-y: auto;
    scroll-behavior: smooth;
    background: var(--bg);
}

/* ============================================
   Welcome Screen — centered, ChatGPT-style
   ============================================ */

.welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 200px);
    padding: 2rem 1.5rem;
    text-align: center;
    max-width: var(--max-width);
    margin: 0 auto;
}

.welcome-logo {
    font-size: 3rem;
    margin-bottom: 16px;
    filter: drop-shadow(0 0 20px var(--accent-glow));
}

.welcome h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text);
    letter-spacing: -0.02em;
}

.welcome .welcome-tagline {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    max-width: 520px;
    line-height: 1.5;
}

/* Hero upload button */
.upload-hero-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 40px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 10px;
}

.upload-hero-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 20px var(--accent-glow);
}

.upload-hint {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-bottom: 2rem;
}

/* Image attachment thumbnails */
.image-thumb-strip {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.image-thumb {
    position: relative;
    width: 56px;
    height: 56px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.image-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-thumb .remove {
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(0,0,0,0.7);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* Prompt suggestion cards — 2x2 grid like ChatGPT */
.welcome-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    max-width: 480px;
    width: 100%;
    margin-bottom: 2.5rem;
}

.welcome-card {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s, border-color 0.2s;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: var(--text);
    font-size: 0.85rem;
    line-height: 1.4;
}

.welcome-card:hover {
    background: var(--bg-hover);
    border-color: rgba(255,255,255,0.15);
}

.wc-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; }
.wc-text { color: var(--text-secondary); font-size: 0.8rem; }
.welcome-card:hover .wc-text { color: var(--text); }

/* ============================================
   SEO Content — subtle for users, visible to crawlers
   ============================================ */

.seo-section {
    text-align: left;
    max-width: 640px;
    margin: 2rem auto 0;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.seo-section h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 1.75rem 0 0.75rem;
    color: var(--text);
    letter-spacing: -0.01em;
}

.seo-section h2:first-child { margin-top: 0; }

.seo-section p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.65;
    margin-bottom: 0.6rem;
}

.seo-steps {
    display: grid;
    gap: 10px;
    margin-bottom: 1.75rem;
}

.seo-step {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
}

.seo-step h3 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--accent);
}

.seo-step p { margin: 0; }

.seo-features {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 1.75rem;
}

.seo-feature {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
}

.seo-feature strong {
    display: block;
    margin-bottom: 4px;
    font-size: 0.85rem;
    color: var(--accent);
}

.seo-feature p { margin: 0; font-size: 0.8rem; }

@media (max-width: 600px) {
    .seo-features { grid-template-columns: 1fr; }
}

/* ============================================
   Messages — clean, no borders, ChatGPT spacing
   ============================================ */

.messages {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 16px 24px;
    width: 100%;
}

.message {
    margin-bottom: 24px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

/* AI messages — subtle background, slightly indented */
.message-ai {
    background: var(--bg-message-ai);
    padding: 16px 20px;
    border-radius: var(--radius-lg);
    margin-left: 0;
    border: none;
}

/* User messages — no background, clean */
.message-user {
    padding: 16px 20px;
    margin-right: 0;
    border: none;
}

.message-user .msg-content,
.message-ai .msg-content { width: 100%; }

.msg-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.msg-avatar.user {
    background: var(--accent);
    color: #fff;
    font-weight: 600;
}

.msg-avatar.ai {
    background: var(--accent-soft);
    color: var(--accent);
}

.msg-content {
    flex: 1;
    min-width: 0;
}

.msg-name {
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-secondary);
}

.message-user .msg-name { color: var(--text); }

.msg-text {
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--text);
}

.msg-text p { margin-bottom: 8px; }
.msg-text p:last-child { margin-bottom: 0; }

.msg-attachment {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-hover);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

/* ============================================
   Progress bars — smooth purple gradient
   ============================================ */

.msg-progress {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-top: 10px;
}

.msg-progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.msg-progress-bar {
    height: 4px;
    background: rgba(255,255,255,0.06);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 8px;
}

.msg-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #a78bfa, #c084fc);
    border-radius: 2px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 8px var(--accent-glow);
}

.msg-progress-step {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ============================================
   Video result cards — clean, rounded, integrated
   ============================================ */

.msg-video {
    margin-top: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.msg-video canvas {
    width: 100%;
    max-height: 500px;
    display: block;
    background: #000;
    cursor: pointer;
}

.msg-video-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-top: 1px solid var(--border);
}

.video-play-btn {
    background: none;
    border: none;
    color: var(--text);
    font-size: 1rem;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: color 0.15s;
}

.video-play-btn:hover { color: var(--accent); }

.video-timeline {
    flex: 1;
    height: 4px;
    background: rgba(255,255,255,0.08);
    border-radius: 2px;
    cursor: pointer;
    overflow: hidden;
}

.video-timeline-fill {
    height: 100%;
    background: var(--accent);
    width: 0%;
    transition: width 0.1s linear;
}

.video-time {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-family: 'Inter', monospace;
    font-variant-numeric: tabular-nums;
}

.msg-video-actions {
    display: flex;
    gap: 8px;
    padding: 0 14px 12px;
    flex-wrap: wrap;
}

.video-action-btn {
    padding: 8px 14px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.video-action-btn:hover {
    border-color: var(--accent);
    color: var(--text);
    background: var(--accent-soft);
}

.video-action-btn.primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.video-action-btn.primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

/* Analysis stats */
.msg-stats {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.msg-stat {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px 12px;
    text-align: center;
    min-width: 70px;
}

.msg-stat-val { font-size: 1rem; font-weight: 700; color: var(--accent); }
.msg-stat-lbl { font-size: 0.6rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }

/* Typing indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 8px 0;
    align-items: center;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: typingBounce 1.4s ease-in-out infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.3; }
    30% { transform: translateY(-6px); opacity: 1; }
}

/* Waveform */
.msg-waveform {
    margin-top: 8px;
    border-radius: 8px;
    overflow: hidden;
}

.msg-waveform canvas {
    width: 100%;
    height: 60px;
    display: block;
}

/* ============================================
   Input Area — ChatGPT pill-shaped input bar
   ============================================ */

.input-area {
    padding: 0 24px 16px;
    flex-shrink: 0;
    background: var(--bg);
}

.input-container {
    max-width: var(--max-width);
    margin: 0 auto;
    background: var(--bg-input);
    border: 1px solid var(--border-input);
    border-radius: var(--radius-xl);
    overflow: hidden;
    transition: border-color 0.2s;
    display: flex;
    flex-direction: column;
}

.input-container:focus-within {
    border-color: rgba(255,255,255,0.2);
}

.input-attachments {
    display: flex;
    gap: 8px;
    padding: 0;
    flex-wrap: wrap;
}

.input-attachments:not(:empty) {
    padding: 10px 16px 4px;
}

.attachment-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.attachment-chip .remove {
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.85rem;
    transition: color 0.15s;
}

.attachment-chip .remove:hover { color: var(--error); }

.attachment-icon { color: var(--accent); }

.input-row {
    display: flex;
    align-items: flex-end;
    padding: 4px 8px 4px 4px;
    gap: 4px;
    min-height: 48px;
}

.attach-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px 10px;
    border-radius: 10px;
    flex-shrink: 0;
    transition: color 0.15s, background 0.15s;
}

.attach-btn:hover { color: var(--text); background: rgba(255,255,255,0.06); }

#userInput {
    flex: 1;
    background: none;
    border: none;
    color: var(--text);
    font-size: 0.9375rem;
    font-family: 'Inter', sans-serif;
    resize: none;
    padding: 10px 4px;
    max-height: 200px;
    line-height: 1.5;
    overflow-y: auto;
}

#userInput::placeholder { color: var(--text-muted); }
#userInput:focus { outline: none; }

.send-btn {
    background: var(--accent);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.15s;
    margin-bottom: 4px;
}

.send-btn:hover { background: var(--accent-hover); transform: scale(1.05); }
.send-btn:disabled { opacity: 0.2; cursor: not-allowed; background: var(--text-muted); }

.input-footer {
    text-align: center;
    font-size: 0.7rem;
    color: var(--text-muted);
    padding-top: 8px;
}

/* ============================================
   Modals — glassmorphism with backdrop blur
   ============================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.modal {
    background: rgba(32, 32, 32, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: color 0.15s, background 0.15s;
}

.modal-close:hover { color: var(--text); background: var(--bg-hover); }

.modal-body { padding: 24px; }

.setting-group {
    margin-bottom: 20px;
}

.setting-group:last-child { margin-bottom: 0; }

.setting-group > label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.setting-row {
    display: flex;
    gap: 8px;
}

.setting-row input {
    flex: 1;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-input);
    border-radius: 10px;
    padding: 10px 12px;
    color: var(--text);
    font-size: 0.85rem;
    font-family: 'Inter', sans-serif;
    transition: border-color 0.2s;
}

.setting-row input:focus { outline: none; border-color: var(--accent); }

.btn-sm {
    background: var(--accent);
    border: none;
    color: #fff;
    padding: 10px 16px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-sm:hover { background: var(--accent-hover); }

.setting-help {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 6px;
}

.key-status {
    font-size: 0.8rem;
    margin-top: 6px;
    min-height: 20px;
}

.key-status.ok { color: var(--success); }
.key-status.error { color: var(--error); }

select {
    width: 100%;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-input);
    border-radius: 10px;
    padding: 10px 12px;
    color: var(--text);
    font-size: 0.85rem;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238e8e8e' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 14px;
    transition: border-color 0.2s;
}

select:focus { outline: none; border-color: var(--accent); }

.setting-group input[type="checkbox"] {
    accent-color: var(--accent);
    margin-right: 6px;
    transform: scale(1.1);
}

/* ============================================
   Auth Tabs
   ============================================ */

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0;
    color: var(--text-muted);
    font-size: 0.75rem;
}

.auth-divider::before, .auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.auth-tabs {
    display: flex;
    gap: 4px;
    background: rgba(255,255,255,0.04);
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 16px;
}

.auth-tab {
    flex: 1;
    padding: 8px 12px;
    background: none;
    border: none;
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.auth-tab:hover { color: var(--text-secondary); }
.auth-tab.active { background: var(--bg-hover); color: var(--text); }

/* ============================================
   Pricing Cards
   ============================================ */

.pricing-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.pricing-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 12px;
    text-align: center;
    position: relative;
    transition: border-color 0.2s;
}

.pricing-card:hover { border-color: rgba(255,255,255,0.15); }

.pricing-card.featured {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.pricing-badge {
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent);
    color: #fff;
    font-size: 0.55rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.pricing-tier {
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-secondary);
}

.pricing-price {
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 10px;
    color: var(--text);
}

.pricing-price span {
    font-size: 0.7rem;
    font-weight: 400;
    color: var(--text-muted);
}

.pricing-features {
    list-style: none;
    text-align: left;
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.pricing-features li { padding: 2px 0; }
.pricing-features li::before { content: '✓ '; color: var(--success); }

.btn-primary {
    background: var(--accent);
    border: none;
    color: #fff;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-primary:hover { background: var(--accent-hover); }

/* ============================================
   Dashboard
   ============================================ */

.dashboard {
    max-width: 900px;
    margin: 0 auto;
    padding: 24px;
}

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

.dashboard-header h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
}

.dashboard-search {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-input);
    border-radius: var(--radius);
    padding: 8px 14px;
    min-width: 220px;
    transition: border-color 0.2s;
}

.dashboard-search:focus-within { border-color: var(--accent); }

.dashboard-search input {
    background: none;
    border: none;
    color: var(--text);
    font-size: 0.85rem;
    flex: 1;
    outline: none;
    font-family: 'Inter', sans-serif;
}

.dashboard-search input::placeholder { color: var(--text-muted); }
.dashboard-search svg { color: var(--text-muted); flex-shrink: 0; }

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

.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
}

.project-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.project-thumb {
    width: 100%;
    aspect-ratio: 9/16;
    max-height: 200px;
    background: rgba(255,255,255,0.03);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    overflow: hidden;
    color: var(--text-muted);
}

.project-thumb img { width: 100%; height: 100%; object-fit: cover; }

.project-info { padding: 10px 12px; }
.project-title {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text);
}

.project-meta {
    font-size: 0.7rem;
    color: var(--text-muted);
    display: flex;
    gap: 8px;
}

.project-style { color: var(--accent); }

.dashboard-loading, .dashboard-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.dashboard-empty p { margin-bottom: 16px; }

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        z-index: 50;
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.4);
    }

    .menu-btn { display: block; }

    .welcome-grid { grid-template-columns: 1fr; max-width: 320px; }
    .welcome h1 { font-size: 1.4rem; }
    .welcome .welcome-tagline { font-size: 0.85rem; }

    .messages { padding: 12px 16px; }

    .message-ai, .message-user {
        margin-left: 0;
        margin-right: 0;
    }

    .input-area { padding: 0 12px 10px; }
    .input-container { border-radius: 18px; }

    .pricing-cards { grid-template-columns: 1fr; }

    .modal { max-width: 95%; border-radius: var(--radius); }
}

@media (max-width: 480px) {
    .header-title { font-size: 0.9rem; }
    .header { padding: 8px 12px; }
    .welcome { padding: 1.5rem 1rem; }
    .welcome h1 { font-size: 1.25rem; }
}
