/* ========================================================================
   GLASS AURORA THEME
   ========================================================================
   Mood:       Vibrant, modern, glassmorphic, bold gradients
   Palette:    Deep navy/purple base, aurora gradient accents, glass effects
   Fonts:      Sora (headings) + Literata (body)
   ======================================================================== */

/* ===== Theme Variables (Dark - Default) ===== */
:root {
    --bg-body: #0c0a1d;
    --bg-sidebar: rgba(16, 14, 36, 0.8);
    --bg-card: rgba(22, 19, 48, 0.7);
    --bg-surface: #100e24;
    --bg-glass: rgba(255, 255, 255, 0.04);
    --bg-glass-hover: rgba(255, 255, 255, 0.07);
    --text-primary: #cfc8e8;
    --text-heading: #f4f0ff;
    --text-muted: #8b82aa;
    --text-faint: #5a5280;
    --text-dimmest: #3d3560;
    --text-secondary: #8b82aa;
    --border-primary: rgba(255, 255, 255, 0.08);
    --border-secondary: rgba(255, 255, 255, 0.08);
    --accent: #8b5cf6;
    --accent-secondary: #6366f1;
    --avatar-text: #ffffff;
    --aurora: linear-gradient(135deg, #6366f1, #8b5cf6, #a855f7, #ec4899);
    --aurora-muted: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(168, 85, 247, 0.12));
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-border-bright: rgba(255, 255, 255, 0.12);
    --green: #34d399;
    --green-dim: rgba(52, 211, 153, 0.15);
    --shadow-glow: 0 0 60px rgba(139, 92, 246, 0.08);
    --radius: 16px;
    --radius-sm: 10px;
    --radius-xl: 24px;
    --gradient-start: #6366f1;
    --gradient-mid: #a855f7;
    --gradient-end: #ec4899;
}

/* ===== Light Theme ===== */
[data-theme="certifai-light"] {
    --bg-body: #f8f6ff;
    --bg-sidebar: rgba(255, 255, 255, 0.85);
    --bg-card: rgba(255, 255, 255, 0.85);
    --bg-surface: #ede8fa;
    --bg-glass: rgba(124, 58, 237, 0.04);
    --bg-glass-hover: rgba(124, 58, 237, 0.07);
    --text-primary: #1e1640;
    --text-heading: #0d0828;
    --text-muted: #7b6fa0;
    --text-faint: #a599c4;
    --text-dimmest: #c4b8de;
    --text-secondary: #7b6fa0;
    --border-primary: #e0d8f0;
    --border-secondary: #cec3e6;
    --accent: #7c3aed;
    --accent-secondary: #6d28d9;
    --avatar-text: #ffffff;
    --aurora: linear-gradient(135deg, #6366f1, #8b5cf6, #a855f7, #ec4899);
    --aurora-muted: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(168, 85, 247, 0.08));
    --glass-border: #e0d8f0;
    --glass-border-bright: #cec3e6;
    --green: #059669;
    --green-dim: rgba(5, 150, 105, 0.1);
    --shadow-glow: 0 0 60px rgba(139, 92, 246, 0.06);
    --gradient-start: #6366f1;
    --gradient-mid: #a855f7;
    --gradient-end: #ec4899;
}

/* ===== Fonts ===== */
body {
    font-family: 'Literata', serif;
    background-color: var(--bg-body);
    color: var(--text-primary);
    margin: 0;
    padding: 0;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Sora', sans-serif;
    font-weight: 700;
    line-height: 1.15;
    color: var(--text-heading);
}

/* ===== App Shell ===== */
.app-shell {
    display: flex;
    min-height: 100vh;
}

/* ===== Mobile Header ===== */
.mobile-header {
    display: none;
}

/* ===== Sidebar Backdrop ===== */
.sidebar-backdrop {
    display: none;
}

/* ===== Sidebar ===== */
.sidebar {
    width: 260px;
    min-width: 260px;
    background-color: var(--bg-sidebar);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: sticky;
    top: 0;
}

/* -- Sidebar Top Row (header + locale picker) -- */
.sidebar-top-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 20px 14px 16px 20px;
    border-bottom: 1px solid var(--glass-border);
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

/* -- Locale Picker -- */
.locale-picker {
    position: relative;
    flex-shrink: 0;
    margin-top: 2px;
}

.locale-picker-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid var(--glass-border);
    background: transparent;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    font-family: 'Sora', sans-serif;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    letter-spacing: 0.5px;
}

.locale-picker-btn:hover {
    background-color: var(--bg-glass-hover);
    color: var(--text-primary);
    border-color: var(--glass-border-bright);
}

.locale-picker-code {
    line-height: 1;
}

.locale-picker-backdrop {
    position: fixed;
    inset: 0;
    z-index: 49;
}

.locale-picker-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    z-index: 50;
    min-width: 140px;
    background-color: var(--bg-surface);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 4px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.locale-picker-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 6px 10px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    font-size: 13px;
    cursor: pointer;
    transition: background-color 0.12s ease, color 0.12s ease;
    text-align: left;
}

.locale-picker-item:hover {
    background-color: var(--bg-glass-hover);
    color: var(--text-primary);
}

.locale-picker-item--active {
    color: var(--accent);
    background-color: rgba(139, 92, 246, 0.1);
}

.locale-picker-item-code {
    font-family: 'Sora', sans-serif;
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 0.5px;
    width: 22px;
    text-align: center;
}

.locale-picker-item-label {
    font-weight: 500;
}

.avatar-circle {
    width: 38px;
    height: 38px;
    min-width: 38px;
    border-radius: var(--radius-sm);
    background: var(--aurora);
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-initials {
    font-family: 'Sora', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: var(--avatar-text);
}

.sidebar-user-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.sidebar-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-heading);
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-email {
    font-size: 12px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* -- Sidebar Navigation -- */
.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 12px 10px;
    gap: 2px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.sidebar-link:hover {
    background-color: var(--bg-glass-hover);
    color: var(--text-primary);
}

.sidebar-link.active {
    background-color: rgba(99, 102, 241, 0.12);
    color: #a5b4fc;
    font-weight: 600;
}

/* -- Sidebar Bottom Actions (Logout + Theme Toggle) -- */
.sidebar-bottom-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 10px;
    border-top: 1px solid var(--glass-border);
}

.logout-btn {
    color: var(--text-muted);
}

.logout-btn:hover {
    color: #f87171;
    background-color: rgba(248, 113, 113, 0.08);
}

.theme-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s, background-color 0.2s;
}

.theme-toggle-btn:hover {
    color: var(--accent);
    background-color: var(--bg-glass-hover);
}

/* -- Sidebar Footer -- */
.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.sidebar-social {
    display: flex;
    gap: 16px;
}

.social-link {
    color: var(--text-faint);
    transition: color 0.15s ease;
    text-decoration: none;
}

