/* ============================================
   AnalystHub - Premium Design System v2
   ============================================ */

/* === Design Tokens === */
:root {
    /* Surfaces */
    --bg-primary: #fafbfe;
    --bg-secondary: #f1f3f9;
    --bg-card: #ffffff;
    --bg-glass: rgba(255, 255, 255, 0.75);
    --bg-elevated: #ffffff;

    /* Text */
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --text-tertiary: #94a3b8;
    --text-inverse: #ffffff;

    /* Brand */
    --brand-primary: #6366f1;
    --brand-secondary: #8b5cf6;
    --brand-light: rgba(99, 102, 241, 0.08);
    --brand-lighter: rgba(99, 102, 241, 0.04);
    --brand-glow: rgba(99, 102, 241, 0.2);

    /* Accents */
    --emerald: #10b981;
    --emerald-bg: rgba(16, 185, 129, 0.08);
    --amber: #f59e0b;
    --amber-bg: rgba(245, 158, 11, 0.08);
    --sky: #0ea5e9;
    --sky-bg: rgba(14, 165, 233, 0.08);
    --rose: #f43f5e;
    --rose-bg: rgba(244, 63, 94, 0.08);
    --violet: #8b5cf6;
    --violet-bg: rgba(139, 92, 246, 0.08);

    /* Borders & Shadows */
    --border: rgba(0, 0, 0, 0.06);
    --border-hover: rgba(99, 102, 241, 0.3);
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.02);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.06), 0 2px 4px rgba(0,0,0,0.02);
    --shadow-lg: 0 12px 32px rgba(0,0,0,0.08), 0 4px 8px rgba(0,0,0,0.02);
    --shadow-brand: 0 4px 16px rgba(99, 102, 241, 0.2);

    /* Spacing & Radius */
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    /* Typography */
    --font: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

    /* Animation */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --duration: 0.2s;

    /* Gradients */
    --gradient-brand: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a78bfa 100%);
    --gradient-hero: linear-gradient(135deg, #1e1b4b 0%, #312e81 30%, #4338ca 60%, #6366f1 100%);
    --gradient-subtle: linear-gradient(180deg, #f0f1ff 0%, #fafbfe 100%);
}

[data-theme="dark"] {
    --bg-primary: #0b0d17;
    --bg-secondary: #111427;
    --bg-card: #161a30;
    --bg-glass: rgba(22, 26, 48, 0.85);
    --bg-elevated: #1c2040;

    --text-primary: #e8eaf0;
    --text-secondary: #94a3b8;
    --text-tertiary: #64748b;

    --brand-primary: #818cf8;
    --brand-secondary: #a78bfa;
    --brand-light: rgba(129, 140, 248, 0.12);
    --brand-lighter: rgba(129, 140, 248, 0.06);
    --brand-glow: rgba(129, 140, 248, 0.2);

    --emerald-bg: rgba(16, 185, 129, 0.12);
    --amber-bg: rgba(245, 158, 11, 0.12);
    --sky-bg: rgba(14, 165, 233, 0.12);
    --rose-bg: rgba(244, 63, 94, 0.12);
    --violet-bg: rgba(139, 92, 246, 0.12);

    --border: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(129, 140, 248, 0.3);
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.2);
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.2);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.25);
    --shadow-lg: 0 12px 32px rgba(0,0,0,0.3);
    --shadow-brand: 0 4px 16px rgba(129, 140, 248, 0.15);

    --gradient-hero: linear-gradient(135deg, #0b0d17 0%, #161a30 30%, #1e1b4b 60%, #312e81 100%);
    --gradient-subtle: linear-gradient(180deg, #0f1225 0%, #0b0d17 100%);
}

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

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* === Header === */
.header {
    background: var(--bg-glass);
    backdrop-filter: blur(24px) saturate(1.4);
    -webkit-backdrop-filter: blur(24px) saturate(1.4);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.9rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-mark {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--gradient-brand);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 800;
    font-size: 1.1rem;
    box-shadow: var(--shadow-brand);
    flex-shrink: 0;
}

.logo-mark.sm {
    width: 28px;
    height: 28px;
    font-size: 0.85rem;
    border-radius: 8px;
}

.logo {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.subtitle {
    font-size: 0.72rem;
    color: var(--text-tertiary);
    letter-spacing: 0.3px;
    text-transform: uppercase;
    font-weight: 500;
}

.theme-toggle {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all var(--duration) var(--ease);
    flex-shrink: 0;
}

.theme-toggle:hover {
    background: var(--brand-light);
    color: var(--brand-primary);
    border-color: var(--border-hover);
}

.icon-sun { display: none; }
.icon-moon { display: block; }
[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }

/* === Nav === */
.nav {
    border-top: 1px solid var(--border);
}

.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    gap: 0.25rem;
    overflow-x: auto;
    scrollbar-width: none;
}

.nav-inner::-webkit-scrollbar { display: none; }

.nav-link {
    padding: 0.65rem 1rem;
    text-decoration: none;
    color: var(--text-tertiary);
    font-size: 0.84rem;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    transition: all var(--duration) var(--ease);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.nav-link svg {
    opacity: 0.5;
    transition: opacity var(--duration) var(--ease);
}

.nav-link:hover { color: var(--brand-primary); }
.nav-link:hover svg { opacity: 0.8; }

.nav-link.active {
    color: var(--brand-primary);
    border-bottom-color: var(--brand-primary);
    font-weight: 600;
}

.nav-link.active svg { opacity: 1; }

/* === Hero === */
.hero {
    background: var(--gradient-hero);
    color: white;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 80% 20%, rgba(139, 92, 246, 0.3) 0%, transparent 60%),
                radial-gradient(ellipse at 20% 80%, rgba(99, 102, 241, 0.2) 0%, transparent 60%);
    pointer-events: none;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
}

.hero-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3.5rem 2rem 3rem;
    position: relative;
    display: flex;
    align-items: center;
    gap: 3rem;
}

