/* ============================================================
   ALPHABOX — DESIGN SYSTEM
   Matching AlphaBox Frontend Design Specification (Figma Make)
   ============================================================ */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Montserrat:wght@300;400;500;600;700;800;900&display=swap');

/* ---- THEME VARIABLES ---- */
:root {
    /* Core palette */
    --green: #198754;
    --green-dark: #146c43;
    --green-dim: #0d5132;
    --red: #ef4444;
    --amber: #f59e0b;
    --blue: #3b82f6;

    /* Light theme defaults */
    --bg-color: #f8fafc;
    --bg-subtle: #f1f5f9;
    --surface: #ffffff;
    --border-color: #e2e8f0;
    --text-primary: #0f172a;
    --text-muted: #64748b;
    --text-faint: #94a3b8;

    /* Header / nav */
    --header-bg: #ffffff;
    --header-border: #e2e8f0;
    --nav-active: #0f172a;
    --nav-text: #64748b;

    /* Ticker */
    --ticker-bg: #000000;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, .08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, .10);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, .12);

    /* Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Typography scale — benchmark: Builder "Strategy Configuration" .section-header */
    --font-xs: 10px;
    /* micro labels, badges, table col headers */
    --font-sm: 11px;
    /* section-header, sidebar nav, card headers */
    --font-base: 16px;
    /* body text = MS Word 12pt (96dpi: 1pt = 1.333px) */
    --font-md: 18px;
    /* sub-headings, card metric labels */
    --font-lg: 20px;
    /* page-level headings */
    --font-xl: 24px;
    /* large metric values */
}

[data-theme="dark"] {
    --bg-color: #0f172a;
    --bg-subtle: #1e293b;
    --surface: #1e293b;
    --border-color: #334155;
    --text-primary: #f1f5f9;
    --text-muted: #94a3b8;
    --text-faint: #64748b;
    --header-bg: #1e293b;
    --header-border: #334155;
    --nav-active: #f1f5f9;
    --nav-text: #94a3b8;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, .4);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, .5);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, .6);
}

/* ============================================================
   RESET & BASE
   ============================================================ */

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    font-family: 'Montserrat', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    -webkit-font-smoothing: antialiased;
}

#app-theme-wrapper {
    min-height: 100vh;
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: 'Montserrat', 'Inter', sans-serif;
    font-size: var(--font-base);
    transition: background-color 0.25s ease, color 0.25s ease;
}

/* ============================================================
   GLOBAL CONTENT FONT NORMALIZATION
   Benchmark: Builder's "Strategy Configuration" (.section-header)
   All body text = 13px, section titles = 11px uppercase 700
   ============================================================ */

/* Normalize paragraph and general text */
.insight-box p,
.insight-box li,
.insight-box label,
.insight-box .card-text {
    font-size: var(--font-base);
    line-height: 1.6;
}

/* Normalize table cells to match Builder table rows */
.insight-box td,
.insight-box th {
    font-size: var(--font-base);
}

/* Normalize Bootstrap card headers inside content */
.insight-box .card-header,
.insight-box .card-header.fw-bold,
.insight-box .card-header.bg-light {
    font-size: var(--font-sm);
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-primary);
}

/* Normalize h4 / h5 / h6 used in analysis/performance/intel tabs */
.insight-box h4,
.insight-box h4.fw-bold {
    font-size: var(--font-md);
    font-weight: 700;
    margin-bottom: 4px;
}

.insight-box h5,
.insight-box h5.fw-bold {
    font-size: var(--font-sm);
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.insight-box h6,
.insight-box h6.fw-bold {
    font-size: var(--font-sm);
    font-weight: 700;
    margin-bottom: 6px;
}

/* Small / muted helper text */
.insight-box .small,
.insight-box small {
    font-size: var(--font-xs);
}

/* Metric values inside cards (Sharpe, Return etc.) */
.insight-box .card-body h4 {
    font-size: var(--font-xl);
    font-weight: 800;
    line-height: 1.1;
}

/* Badge text */
.insight-box .badge {
    font-size: var(--font-xs);
    font-weight: 700;
    letter-spacing: 0.5px;
}


/* ============================================================
   HEADER
   ============================================================ */

.header-row {
    background-color: #f3f4f6;
    padding: 0 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--header-border);
    position: sticky;
    top: 0;
    z-index: 1000;
    height: 72px;
    transition: background-color 0.25s ease;
}

.header-left {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-center {
    flex: 2;
    display: flex;
    justify-content: center;
    align-items: center;
}

.header-right {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
}

/* Logo */
.logo-icon-img {
    height: 40px;
    width: 40px;
}

.alphabox-logo-text {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text-primary);
    margin: 0;
    line-height: 1;
}

/* Theme toggle */
.theme-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-family: 'Inter', sans-serif;
}

.theme-btn:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
    transform: scale(1.05);
}

/* Avatar */
.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--text-primary);
    color: var(--surface);
    font-size: 13px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-name-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

/* Logout button */
.logout-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 13px;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: 'Inter', sans-serif;
}

.logout-btn:hover {
    background-color: var(--bg-subtle);
    color: var(--red);
}

/* ============================================================
   TICKER BAR
   ============================================================ */

#DeltaScreen {
    background-color: #000000;
    overflow: hidden;
    white-space: nowrap;
    display: flex;
    height: 36px;
    align-items: center;
    width: 100%;
    position: relative;
    z-index: 10;
    border-bottom: 1px solid #1a1a1a;
}

@keyframes scrollText {
    0% {
        transform: translateX(0%);
    }

    100% {
        transform: translateX(-50%);
    }
}

.scrolling-text {
    display: inline-block;
    white-space: nowrap;
    animation: scrollText 180s linear infinite;
    padding-left: 20px;
}

.ticker-item {
    display: inline-block;
    margin-right: 48px;
    font-weight: 500;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: #ffffff;
}

/* ============================================================
   NAVIGATION TABS
   ============================================================ */

.nav-tabs {
    display: flex;
    justify-content: center;
    /* Shrink to fit tab content — no full-width grey bar */
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
    /* Drop down so it doesn't touch the ticker tape */
    margin-top: 10px !important;
    margin-bottom: 0;
    border: 1px solid #c8d3df !important;
    gap: 0;
    padding: 6px 14px;
    background-color: #dde4ed;
    position: sticky;
    top: 80px;
    z-index: 999;
    /* Fully rounded pill — all four corners */
    border-radius: 24px;
    /* Inset "hole" shadow — sunken look */
    box-shadow:
        inset 0 4px 10px rgba(0, 0, 0, 0.12),
        inset 0 1px 4px rgba(0, 0, 0, 0.08),
        0 2px 6px rgba(0, 0, 0, 0.06);
}

.nav-link {
    font-family: 'Montserrat', 'Inter', sans-serif;
    color: var(--nav-text) !important;
    font-weight: 600;
    font-size: 15px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    background-color: transparent !important;
    border: 1.5px solid transparent !important;
    border-radius: 100px !important;
    padding: 9px 22px !important;
    margin: 4px 3px !important;
    transition: color 0.15s ease, background-color 0.15s ease !important;
    white-space: nowrap;
}

.nav-link:hover {
    color: var(--nav-active) !important;
    border-color: var(--border-color) !important;
    background-color: var(--surface) !important;
}

.nav-link.active {
    color: var(--nav-active) !important;
    border: 1.5px solid var(--nav-active) !important;
    border-radius: 100px !important;
    background-color: var(--surface) !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

/* BUILDER tab: dotted border + bold weight (Figma spec) */
.nav-link.active[href="#builder"],
.main-tabs .nav-link:first-child.active,
#main-tabs li:first-child .nav-link.active {
    border-style: dashed !important;
    font-weight: 800 !important;
    letter-spacing: 1.5px !important;
}