.social-link:hover {
    color: var(--accent);
}

.sidebar-legal {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 4px;
}

.legal-link {
    font-size: 11px;
    color: var(--text-dimmest);
    text-decoration: none;
    transition: color 0.15s ease;
}

.legal-link:hover {
    color: var(--text-secondary);
}

.legal-sep {
    font-size: 10px;
    color: var(--text-dimmest);
    opacity: 0.5;
}

.sidebar-version {
    font-size: 11px;
    color: var(--text-dimmest);
    font-family: 'Literata', monospace;
}

/* ===== Main Content ===== */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 40px 48px;
    min-height: 100vh;
}

/* ===== Overview Page ===== */
.overview-page {
    max-width: 960px;
}

.overview-heading {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 32px;
}

/* ===== Dashboard Grid ===== */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== Dashboard Card ===== */
.dashboard-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 24px;
    background-color: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text-primary);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.dashboard-card:hover {
    border-color: var(--glass-border-bright);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

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

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-heading);
    margin: 0;
}

.card-description {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0;
}

/* ===== Landing Page ===== */
.landing {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

/* Aurora background atmosphere */
.landing::before {
    content: '';
    position: fixed;
    top: -40%;
    left: -20%;
    width: 80%;
    height: 80%;
    background: radial-gradient(ellipse, rgba(99, 102, 241, 0.12) 0%, transparent 60%);
    pointer-events: none;
}

.landing::after {
    content: '';
    position: fixed;
    bottom: -30%;
    right: -20%;
    width: 70%;
    height: 70%;
    background: radial-gradient(ellipse, rgba(236, 72, 153, 0.08) 0%, transparent 60%);
    pointer-events: none;
}

/* -- Landing Nav -- */
.landing-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(16, 14, 36, 0.6);
    backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--glass-border);
}

[data-theme="certifai-light"] .landing-nav {
    background: rgba(248, 246, 255, 0.7);
}

.landing-nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 18px 56px;
    display: flex;
    align-items: center;
    gap: 32px;
}

.landing-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Sora', sans-serif;
    font-size: 22px;
    font-weight: 800;
    background: var(--aurora);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
}

.landing-logo-icon {
    color: var(--accent);
    display: flex;
    align-items: center;
    /* Override the gradient text fill for the icon */
    -webkit-text-fill-color: initial;
}

.landing-nav-links {
    display: flex;
    gap: 32px;
    flex: 1;
}

.landing-nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-family: 'Sora', sans-serif;
    font-size: 13px;
    font-weight: 500;
    transition: color 0.2s ease;
}

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

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

/* -- Hero Section -- */
.hero-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 120px 56px 100px;
    text-align: center;
    position: relative;
    width: 100%;
}

.hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* -- Hero Pills -- */
.hero-pills {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 32px;
    animation: fadeUp 0.6s ease;
}

.pill {
    font-family: 'Sora', sans-serif;
    font-size: 12px;
    font-weight: 500;
    padding: 6px 16px;
    background: var(--bg-glass);
    border: 1px solid var(--glass-border);
    border-radius: 100px;
    color: var(--text-secondary);
    backdrop-filter: blur(8px);
}

.pill.accent {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.3);
    color: #a5b4fc;
}

[data-theme="certifai-light"] .pill.accent {
    color: #6366f1;
}

.hero-title {
    font-size: 68px;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -2px;
    color: var(--text-heading);
    margin: 0 0 20px;
    animation: fadeUp 0.6s ease 0.1s both;
}

.hero-title-accent {
    background: var(--aurora);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 17px;
    line-height: 1.7;
    color: var(--text-secondary);
    margin: 0 auto 40px;
    max-width: 540px;
    animation: fadeUp 0.6s ease 0.2s both;
}

.hero-actions {
    display: flex;
    gap: 14px;
    justify-content: center;
    animation: fadeUp 0.6s ease 0.3s both;
}

/* -- Glass Preview -- */
.preview-container {
    max-width: 900px;
    margin: 64px auto 0;
    animation: fadeUp 0.8s ease 0.4s both;
    width: 100%;
}

.glass-preview {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: 32px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.preview-stat {
    padding: 20px;
    background: var(--bg-glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    text-align: center;
}

.preview-stat-value {
    font-family: 'Sora', sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 4px;
}

.preview-stat-label {
    font-family: 'Sora', sans-serif;
    font-size: 12px;
    color: var(--text-muted);
}

/* -- Trust Bar -- */
.trust-bar {
    display: flex;
    justify-content: center;
    gap: 40px;
    padding: 48px 56px;
    border-top: 1px solid var(--glass-border);
}

.trust-item {
    font-family: 'Sora', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

.trust-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--aurora);
}

/* -- Section Titles -- */
.section-title {
    font-size: 40px;
    font-weight: 700;
    color: var(--text-heading);
    text-align: center;
    margin: 0 0 12px;
    letter-spacing: -1px;
}

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

/* -- Features Section -- */
.features-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 100px 56px;
}

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

.feature-card {
    padding: 28px;
    background-color: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.feature-card:hover {
    border-color: var(--glass-border-bright);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

.feature-icon-bar {
    width: 40px;
    height: 4px;
    border-radius: 2px;
    background: var(--aurora);
    margin-bottom: 18px;
}

.feature-card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-heading);
    margin: 0 0 8px;
}

.feature-card-desc {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-secondary);
    margin: 0;
}

/* -- How It Works -- */
.how-it-works-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 80px 56px;
}

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

.step-card {
    text-align: center;
    padding: 40px 28px;
}

.step-number {
    font-family: 'Sora', sans-serif;
    font-size: 48px;
    font-weight: 700;
    background: var(--aurora);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: block;
    margin-bottom: 16px;
}

.step-title {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-heading);
    margin: 0 0 12px;
}

.step-desc {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-muted);
    margin: 0;
}

/* -- CTA Section -- */
.cta-section {
    padding: 80px 56px;
    text-align: center;
}

.cta-box {
    max-width: 700px;
    margin: 0 auto;
    padding: 60px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    position: relative;
    overflow: hidden;
}

.cta-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--aurora);
}

.cta-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-heading);
    margin: 0 0 12px;
}

.cta-subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    margin: 0 0 28px;
}

.cta-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
}

/* -- Landing Footer -- */
.landing-footer {
    border-top: 1px solid var(--glass-border);
    padding: 60px 56px 0;
    margin-top: auto;
}

.landing-footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 48px;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-tagline {
    font-size: 14px;
    color: var(--text-faint);
    margin: 0;
    max-width: 280px;
}

.footer-links-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-links-heading {
    font-family: 'Sora', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 4px;
}

.footer-links-group a {
    font-size: 14px;
    color: var(--text-faint);
    text-decoration: none;
    transition: color 0.15s ease;
}

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