.hero-content { flex: 1; }

.hero-badge {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.15);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    margin-bottom: 1rem;
    backdrop-filter: blur(8px);
}

.hero-title {
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.5px;
    margin-bottom: 0.8rem;
}

.hero-title span {
    background: linear-gradient(135deg, #c7d2fe, #a5b4fc, #e9d5ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-desc {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.7;
    max-width: 520px;
}

.hero-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
    flex-shrink: 0;
}

.stat-card {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius);
    padding: 1.2rem 1.4rem;
    backdrop-filter: blur(12px);
    text-align: center;
    min-width: 120px;
    transition: all 0.3s var(--ease);
}

.stat-card:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-2px);
}

.stat-number {
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 0.25rem;
    background: linear-gradient(135deg, #fff, #c7d2fe);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.55);
    font-weight: 500;
    letter-spacing: 0.3px;
}

/* === Main === */
.main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2.5rem 2rem 3rem;
    width: 100%;
    flex: 1;
}

.tab-content {
    display: none;
    animation: slideUp 0.35s var(--ease);
}

.tab-content.active { display: block; }

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

/* === Section Headers === */
.section-header {
    margin-bottom: 2rem;
    padding-bottom: 1.2rem;
    border-bottom: 1px solid var(--border);
}

.section-header h2 {
    font-size: 1.4rem;
    font-weight: 750;
    letter-spacing: -0.3px;
    color: var(--text-primary);
}

.section-desc {
    color: var(--text-secondary);
    font-size: 0.88rem;
    margin-top: 0.3rem;
}

/* === Cards === */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.4rem 1.6rem;
    box-shadow: var(--shadow-xs);
    transition: all 0.25s var(--ease);
    position: relative;
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
    border-color: var(--border-hover);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
    gap: 1rem;
}

/* === Glass Card === */
.glass-card {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

/* === Badges === */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.badge-level { background: var(--brand-light); color: var(--brand-primary); }
.badge-free { background: var(--emerald-bg); color: var(--emerald); }
.badge-paid { background: var(--amber-bg); color: var(--amber); }
.badge-remote { background: var(--sky-bg); color: var(--sky); }

/* === Timeline (Roadmap) === */
.timeline {
    position: relative;
    padding-left: 3.5rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 1rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom,
        var(--brand-primary),
        var(--brand-secondary),
        var(--emerald));
    border-radius: 2px;
    opacity: 0.4;
}

.timeline-item {
    position: relative;
    margin-bottom: 1.5rem;
}