.nav-link.disabled {
    color: var(--text-faint) !important;
    opacity: 0.45;
    pointer-events: none;
}

/* ============================================================
   MAIN CONTENT PANEL
   ============================================================ */

.insight-box {
    background-color: var(--bg-color);
    border-top: none;
    min-height: calc(100vh - 180px);
    padding: 0;
}

/* --- Section card (white rounded card holding tab content) --- */
.section-card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0;
    margin-bottom: 16px;
    overflow: hidden;
}

/* --- Centered uppercase section header (STRATEGY CONFIGURATION, PORTFOLIO COMPOSITION etc.) --- */
.section-card .section-header.main-section-header {
    text-align: center;
    font-size: 16px !important;
    font-weight: 700;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: var(--text-primary);
    padding: 10px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #e2e8f0;
}

/* Builder Saved Portfolios header: smaller than default section headers */
.section-card .section-header.main-section-header.saved-portfolios-header {
    font-size: 14px !important;
    letter-spacing: 1.8px;
}

/* Portfolio Table Header specifically (12px ALL CAPS) */
.portfolio-header-row div {
    font-size: 12px !important;
    text-transform: uppercase !important;
    font-weight: 700 !important;
}

.section-header-info {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    border: 1.5px solid var(--text-faint);
    color: var(--text-faint);
    font-size: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: help;
    flex-shrink: 0;
}

/* ============================================================
   CARDS
   ============================================================ */

.ab-card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 24px;
    transition: box-shadow 0.2s ease;
}

.ab-card:hover {
    box-shadow: var(--shadow-md);
}

/* Dashed border card (from design) */
.ab-card-dashed {
    background: var(--surface);
    border: 1.5px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
}

/* Metric cards (hero + dashboard) */
.metric-card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px 24px;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.metric-card .metric-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.metric-card .metric-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.1;
}

.metric-card .metric-value.positive {
    color: var(--green);
}

.metric-card .metric-value.negative {
    color: var(--red);
}

/* ============================================================
   HERO / LANDING PAGE
   ============================================================ */

.hero-wrapper {
    min-height: 100vh;
    background: linear-gradient(to bottom,
            rgba(0, 0, 0, 0.65) 0%,
            rgba(0, 0, 0, 0.45) 60%,
            rgba(0, 0, 0, 0.70) 100%),
        url('/assets/hero-bg.jpg') center center / cover no-repeat;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 24px 60px;
    text-align: center;
    color: white;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 100px;
    padding: 6px 18px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 28px;
    backdrop-filter: blur(8px);
}

.hero-badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--green);
    display: inline-block;
}

.hero-headline {
    font-size: clamp(36px, 5vw, 58px);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -1px;
    margin: 0 0 16px;
    color: white;
}

.hero-headline .highlight {
    color: var(--green);
    display: block;
}

.hero-subtitle {
    font-size: 16px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.7);
    max-width: 560px;
    margin: 0 auto 20px;
    line-height: 1.6;
}

.hero-powered {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 1px;
    margin-top: 16px;
    font-style: italic;
}

.hero-cta {
    background: white;
    color: #0f172a;
    border: none;
    border-radius: 100px;
    padding: 14px 36px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Montserrat', 'Inter', sans-serif;
    margin-top: 32px;
    display: inline-block;
    text-decoration: none;
}

.hero-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

/* Terminal widget on hero */
.terminal-widget {
    background: #0d1117;
    border-radius: var(--radius-lg);
    border: 1px solid #30363d;
    width: 100%;
    max-width: 520px;
    margin: 40px auto 0;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
    text-align: left;
}

.terminal-topbar {
    background: #161b22;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid #30363d;
}

.terminal-circle {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.tc-red {
    background: #ff5f57;
}

.tc-yellow {
    background: #febc2e;
}

.tc-green {
    background: #28c840;
}

.terminal-title {
    font-size: 11px;
    color: #6e7681;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    margin-left: 8px;
}

.terminal-body {
    padding: 18px 20px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.7;
    color: #c9d1d9;
    min-height: 140px;
}

.terminal-line-green {
    color: #198754;
}

.terminal-line-dim {
    color: #6e7681;
}

.terminal-prompt {
    color: #58a6ff;
}

/* Typing cursor */
@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

.cursor {
    display: inline-block;
    width: 8px;
    height: 14px;
    background: #198754;
    animation: blink 1s ease infinite;
    vertical-align: text-bottom;
    margin-left: 2px;
}

/* ============================================================
   TERMINAL WIDGET EXTRAS (Figma match)
   ============================================================ */

.terminal-optimizing-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #198754;
    color: white;
    border: none;
    border-radius: 100px;
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 700;
    font-family: 'Montserrat', 'Inter', sans-serif;
    letter-spacing: 0.3px;
    cursor: default;
    margin: 12px 0 14px;
}

.terminal-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: white;
    border-radius: 50%;
    display: inline-block;
    animation: term-spin 0.8s linear infinite;
    flex-shrink: 0;
}

@keyframes term-spin {
    to {
        transform: rotate(360deg);
    }
}

.terminal-status-line {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Courier New', monospace;
    font-size: 12.5px;
    color: #198754;
    line-height: 1.8;
}

.terminal-status-spinner {
    width: 12px;
    height: 12px;
    border: 1.5px solid rgba(25, 135, 84, 0.3);
    border-top-color: #198754;
    border-radius: 50%;
    display: inline-block;
    animation: term-spin 1.1s linear infinite;
    flex-shrink: 0;
}

/* Hero metric cards — Figma variant (dark semi-transparent) */
.hero-metric-card {
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 18px 20px;
    text-align: left;
    backdrop-filter: blur(8px);
    flex: 1;
    min-width: 140px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hero-metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.4);
}

.hero-metric-icon {
    font-size: 14px;
    margin-bottom: 8px;
    opacity: 0.7;
}

.hero-metric-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
    margin-bottom: 6px;
    font-family: 'Montserrat', sans-serif;
}

.hero-metric-value {
    font-size: 26px;
    font-weight: 800;
    line-height: 1.1;
    font-family: 'Montserrat', sans-serif;
}

.hero-metric-value.green {
    color: #198754;
}

.hero-metric-value.orange {
    color: #fd7e14;
}

.hero-metric-value.red {
    color: #dc3545;
}

.hero-metric-cards-row {
    display: flex;
    gap: 14px;
    width: 100%;
    max-width: 520px;
    margin: 28px auto 0;
    flex-wrap: wrap;
}

/* Ensure dashboard metric cards also get fixed colors */
.metric-card .metric-value.orange {
    color: #fd7e14;
}

/* Home panel overlay (login screen) */
.home-panel {
    position: fixed;
    inset: 0;
    z-index: 2000;
    overflow-y: auto;
    background-image: url('/assets/atlanta_skyline.png');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
}

/* Hero / landing panel overlay (shown first on app load) */
.hero-panel {
    position: fixed;
    inset: 0;
    z-index: 1900;
    overflow: hidden;
    background-image: url('/assets/atlanta_skyline.png');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
}

.hero-terminal-title-bar {
    font-family: 'Montserrat', 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 600;
    color: #6e7681;
    letter-spacing: 0.5px;
}

.hero-terminal-shell {
    position: relative;
    width: 100%;
    max-width: 820px;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    background: linear-gradient(180deg, rgba(2, 6, 23, 0.92), rgba(3, 7, 18, 0.84));
    box-shadow: 0 18px 55px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.03);
    overflow: hidden;
    text-align: left;
}

