/* ===== CSS VARIABLES ===== */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #111118;
    --bg-card: rgba(255, 255, 255, 0.04);
    --bg-card-hover: rgba(255, 255, 255, 0.07);
    --border-color: rgba(255, 255, 255, 0.08);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --brand: #22c55e;
    --brand-glow: rgba(34, 197, 94, 0.15);
    --brand-hover: #16a34a;
    --accent-purple: #8b5cf6;
    --accent-pink: #d946ef;
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a {
    color: var(--brand);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--brand-hover);
}

/* ===== UTILITY ===== */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

.hidden {
    display: none !important;
}

.section {
    padding: 100px 0;
}

.section-title {
    font-size: 36px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

.section-subtitle {
    font-size: 16px;
    color: var(--text-secondary);
    text-align: center;
    max-width: 500px;
    margin: 0 auto 60px;
}

.gradient-text {
    background: linear-gradient(135deg, var(--brand), #14b8a6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== NAV ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 16px 0;
    background: rgba(10, 10, 15, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.nav-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.nav-brand svg {
    flex-shrink: 0;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
    list-style: none;
}

.nav-links a {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
}

.nav-links a:hover {
    color: var(--text-primary);
}

.nav-cta {
    background: var(--brand);
    color: #fff !important;
    padding: 8px 18px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
}

.nav-cta:hover {
    background: var(--brand-hover);
    color: #fff !important;
}

/* ===== HERO ===== */
.hero {
    padding: 160px 0 100px;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -200px;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--brand-glow) 0%, transparent 70%);
    pointer-events: none;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 100px;
    padding: 6px 14px;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.hero-badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--brand);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.hero h1 {
    font-size: 52px;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-bottom: 20px;
}

.hero p {
    font-size: 17px;
    color: var(--text-secondary);
    margin-bottom: 36px;
    max-width: 440px;
    line-height: 1.7;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.btn-primary {
    background: var(--brand);
    color: #fff;
    box-shadow: 0 4px 20px rgba(34, 197, 94, 0.3);
}

.btn-primary:hover {
    background: var(--brand-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 28px rgba(34, 197, 94, 0.4);
    color: #fff;
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    transform: translateY(-2px);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: var(--danger-hover);
    transform: translateY(-2px);
}

/* Hero Demo Card */
.hero-demo {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.demo-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid var(--border-color);
}

.demo-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.demo-dot.red { background: #ef4444; }
.demo-dot.yellow { background: #f59e0b; }
.demo-dot.green { background: #22c55e; }

.demo-title {
    font-size: 12px;
    color: var(--text-muted);
    margin-left: 8px;
}

.demo-body {
    padding: 20px;
}

.demo-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.demo-input {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    color: var(--text-primary);
    font-size: 13px;
    width: 100%;
    margin-bottom: 16px;
}

.demo-output {
    background: #0f172a;
    border-radius: 8px;
    padding: 14px;
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 13px;
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.demo-typing {
    overflow: hidden;
    border-right: 2px solid var(--brand);
    white-space: nowrap;
    animation: typing 3s steps(40) infinite, blink 0.7s step-end infinite;
}

@keyframes typing {
    0% { width: 0; }
    50% { width: 100%; }
    100% { width: 100%; }
}

@keyframes blink {
    50% { border-color: transparent; }
}

/* ===== FEATURES ===== */
.features {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px;
    transition: var(--transition);
}

.feature-card:hover {
    background: var(--bg-card-hover);
    transform: translateY(-4px);
    border-color: rgba(34, 197, 94, 0.2);
}

.feature-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-bottom: 20px;
}

.feature-icon.green { background: rgba(34, 197, 94, 0.12); }
.feature-icon.blue { background: rgba(56, 189, 248, 0.12); }
.feature-icon.purple { background: rgba(139, 92, 246, 0.12); }

.feature-card h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
}

.feature-card p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ===== PRICING ===== */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    max-width: 700px;
    margin: 0 auto;
}

.pricing-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 36px;
    position: relative;
    transition: var(--transition);
}

.pricing-card:hover {
    transform: translateY(-4px);
}

.pricing-card.popular {
    border-color: var(--brand);
    box-shadow: 0 0 30px var(--brand-glow);
}

.pricing-popular-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--brand);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 14px;
    border-radius: 100px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.pricing-card h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.pricing-amount {
    font-size: 42px;
    font-weight: 800;
    margin-bottom: 4px;
}

.pricing-amount .currency {
    font-size: 20px;
    font-weight: 600;
    vertical-align: super;
}

.pricing-period {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.pricing-features {
    list-style: none;
    margin-bottom: 28px;
}

.pricing-features li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--text-secondary);
    padding: 8px 0;
}

.pricing-features li.disabled {
    color: var(--text-muted);
    text-decoration: line-through;
    opacity: 0.5;
}

.pricing-card .btn {
    width: 100%;
    justify-content: center;
}

/* ===== FOOTER ===== */
.footer {
    padding: 48px 0;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.footer p {
    font-size: 13px;
    color: var(--text-muted);
}

.footer-links {
    display: flex;
    gap: 20px;
}

.footer-links a {
    font-size: 13px;
    color: var(--text-muted);
}

.footer-links a:hover {
    color: var(--text-primary);
}

/* ===== ACCOUNT PAGE ===== */
.account-page {
    min-height: 100vh;
    padding-top: 100px;
}

/* Auth Card */
.auth-section {
    max-width: 420px;
    margin: 60px auto;
}

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 36px;
}

.auth-card h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 6px;
    text-align: center;
}

.auth-card .auth-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 28px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition);
    outline: none;
}