.footer-bottom {
    max-width: 1200px;
    margin: 48px auto 0;
    padding: 20px 0;
    border-top: 1px solid var(--glass-border);
    text-align: center;
}

.footer-bottom p {
    font-family: 'Sora', sans-serif;
    font-size: 12px;
    color: var(--text-muted);
    margin: 0;
}

/* ===== Legal Pages (Impressum, Privacy) ===== */
.legal-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.legal-nav {
    padding: 20px 32px;
    border-bottom: 1px solid var(--glass-border);
}

.legal-content {
    max-width: 760px;
    margin: 0 auto;
    padding: 48px 32px 80px;
    flex: 1;
}

.legal-content h1 {
    font-size: 36px;
    font-weight: 700;
    color: var(--text-heading);
    margin: 0 0 32px;
}

.legal-content h2 {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-heading);
    margin: 40px 0 12px;
}

.legal-content p {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-muted);
    margin: 0 0 16px;
}

.legal-content ul {
    padding-left: 24px;
    margin: 0 0 16px;
}

.legal-content li {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.legal-updated {
    font-size: 14px;
    color: var(--text-faint);
    font-style: italic;
}

.legal-footer {
    padding: 20px 32px;
    border-top: 1px solid var(--glass-border);
    display: flex;
    gap: 24px;
    justify-content: center;
}

.legal-footer a {
    font-size: 14px;
    color: var(--text-faint);
    text-decoration: none;
    transition: color 0.15s ease;
}

.legal-footer a:hover {
    color: var(--accent);
}

/* ===== Responsive: Landing Page ===== */
@media (max-width: 1024px) {
    .hero-section {
        padding: 80px 24px 60px;
    }

    .hero-title {
        font-size: 48px;
        letter-spacing: -1px;
    }

    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .landing-footer-inner {
        grid-template-columns: 1fr 1fr;
        gap: 32px;
    }

    .landing-nav-inner {
        padding: 16px 24px;
    }

    .features-section,
    .how-it-works-section {
        padding: 80px 24px;
    }

    .cta-section {
        padding: 60px 24px;
    }

    .trust-bar {
        padding: 40px 24px;
        gap: 24px;
        flex-wrap: wrap;
    }

    .landing-footer {
        padding: 48px 24px 0;
    }
}

@media (max-width: 768px) {
    .landing-nav-links {
        display: none;
    }

    .hero-section {
        padding: 60px 16px 40px;
    }

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

    .hero-subtitle {
        font-size: 16px;
    }

    .hero-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .hero-pills {
        flex-wrap: wrap;
    }

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

    .glass-preview {
        grid-template-columns: 1fr;
    }

    .trust-bar {
        flex-direction: column;
        align-items: center;
        gap: 16px;
    }

    .cta-box {
        padding: 40px 24px;
    }

    .cta-title {
        font-size: 24px;
    }

    .cta-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .landing-footer-inner {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .section-title {
        font-size: 28px;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 28px;
    }

    .hero-subtitle {
        font-size: 15px;
    }

    .section-title {
        font-size: 24px;
    }

    .landing-nav-inner {
        padding: 12px 16px;
    }

    .features-section,
    .how-it-works-section {
        padding: 48px 16px;
    }

    .step-card {
        padding: 24px 16px;
    }

    .feature-card {
        padding: 20px 16px;
    }
}

/* ===== Shared UI Elements ===== */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 24px;
    background: var(--aurora);
    background-size: 200% 200%;
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Sora', sans-serif;
    text-decoration: none;
}

.btn-primary:hover {
    background-position: 100% 0;
    transform: translateY(-1px);
    box-shadow: 0 4px 24px rgba(139, 92, 246, 0.3);
}

.btn-primary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    background-color: var(--bg-glass);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Sora', sans-serif;
    text-decoration: none;
}

.btn-secondary:hover {
    background-color: var(--bg-glass-hover);
    border-color: var(--glass-border-bright);
}

.btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 22px;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Sora', sans-serif;
    text-decoration: none;
}

.btn-ghost:hover {
    border-color: var(--glass-border-bright);
    color: var(--text-heading);
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 22px;
    background: var(--bg-glass);
    backdrop-filter: blur(8px);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: 'Sora', sans-serif;
    text-decoration: none;
}

.btn-outline:hover {
    background: var(--bg-glass-hover);
    border-color: var(--glass-border-bright);
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background-color: transparent;
    color: var(--text-muted);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.btn-icon:hover {
    color: var(--text-primary);
    border-color: var(--accent);
}

.btn-danger {
    color: #f87171;
    border-color: rgba(248, 113, 113, 0.3);
    font-size: 12px;
    padding: 4px 12px;
    width: auto;
    height: auto;
}

.btn-danger:hover {
    background-color: rgba(248, 113, 113, 0.08);
    border-color: #f87171;
    color: #f87171;
}

.btn-sm {
    padding: 8px 18px;
    font-size: 13px;
}

.btn-lg {
    padding: 14px 36px;
    font-size: 14px;
}

.badge {
    font-family: 'Sora', sans-serif;
    font-size: 12px;
    font-weight: 500;
    padding: 4px 12px;
    border-radius: 100px;
}

.badge-outline {
    border: 1px solid var(--glass-border);
    color: var(--accent);
}

/* ===== Form Elements ===== */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.form-group label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
}

.form-select,
.form-input {
    padding: 10px 14px;
    background-color: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    font-family: 'Literata', serif;
    outline: none;
    transition: border-color 0.15s ease;
}

.form-select:focus,
.form-input:focus {
    border-color: var(--accent);
}

.form-success {
    font-size: 13px;
    color: var(--green);
    margin-top: 8px;
}

/* ===== Page Header ===== */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 32px;
    gap: 24px;
}

.page-header-text {
    flex: 1;
}

.page-title {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text-heading);
    margin: 0 0 4px;
}

.page-subtitle {
    font-family: 'Sora', sans-serif;
    font-size: 13px;
    color: var(--text-muted);
    margin: 0;
}

/* ===== Sub Navigation (Developer/Org tabs) ===== */
.sub-nav {
    display: flex;
    gap: 4px;
    padding: 0 0 20px;
    border-bottom: 1px solid var(--glass-border);
    margin-bottom: 24px;
}