.hero-terminal-shell::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 0%, rgba(59, 130, 246, 0.09), transparent 45%),
        radial-gradient(circle at 80% 100%, rgba(34, 197, 94, 0.07), transparent 40%);
    pointer-events: none;
}

.hero-terminal-scanlines {
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0.015) 0px,
        rgba(255, 255, 255, 0.015) 1px,
        rgba(0, 0, 0, 0) 2px,
        rgba(0, 0, 0, 0) 4px
    );
    opacity: 0.55;
    pointer-events: none;
}

.hero-terminal-title {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(15, 23, 42, 0.55);
}

.hero-terminal-dots {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.hero-terminal-dots .dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    display: inline-block;
}

.hero-terminal-dots .dot.red { background: #ff4d5a; }
.hero-terminal-dots .dot.amber { background: #ffb020; }
.hero-terminal-dots .dot.green { background: #22c55e; }

.hero-terminal-chip {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.2px;
    color: #34d399;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(52, 211, 153, 0.25);
    border-radius: 999px;
    padding: 2px 8px;
    font-family: 'Inter', sans-serif;
}

.hero-terminal-body {
    position: relative;
    z-index: 1;
    padding: 14px 16px 16px;
    color: #dbe7ff;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
    font-size: 12px;
    line-height: 1.55;
    min-height: 150px;
}

.hero-stage {
    opacity: 0;
    transform: translateY(10px);
    animation: heroStageFade 0.5s ease forwards;
}

.hero-stage-1 { animation-delay: 0.15s; }
.hero-stage-4 { animation-delay: 1.85s; }
.hero-stage-5 { animation-delay: 2.35s; }
.hero-stage-7 { animation-delay: 6.05s; }

.hero-powered-copy.hero-stage-4 { animation-delay: 3.1s; }

.hero-headline {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin: 0;
}

.hero-headline-line {
    display: block;
    overflow: hidden;
    white-space: nowrap;
    max-width: 0;
    opacity: 0;
    animation: heroLineType 1.0s steps(30, end) forwards;
}

.hero-headline-line-1 {
    color: #fff;
    animation-delay: 0.45s;
}

.hero-headline-line-2 {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    animation-delay: 1.15s;
}

.hero-headline-line-2 .highlight {
    color: #22c55e;
}

.hero-headline-cursor {
    display: inline-block;
    width: 4px;
    height: 1.05em;
    background: #22c55e;
    margin-left: 4px;
    vertical-align: middle;
    animation: blink 0.95s steps(1, end) infinite;
}

.hero-term-line {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 2px 0;
}

.hero-term-prompt {
    margin-bottom: 7px;
    font-size: 11px;
}

.hero-term-user {
    color: #22c55e;
    font-weight: 700;
}

.hero-term-type {
    display: inline-block;
    max-width: 0;
    overflow: hidden;
    vertical-align: bottom;
    animation: heroType 2.1s steps(52, end) 2.65s forwards;
}

.hero-term-cursor {
    display: inline-block;
    width: 8px;
    height: 18px;
    background: rgba(255, 255, 255, 0.9);
    vertical-align: text-bottom;
    margin-left: 2px;
    animation: blink 0.9s steps(1, end) infinite;
}

.hero-term-tag {
    font-weight: 800;
}

.hero-term-tag.info { color: #60a5fa; }
.hero-term-tag.run { color: #fbbf24; }
.hero-term-tag.ok  { color: #34d399; }

.hero-terminal-body .reveal-1,
.hero-terminal-body .reveal-2,
.hero-terminal-body .reveal-3,
.hero-terminal-body .reveal-4,
.hero-terminal-body .reveal-5 {
    opacity: 0;
    transform: translateY(4px);
    animation: heroRevealLine 0.45s ease forwards;
}

.hero-terminal-body .reveal-1 { animation-delay: 4.85s; }
.hero-terminal-body .reveal-2 { animation-delay: 5.15s; }
.hero-terminal-body .reveal-3 { animation-delay: 5.45s; }
.hero-terminal-body .reveal-4 { animation-delay: 5.75s; }
.hero-terminal-body .reveal-5 { animation-delay: 6.05s; }

.hero-terminal-body::before {
    content: 'Optimizing...';
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    padding: 6px 14px 6px 32px;
    margin: 6px 0 8px;
    border-radius: 12px;
    font-family: 'Montserrat', 'Inter', sans-serif;
    font-size: 10px;
    font-weight: 700;
    color: #86efac;
    background: linear-gradient(180deg, rgba(22, 163, 74, 0.92), rgba(22, 163, 74, 0.70));
    border: 1px solid rgba(134, 239, 172, 0.15);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.1);
    opacity: 0;
    transform: translateY(6px);
    animation: heroStageFade 0.35s ease 4.45s forwards;
}

.hero-terminal-body::after {
    content: '';
    position: absolute;
    left: 24px;
    top: 22px;
    width: 12px;
    height: 12px;
    border: 2px solid rgba(255,255,255,0.55);
    border-top-color: transparent;
    border-radius: 50%;
    opacity: 0;
    animation: heroSpinner 0.8s linear infinite, heroStageFade 0.2s ease 4.45s forwards;
    z-index: 2;
    pointer-events: none;
}

.hero-metric-row {
    width: 100%;
    max-width: 860px;
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px !important;
}

.hero-metric-card {
    min-width: 0;
}

.hero-metric-card > div:first-child {
    font-size: 11px !important;
}

.hero-metric-card > div:last-child {
    font-size: clamp(20px, 2vw, 28px) !important;
}

.hero-metric-row .hero-metric-card {
    opacity: 0;
    transform: translateY(12px);
    animation: heroMetricIn 0.45s ease forwards;
}

.hero-metric-row .hero-metric-card:nth-child(1) { animation-delay: 6.15s; }
.hero-metric-row .hero-metric-card:nth-child(2) { animation-delay: 6.35s; }
.hero-metric-row .hero-metric-card:nth-child(3) { animation-delay: 6.55s; }
.hero-metric-row .hero-metric-card:nth-child(4) { animation-delay: 6.75s; }

@keyframes heroType {
    from { max-width: 0; }
    to { max-width: 55ch; }
}

@keyframes heroLineType {
    from {
        max-width: 0;
        opacity: 1;
    }
    to {
        max-width: 34ch;
        opacity: 1;
    }
}

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

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

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

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

@media (max-height: 860px) {
    .hero-viewport-content {
        padding-top: 22px !important;
        padding-bottom: 18px !important;
        gap: 10px !important;
    }
    .hero-terminal-shell {
        max-width: 760px;
    }
    .hero-terminal-body {
        min-height: 132px;
        font-size: 12px;
        line-height: 1.45;
    }
    .hero-terminal-body::before {
        margin-top: 6px;
        margin-bottom: 8px;
    }
}

@media (max-width: 980px) {
    .hero-metric-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        max-width: 620px;
    }
    .hero-terminal-shell {
        max-width: 94vw;
    }
    .hero-terminal-title {
        grid-template-columns: auto 1fr;
    }
    .hero-terminal-chip {
        display: none;
    }
    .hero-headline-line {
        white-space: normal;
        max-width: none;
        opacity: 1;
        animation: none;
    }
    .hero-headline {
        gap: 2px;
    }
}

@media (max-width: 640px) {
    .hero-terminal-body {
        font-size: 11px;
        min-height: 124px;
        padding: 12px 12px 14px;
    }
    .hero-term-line {
        margin: 2px 0;
    }
    .hero-term-prompt {
        white-space: normal;
        text-overflow: clip;
    }
    .hero-term-type {
        white-space: normal;
        animation: none;
        max-width: none;
    }
    .hero-term-cursor {
        display: none;
    }
    .hero-terminal-body::after {
        display: none;
    }
}

/* ============================================================
   LOGIN / SIGNUP PAGES
   ============================================================ */

/* Login background image (fills the fixed home-panel) */
.login-bg-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* Semi-transparent dark overlay on top of the image */
.login-bg-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.52);
}

/* Wrapper that centres the card above image + overlay */
.login-card-wrapper {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
}

.login-logo-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 4px;
}

.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    position: relative;
}

