:root {
    --bg-dark: #0a0a0a;
    --bg-surface: #141414;
    --bg-sidebar: #111111;
    --bg-elevated: #1a1a1a;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --text-dimmed: #6b7280;
    --accent-primary: #10b981;
    --accent-primary-hover: #059669;
    --accent-secondary: #3b82f6;
    --accent-error: #ef4444;
    --accent-pro: #f59e0b;
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --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 8px 24px rgba(0, 0, 0, 0.5);
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-body);
    line-height: 1.6;
    min-height: 100vh;
}

.hidden {
    display: none !important;
}

/* ── Typography & Links ── */
button, a {
    font-family: var(--font-body);
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    text-decoration: none;
}

/* Focus states for accessibility */
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

/* ══════════════════════════════════════════════════════════
   LANDING PAGE STYLES
   ══════════════════════════════════════════════════════════ */

.landing-body {
    display: flex;
    flex-direction: column;
}

/* ── Navbar ── */
.navbar.solid {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border-color);
    background: rgba(10, 10, 10, 0.9);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-main);
}

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

.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-link {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
}

.nav-link:hover {
    color: var(--text-main);
}

.mobile-nav-toggle {
    display: none;
    background: transparent;
    color: var(--text-main);
    padding: 0.5rem;
}

.btn-secondary {
    color: var(--text-muted);
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
}

.btn-secondary:hover {
    color: var(--text-main);
    background: var(--bg-surface);
}

.btn-secondary.full-width {
    width: 100%;
    text-align: center;
    padding: 0.75rem 1.5rem;
    border: 1px solid var(--border-color);
}

.btn-primary-flat {
    background: var(--text-main);
    color: var(--bg-dark);
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary-flat:hover {
    background: #ffffff;
    transform: translateY(-1px);
}

.btn-primary-flat.large {
    padding: 0.85rem 2rem;
    font-size: 1rem;
    border-radius: var(--radius-md);
}

.btn-primary-flat.full-width {
    width: 100%;
    justify-content: center;
}

/* ── Landing Main ── */
.landing-main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* ── Hero Section ── */
.hero.clean {
    max-width: 900px;
    margin: 0 auto;
    padding: 5rem 2rem 4rem;
    text-align: center;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-primary);
    padding: 0.4rem 1rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.title-clean {
    font-family: var(--font-heading);
    font-size: clamp(2.5rem, 5vw, 3.75rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    color: var(--text-main);
    letter-spacing: -0.02em;
}

.text-gradient {
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle-clean {
    font-size: 1.15rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    max-width: 640px;
    margin-inline: auto;
    line-height: 1.7;
}

.landing-cta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 4rem;
}

.cta-subtext {
    font-size: 0.85rem;
    color: var(--text-dimmed);
}

/* ── Hero Preview ── */
.hero-preview {
    max-width: 700px;
    margin: 0 auto;
}

.preview-window {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.preview-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: var(--bg-sidebar);
    border-bottom: 1px solid var(--border-color);
}

.preview-dots {
    display: flex;
    gap: 6px;
}

.preview-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--bg-elevated);
}