.timeline-dot {
    position: absolute;
    left: -3.5rem;
    top: 1.3rem;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--gradient-brand);
    border: 3px solid var(--bg-primary);
    box-shadow: 0 0 0 3px var(--brand-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    color: white;
    font-weight: 700;
    z-index: 2;
}

.timeline-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.4rem 1.6rem;
    box-shadow: var(--shadow-xs);
    cursor: pointer;
    transition: all 0.25s var(--ease);
}

.timeline-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--border-hover);
}

.timeline-card h3 {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.15rem;
    color: var(--text-primary);
}

.timeline-card .role {
    color: var(--brand-primary);
    font-weight: 600;
    font-size: 0.88rem;
}

.timeline-card .skills {
    margin-top: 0.75rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.skill-tag {
    background: var(--brand-light);
    color: var(--brand-primary);
    padding: 0.2rem 0.55rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 550;
}

.timeline-details {
    display: none;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.75;
}

.timeline-details.open {
    display: block;
    animation: slideUp 0.25s var(--ease);
}

.timeline-details ul { padding-left: 1.2rem; margin: 0.4rem 0 0.8rem; }
.timeline-details li { margin-bottom: 0.25rem; }

.toggle-hint {
    margin-top: 0.7rem;
    font-size: 0.76rem;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: color var(--duration) var(--ease);
}

.toggle-hint:hover { color: var(--brand-primary); }

/* === Tip Card === */
.insight-tip {
    margin-top: 0.8rem;
    padding: 1rem 1.2rem;
    background: var(--brand-lighter);
    border: 1px solid var(--brand-light);
    border-radius: var(--radius);
    border-left: 3px solid var(--brand-primary);
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.65;
}

.data-source {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: -0.3rem;
}

.data-note {
    margin-top: 0.6rem;
    padding: 0.5rem 0.8rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    border-top: 1px dashed var(--border);
    line-height: 1.5;
}

/* === Filters === */
.filter-bar {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.filter-btn {
    padding: 0.42rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 550;
    transition: all var(--duration) var(--ease);
    box-shadow: var(--shadow-xs);
}

.filter-btn:hover {
    border-color: var(--border-hover);
    color: var(--brand-primary);
}

.filter-btn.active {
    background: var(--gradient-brand);
    color: white;
    border-color: transparent;
    box-shadow: var(--shadow-brand);
}

.search-input {
    padding: 0.42rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.84rem;
    font-family: var(--font);
    outline: none;
    width: 220px;
    transition: all var(--duration) var(--ease);
    box-shadow: var(--shadow-xs);
}

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

/* === Cert Cards === */
.cert-card h3 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
    color: var(--text-primary);
}

.cert-card .cert-org {
    color: var(--text-tertiary);
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
}

.cert-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin: 0.6rem 0;
    padding: 0.6rem 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.cert-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: var(--brand-primary);
    text-decoration: none;
    font-size: 0.84rem;
    font-weight: 600;
    transition: all var(--duration) var(--ease);
}

.cert-link:hover { color: var(--brand-secondary); gap: 0.5rem; }

/* === Resource Cards === */
.resource-card h3 {
    font-size: 0.92rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
    color: var(--text-primary);
}

.resource-card .resource-desc {
    color: var(--text-secondary);
    font-size: 0.84rem;
    margin: 0.35rem 0;
    line-height: 1.6;
}

.resource-tags {
    display: flex;
    gap: 0.3rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

/* === Insights === */
.insight-controls {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.insight-btn {
    padding: 0.6rem 1.2rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.86rem;
    font-weight: 550;
    font-family: var(--font);
    transition: all var(--duration) var(--ease);
    box-shadow: var(--shadow-xs);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.insight-btn:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-sm);
}

.insight-btn.active {
    background: var(--gradient-brand);
    color: white;
    border-color: transparent;
    box-shadow: var(--shadow-brand);
}

.insight-icon { font-size: 1rem; }

.insight-output {
    padding: 2rem;
    min-height: 350px;
}

.insight-loading {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-tertiary);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--brand-primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

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

.insight-chart { text-align: center; }
.insight-chart img {
    max-width: 100%;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.insight-stats {
    margin-top: 1.5rem;
    font-size: 0.9rem;
    line-height: 1.8;
}

.insight-stats h3 {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--brand-light);
    color: var(--text-primary);
}

.insight-stats ul { padding-left: 1.2rem; margin: 0.5rem 0; }
.insight-stats li { margin-bottom: 0.3rem; }

.insight-error {
    padding: 2rem;
    color: var(--rose);
    text-align: center;
    font-size: 0.9rem;
}

/* === ROI Table === */
.roi-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    font-size: 0.86rem;
}