.auth-wrapper::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.50);
}

.auth-card {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-xl);
    padding: 48px 40px;
    width: 100%;
    max-width: 440px;
    position: relative;
    z-index: 1;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.3);
}

.auth-logo {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo img {
    height: 48px;
    display: inline-block;
    transform: scale(1.8);
    transform-origin: center bottom;
}

.auth-title {
    font-size: 22px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 4px;
    text-align: center;
}

.auth-subtitle {
    font-size: 14px;
    color: #64748b;
    text-align: center;
    margin: 0 0 28px;
}

.auth-label {
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
    display: block;
    margin-bottom: 6px;
}

.auth-input {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    color: #0f172a;
    background: #f8fafc;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
    margin-bottom: 16px;
}

.auth-input:focus {
    border-color: #0f172a;
    box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.08);
    background: white;
}

.auth-btn-primary {
    width: 100%;
    padding: 13px;
    background: #0f172a;
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s ease;
    margin-top: 8px;
}

.auth-btn-primary:hover {
    background: #1e293b;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.25);
}

.auth-divider {
    text-align: center;
    position: relative;
    margin: 20px 0;
    color: #94a3b8;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: calc(50% - 60px);
    height: 1px;
    background: #e2e8f0;
}

.auth-divider::before {
    left: 0;
}

.auth-divider::after {
    right: 0;
}

.auth-btn-google {
    width: 100%;
    padding: 11px;
    background: white;
    color: #0f172a;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s ease;
}

.auth-btn-google:hover {
    border-color: #94a3b8;
    box-shadow: var(--shadow-sm);
}

.auth-footer-link {
    text-align: center;
    font-size: 13px;
    color: #64748b;
    margin-top: 20px;
}

.auth-footer-link a {
    color: #0f172a;
    font-weight: 700;
    text-decoration: none;
}

/* ============================================================
   BUILDER TAB
   ============================================================ */

.portfolio-table-header {
    display: grid;
    grid-template-columns: 1fr 1fr 1.5fr 0.7fr 0.7fr 0.7fr 0.7fr 40px;
    gap: 8px;
    padding: 10px 12px;
    background: var(--bg-subtle);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--text-muted);
}

.portfolio-valid-banner {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: var(--radius-md);
    padding: 12px 20px;
    font-size: 13px;
    font-weight: 600;
    color: var(--green-dark);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
}

[data-theme="dark"] .portfolio-valid-banner {
    background: #052e16;
    border-color: #166534;
    color: var(--green);
}

/* ============================================================
   ANALYSIS TAB — left sidebar layout
   ============================================================ */

.analysis-layout {
    display: flex;
    gap: 18px;
    min-height: 500px;
    align-items: flex-start;
}

.analysis-sticky-header-wrap {
    position: sticky;
    top: 168px;
    z-index: 20;
    background: #ffffff;
    padding-top: 6px;
    padding-bottom: 8px;
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.05);
}

.analysis-sticky-header-wrap #analysis-summary-banner .card,
.analysis-sticky-header-wrap #analysis-summary-banner .shadow-sm {
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06) !important;
}

.analysis-sticky-header-wrap #analysis-summary-banner h6 {
    font-size: 0.95rem !important;
}

.analysis-sticky-header-wrap #analysis-summary-banner h4 {
    font-size: 1.35rem !important;
}

.analysis-sidebar {
    width: 220px;
    flex-shrink: 0;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: #f8fafc;
    overflow: hidden;
}

.analysis-sidebar-title {
    padding: 14px 16px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    background: #eef2f7;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.analysis-sidebar-item {
    display: block;
    padding: 11px 16px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: var(--text-primary);
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    transition: all 0.15s ease;
    font-family: 'Inter', sans-serif;
    border-left: 3px solid transparent;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.analysis-sidebar-item:hover {
    color: var(--text-primary);
    background: #f1f5f9;
}

.analysis-sidebar-item.active {
    color: var(--text-primary);
    border-left-color: var(--text-primary);
    background: white;
    font-weight: 700;
}

.analysis-main {
    flex: 1;
    padding: 0;
    min-width: 0;
}

.analysis-section-title {
    font-size: var(--font-sm);
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-primary);
    margin: 0 0 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

/* ============================================================
   INTEL TAB — country card
   ============================================================ */

.intel-country-card {
    display: flex;
    border: 1.5px dashed var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--surface);
    max-width: 840px;
    margin: 0 auto;
    box-shadow: var(--shadow-md);
}

.intel-country-photo {
    flex: 0 0 42%;
    position: relative;
    min-height: 400px;
    overflow: hidden;
}

.intel-country-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(100%);
}

.intel-country-photo-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.75) 0%, transparent 100%);
    color: white;
}

.intel-country-photo-caption .caption-title {
    font-size: 9px;
    letter-spacing: 1px;
    opacity: 0.7;
    text-transform: uppercase;
}

.intel-country-photo-caption .caption-name {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
    margin-top: 2px;
}

.intel-country-data {
    flex: 1;
    padding: 28px 32px;
}

.intel-country-name {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.intel-country-flag-code {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 2px 6px;
}

.intel-country-divider {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 12px 0 16px;
}

.intel-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
}

.intel-stat-row:last-child {
    border-bottom: none;
}

.intel-stat-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-muted);
}

.intel-stat-value {
    font-weight: 600;
    color: var(--text-primary);
    text-align: right;
}

.intel-stat-value.amber {
    color: var(--amber);
}

.intel-stat-value.green {
    color: var(--green);
}

.intel-stat-value.red {
    color: var(--red);
}

.intel-did-you-know {
    margin-top: 20px;
    background: var(--bg-subtle);
    border-radius: var(--radius-md);
    padding: 14px 16px;
}

.intel-did-you-know-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.intel-did-you-know-text {
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.6;
}

.intel-progress-bar-wrap {
    margin-top: 16px;
    background: var(--bg-subtle);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    padding: 14px 24px;
    font-size: 10px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 10px;
}

.intel-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
    flex-shrink: 0;
    animation: pulse 2s ease infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(0.85);
    }
}

/* ============================================================
   ABOUT TAB
   ============================================================ */

.about-hero-banner {
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
}

.about-hero-banner img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* opacity set inline per-instance */
}

.about-hero-text {
    position: relative;
    z-index: 1;
    text-align: center;
    color: white;
    padding: 40px 24px;
    font-family: 'Montserrat', 'Inter', sans-serif;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
}

#analysis-sub-content .analysis-table-card {
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: transparent;
    box-shadow: none !important;
}

#analysis-sub-content .analysis-table-card > .card-header {
    background: #f8fafc !important;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

#analysis-sub-content .analysis-table-card > .card-body {
    background: transparent;
    padding: 12px 14px;
}

#analysis-sub-content,
#analysis-sub-content .card-body {
    font-size: 15px;
    line-height: 1.55;
}

#analysis-sub-content p,
#analysis-sub-content li,
#analysis-sub-content td,
#analysis-sub-content th,
#analysis-sub-content .small,
#analysis-sub-content small,
#analysis-sub-content .text-muted {
    font-size: 14px !important;
    line-height: 1.55;
}