.form-input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-glow);
}

.auth-error-msg {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #ef4444;
    font-size: 13px;
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.auth-toggle {
    text-align: center;
    margin-top: 20px;
    font-size: 13px;
    color: var(--text-secondary);
}

.auth-toggle a {
    font-weight: 600;
}

/* Dashboard */
.dashboard {
    max-width: 680px;
    margin: 40px auto;
}

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

.dashboard-header h2 {
    font-size: 26px;
    font-weight: 700;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 24px;
}

.stat-card .stat-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.stat-card .stat-value {
    font-size: 22px;
    font-weight: 700;
}

.stat-card .stat-value.pro {
    color: var(--brand);
}

.stat-card .stat-value.free {
    color: var(--text-secondary);
}

/* Plan Card */
.plan-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 28px;
    margin-bottom: 20px;
}

.plan-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.plan-card-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.plan-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 100px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.plan-badge.pro {
    background: linear-gradient(135deg, var(--brand), #14b8a6);
    color: #fff;
}

.plan-badge.free {
    background: rgba(100, 116, 139, 0.2);
    color: var(--text-secondary);
}

.plan-card p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.6;
}

.plan-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.plan-actions .btn {
    padding: 10px 20px;
    font-size: 13px;
}

/* Account Info Card */
.account-info-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 28px;
}

.account-info-card h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
}

.info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-color);
}

.info-row:last-child {
    border-bottom: none;
}

.info-row .info-label {
    font-size: 13px;
    color: var(--text-muted);
}