.sub-nav-item {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.sub-nav-item:hover {
    background-color: var(--bg-glass-hover);
    color: var(--text-primary);
}

.sub-nav-item--active {
    background-color: rgba(99, 102, 241, 0.12);
    color: #a5b4fc;
}

[data-theme="certifai-light"] .sub-nav-item--active {
    color: var(--accent);
}

/* ===== Shell Content (Developer/Org) ===== */
.developer-shell,
.org-shell {
    max-width: 1200px;
}

.shell-content {
    min-height: 400px;
}

/* ===== Dashboard Page (News Feed) ===== */
.dashboard-page {
    max-width: 1200px;
}

.dashboard-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.filter-tab {
    padding: 6px 16px;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    background-color: transparent;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: 'Sora', sans-serif;
}

.filter-tab:hover {
    border-color: var(--glass-border-bright);
    color: var(--text-primary);
}

.filter-tab--active {
    background-color: rgba(99, 102, 241, 0.12);
    border-color: var(--accent);
    color: var(--accent);
}

/* ===== News Card ===== */
.news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.news-card {
    background-color: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.news-card:hover {
    border-color: var(--glass-border-bright);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.news-card-thumb {
    overflow: hidden;
    height: 140px;
    flex-shrink: 0;
}

.news-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    color: transparent;
    font-size: 0;
}

.news-card-body {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.news-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.news-badge {
    font-family: 'Sora', sans-serif;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background-color: rgba(99, 132, 210, 0.15);
    color: var(--accent);
}

.news-badge--llm {
    background-color: rgba(99, 102, 241, 0.15);
    color: #818cf8;
}

.news-badge--agents {
    background-color: rgba(168, 85, 247, 0.15);
    color: #c084fc;
}

.news-badge--privacy {
    background-color: rgba(52, 211, 153, 0.15);
    color: #34d399;
}

.news-badge--infrastructure {
    background-color: rgba(234, 179, 8, 0.15);
    color: #facc15;
}

.news-badge--open-source {
    background-color: rgba(236, 72, 153, 0.15);
    color: #f472b6;
}

.news-card-source {
    font-size: 12px;
    color: var(--text-faint);
}

.news-card-date {
    font-size: 12px;
    color: var(--text-dimmest);
}

.news-card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-heading);
    margin: 0 0 8px;
    line-height: 1.3;
}

.news-card-title a {
    color: inherit;
    text-decoration: none;
}

.news-card-title a:hover {
    color: var(--accent);
}

.news-card-summary {
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-muted);
    margin: 0;
}

.news-card--selected {
    border-color: var(--accent);
    background-color: rgba(139, 92, 246, 0.08);
}

.news-card--no-thumb {
    min-height: 200px;
}

.news-card--no-thumb .news-card-body {
    text-align: center;
    justify-content: center;
}

.news-card--no-thumb .news-card-meta {
    justify-content: center;
}

/* ===== Dashboard Split View ===== */
.dashboard-split {
    display: flex;
    gap: 24px;
    min-height: 60vh;
}

.dashboard-full {
    display: block;
}

/* ===== Dashboard With Sidebar ===== */
.dashboard-with-sidebar {
    display: flex;
    gap: 24px;
    min-height: 60vh;
}

.dashboard-full-grid {
    width: 100%;
}

.dashboard-left {
    width: 40%;
    min-width: 0;
    overflow-y: auto;
    max-height: 80vh;
}

.dashboard-right {
    width: 60%;
    min-width: 0;
    position: sticky;
    top: 24px;
    align-self: flex-start;
    max-height: 80vh;
    overflow-y: auto;
}

.news-grid--compact {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.dashboard-loading {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
    font-size: 14px;
}

/* ===== Topic Tabs ===== */
.topic-tab-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.topic-remove {
    background: none;
    border: none;
    color: var(--text-faint);
    font-size: 12px;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    transition: color 0.15s ease;
}

.topic-remove:hover {
    color: #f87171;
}

.topic-add-btn {
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px dashed var(--glass-border);
    background-color: transparent;
    color: var(--text-faint);
    font-size: 16px;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: 'Sora', sans-serif;
    line-height: 1;
}

.topic-add-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.topic-input-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.topic-input {
    padding: 5px 12px;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    background-color: var(--bg-card);
    color: var(--text-primary);
    font-size: 13px;
    font-family: 'Literata', serif;
    outline: none;
    width: 140px;
}

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

.topic-cancel-btn {
    background: none;
    border: none;
    color: var(--text-faint);
    font-size: 12px;
    cursor: pointer;
}

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

/* ===== Settings Panel ===== */
.settings-toggle {
    margin-left: auto;
}

.settings-panel {
    background-color: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 24px;
}

.settings-panel-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 16px;
}

.settings-field {
    margin-bottom: 12px;
}

.settings-field label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
    font-weight: 500;
}

.settings-input {
    width: 100%;
    max-width: 400px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--glass-border);
    background-color: var(--bg-body);
    color: var(--text-primary);
    font-size: 13px;
    font-family: 'Literata', serif;
    outline: none;
}

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

.settings-hint {
    background-color: rgba(234, 179, 8, 0.1);
    border: 1px solid rgba(234, 179, 8, 0.3);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 13px;
    color: #facc15;
}

/* ===== Article Detail Panel ===== */
.article-detail-panel {
    background-color: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 24px;
    position: relative;
}

.article-detail-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.article-detail-close:hover {
    border-color: #f87171;
    color: #f87171;
}

.article-detail-content {
    padding-right: 40px;
}

.article-detail-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-heading);
    margin: 0 0 12px;
    line-height: 1.3;
}

.article-detail-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.article-detail-source {
    font-size: 13px;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.source-favicon {
    width: 16px;
    height: 16px;
    border-radius: 2px;
    flex-shrink: 0;
}

.article-detail-date {
    font-size: 13px;
    color: var(--text-faint);
}

.article-detail-body {
    margin-bottom: 20px;
}

.article-detail-body p {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-primary);
    margin: 0;
}

.article-detail-link {
    display: inline-block;
    font-size: 13px;
    color: var(--accent);
    text-decoration: none;
    margin-bottom: 20px;
    transition: color 0.15s ease;
}

.article-detail-link:hover {
    color: var(--accent-secondary);
}

/* ---- AI Summary Bubble ---- */
.ai-summary-bubble {
    margin-top: 20px;
    background-color: rgba(139, 92, 246, 0.08);
    border: 1px solid rgba(139, 92, 246, 0.18);
    border-radius: var(--radius);
    padding: 16px 18px;
    position: relative;
}

.ai-summary-bubble-text {
    font-size: 14px;
    line-height: 1.65;
    color: var(--text-primary);
    margin: 0;
    white-space: pre-wrap;
}

.ai-summary-bubble-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--accent);
    margin-top: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.6;
}

.ai-summary-bubble-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--accent);
    font-style: italic;
}

/* Pulsing dots animation for loading states */
.ai-summary-dot-pulse {
    display: flex;
    gap: 4px;
}

.ai-summary-dot-pulse::before,
.ai-summary-dot-pulse::after,
.ai-summary-dot-pulse {
    position: relative;
}

.ai-summary-dot-pulse::before,
.ai-summary-dot-pulse::after {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    animation: dotPulse 1.2s infinite ease-in-out;
}

.ai-summary-dot-pulse::after {
    animation-delay: 0.4s;
}