#analysis-sub-content h6 {
    font-size: 17px;
}

#analysis-sub-content ul {
    padding-left: 1.15rem;
}

.analysis-risk-badges {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.analysis-risk-badge {
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 10px;
    background: #fff;
    padding: 8px 10px;
}

.analysis-risk-badge-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.analysis-risk-badge-value {
    font-weight: 700;
    color: var(--text-primary);
}

.analysis-risk-theme-card {
    border: 1px dashed rgba(100, 116, 139, 0.55);
    box-shadow: none !important;
}

.analysis-risk-theme-card .card-header {
    background: #f8fafc !important;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
    gap: 8px;
}

@media (max-width: 992px) {
    .analysis-sticky-header-wrap {
        top: 146px;
        padding-top: 4px;
    }

    .analysis-layout {
        flex-direction: column;
        gap: 12px;
    }

    .analysis-sidebar {
        width: 100%;
    }

    .analysis-sidebar-item {
        font-size: 11px;
    }
}

.about-hero-text h1 {
    font-size: 42px;
    font-weight: 800;
    margin: 0 0 8px;
    letter-spacing: -0.5px;
    font-family: 'Montserrat', 'Inter', sans-serif;
}

.about-hero-text p {
    font-size: 18px;
    opacity: 0.9;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 300;
    font-family: 'Montserrat', 'Inter', sans-serif;
    margin: 0 0 16px;
}

.about-hero-text .built-by {
    font-size: 14px;
    opacity: 0.95;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    letter-spacing: 0.5px;
    text-transform: none;
    font-weight: 400;
}

/* About hero: force all visible text to white for image contrast */
.about-hero-text h1,
.about-hero-text p,
.about-hero-text .built-by,
.about-hero-text .built-by span {
    color: #ffffff !important;
    opacity: 1 !important;
    font-weight: 700 !important;
}

/* Force compact numeric text in Builder inputs (Bootstrap can override inline styles) */
#investment-amount,
#time-horizon-input,
#weight-equities,
#weight-etfs,
#weight-bonds,
#weight-derivatives {
    font-size: 15px !important;
}

.about-stat-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.about-stat-card {
    background: var(--surface);
    border: 1.5px dashed rgba(15, 23, 42, 0.55);
    border-radius: var(--radius-lg);
    padding: 28px 20px;
    text-align: center;
}

.about-stat-card .stat-icon {
    font-size: 20px;
    margin-bottom: 12px;
    color: var(--text-primary);
    font-weight: 700;
    line-height: 1;
}

/* Hide legacy placeholder symbol icons in About stat cards */
.about-stat-cards .about-stat-card > .stat-icon {
    display: none;
}

/* New stat card icons (monochrome line icons, screenshot-style) */
.about-stat-card .stat-icon-v2 {
    width: 36px;
    height: 36px;
    margin: 0 auto 14px;
    border-radius: 10px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    line-height: 1;
}

.about-stat-card .stat-icon-v2 i {
    font-size: 18px;
    line-height: 1;
}

.about-stat-card .stat-number {
    font-size: 32px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 6px;
}

.about-stat-card .stat-number {
    font-family: 'Montserrat', 'Inter', sans-serif;
}

.about-stat-card .stat-label {
    font-size: 10px;
    font-family: 'Montserrat', 'Inter', sans-serif;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* ============================================================
   ABOUT PANEL — font normalization
   ============================================================ */

#panel-about .about-panel-card {
    border: 1px solid #e2e8f0 !important;
    border-radius: 16px !important;
}

#panel-about .about-info-card .card-body {
    display: block;
}

#panel-about .about-info-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

#panel-about .about-info-title-icon {
    width: 40px !important;
    height: 40px !important;
    background: #f3f4f6 !important;
    border: 1px solid #e5e7eb;
    border-radius: 12px !important;
}

#panel-about .about-info-title {
    font-family: 'Montserrat', 'Inter', sans-serif !important;
    font-size: 17px !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    margin: 0 !important;
}

#panel-about .about-info-body-card {
    border-radius: 14px !important;
    border: 1px solid #e2e8f0 !important;
    background: #f8fafc !important;
    box-shadow: none !important;
}

#panel-about .about-info-body-text {
    font-family: 'Montserrat', 'Inter', sans-serif !important;
    font-size: 14px !important;
    line-height: 1.7 !important;
    color: #334155 !important;
    margin: 0 !important;
}

#panel-about .about-info-body-text strong {
    font-size: 14px !important;
    letter-spacing: 0 !important;
    color: #0f172a !important;
}

#panel-about .about-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    color: #0f172a;
    font-family: 'Montserrat', 'Inter', sans-serif;
    font-size: 17px;
    font-weight: 700;
}

#panel-about .about-section-title i {
    color: #6b7280;
    font-size: 18px;
    line-height: 1;
}

#panel-about .about-platform-card .card-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 34px;
    align-items: start;
}

#panel-about .about-platform-card .about-section-title {
    grid-column: 1 / -1;
    margin-bottom: 2px;
}

#panel-about .about-module-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 10px 0 8px;
    margin: 0;
}

#panel-about .about-module-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: #f3f4f6;
    border: 1px solid #eceff3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    flex-shrink: 0;
}

#panel-about .about-module-icon i {
    font-size: 18px;
    line-height: 1;
}

#panel-about .about-module-name {
    font-family: 'Montserrat', 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 4px;
}

#panel-about .about-module-desc {
    font-family: 'Montserrat', 'Inter', sans-serif;
    font-size: 12px;
    line-height: 1.45;
    color: #334155;
}

#panel-about .about-platform-card .about-module-item:last-child {
    grid-column: 1 / 2;
}

#panel-about .about-tech-card .about-tech-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 14px;
}

#panel-about .about-tech-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 14px 16px 12px;
    min-height: 128px;
}

#panel-about .about-tech-box-title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #0f172a;
    font-family: 'Montserrat', 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 10px;
}

#panel-about .about-tech-box-title i {
    color: #6b7280;
    font-size: 15px;
}

#panel-about .about-tech-list {
    margin: 0;
    padding-left: 16px;
    color: #334155;
    font-family: 'Montserrat', 'Inter', sans-serif;
    font-size: 11px;
    line-height: 1.55;
}

#panel-about .about-tech-libraries {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 14px 16px;
}

#panel-about .about-tech-libraries-title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #0f172a;
    font-family: 'Montserrat', 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 8px;
}

#panel-about .about-tech-libraries-title i {
    color: #6b7280;
    font-size: 15px;
}

#panel-about .about-tech-libraries-text {
    font-family: 'Montserrat', 'Inter', sans-serif;
    font-size: 12px;
    line-height: 1.5;
    color: #334155;
}

#panel-about .about-tech-card .about-tech-libraries ~ p {
    display: none !important;
}

#panel-about .about-tech-card .card-body {
    padding-top: 24px !important;
}

@media (max-width: 992px) {
    #panel-about .about-platform-card .card-body {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    #panel-about .about-platform-card .about-module-item:last-child {
        grid-column: auto;
    }

    #panel-about .about-tech-card .about-tech-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 640px) {
    #panel-about .about-tech-card .about-tech-grid {
        grid-template-columns: 1fr;
    }
}

#panel-about h5,
#panel-about .card-body h5 {
    font-family: 'Montserrat', 'Inter', sans-serif !important;
    font-size: 17px !important;
    font-weight: 700 !important;
    letter-spacing: 0.2px;
    color: var(--text-primary);
    text-transform: none;
}