.info-row .info-value {
    font-size: 14px;
    font-weight: 500;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero h1 {
        font-size: 36px;
    }

    .hero p {
        margin: 0 auto 36px;
    }

    .hero-buttons {
        justify-content: center;
    }

    .hero-demo {
        max-width: 400px;
        margin: 0 auto;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

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

    .nav-links {
        display: none;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .footer-content {
        flex-direction: column;
        gap: 16px;
    }

    .plan-actions {
        flex-direction: column;
    }
}

/* ===== CANCEL MODAL ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.2s ease;
}

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

.modal-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px;
    max-width: 440px;
    width: 90%;
    animation: slideUp 0.3s ease;
}

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

.modal-card h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
}

.cancel-reasons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.reason-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 14px;
    color: var(--text-secondary);
}

.reason-option:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
}

.reason-option input[type="radio"] {
    accent-color: var(--brand);
}

.reason-option input[type="radio"]:checked + span {
    color: var(--text-primary);
}

/* ===== GENERATOR APP ===== */
.app-body {
    background: #050505;
    background-image: radial-gradient(circle at 50% 0%, var(--brand-glow) 0%, transparent 60%);
    background-repeat: no-repeat;
}

.app-navbar {
    background: rgba(5, 5, 5, 0.8);
}

.app-container {
    padding-top: 100px;
    min-height: 100vh;
}

.generator-workspace {
    max-width: 800px;
    margin: 40px auto;
    padding: 0 20px;
}

.workspace-header {
    text-align: center;
    margin-bottom: 32px;
}

.workspace-header h2 {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 24px;
}

.mode-tabs {
    display: inline-flex;
    background: var(--bg-card);
    padding: 6px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.mode-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 8px 24px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.mode-btn:hover {
    color: var(--text-primary);
}

.mode-btn.active {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.workspace-card {
    background: rgba(15, 15, 20, 0.6);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.input-section {
    margin-bottom: 24px;
}

.input-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.app-textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    color: var(--text-primary);
    font-size: 16px;
    font-family: inherit;
    resize: vertical;
    min-height: 120px;
    transition: var(--transition);
    outline: none;
}

.app-textarea:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-glow);
}

.action-row {
    display: flex;
    justify-content: center;
}

.btn-large {
    padding: 16px 40px;
    font-size: 16px;
    border-radius: 12px;
}

.sparkle-icon {
    margin-left: 4px;
    animation: sparkle 2s ease-in-out infinite;
}

@keyframes sparkle {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.1); }
}

.state-container {
    text-align: center;
    padding: 40px 0;
    margin-top: 24px;
    border-top: 1px solid var(--border-color);
    animation: fadeIn 0.3s ease;
}

.error-state {
    background: rgba(239, 68, 68, 0.05);
    border-radius: 16px;
    border-top: 1px solid rgba(239, 68, 68, 0.2);
}

.state-text {
    margin-top: 16px;
    font-size: 15px;
    color: var(--text-secondary);
}

.loader-web {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--brand);
    border-radius: 50%;
    margin: 0 auto;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.result-container {
    margin-top: 32px;
    animation: slideUp 0.4s ease;
}

.result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.result-badge {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.copy-btn {
    padding: 8px 16px;
    font-size: 13px;
    background: rgba(255, 255, 255, 0.05);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.copy-btn.copied {
    background: var(--brand);
    color: #fff;
    border-color: var(--brand);
}

.code-block {
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 24px;
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 15px;
    color: #e2e8f0;
    line-height: 1.6;
    overflow-x: auto;
    text-align: left;
}

.upgrade-glow-btn {
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.4);
}

.upgrade-glow-btn:hover {
    background: linear-gradient(135deg, #7c3aed, #c026d3);
    box-shadow: 0 6px 28px rgba(139, 92, 246, 0.6);
}

/* ===== EXTENSION BANNER ===== */
.ext-banner {
    background: linear-gradient(90deg, #10b981 0%, #3b82f6 100%);
    color: white;
    padding: 10px 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 500;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2000;
}
.ext-banner-content {
    display: flex;
    align-items: center;
    gap: 8px;
}
.ext-banner-link {
    color: white;
    text-decoration: underline;
    font-weight: 700;
    margin-left: 4px;
}
.ext-banner-link:hover {
    color: #f1f5f9;
}
.close-banner {
    background: transparent;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    position: absolute;
    right: 20px;
    opacity: 0.8;
}
.close-banner:hover {
    opacity: 1;
}

/* Adjust navbar when banner is present */
.chat-navbar {
    top: 40px;
}
.chat-app-body .chat-layout {
    padding-top: 100px;
}

/* ===== CHAT LAYOUT ===== */
.chat-layout {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}
.chat-container-main {
    flex: 1;
    overflow-y: auto;
    padding: 20px 20px 180px 20px;
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

/* Welcome Screen */
.chat-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    margin-top: 15vh;
    animation: fadeIn 0.5s ease;
}
.chat-welcome h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 30px;
}
.welcome-suggestions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}
.suggestion-chip {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 12px 20px;
    border-radius: 100px;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
}
.suggestion-chip:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    transform: translateY(-2px);
}