@keyframes dotPulse {

    0%,
    80%,
    100% {
        opacity: 0.3;
        transform: scale(0.8);
    }

    40% {
        opacity: 1;
        transform: scale(1);
    }
}

/* ---- Follow-up Chat ---- */
.article-chat {
    margin-top: 16px;
    border-top: 1px solid var(--glass-border);
    padding-top: 16px;
}

.article-chat-messages {
    max-height: 300px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
    padding-right: 4px;
}

.chat-msg {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: var(--radius);
    font-size: 14px;
    line-height: 1.55;
}

.chat-msg p {
    margin: 0;
    white-space: pre-wrap;
}

.chat-msg--user {
    align-self: flex-end;
    background: rgba(99, 102, 241, 0.2);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: var(--text-primary);
    border-bottom-right-radius: 4px;
}

.chat-msg--assistant {
    align-self: flex-start;
    background: rgba(139, 92, 246, 0.08);
    border: 1px solid rgba(139, 92, 246, 0.15);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
}

.chat-msg--typing {
    padding: 12px 16px;
}

.article-chat-input {
    display: flex;
    gap: 8px;
}

.article-chat-textbox {
    flex: 1;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 14px;
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.2s;
}

.article-chat-textbox:focus {
    border-color: var(--accent);
}

.article-chat-textbox:disabled {
    opacity: 0.5;
}

.article-chat-send {
    background: var(--aurora);
    background-size: 200% 200%;
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.article-chat-send:hover:not(:disabled) {
    background-position: 100% 0;
}

.article-chat-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===== Providers Page ===== */
.providers-page {
    max-width: 960px;
}

.providers-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}

.providers-form {
    background-color: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 28px;
}

.providers-status {
    position: sticky;
    top: 40px;
    align-self: start;
}

.providers-status h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-heading);
    margin: 0 0 16px;
}

.status-card {
    background-color: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 20px;
}

.status-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--glass-border);
}

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

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

.status-value {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

/* ===== Chat Page ===== */
.chat-page {
    display: flex;
    height: calc(100vh - 80px);
    margin: -40px -48px;
    overflow: hidden;
}

.chat-sidebar-panel {
    width: 260px;
    min-width: 260px;
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    background-color: var(--bg-sidebar);
    backdrop-filter: blur(20px);
}

.chat-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid var(--glass-border);
}

.chat-sidebar-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-heading);
    margin: 0;
}

.chat-session-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.chat-session-item {
    width: 100%;
    text-align: left;
    padding: 12px;
    border-radius: var(--radius-sm);
    border: none;
    background-color: transparent;
    cursor: pointer;
    transition: background-color 0.15s ease;
    font-family: 'Literata', serif;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.chat-session-item:hover {
    background-color: var(--bg-glass-hover);
}

.chat-session-item--active {
    background-color: rgba(99, 102, 241, 0.12);
}

.chat-session-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-session-date {
    font-size: 12px;
    color: var(--text-faint);
}

.chat-session-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.chat-session-actions {
    display: none;
    gap: 4px;
    flex-shrink: 0;
}

.chat-session-item:hover .chat-session-actions {
    display: flex;
}

.chat-main-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px 32px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chat-empty {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-faint);
}

/* ===== Chat Bubble ===== */
.chat-bubble {
    max-width: 72%;
    padding: 14px 18px;
    border-radius: var(--radius);
    font-size: 14px;
    line-height: 1.6;
}

.chat-bubble--user {
    align-self: flex-end;
    background-color: rgba(99, 102, 241, 0.15);
    color: var(--text-primary);
    border-bottom-right-radius: 4px;
}

.chat-bubble--assistant {
    align-self: flex-start;
    background-color: var(--bg-card);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
}

.chat-bubble--system {
    align-self: center;
    background-color: transparent;
    color: var(--text-faint);
    font-size: 13px;
    font-style: italic;
}

.chat-bubble-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.chat-bubble-role {
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
}

.chat-bubble-time {
    font-size: 11px;
    color: var(--text-faint);
}

.chat-bubble-content {
    white-space: pre-wrap;
}

.chat-bubble-attachments {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.chat-attachment {
    font-size: 12px;
    padding: 4px 10px;
    background-color: rgba(139, 92, 246, 0.1);
    border-radius: 4px;
    color: var(--accent);
}

/* -- Chat Action Bar -- */
.chat-action-bar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 24px 0;
    background-color: var(--bg-sidebar);
}

.chat-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    background: none;
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.chat-action-btn:hover:not(:disabled) {
    color: var(--text-primary);
    background-color: var(--bg-glass-hover);
    border-color: var(--glass-border);
}

.chat-action-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.chat-action-label {
    font-family: 'Sora', sans-serif;
}

/* -- Chat Input Bar -- */
.chat-input-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 24px;
    border-top: 1px solid var(--glass-border);
    background-color: var(--bg-sidebar);
}

.chat-input {
    flex: 1;
    padding: 10px 14px;
    background-color: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    font-family: 'Literata', serif;
    outline: none;
}

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

.chat-attach-btn {
    font-size: 18px;
}

.chat-send-btn {
    padding: 10px 20px;
}

/* -- Chat Model Selector Bar -- */
.chat-model-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 24px;
    border-bottom: 1px solid var(--glass-border);
    background-color: var(--bg-sidebar);
}

.chat-model-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.chat-model-select {
    padding: 6px 12px;
    background-color: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 13px;
    font-family: 'Literata', serif;
    outline: none;
    cursor: pointer;
    min-width: 160px;
}

.chat-model-select:focus {
    border-color: var(--accent);
}

/* -- Chat Namespace Headers -- */
.chat-namespace-header {
    font-family: 'Sora', sans-serif;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-faint);
    padding: 12px 12px 4px;
}

.btn-icon-sm {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    color: var(--text-faint);
    transition: all 0.15s ease;
    padding: 0;
}

.btn-icon-sm:hover {
    background-color: var(--bg-glass-hover);
    color: var(--text-primary);
}

.btn-icon-danger:hover {
    color: #ef4444;
}

/* -- Inline Rename -- */
.chat-session-rename-input {
    width: 100%;
    padding: 8px 10px;
    background-color: var(--bg-card);
    border: 1px solid var(--accent);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 13px;
    font-family: 'Literata', serif;
    outline: none;
}

/* -- Chat Message List -- */
.chat-message-list {
    flex: 1;
    overflow-y: auto;
    padding: 24px 32px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* -- Chat Empty Hint -- */
.chat-empty-hint {
    font-size: 13px;
    color: var(--text-faint);
    padding: 8px 12px;
}

/* -- Thinking Indicator -- */
.chat-bubble--thinking {
    background-color: transparent;
    border: none;
    padding: 8px 0;
}

.chat-thinking {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-faint);
    font-size: 14px;
}

.chat-thinking-text {
    opacity: 0.7;
}