#panel-about h6,
#panel-about .card-body h6 {
    font-family: 'Montserrat', 'Inter', sans-serif !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--text-primary);
}

#panel-about p,
#panel-about .card-body p,
#panel-about .text-muted {
    font-family: 'Montserrat', 'Inter', sans-serif !important;
    font-size: 15px !important;
    line-height: 1.75 !important;
    color: var(--text-muted) !important;
}

/* Re-override hero banner text after #panel-about normalization */
#panel-about .about-hero-text h1,
#panel-about .about-hero-text p,
#panel-about .about-hero-text .built-by,
#panel-about .about-hero-text .built-by span {
    color: #ffffff !important;
    opacity: 1 !important;
    font-weight: 700 !important;
}

#panel-about strong,
#panel-about .card-body strong {
    font-family: 'Montserrat', 'Inter', sans-serif !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--text-primary) !important;
}

#panel-about .card-body .small,
#panel-about small {
    font-family: 'Montserrat', 'Inter', sans-serif !important;
    font-size: 14px !important;
    line-height: 1.7 !important;
}

/* ============================================================
   FOOTER
   ============================================================ */

.app-footer {
    border-top: 1px solid var(--border-color);
    padding: 24px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--header-bg);
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    flex-wrap: wrap;
    gap: 12px;
}

.footer-links {
    display: flex;
    gap: 20px;
    align-items: center;
}

.footer-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    text-transform: uppercase;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.15s ease;
    background: none;
    border: none;
    font-family: 'Inter', sans-serif;
    padding: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.footer-link:hover {
    color: var(--text-primary);
}

.footer-tagline {
    width: 100%;
    text-align: center;
    font-size: 12px;
    text-transform: uppercase;
    color: var(--text-faint);
    font-weight: 400;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

/* ============================================================
   CONTACT MODAL
   ============================================================ */

.contact-modal-shell .modal-dialog {
    max-width: 760px;
}

.contact-modal-content {
    border: 1px solid #d1d5db !important;
    border-radius: 10px !important;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.2) !important;
    overflow: hidden;
}

.contact-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px 12px;
    background: #f3f4f6;
    border-bottom: 1px solid #e5e7eb;
}

.contact-modal-title-wrap {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: #111827;
}

.contact-modal-title-wrap > i {
    font-size: 18px;
    margin-top: 2px;
    color: #4b5563;
}

.contact-modal-title {
    font-family: 'Montserrat', 'Inter', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 6px;
}

.contact-modal-subtitle {
    font-family: 'Montserrat', 'Inter', sans-serif;
    font-size: 13px;
    line-height: 1.45;
    color: #6b7280;
    max-width: 520px;
}

.contact-modal-x {
    border: none;
    background: transparent;
    color: #6b7280;
    font-size: 22px;
    line-height: 1;
    padding: 0 2px;
    cursor: pointer;
}

.contact-modal-x:hover {
    color: #111827;
}

.contact-modal-body {
    padding: 16px 18px 12px;
    background: #ffffff;
}

.contact-form-group {
    margin-bottom: 14px;
}

.contact-form-label {
    display: block;
    font-family: 'Montserrat', 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 6px;
}

.req-star {
    color: #ef4444;
    font-weight: 700;
}

.contact-form-input.form-control,
.contact-form-textarea.form-control {
    border-radius: 10px;
    border: 1px solid #d1d5db;
    font-size: 14px;
    color: #111827;
    box-shadow: none;
}

.contact-form-input.form-control {
    min-height: 40px;
}

.contact-form-textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

.contact-form-input.form-control:focus,
.contact-form-textarea.form-control:focus {
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.contact-form-dropdown .Select-control {
    border-radius: 10px !important;
    border: 1px solid #d1d5db !important;
    min-height: 40px;
    box-shadow: none !important;
}

.contact-form-dropdown .is-focused:not(.is-open)>.Select-control,
.contact-form-dropdown .is-open>.Select-control {
    border-color: #93c5fd !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15) !important;
}

.contact-form-dropdown .Select-placeholder,
.contact-form-dropdown .Select-value-label,
.contact-form-dropdown .Select-input input {
    font-size: 14px !important;
}

.contact-form-dropdown .Select-menu-outer {
    border-radius: 10px;
    border: 1px solid #d1d5db;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

.contact-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 10px 18px 16px;
    background: #ffffff;
}

.contact-modal-btn {
    border-radius: 10px;
    padding: 8px 18px;
    font-family: 'Montserrat', 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid #d1d5db;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.contact-form-input.form-control[readonly] {
    background: #f9fafb;
    color: #374151;
}

.contact-send-status {
    min-height: 22px;
    font-family: 'Montserrat', 'Inter', sans-serif;
}

.contact-modal-btn-secondary {
    background: #ffffff;
    color: #111827;
}

.contact-modal-btn-secondary:hover {
    background: #f9fafb;
}

.contact-modal-btn-primary {
    background: #f3f4f6;
    color: #111827;
}

.contact-modal-btn-primary:hover {
    background: #e5e7eb;
    border-color: #cbd5e1;
}

/* ============================================================
   PRIVACY POLICY MODAL
   ============================================================ */

.policy-modal-shell .modal-dialog {
    max-width: 760px;
}

.policy-modal-content {
    border: 1px solid #d1d5db !important;
    border-radius: 14px !important;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.2) !important;
    overflow: hidden;
}

.policy-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    background: #eef2f7;
    border-bottom: 1px solid #e5e7eb;
}

.policy-modal-title-wrap {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.policy-modal-title-wrap > i {
    color: #4b5563;
    font-size: 18px;
    margin-top: 2px;
}

.policy-modal-title {
    font-family: 'Montserrat', 'Inter', sans-serif;
    font-size: 19px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 4px;
}

.policy-modal-subtitle {
    font-family: 'Montserrat', 'Inter', sans-serif;
    font-size: 12px;
    color: #6b7280;
}

.policy-modal-x {
    border: none;
    background: transparent;
    color: #6b7280;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 0 2px;
}

.policy-modal-x:hover {
    color: #111827;
}

.policy-modal-body {
    padding: 18px 20px 8px;
    background: #ffffff;
    max-height: 62vh;
    overflow-y: auto;
}

.policy-section {
    margin-bottom: 18px;
}

.policy-section h4 {
    font-family: 'Montserrat', 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 8px;
}

.policy-section p,
.policy-section li {
    font-family: 'Montserrat', 'Inter', sans-serif;
    font-size: 12px;
    line-height: 1.55;
    color: #334155;
}

.policy-section p {
    margin: 0 0 8px;
}

.policy-section ul {
    margin: 0;
    padding-left: 18px;
}

.policy-section li {
    margin-bottom: 4px;
}

.policy-modal-footer {
    display: flex;
    justify-content: flex-end;
    padding: 10px 20px 16px;
    background: #ffffff;
    border-top: 1px solid #f1f5f9;
}

.policy-risk-disclaimer {
    margin-top: 8px;
    border: 1px solid #fb7185;
    background: #fff1f2;
    border-radius: 12px;
    padding: 12px 14px;
}

.policy-risk-disclaimer-title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #e11d48;
    font-family: 'Montserrat', 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.2px;
    margin-bottom: 8px;
}

.policy-risk-disclaimer-title i {
    color: #f59e0b;
    font-size: 14px;
}

.policy-risk-disclaimer p {
    margin: 0;
    font-family: 'Montserrat', 'Inter', sans-serif;
    font-size: 12px;
    line-height: 1.5;
    color: #334155;
}

/* ============================================================
   UTILITY
   ============================================================ */

.text-success {
    color: var(--green) !important;
}