.preview-title {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.preview-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.preview-message {
    padding: 0.875rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
}

.preview-message.user-preview {
    background: var(--bg-elevated);
    color: var(--text-main);
    align-self: flex-end;
    max-width: 85%;
}

.preview-message.assistant-preview {
    background: transparent;
    align-self: flex-start;
    width: 100%;
}

.preview-result {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.result-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 500;
    width: fit-content;
}

.result-badge.exists {
    background: rgba(245, 158, 11, 0.1);
    color: var(--accent-pro);
}

.preview-result p {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.preview-result strong {
    color: var(--accent-primary);
}

/* ── Features Section ── */
.features-section {
    padding: 5rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.section-header {
    text-align: center;
    margin-bottom: 3.5rem;
}

.section-header h2 {
    font-family: var(--font-heading);
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.section-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.feature-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    transition: all 0.2s ease;
}

.feature-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

.feature-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.feature-icon.secondary {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-secondary);
}

.feature-icon.pro {
    background: rgba(245, 158, 11, 0.1);
    color: var(--accent-pro);
}

.feature-card h3 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.feature-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* ── How It Works ── */
.how-it-works {
    padding: 5rem 2rem;
    background: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.steps-grid {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 2rem;
    max-width: 1000px;
    margin: 0 auto;
    flex-wrap: wrap;
}

.step {
    flex: 1;
    min-width: 200px;
    max-width: 280px;
    text-align: center;
}

.step-number {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    color: white;
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.step h3 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.step p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.step-arrow {
    display: flex;
    align-items: center;
    color: var(--text-dimmed);
    padding-top: 0.75rem;
}

/* ── Pricing Section ── */
.pricing-section {
    padding: 5rem 2rem;
    max-width: 900px;
    margin: 0 auto;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.pricing-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    position: relative;
    display: flex;
    flex-direction: column;
}

.pricing-card.featured {
    border-color: var(--accent-primary);
    background: linear-gradient(180deg, rgba(16, 185, 129, 0.05) 0%, var(--bg-surface) 100%);
}

.popular-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent-primary);
    color: white;
    padding: 0.25rem 1rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.pricing-header {
    text-align: center;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.pricing-header h3 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.price {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
}

.price .amount {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 700;
}

.price .period {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.pricing-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.pricing-features {
    list-style: none;
    flex: 1;
    margin-bottom: 1.5rem;
}

.pricing-features li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0;
    font-size: 0.9rem;
    color: var(--text-main);
}

.pricing-features li i {
    width: 18px;
    height: 18px;
    color: var(--accent-primary);
    flex-shrink: 0;
}

.pricing-features li.disabled {
    color: var(--text-dimmed);
}

.pricing-features li.disabled i {
    color: var(--text-dimmed);
}

/* ── Final CTA ── */
.final-cta {
    text-align: center;
    padding: 5rem 2rem;
    background: linear-gradient(180deg, var(--bg-dark) 0%, var(--bg-surface) 100%);
}

.final-cta h2 {
    font-family: var(--font-heading);
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.final-cta p {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

/* ── Footer ── */
.landing-footer {
    background: var(--bg-sidebar);
    border-top: 1px solid var(--border-color);
    padding: 3rem 2rem 1.5rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    gap: 3rem;
    flex-wrap: wrap;
}

.footer-brand {
    max-width: 280px;
}

.footer-brand .logo {
    margin-bottom: 0.75rem;
}

.footer-brand p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-links {
    display: flex;
    gap: 4rem;
}

.footer-column h4 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 1rem;
}

.footer-column a {
    display: block;
    color: var(--text-muted);
    font-size: 0.9rem;
    padding: 0.35rem 0;
}

.footer-column a:hover {
    color: var(--text-main);
}

.footer-bottom {
    max-width: 1200px;
    margin: 2rem auto 0;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.footer-bottom p {
    color: var(--text-dimmed);
    font-size: 0.85rem;
}

/* ══════════════════════════════════════════════════════════
   AUTH PAGE STYLES
   ══════════════════════════════════════════════════════════ */

.auth-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg-dark);
}

.auth-container {
    width: 100%;
    padding: 2rem;
    display: flex;
    justify-content: center;
}

.auth-card.solid {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.auth-logo {
    margin-bottom: 2rem;
    justify-content: center;
    font-size: 1.5rem;
}

.auth-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 2rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    text-align: left;
}

.input-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

.input-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
}

.input-group input:focus {
    border-color: var(--accent-primary);
}

.input-group input::placeholder {
    color: var(--text-dimmed);
}

.auth-error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--accent-error);
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    text-align: center;
}

.auth-btn {
    width: 100%;
    margin-top: 0.5rem;
    padding: 0.75rem 1.5rem;
}

.auth-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.auth-switch {
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.text-btn {
    background: none;
    color: var(--accent-primary);
    font-weight: 600;
    padding: 0 0.25rem;
}

.text-btn:hover {
    text-decoration: underline;
}

.auth-links {
    margin-top: 1rem;
    text-align: center;
}

.auth-links a {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.auth-links a:hover {
    color: var(--accent-primary);
}

.auth-terms {
    margin-top: 1.5rem;
    font-size: 0.8rem;
    color: var(--text-dimmed);
    line-height: 1.5;
    display: none;
}

.auth-terms a {
    color: var(--text-muted);
}

.auth-terms a:hover {
    color: var(--text-main);
}

.btn-loader {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.spin {
    animation: spin 1s linear infinite;
}

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

/* ══════════════════════════════════════════════════════════
   CHAT APP STYLES
   ══════════════════════════════════════════════════════════ */

.app-layout {
    display: flex;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

/* ── Sidebar ── */
.sidebar.solid {
    width: 260px;
    background: var(--bg-sidebar);
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 1rem;
}

.new-chat-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: transparent;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    color: var(--text-main);
}

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

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.1rem;
}

.sidebar-recent {
    flex: 1;
    overflow-y: auto;
    padding: 0 0.5rem;
}

.sidebar-section-title {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    padding: 1rem 0.5rem 0.5rem 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.history-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem;
    background: transparent;
    color: var(--text-main);
    border-radius: var(--radius-sm);
    text-align: left;
    font-size: 0.9rem;
}

.history-item:hover {
    background: var(--bg-surface);
}

.history-item.active {
    background: var(--bg-surface);
}

#new-chat-btn {
    background: var(--text-main);
    color: var(--bg-dark);
    margin-top: 0.5rem;
    font-weight: 600;
}

#new-chat-btn:hover {
    background: #ffffff;
}

.truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
}