.chat-thinking-dots {
    display: flex;
    gap: 4px;
}

.chat-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--accent);
    animation: dot-pulse 1.4s ease-in-out infinite;
}

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

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

@keyframes dot-pulse {
    0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
    40% { opacity: 1; transform: scale(1); }
}

/* -- Streaming Bubble -- */
.chat-bubble--streaming {
    border: 1px solid var(--accent);
    border-style: dashed;
}

.chat-streaming-cursor {
    display: inline-block;
    width: 8px;
    height: 16px;
    background-color: var(--accent);
    margin-left: 2px;
    animation: blink-cursor 1s steps(2) infinite;
    vertical-align: text-bottom;
}

@keyframes blink-cursor {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* -- Chat Prose (Markdown in Assistant Bubbles) -- */
.chat-prose {
    white-space: normal;
}

.chat-prose p {
    margin: 0 0 12px;
}

.chat-prose p:last-child {
    margin-bottom: 0;
}

.chat-prose pre {
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    overflow-x: auto;
    margin: 8px 0;
    font-size: 13px;
    line-height: 1.5;
}

.chat-prose code {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 13px;
}

.chat-prose :not(pre) > code {
    background-color: rgba(139, 92, 246, 0.15);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
}

.chat-prose ul,
.chat-prose ol {
    padding-left: 20px;
    margin: 8px 0;
}

.chat-prose li {
    margin-bottom: 4px;
}

.chat-prose blockquote {
    border-left: 3px solid var(--accent);
    padding-left: 12px;
    color: var(--text-secondary);
    margin: 8px 0;
    font-style: italic;
}

.chat-prose table {
    width: 100%;
    border-collapse: collapse;
    margin: 8px 0;
    font-size: 13px;
}

.chat-prose th,
.chat-prose td {
    border: 1px solid var(--glass-border);
    padding: 8px;
    text-align: left;
}

.chat-prose th {
    background-color: rgba(139, 92, 246, 0.1);
    font-weight: 600;
}

.chat-prose a {
    color: var(--accent);
    text-decoration: underline;
}

.chat-prose h1,
.chat-prose h2,
.chat-prose h3 {
    font-family: 'Sora', sans-serif;
    margin: 16px 0 8px;
    color: var(--text-heading);
}

.chat-prose h1 { font-size: 20px; }
.chat-prose h2 { font-size: 17px; }
.chat-prose h3 { font-size: 15px; }

/* ===== Tools Page ===== */
.tools-page {
    max-width: 1200px;
}

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

/* ===== Tool Card ===== */
.tool-card {
    background-color: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 24px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.tool-card:hover {
    border-color: var(--glass-border-bright);
    box-shadow: var(--shadow-glow);
}

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

.tool-card-icon {
    font-size: 24px;
    color: var(--accent);
}

.tool-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.tool-status--active {
    background-color: var(--green);
    box-shadow: 0 0 6px rgba(52, 211, 153, 0.4);
}

.tool-status--inactive {
    background-color: var(--text-faint);
}

.tool-status--error {
    background-color: #f87171;
}

.tool-card-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-heading);
    margin: 0 0 6px;
}

.tool-card-desc {
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-muted);
    margin: 0 0 16px;
}

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

.tool-card-category {
    font-family: 'Sora', sans-serif;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-faint);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tool-toggle {
    padding: 4px 14px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    font-family: 'Sora', sans-serif;
    transition: all 0.15s ease;
}

.tool-toggle--on {
    background-color: var(--green-dim);
    color: var(--green);
}

.tool-toggle--off {
    background-color: var(--bg-glass);
    color: var(--text-faint);
}

/* ===== Knowledge Base Page ===== */
.knowledge-page {
    max-width: 1200px;
}

.knowledge-toolbar {
    margin-bottom: 20px;
}

.knowledge-search {
    max-width: 320px;
}

.knowledge-table-wrapper {
    overflow-x: auto;
}

.knowledge-table {
    width: 100%;
    border-collapse: collapse;
}

.knowledge-table thead th {
    font-family: 'Sora', sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-faint);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--glass-border);
}

.knowledge-table tbody td {
    font-size: 14px;
    color: var(--text-primary);
    padding: 14px 16px;
    border-bottom: 1px solid var(--glass-border);
}

.file-row:hover {
    background-color: rgba(139, 92, 246, 0.04);
}

.file-row-name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.file-row-icon {
    color: var(--accent);
    font-size: 12px;
}

/* ===== Placeholder Pages (Developer) ===== */
.placeholder-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 0;
    gap: 32px;
}

.placeholder-card {
    text-align: center;
    max-width: 480px;
    padding: 48px 40px;
    background-color: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
}

.placeholder-icon {
    width: 64px;
    height: 64px;
    border-radius: var(--radius);
    background: var(--aurora-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-family: 'Sora', sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: var(--accent);
}

.placeholder-card h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-heading);
    margin: 0 0 12px;
}

.placeholder-desc {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-muted);
    margin: 0 0 24px;
}

.placeholder-badge {
    display: inline-block;
    margin-top: 12px;
    font-family: 'Sora', sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
    padding: 4px 12px;
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 20px;
}

/* ===== Tool Embed (iframe integration) ===== */
.tool-embed {
    display: flex;
    flex-direction: column;
    flex: 1;
    height: calc(100vh - 60px);
    min-height: 400px;
}

.tool-embed-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--glass-border);
}

.tool-embed-title {
    font-family: 'Sora', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-heading);
}

.tool-embed-popout-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 500;
    color: var(--accent);
    background-color: transparent;
    border: 1px solid var(--accent);
    border-radius: 6px;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
}

.tool-embed-popout-btn:hover {
    background-color: var(--accent);
    color: #fff;
}

.tool-embed-iframe {
    flex: 1;
    width: 100%;
    border: none;
}

/* ===== Analytics Stats Bar ===== */
.analytics-stats-bar {
    display: flex;
    gap: 24px;
    width: 100%;
    max-width: 720px;
}

.analytics-stat {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 16px;
    background-color: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
}

.analytics-stat-value {
    font-family: 'Sora', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: var(--text-heading);
}

.analytics-stat-label {
    font-size: 12px;
    color: var(--text-faint);
}

.analytics-stat-change {
    font-size: 12px;
    font-weight: 500;
}

.analytics-stat-change--up {
    color: var(--green);
}

.analytics-stat-change--down {
    color: #f87171;
}

/* ===== Pricing Page ===== */
.pricing-page {
    max-width: 1200px;
}

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

/* ===== Pricing Card ===== */
.pricing-card {
    background-color: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 32px 28px;
    text-align: center;
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.pricing-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.pricing-card--highlighted {
    border-color: var(--accent);
    box-shadow: 0 0 30px rgba(139, 92, 246, 0.1);
    position: relative;
}

.pricing-card-name {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-heading);
    margin: 0 0 16px;
}