.text-danger {
    color: var(--red) !important;
}

.text-muted {
    color: var(--text-muted) !important;
}

/* Loading animation */
@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(400%);
    }
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

/* Scrollbars (webkit) */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-faint);
}

/* Remove Bootstrap tab bottom border bleed */
.nav-tabs .nav-link {
    border-radius: 0 !important;
}

.nav-tabs .nav-link.active {
    border-radius: 24px !important;
}

/* ============================================================
   INTEL TAB — sentiment summary + feed / prediction markets
   ============================================================ */

.intel-summary-card {
    border: 1px solid #dbe3ee;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: none !important;
}

.intel-summary-card > .card-header {
    background: #eef2f7;
    border-bottom: 1px solid #dbe3ee;
    padding: 14px 18px;
    font-size: 15px;
    letter-spacing: 0.2px;
}

.intel-summary-card > .card-body {
    padding: 0;
    background: #fff;
}

.intel-summary-table-wrap {
    overflow-x: auto;
}

.intel-summary-table thead th {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #0f172a;
    white-space: nowrap;
    padding: 12px 16px;
}

.intel-summary-table tbody td {
    padding: 14px 16px;
    border-top: 1px solid #eef2f7;
    font-size: 14px;
    vertical-align: middle;
    white-space: nowrap;
}

.intel-sentiment-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 700;
    min-width: 72px;
}