/* Chat History */
.chat-history {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Messages */
.chat-message {
    display: flex;
    gap: 16px;
    animation: slideUp 0.3s ease;
}
.user-message {
    justify-content: flex-end;
}
.user-message .message-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 16px 20px;
    border-radius: 20px 20px 4px 20px;
    max-width: 80%;
}
.ai-message .message-content {
    padding: 10px 0;
    max-width: 85%;
    width: 100%;
}
.error-message .message-content {
    background: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 16px 20px;
    border-radius: 20px;
}
.ai-avatar {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-primary));
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 8px;
}
.message-badge {
    font-size: 11px;
    text-transform: uppercase;
    color: #10b981;
    font-weight: 700;
    margin-bottom: 4px;
    letter-spacing: 0.05em;
}
.message-text {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-primary);
}
.result-text {
    color: #e2e8f0;
}
.error-text {
    color: #fca5a5;
}

/* Formula Block in Chat */
.formula-block {
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 16px 20px;
    position: relative;
    margin-top: 8px;
}
.copy-fab-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--text-secondary);
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition);
}
.copy-fab-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}
.copy-fab-btn.copied {
    color: #10b981;
}
.formula-text {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 14px;
    color: #4ade80;
    white-space: pre-wrap;
    word-break: break-all;
    margin-top: 24px;
}

/* Inline Code and Markdown */
.code-span {
    background: rgba(0, 0, 0, 0.3);
    padding: 12px;
    border-radius: 8px;
    font-family: monospace;
    display: block;
    margin: 8px 0;
    border: 1px solid rgba(255, 255, 255, 0.05);
}
.code-span-inline {
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    color: #fca5a5;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 0;
}
.typing-dot {
    width: 6px;
    height: 6px;
    background: var(--text-secondary);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite;
}
.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }
@keyframes typingBounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* Input Wrapper */
.chat-input-wrapper {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, transparent 0%, var(--bg-primary) 30%);
    padding: 20px 0;
    z-index: 100;
}
.chat-input-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}
.chat-modes {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}
.chat-modes .chat-mode-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    padding: 6px 14px;
    border-radius: 100px;
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
}
.chat-modes .chat-mode-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}
.chat-modes .chat-mode-btn.active {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
}

.chat-input-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: flex-end;
    padding: 12px 16px;
    gap: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transition: var(--transition);
}
.chat-input-box:focus-within {
    border-color: var(--brand);
    box-shadow: 0 0 0 2px var(--brand-glow), 0 10px 30px rgba(0, 0, 0, 0.6);
}
.chat-textarea {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    resize: none;
    max-height: 200px;
    outline: none;
    padding: 6px 0;
    line-height: 1.5;
}
.chat-send-btn {
    background: var(--text-primary);
    border: none;
    color: #000;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: var(--transition);
}
.chat-send-btn .send-icon {
    width: 16px;
    height: 16px;
    margin-right: 1px;
}
.chat-send-btn:hover {
    transform: scale(1.05);
    background: #fff;
}
.chat-send-btn.disabled {
    background: var(--text-muted);
    cursor: not-allowed;
    transform: none;
}
.chat-footer-text {
    text-align: center;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 12px;
}

/* ===== SCREEN-READER ONLY ===== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ===== FAQ SECTION ===== */
.faq-grid {
    max-width: 700px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.faq-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
}

.faq-item:hover {
    border-color: rgba(34, 197, 94, 0.2);
}

.faq-item[open] {
    border-color: rgba(34, 197, 94, 0.15);
    background: var(--bg-card-hover);
}

.faq-question {
    padding: 20px 24px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: var(--transition);
    user-select: none;
}

.faq-question::-webkit-details-marker {
    display: none;
}

.faq-question::after {
    content: '+';
    font-size: 20px;
    font-weight: 300;
    color: var(--text-muted);
    transition: transform 0.3s ease;
    flex-shrink: 0;
    margin-left: 16px;
}

.faq-item[open] .faq-question::after {
    content: '−';
    color: var(--brand);
}

.faq-question:hover {
    color: var(--brand);
}

.faq-answer {
    padding: 0 24px 20px;
}

.faq-answer p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* ===== HOW IT WORKS SECTION ===== */
.how-it-works {
    border-bottom: 1px solid var(--border-color);
}

@media (max-width: 768px) {
    .faq-question {
        font-size: 14px;
        padding: 16px 20px;
    }
    .faq-answer {
        padding: 0 20px 16px;
    }
}