.pricing-card-price {
    margin-bottom: 8px;
}

.pricing-card-amount {
    font-family: 'Sora', sans-serif;
    font-size: 40px;
    font-weight: 700;
    color: var(--text-heading);
}

.pricing-card-period {
    font-size: 14px;
    color: var(--text-faint);
}

.pricing-card-seats {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0 0 24px;
}

.pricing-card-features {
    list-style: none;
    padding: 0;
    margin: 0 0 28px;
    text-align: left;
}

.pricing-card-features li {
    font-size: 14px;
    color: var(--text-muted);
    padding: 6px 0;
    border-bottom: 1px solid var(--glass-border);
}

.pricing-card-features li:last-child {
    border-bottom: none;
}

.pricing-card-cta {
    width: 100%;
    padding: 12px;
    background: var(--aurora);
    background-size: 200% 200%;
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Sora', sans-serif;
    transition: all 0.3s ease;
}

.pricing-card-cta:hover {
    background-position: 100% 0;
    box-shadow: 0 4px 24px rgba(139, 92, 246, 0.3);
}

/* ===== Organization Dashboard ===== */
.org-dashboard-page {
    max-width: 1200px;
}

.org-stats-bar {
    display: flex;
    gap: 20px;
    margin-bottom: 32px;
}

.org-stat {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 20px;
    background-color: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
}

.org-stat-value {
    font-family: 'Sora', sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-heading);
}

.org-stat-label {
    font-size: 12px;
    color: var(--text-faint);
}

/* ===== Organization Usage Section ===== */
.org-section-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-heading);
    margin: 0 0 16px;
}

.org-usage-loading,
.org-usage-unavailable {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    margin-bottom: 32px;
    background-color: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    font-size: 14px;
    color: var(--text-muted);
}

.org-usage-loading {
    animation: pulse-fade 1.5s ease-in-out infinite;
}

@keyframes pulse-fade {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* ===== Organization Table ===== */
.org-table-wrapper {
    overflow-x: auto;
}

.org-table {
    width: 100%;
    border-collapse: collapse;
}

.org-table thead th {
    font-family: 'Sora', sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-faint);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--glass-border);
}

.org-table tbody td {
    font-size: 14px;
    color: var(--text-primary);
    padding: 14px 16px;
    border-bottom: 1px solid var(--glass-border);
}

.member-row:hover {
    background-color: rgba(139, 92, 246, 0.04);
}

.member-role-select {
    padding: 6px 10px;
    background-color: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 13px;
    font-family: 'Literata', serif;
    outline: none;
}

.member-role-select:focus {
    border-color: var(--accent);
}

/* ===== Modal ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background-color: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 32px;
    min-width: 400px;
    max-width: 500px;
}

.modal-content h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-heading);
    margin: 0 0 20px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

/* ===== Dashboard Sidebar ===== */
.dashboard-sidebar {
    width: 30%;
    min-width: 240px;
    max-width: 320px;
    position: sticky;
    top: 24px;
    align-self: flex-start;
    max-height: 80vh;
    overflow-y: auto;
    border-left: 1px solid var(--glass-border);
    padding-left: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.sidebar-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sidebar-section-title {
    font-family: 'Sora', sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-faint);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0;
}

.sidebar-status-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.sidebar-status-dot--online {
    background-color: var(--green);
    box-shadow: 0 0 6px rgba(52, 211, 153, 0.4);
}

.sidebar-status-dot--offline {
    background-color: #f87171;
    box-shadow: 0 0 6px rgba(248, 113, 113, 0.4);
}

.sidebar-status-label {
    font-size: 13px;
    color: var(--text-primary);
    font-weight: 500;
}

.sidebar-model-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.sidebar-model-tag {
    display: inline-block;
    font-family: 'Sora', sans-serif;
    font-size: 11px;
    font-weight: 500;
    padding: 3px 10px;
    border-radius: 12px;
    background-color: rgba(139, 92, 246, 0.1);
    color: var(--accent);
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.sidebar-topic-link {
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 13px;
    font-family: 'Literata', serif;
    color: var(--text-muted);
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.sidebar-topic-link:hover {
    background-color: rgba(139, 92, 246, 0.08);
    color: var(--text-primary);
}

/* ===== Responsive: Tablet (max-width: 1024px) ===== */
@media (max-width: 1024px) {

    .news-grid,
    .tools-grid,
    .pricing-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .providers-layout {
        grid-template-columns: 1fr;
    }

    .analytics-stats-bar {
        flex-wrap: wrap;
    }

    .org-stats-bar {
        flex-wrap: wrap;
    }

    .dashboard-sidebar {
        display: none;
    }

    .dashboard-with-sidebar {
        display: block;
    }

    .dashboard-split {
        flex-direction: column;
    }

    .dashboard-left {
        width: 100%;
        max-height: none;
        overflow-y: visible;
    }

    .dashboard-right {
        width: 100%;
        position: static;
        max-height: none;
    }

    .news-grid--compact {
        grid-template-columns: repeat(2, 1fr);
    }

    .main-content {
        padding: 32px 24px;
    }

    .chat-page {
        margin: -32px -24px;
        height: calc(100vh - 64px);
    }
}

/* ===== Responsive: Mobile (max-width: 768px) ===== */
@media (max-width: 768px) {

    /* -- Mobile header bar with hamburger -- */
    .mobile-header {
        display: flex;
        align-items: center;
        gap: 12px;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 90;
        height: 56px;
        padding: 0 16px;
        background-color: var(--bg-sidebar);
        backdrop-filter: blur(20px);
        border-bottom: 1px solid var(--glass-border);
    }

    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        border: none;
        border-radius: 8px;
        background: transparent;
        color: var(--text-primary);
        cursor: pointer;
        transition: background-color 0.15s ease;
    }

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

    .mobile-header-title {
        font-family: 'Sora', sans-serif;
        font-size: 18px;
        font-weight: 700;
        background: var(--aurora);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }

    /* -- Sidebar: hidden off-screen, slides in as overlay -- */
    .app-shell {
        flex-direction: column;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 200;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        width: 280px;
        min-width: 280px;
    }

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

    .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 199;
        background-color: rgba(0, 0, 0, 0.5);
    }

    /* -- Main content: add top padding for mobile header -- */
    .main-content {
        padding: 72px 16px 24px;
        min-height: calc(100vh - 56px);
    }

    /* -- Dashboard grids -- */
    .news-grid,
    .tools-grid,
    .pricing-grid {
        grid-template-columns: 1fr;
    }

    .news-grid--compact {
        grid-template-columns: 1fr;
    }

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

    /* -- Chat page -- */
    .chat-page {
        flex-direction: column;
        height: auto;
        min-height: calc(100vh - 56px);
        margin: -72px -16px -24px;
    }

    .chat-sidebar-panel {
        width: 100%;
        min-width: unset;
        max-height: 200px;
        border-right: none;
        border-bottom: 1px solid var(--glass-border);
    }

    .chat-messages,
    .chat-message-list {
        padding: 16px;
    }

    .chat-input-bar {
        padding: 12px 16px;
    }

    .chat-model-bar {
        padding: 8px 16px;
    }

    .chat-bubble {
        max-width: 90%;
    }

    /* -- Page header -- */
    .page-header {
        flex-direction: column;
        gap: 12px;
    }

    .page-title {
        font-size: 22px;
    }

    /* -- Stats bars -- */
    .analytics-stats-bar {
        flex-direction: column;
    }

    .org-stats-bar {
        flex-direction: column;
    }

    /* -- Sub navigation (Developer/Org tabs) -- */
    .sub-nav {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
        padding-bottom: 12px;
    }

    .sub-nav-item {
        flex-shrink: 0;
    }

    /* -- Modal -- */
    .modal-content {
        min-width: unset;
        margin: 16px;
        max-width: calc(100vw - 32px);
    }

    /* -- Dashboard filters -- */
    .dashboard-filters {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
        padding-bottom: 4px;
    }

    .filter-tab {
        flex-shrink: 0;
    }

    /* -- Providers page -- */
    .providers-layout {
        grid-template-columns: 1fr;
    }

    /* -- Tables: horizontal scroll -- */
    .knowledge-table-wrapper,
    .org-table-wrapper {
        margin: 0 -16px;
        padding: 0 16px;
    }

    /* -- Settings -- */
    .settings-input {
        max-width: 100%;
    }

    /* -- Placeholder pages -- */
    .placeholder-card {
        padding: 32px 20px;
    }

    /* -- Article detail -- */
    .article-detail-title {
        font-size: 18px;
    }

    .article-detail-content {
        padding-right: 32px;
    }

    /* -- Pricing cards -- */
    .pricing-card {
        padding: 24px 20px;
    }
}