.roi-table th {
    text-align: left;
    padding: 0.6rem 0.8rem;
    border-bottom: 2px solid var(--border);
    font-weight: 600;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.roi-table td {
    padding: 0.55rem 0.8rem;
    border-bottom: 1px solid var(--border);
}

.roi-table tr:hover td { background: var(--brand-lighter); }
.roi-table .center { text-align: center; }
.roi-table .td-gain { color: var(--emerald); font-weight: 600; }
.roi-table .td-bold { font-weight: 700; color: var(--brand-primary); }

/* === Status Bar === */
.status-bar {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    margin-bottom: 1rem;
    font-weight: 550;
}

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

.status-loading { background: var(--amber-bg); color: var(--amber); }
.status-loading .status-dot { background: var(--amber); animation: pulse 1.5s ease-in-out infinite; }
.status-ready { background: var(--emerald-bg); color: var(--emerald); }
.status-ready .status-dot { background: var(--emerald); }
.status-error { background: var(--rose-bg); color: var(--rose); }
.status-error .status-dot { background: var(--rose); }

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

/* === Pyodide Advanced Mode === */
.pyodide-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.pyodide-toggle {
    padding: 0.6rem 1.2rem;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.84rem;
    font-weight: 550;
    font-family: var(--font);
    transition: all var(--duration) var(--ease);
    width: 100%;
    text-align: center;
}

.pyodide-toggle:hover {
    border-color: var(--border-hover);
    color: var(--brand-primary);
    background: var(--brand-lighter);
}

.pyodide-toggle:disabled {
    cursor: wait;
    opacity: 0.8;
}

.pyodide-editor {
    width: 100%;
    margin-top: 1rem;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.84rem;
    line-height: 1.6;
    resize: vertical;
    outline: none;
    transition: border-color var(--duration) var(--ease);
}

.pyodide-editor:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px var(--brand-glow);
}

.pyodide-output {
    margin-top: 0.8rem;
    padding: 1rem;
    border-radius: var(--radius);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.8rem;
    line-height: 1.5;
    max-height: 400px;
    overflow: auto;
    white-space: pre-wrap;
    border: 1px solid var(--border);
}

/* === Footer === */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    margin-top: auto;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.footer p {
    color: var(--text-tertiary);
    font-size: 0.78rem;
}

.footer-copy {
    font-size: 0.72rem !important;
    margin-top: 0.25rem;
}

/* === Responsive === */
@media (max-width: 768px) {
    .header-inner { padding: 0.7rem 1.2rem; }
    .logo { font-size: 1.1rem; }
    .subtitle { display: none; }
    .nav-inner { padding: 0 1.2rem; gap: 0; }
    .nav-link { padding: 0.6rem 0.7rem; font-size: 0.8rem; }
    .nav-link svg { display: none; }

    .hero-inner {
        flex-direction: column;
        padding: 2.5rem 1.5rem 2rem;
        gap: 2rem;
    }
    .hero-title { font-size: 1.6rem; }
    .hero-stats { grid-template-columns: 1fr 1fr; width: 100%; }
    .stat-card { padding: 0.8rem 1rem; }
    .stat-number { font-size: 1.4rem; }

    .main { padding: 1.5rem 1.2rem; }
    .card-grid { grid-template-columns: 1fr; }
    .search-input { width: 100%; }
    .timeline { padding-left: 2.8rem; }
    .timeline-dot { left: -2.8rem; }
    .insight-output { padding: 1.2rem; }
    .section-header { margin-bottom: 1.5rem; padding-bottom: 1rem; }
}

@media (max-width: 480px) {
    .hero-stats { gap: 0.5rem; }
    .stat-card { padding: 0.7rem; min-width: auto; }
    .hero-badge { font-size: 0.6rem; }
}