.profile-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: transparent;
    color: var(--text-main);
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    text-align: left;
}

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

.avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.logout-icon {
    margin-left: auto;
    width: 16px;
    color: var(--text-dimmed);
}

.profile-btn:hover .logout-icon {
    color: var(--accent-error);
}

/* ── Upgrade CTA in Sidebar ── */
.upgrade-cta {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(245, 158, 11, 0.05) 100%);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: var(--radius-md);
}

.upgrade-cta-content {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.upgrade-cta-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: rgba(245, 158, 11, 0.2);
    color: var(--accent-pro);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.upgrade-cta-text {
    flex: 1;
}

.upgrade-cta-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.15rem;
}

.upgrade-cta-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.upgrade-cta-btn {
    width: 100%;
    background: var(--accent-pro);
    color: var(--bg-dark);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.85rem;
}

.upgrade-cta-btn:hover {
    opacity: 0.9;
}

/* ── User Tier Badge ── */
.user-tier-badge {
    display: flex;
    align-items: center;
    margin-left: auto;
    padding: 0.25rem 0.75rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
}

.user-tier-badge.pro {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.3);
    color: var(--accent-pro);
}

.user-tier-badge.pro .tier-label::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    background: var(--accent-pro);
    border-radius: 50%;
    margin-right: 0.4rem;
}

/* ── Locked Tier Button ── */
.tier-btn.locked {
    opacity: 0.5;
    cursor: not-allowed;
}

.tier-btn.locked:hover {
    color: var(--text-muted);
}

/* ── Free Tier CTA in Chat ── */
.free-tier-cta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
    padding: 0.875rem 1rem;
    background: var(--bg-surface);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    color: var(--text-muted);
}

.free-tier-cta i {
    color: var(--accent-pro);
    flex-shrink: 0;
}

.free-tier-cta strong {
    color: var(--accent-pro);
}

/* ── Inline Upgrade Button ── */
.btn-upgrade-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--accent-pro);
    color: var(--bg-dark);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
}

.btn-upgrade-inline:hover {
    opacity: 0.9;
}

/* ── Main Chat Area ── */
.chat-main.solid-bg {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    background: var(--bg-dark);
}

.chat-header {
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
    background: var(--bg-dark);
    border-bottom: 1px solid var(--border-color);
}

.mobile-menu-btn {
    display: none;
    background: transparent;
    color: var(--text-main);
    padding: 0.5rem;
}

/* ── Tier Toggle ── */
.tier-toggle {
    display: inline-flex;
    background: var(--bg-surface);
    border-radius: var(--radius-sm);
    padding: 3px;
    border: 1px solid var(--border-color);
}

.tier-btn {
    padding: 0.35rem 0.9rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    background: transparent;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.tier-btn:hover {
    color: var(--text-main);
}

.tier-btn.active {
    background: var(--bg-dark);
    color: var(--text-main);
    box-shadow: var(--shadow-sm);
}

.tier-btn[data-tier="pro"].active {
    color: var(--accent-pro);
}

.tier-btn[data-tier="pro"] i {
    color: var(--accent-pro);
}

/* ── Chat History ── */
.chat-history {
    flex: 1;
    overflow-y: auto;
    padding: 80px 0 180px 0;
    scroll-behavior: smooth;
    display: flex;
    flex-direction: column;
}

.message {
    padding: 1.5rem 1rem;
    display: flex;
    justify-content: center;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-right: 1rem;
}

.user-avatar {
    background: var(--bg-elevated);
    color: var(--text-main);
}

.assistant-avatar {
    background: var(--accent-primary);
    color: white;
}

.message-content {
    flex: 1;
    max-width: 800px;
}

.message-text {
    font-size: 1rem;
    color: var(--text-main);
    line-height: 1.7;
}

.message-text h3 {
    font-family: var(--font-heading);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

/* ── Chat Input Area ── */
.chat-input-container {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem;
    background: linear-gradient(180deg, transparent, var(--bg-dark) 30%);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.chat-input-wrapper.solid {
    width: 100%;
    max-width: 800px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    display: flex;
    align-items: flex-end;
    transition: border-color 0.2s;
}

.chat-input-wrapper.solid:focus-within {
    border-color: var(--accent-primary);
}

textarea {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 1rem;
    outline: none;
    resize: none;
    overflow-y: hidden;
    min-height: 24px;
    max-height: 200px;
    line-height: 1.5;
    padding-top: 2px;
}

textarea::placeholder {
    color: var(--text-dimmed);
}

.send-btn {
    background: var(--accent-primary);
    color: white;
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 0.5rem;
}

.send-btn:disabled {
    background: var(--bg-elevated);
    color: var(--text-dimmed);
    cursor: not-allowed;
}

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

.helper-text {
    font-size: 0.75rem;
    color: var(--text-dimmed);
    margin-top: 0.5rem;
    text-align: center;
}

/* ── Rich UI Cards inside Chat ── */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.chat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    transition: border-color 0.2s;
}

.chat-card:hover {
    border-color: var(--border-hover);
}

.chat-card h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-heading);
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.chat-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.card-links {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.card-link {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--text-main);
    font-size: 0.85rem;
    padding: 0.4rem 0.75rem;
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
    transition: background 0.2s;
}

.card-link:hover {
    background: rgba(255, 255, 255, 0.1);
}

.niche-tag {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-primary);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

/* ── Market Analysis ── */
.market-analysis {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-top: 1.5rem;
}

.opportunity-score {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1rem 0;
}

.score-bar-bg {
    flex: 1;
    height: 8px;
    background: var(--bg-elevated);
    border-radius: 999px;
    overflow: hidden;
}

.score-bar-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.5s ease;
}