/* ===== Responsive: Small Phones (max-width: 480px) ===== */
@media (max-width: 480px) {

    .main-content {
        padding: 64px 12px 16px;
    }

    .chat-page {
        margin: -64px -12px -16px;
    }

    .page-title {
        font-size: 20px;
    }

    .overview-heading {
        font-size: 22px;
    }

    .dashboard-card {
        padding: 16px;
    }

    .tool-card {
        padding: 16px;
    }

    .news-card-body {
        padding: 14px;
    }

    .sidebar {
        width: 260px;
        min-width: 260px;
    }

    .chat-bubble {
        max-width: 95%;
        padding: 10px 14px;
    }

    .modal-content {
        padding: 20px;
    }
}

/* ===== Agents Page ===== */
.agents-page {
    display: flex;
    flex-direction: column;
    padding: 32px;
    gap: 32px;
}

.agents-hero {
    max-width: 720px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.agents-hero-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 16px;
}

.agents-hero-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
    background: var(--aurora);
    color: #fff;
    border-radius: var(--radius);
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.agents-hero-title {
    font-family: 'Sora', sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: var(--text-heading);
    margin: 0;
}

.agents-hero-desc {
    font-size: 15px;
    color: var(--text-muted);
    line-height: 1.6;
    max-width: 600px;
    margin: 0;
}

.agents-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.agents-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.agents-status-dot--on {
    background-color: var(--green);
    box-shadow: 0 0 6px rgba(52, 211, 153, 0.4);
}

.agents-status-dot--off {
    background-color: var(--text-faint);
}

.agents-status-url {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    color: var(--accent);
    font-size: 13px;
}

.agents-status-hint {
    font-size: 13px;
    color: var(--text-faint);
    font-style: italic;
}

.agents-section-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-heading);
    margin: 0 0 12px 0;
}

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

.agents-card {
    display: block;
    text-decoration: none;
    background-color: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 24px;
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.agents-card:hover {
    border-color: var(--glass-border-bright);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.agents-card-icon {
    width: 36px;
    height: 36px;
    min-width: 36px;
    background: var(--aurora);
    color: #fff;
    border-radius: var(--radius-sm);
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.agents-card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-heading);
    margin: 12px 0 4px;
}

.agents-card-desc {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
}

.agents-card--disabled {
    opacity: 0.4;
    pointer-events: none;
    cursor: default;
}

/* -- Agents table -- */
.agents-table-section {
    max-width: 960px;
}

.agents-table-wrap {
    overflow-x: auto;
}

.agents-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.agents-table thead th {
    font-family: 'Sora', sans-serif;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-faint);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 8px 12px;
    border-bottom: 1px solid var(--glass-border);
}

.agents-table tbody td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--glass-border);
    color: var(--text-primary);
    vertical-align: middle;
}

.agents-table tbody tr:hover {
    background-color: var(--bg-glass-hover);
}

.agents-cell-name {
    font-weight: 600;
    color: var(--text-heading);
    white-space: nowrap;
}

.agents-cell-id {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 12px;
    color: var(--text-muted);
}

.agents-cell-desc {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-muted);
}

.agents-cell-none {
    color: var(--text-faint);
}

.agents-badge {
    display: inline-block;
    font-family: 'Sora', sans-serif;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 9999px;
}

.agents-badge--active {
    background-color: var(--green-dim);
    color: var(--green);
}

.agents-table-loading,
.agents-table-empty {
    font-size: 14px;
    color: var(--text-faint);
    font-style: italic;
    padding: 16px 0;
}

@media (max-width: 768px) {
    .agents-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .agents-page,
    .analytics-page {
        padding: 20px 16px;
    }

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

/* ===== Analytics Page ===== */
.analytics-page {
    display: flex;
    flex-direction: column;
    padding: 32px;
    gap: 32px;
}

.analytics-hero {
    max-width: 720px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.analytics-hero-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 16px;
}

.analytics-hero-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
    background: var(--aurora);
    color: #fff;
    border-radius: var(--radius);
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.analytics-hero-title {
    font-family: 'Sora', sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: var(--text-heading);
    margin: 0;
}

.analytics-hero-desc {
    font-size: 15px;
    color: var(--text-muted);
    line-height: 1.6;
    max-width: 600px;
    margin: 0;
}

.analytics-sso-hint {
    font-size: 13px;
    color: var(--text-muted);
    font-style: italic;
    margin: 0;
}

.analytics-launch-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--aurora);
    background-size: 200% 200%;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: all 0.3s;
    width: fit-content;
}

.analytics-launch-btn:hover {
    background-position: 100% 0;
    transform: translateY(-1px);
    box-shadow: 0 4px 24px rgba(139, 92, 246, 0.3);
}

.analytics-stats-bar {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .analytics-stats-bar {
        flex-direction: column;
    }
}

/* ===== Animations ===== */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