.intel-sentiment-pill.bullish { background: #22c55e; color: #fff; }
.intel-sentiment-pill.bearish { background: #ef4444; color: #fff; }
.intel-sentiment-pill.mixed { background: #f59e0b; color: #111827; }
.intel-sentiment-pill.neutral { background: #e5e7eb; color: #111827; }

.intel-trend {
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
}

.intel-trend.up { color: #16a34a; }
.intel-trend.down { color: #f43f5e; }

.intel-feed-shell {
    margin-top: 4px;
}

.intel-feed-tabs.nav-tabs {
    width: 100%;
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    border-radius: 18px;
    background: #e5e7eb;
    border: none !important;
    padding: 2px;
    gap: 2px;
}

.intel-feed-tabs .nav-item {
    width: 100%;
}

.intel-feed-tabs .nav-link {
    width: 100%;
    border: 1px dashed transparent !important;
    border-radius: 16px !important;
    color: #111827;
    font-weight: 600;
    background: transparent;
}

.intel-feed-tabs .nav-link.active {
    background: #ffffff !important;
    border-color: #9ca3af !important;
    color: #111827 !important;
    box-shadow: none !important;
}

.intel-filter-label {
    font-size: 13px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 6px;
}

.intel-feed-card {
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: none !important;
}

.intel-feed-card > .card-header {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 14px 18px;
    font-size: 15px;
}

.intel-feed-card > .card-body {
    padding: 14px;
}

.intel-feed-item,
.intel-pred-card {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 14px 16px;
    background: #fff;
    margin-bottom: 12px;
}

.intel-feed-item:last-child,
.intel-pred-card:last-child {
    margin-bottom: 0;
}

.intel-feed-item-left {
    min-width: 0;
    flex: 1;
}

.intel-feed-item-right {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.intel-feed-item-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.intel-feed-ticker {
    font-weight: 800;
    color: #0f172a;
    margin-right: 2px;
}

.intel-source-badge {
    border: 1px solid #c7d2fe;
    border-radius: 999px !important;
    font-weight: 600 !important;
}

.intel-feed-item-title {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.35;
    margin-bottom: 4px;
}

.intel-feed-item-sub {
    font-size: 12px;
    color: #64748b;
    line-height: 1.35;
    margin-bottom: 4px;
}

.intel-feed-item-snippet {
    font-size: 13px;
    color: #475569;
    line-height: 1.45;
}

.intel-open-link {
    font-size: 13px;
    text-decoration: none;
    color: #2563eb;
    font-weight: 700;
}

.intel-pred-right {
    min-width: 108px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 2px;
}

.intel-pred-prob {
    font-size: 20px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1;
}

.intel-pred-label {
    font-size: 12px;
    color: #64748b;
}

/* ============================================================
   RESEARCH TAB — left alpha signals menu + card panels
   ============================================================ */

.research-shell {
    display: flex;
    gap: 22px;
    align-items: flex-start;
}

.research-sidebar {
    width: 280px;
    flex-shrink: 0;
    border: 1px dashed #64748b;
    border-radius: 14px;
    overflow: hidden;
    background: #f3f4f6;
}

.research-sidebar-title {
    background: #dfe4ea;
    border-bottom: 1px solid #dbe3ee;
    padding: 18px 16px;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1.1px;
    text-transform: uppercase;
    color: #0f172a;
}

.research-sidebar-item {
    width: calc(100% - 18px);
    margin: 12px 9px 0;
    border: 1px dashed transparent;
    border-radius: 12px;
    background: #f3f4f6;
    color: #1f2937;
    text-align: left;
    padding: 12px 14px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    transition: all 0.15s ease;
}

.research-sidebar-item:last-child {
    margin-bottom: 12px;
}

.research-sidebar-item:hover {
    background: #eceff3;
    border-color: #b8c2cf;
}

.research-sidebar-item.active {
    background: #e5e7eb;
    border-color: #475569;
    color: #0f172a;
}

.research-main {
    flex: 1;
    min-width: 0;
}

.research-main-empty {
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    border-radius: 14px;
    padding: 18px;
}

.research-panel-card {
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: none !important;
}

.research-panel-card > .card-body {
    padding: 14px;
}

.research-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: #e9edf2;
    border-bottom: 1px solid #e2e8f0;
}

.research-panel-title {
    font-size: 15px;
    font-weight: 700;
    color: #0b1220;
    display: flex;
    align-items: center;
}

.research-stock-count {
    font-size: 12px;
    color: #334155;
    background: #e2e8f0;
    border-radius: 8px;
    padding: 3px 8px;
    white-space: nowrap;
}

.research-list-wrap {
    max-height: 680px;
    overflow-y: auto;
    padding-right: 4px;
}

.research-signal-card {
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #f8fafc;
    padding: 14px 14px 12px;
    margin-bottom: 12px;
}

.research-signal-card:last-child {
    margin-bottom: 0;
}

.research-signal-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 8px;
}

.research-signal-ticker {
    font-size: 16px;
    font-weight: 800;
    color: #0f172a;
}

.research-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    white-space: nowrap;
}

.research-label {
    font-size: 12px;
    color: #475569;
    line-height: 1.3;
}

.research-score-bar {
    width: 100%;
    height: 8px;
    background: #dfe5ec;
    border-radius: 999px;
    overflow: hidden;
    margin: 6px 0 10px;
}

.research-score-fill {
    height: 100%;
    border-radius: 999px;
}

.research-metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.research-metrics-grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 8px;
}

.research-metrics-grid.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 8px;
}

.research-metric-value {
    font-size: 13px;
    font-weight: 700;
    color: #111827;
    line-height: 1.2;
}

.research-metric-value.green,
.research-big-score.green {
    color: #10b981;
}

.research-metric-value.red,
.research-big-score.red {
    color: #ef4444;
}

.research-big-score {
    font-size: 20px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1;
}

.research-mini-list {
    margin-top: 10px;
    border-top: 1px solid #eef2f7;
    padding-top: 8px;
}

.research-mini-row {
    padding: 8px 8px;
    border: 1px solid #f1f5f9;
    border-radius: 10px;
    margin-bottom: 8px;
    background: #eef2f7;
}

.research-mini-row:last-child {
    margin-bottom: 0;
}

.research-range-labels {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: 12px;
    color: #475569;
    margin-top: 4px;
}

.research-bullets {
    margin: 8px 0 0;
    padding-left: 18px;
    color: #111827;
    font-size: 13px;
}

.research-quarter-track {
    background: #eef2f7;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
}

.research-quarter-dot {
    font-size: 18px;
    margin-right: 5px;
}

.research-panel-card .card-body,
.research-panel-card p,
.research-panel-card li,
.research-panel-card td,
.research-panel-card th,
.research-panel-card .text-muted,
.research-panel-card small {
    color: #1f2937;
}

@media (max-width: 1100px) {
    .research-shell {
        flex-direction: column;
    }

    .research-sidebar {
        width: 100%;
    }

    .research-metrics-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .research-metrics-grid.three {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
.perf-shell {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.perf-title-wrap {
  border-bottom: 1px dashed #111827;
  padding-bottom: 14px;
}

.perf-page-title {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.perf-page-subtitle {
  margin: 6px 0 0 0;
  color: #64748b;
  font-size: 13px;
}

.perf-mode-tabs {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.perf-mode-btn {
  border: 1px dashed #6b7280;
  border-radius: 14px;
  background: #f3f4f6;
  color: #475569;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 12px 24px;
}

.perf-mode-btn.active {
  background: #ffffff;
  color: #111827;
  border-color: #111827;
}

.perf-panel {
  display: block;
}

.perf-section-card {
  border: 1px dashed #6b7280;
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
  margin-bottom: 16px;
}

.perf-section-header {
  background: #f3f4f6;
  border-bottom: 1px dashed #6b7280;
  padding: 14px 16px;
  font-weight: 800;
  letter-spacing: 0.04em;
  font-size: 12px;
}

.perf-section-header-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.perf-section-body {
  padding: 16px;
}

.perf-strategy-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.perf-strategy-card {
  width: 100%;
  text-align: left;
  border: 1px solid #d1d5db;
  border-radius: 14px;
  background: #fff;
  padding: 16px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.perf-strategy-card:hover {
  border-color: #94a3b8;
  background: #fafafa;
}

.perf-strategy-card.active {
  border-color: #111827;
  box-shadow: inset 0 0 0 1px #111827;
  background: #f8fafc;
}

.perf-strategy-card.preview {
  background: #fcfcfd;
}

.perf-strategy-radio {
  width: 22px;
  height: 22px;
  border: 2px solid #94a3b8;
  border-radius: 999px;
  flex: 0 0 22px;
  margin-top: 2px;
}

.perf-strategy-radio.active {
  border-color: #111827;
  box-shadow: inset 0 0 0 5px #111827;
}

.perf-strategy-copy {
  flex: 1;
  min-width: 0;
}

.perf-strategy-title-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.perf-strategy-title-row h4 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: #111827;
}

.perf-strategy-pill {
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.03em;
  border: 1px solid #cbd5e1;
  background: #e5e7eb;
  color: #334155;
}

.perf-strategy-pill.classic { background: #e5e7eb; }
.perf-strategy-pill.risk { background: #dbeafe; }
.perf-strategy-pill.ml { background: #dcfce7; }
.perf-strategy-pill.adv { background: #ede9fe; }

.perf-strategy-status {
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.03em;
  border: 1px solid #cbd5e1;
}

.perf-strategy-status.implemented {
  background: #dcfce7;
  color: #166534;
  border-color: #86efac;
}

.perf-strategy-status.preview {
  background: #fef3c7;
  color: #92400e;
  border-color: #fcd34d;
}

.perf-strategy-summary,
.perf-strategy-detail {
  margin: 0;
  line-height: 1.45;
}

.perf-strategy-summary {
  color: #111827;
  font-size: 13px;
  margin-bottom: 8px;
}

.perf-strategy-detail {
  color: #64748b;
  font-size: 12px;
}

.perf-run-row {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.perf-selection-helper {
  color: #64748b;
  font-size: 12px;
}

.perf-run-btn {
  min-width: 380px;
  max-width: 100%;
  border: none;
  border-radius: 12px;
  background: #111827;
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.03em;
  padding: 14px 22px;
}

.perf-run-btn.disabled,
.perf-run-btn:disabled {
  background: #9ca3af;
  color: #e5e7eb;
  cursor: not-allowed;
}

.perf-results-shell {
  display: block;
}

.perf-results-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 12px;
}

.perf-results-title {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.perf-benchmark-wrap {
  min-width: 240px;
}

.perf-benchmark-label {
  display: block;
  font-size: 11px;
  color: #64748b;
  margin-bottom: 4px;
  font-weight: 700;
}

.perf-empty-state {
  border: 1px dashed #cbd5e1;
  border-radius: 14px;
  padding: 28px 20px;
  text-align: center;
  color: #64748b;
  background: #fff;
}

.perf-empty-state i {
  font-size: 24px;
  display: block;
  margin-bottom: 8px;
  color: #475569;
}

.perf-empty-state h4 {
  margin: 0 0 6px 0;
  color: #111827;
  font-weight: 800;
}

.perf-empty-state p {
  margin: 0 auto;
  max-width: 760px;
  font-size: 13px;
}

.perf-result-meta-card {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
  padding: 12px 14px;
  margin-bottom: 12px;
}

.perf-result-meta-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.perf-meta-block.right {
  text-align: right;
}

.perf-meta-label {
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 4px;
}

.perf-meta-value {
  color: #111827;
  font-size: 14px;
  font-weight: 800;
}

.perf-selected-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.perf-selected-pill {
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #334155;
  font-size: 11px;
  padding: 4px 8px;
  font-weight: 700;
}

.perf-preview-note {
  margin-top: 10px;
  border-top: 1px solid #e2e8f0;
  padding-top: 10px;
  color: #92400e;
  font-size: 12px;
  display: flex;
  align-items: center;
}

.perf-exec-provider-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.perf-broker-card {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 14px;
  background: #fff;
  padding: 18px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  text-align: left;
}

.perf-broker-card.active {
  border-color: #111827;
  box-shadow: inset 0 0 0 1px #111827;
  background: #f8fafc;
}

.perf-broker-card i {
  font-size: 20px;
  color: #111827;
}

.perf-broker-card-copy h4 {
  margin: 0 0 6px 0;
  font-size: 18px;
  font-weight: 800;
}

.perf-broker-card-copy p {
  margin: 0;
  color: #64748b;
  font-size: 13px;
}

.perf-status-pill {
  border-radius: 999px;
  background: #e5e7eb;
  color: #111827;
  font-size: 11px;
  font-weight: 800;
  padding: 6px 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #9ca3af;
  display: inline-block;
}

.perf-form-label {
  font-size: 12px;
  font-weight: 800;
  color: #111827;
  margin-bottom: 6px;
}

.perf-form-block {
  margin-top: 14px;
}

.perf-toggle-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.perf-toggle-btn {
  border: 1px solid #d1d5db;
  border-radius: 12px;
  padding: 12px;
  background: #fff;
  font-weight: 700;
  color: #475569;
}

.perf-toggle-btn.active {
  border-color: #111827;
  color: #111827;
  background: #f8fafc;
}

.perf-connect-btn {
  width: 100%;
  border: none;
  border-radius: 12px;
  background: #000;
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.03em;
  padding: 12px;
  margin-top: 16px;
}

@media (max-width: 992px) {
  .perf-exec-provider-grid {
    grid-template-columns: 1fr;
  }
  .perf-results-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .perf-benchmark-wrap {
    min-width: 0;
    width: 100%;
  }
  .perf-run-btn {
    min-width: 0;
    width: 100%;
  }
}