.ma-gaps {
    list-style: none;
    margin: 1rem 0;
}

.ma-gaps li {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.ma-gaps li i {
    color: var(--accent-primary);
    flex-shrink: 0;
    margin-top: 3px;
}

.ma-rec {
    background: var(--bg-elevated);
    border-left: 3px solid var(--accent-primary);
    padding: 0.875rem 1rem;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 0.9rem;
    color: var(--text-main);
}

/* ── Trend Analysis Chart ── */
.trend-analysis {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
}

.trend-chart {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 120px;
    padding-top: 0.5rem;
}

.trend-bar-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    justify-content: flex-end;
}

.trend-bar {
    width: 100%;
    min-width: 8px;
    background: var(--accent-secondary);
    border-radius: 3px 3px 0 0;
    transition: height 0.6s ease, opacity 0.2s;
    opacity: 0.7;
}

.trend-bar:hover {
    opacity: 1;
}

.trend-label {
    font-size: 0.6rem;
    color: var(--text-dimmed);
    margin-top: 4px;
    white-space: nowrap;
}

/* ── Loading Indicator ── */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 24px;
}

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

.typing-dot:nth-child(1) {
    animation-delay: -0.32s;
}

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

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

/* ══════════════════════════════════════════════════════════
   MOBILE RESPONSIVENESS
   ══════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    /* Landing - Navbar */
    .navbar.solid {
        padding: 1rem;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-surface);
        border-bottom: 1px solid var(--border-color);
        flex-direction: column;
        padding: 1rem;
        gap: 0.5rem;
    }

    .nav-links.open {
        display: flex;
    }

    .nav-links .btn-primary-flat {
        width: 100%;
        text-align: center;
        justify-content: center;
    }

    .mobile-nav-toggle {
        display: flex;
    }

    /* Landing - Hero */
    .hero.clean {
        padding: 3rem 1rem 2rem;
    }

    .hero-preview {
        margin: 0 -1rem;
    }

    .preview-window {
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    /* Landing - Steps */
    .steps-grid {
        flex-direction: column;
        align-items: center;
    }

    .step-arrow {
        transform: rotate(90deg);
        padding: 0.5rem 0;
    }

    /* Landing - Features */
    .features-section {
        padding: 3rem 1rem;
    }

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

    /* Landing - Pricing */
    .pricing-section {
        padding: 3rem 1rem;
    }

    /* Landing - Footer */
    .footer-content {
        flex-direction: column;
        gap: 2rem;
    }

    .footer-links {
        gap: 2rem;
    }

    /* Chat - Sidebar */
    .sidebar.solid {
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        z-index: 50;
        transform: translateX(-100%);
    }

    .sidebar.solid.open {
        transform: translateX(0);
    }

    .mobile-menu-btn {
        display: flex;
    }

    /* Chat */
    .chat-header {
        padding: 0 1rem;
    }

    .message {
        padding: 1rem;
    }

    .message-avatar {
        margin-right: 0.75rem;
    }

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

    .chat-input-container {
        padding: 1rem;
    }
}

/* ── Sidebar Overlay for Mobile ── */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 40;
}

.sidebar-overlay.visible {
    display: block;
}

/* ── Upgrade Success Toast ── */
.upgrade-success-toast {
    position: fixed;
    top: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-primary-hover));
    color: white;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    animation: toastSlideIn 0.3s ease, toastFadeOut 0.3s ease 4.7s forwards;
}

.upgrade-success-toast i {
    width: 20px;
    height: 20px;
}

@keyframes toastSlideIn {
    from {
        transform: translateX(-50%) translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

@keyframes toastFadeOut {
    to {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
}
