* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; background-color: #000000; color: #f3f4f6; padding-bottom: 50px; }
.container { max-width: 1400px; margin: 0 auto; padding: 20px; }

/* THE PWA (APPLE DYNAMIC ISLAND) FIX */
@media (display-mode: standalone) {
    /* Targets the container directly instead of the body */
    #mainAppContainer { 
        padding-top: max(60px, env(safe-area-inset-top)) !important; 
    }
}

.top-bar { display: flex; justify-content: space-between; align-items: center; padding-bottom: 20px; border-bottom: 1px solid #1f2937; margin-bottom: 20px; }
.logo { font-size: 1.7rem; font-weight: bold; letter-spacing: -0.5px; cursor: pointer; transition: opacity 0.2s;}
.logo:hover { opacity: 0.8; }
.logo span { color: #2563eb; }
.search-group { display: flex; gap: 20px; align-items: center; }
.search-container { display: flex; gap: 10px; width: 350px; }
.search-input { flex: 1; padding: 10px 15px; border-radius: 8px; border: 1px solid #374151; background: #111827; color: white; outline: none; transition: border 0.2s; }
.search-input:focus { border-color: #2563eb; }
.search-btn { padding: 0 20px; border-radius: 8px; border: none; background: #2563eb; color: white; font-weight: 600; cursor: pointer; transition: background 0.2s; }
.search-btn:hover { background: #1d4ed8; }
.auth-btn { background: transparent; border: 1px solid #4b5563; color: white; padding: 8px 15px; border-radius: 8px; cursor: pointer; font-weight: bold; transition: all 0.2s; }
.auth-btn:hover { background: #1f2937; border-color: #9ca3af; }
.plan-selector { background: #1f2937; padding: 8px 15px; border-radius: 8px; cursor: pointer; font-size: 0.9rem; font-weight: bold; border: 1px solid #374151; display: flex; align-items: center; gap: 8px; transition: 0.2s; }
.plan-selector:hover { background: #374151; border-color: #4b5563; }
.plan-badge { background: #10b981; color: #000; padding: 2px 6px; border-radius: 4px; font-size: 0.7rem; text-transform: uppercase; }
.finnhub-banner { background: #fbbf24; color: #000; padding: 12px 20px; border-radius: 8px; display: flex; justify-content: space-between; align-items: center; font-weight: 600; margin-bottom: 24px; box-shadow: 0 4px 6px rgba(0,0,0,0.1); }
.finnhub-banner button { background: #000; color: #fff; border: none; padding: 8px 16px; border-radius: 6px; cursor: pointer; font-weight: bold; transition: background 0.2s; }
.finnhub-banner button:hover { background: #1f2937; }
.ad-container { background: #111827; border: 1px dashed #4b5563; display: flex; align-items: center; justify-content: center; color: #6b7280; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 20px; position: relative; overflow: hidden; }
.ad-container::after { content: "ADVERTISEMENT"; position: absolute; top: 5px; right: 5px; font-size: 0.6rem; opacity: 0.5; }
.ad-leaderboard { width: 100%; height: 90px; margin-bottom: 24px; } 
.ad-sidebar { width: 100%; height: 250px; margin-bottom: 24px; } 

.hero-section { text-align: center; padding: 90px 20px 80px; border-bottom: 1px solid #1f2937; margin-bottom: 30px; background: radial-gradient(ellipse at 50% -10%, #0f172a 0%, #000000 65%); border-radius: 12px; position: relative; overflow: hidden;}
.hero-section::before { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 0%, rgba(37,99,235,0.07) 0%, transparent 65%); pointer-events: none; }
.hero-title { font-size: 3.5rem; font-weight: 800; margin-bottom: 18px; letter-spacing: -1.5px; line-height: 1.1; }
.hero-title-accent { background: linear-gradient(90deg, #3b82f6, #60a5fa); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hero-subtitle { font-size: 1.15rem; color: #6b7280; max-width: 520px; margin: 0 auto 36px auto; line-height: 1.65; text-align: center; }
.hero-badge { display: inline-flex; align-items: center; gap: 7px; padding: 6px 16px; border-radius: 30px; background: rgba(139, 92, 246, 0.08); border: 1px solid rgba(139, 92, 246, 0.35); color: #c084fc; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.3px; margin-bottom: 24px; box-shadow: 0 0 15px rgba(139, 92, 246, 0.15); animation: pulseGlow 3s infinite alternate;}
@keyframes pulseGlow { 0% { box-shadow: 0 0 10px rgba(139, 92, 246, 0.1); } 100% { box-shadow: 0 0 25px rgba(139, 92, 246, 0.35); } }

.hero-cta-group { display: flex; gap: 12px; justify-content: center; align-items: center; flex-wrap: wrap; }
.hero-cta-primary { padding: 13px 26px; border-radius: 8px; border: none; background: #2563eb; color: white; font-weight: 700; font-size: 0.95rem; cursor: pointer; transition: background 0.2s, transform 0.15s, box-shadow 0.2s; box-shadow: 0 0 0 0 rgba(37,99,235,0); letter-spacing: 0.01em; }
.hero-cta-primary:hover { background: #1d4ed8; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(37,99,235,0.35); }
.hero-cta-secondary { padding: 12px 22px; border-radius: 8px; border: 1px solid #374151; background: transparent; color: #d1d5db; font-weight: 600; font-size: 0.95rem; cursor: pointer; transition: all 0.2s; }
.hero-cta-secondary:hover { background: #111827; border-color: #4b5563; color: white; }
.hero-cta-ghost { display: inline-flex; align-items: center; gap: 6px; padding: 12px 18px; border-radius: 8px; background: transparent; color: #4b5563; font-weight: 600; font-size: 0.9rem; text-decoration: none; transition: color 0.2s; cursor: pointer; }
.hero-cta-ghost:hover { color: #9ca3af; }

.market-pulse-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 30px; }
.pulse-card { background: #111827; border: 1px solid #1f2937; border-radius: 12px; padding: 20px; display: flex; justify-content: space-between; align-items: center; cursor: pointer; transition: 0.2s; }
.pulse-card:hover { border-color: #374151; transform: translateY(-2px); }
.pulse-name { font-size: 0.9rem; color: #9ca3af; margin-bottom: 5px; text-transform: uppercase; font-weight: bold; }
.pulse-symbol { font-size: 1.5rem; font-weight: bold; }
.pulse-price { font-size: 1.5rem; font-weight: bold; text-align: right; }
.pulse-change { font-size: 0.9rem; text-align: right; font-weight: 600; margin-top: 5px; }
.home-content-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; }
.ai-market-banner { background: linear-gradient(135deg, #1e3a8a, #2563eb); border: 1px solid #3b82f6; border-radius: 12px; padding: 24px; display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.ai-market-text h3 { font-size: 1.4rem; margin-bottom: 5px; color: #ffffff; display: flex; align-items: center; gap: 8px;}
.ai-market-text p { color: #bfdbfe; font-size: 0.95rem; line-height: 1.5; max-width: 500px; }
.ai-market-btn { background: #ffffff; color: #1d4ed8; padding: 12px 24px; border-radius: 8px; font-weight: bold; border: none; cursor: pointer; font-size: 1rem; transition: 0.2s; display: flex; align-items: center; gap: 8px; }
.ai-market-btn:hover { background: #f3f4f6; }
.ai-market-btn.locked { background: #374151; color: #9ca3af; cursor: not-allowed; border: 1px solid #4b5563; }

.home-copilot-widget { background: #111827; border: 1px solid #4c1d95; border-radius: 12px; padding: 15px 20px; display: flex; gap: 15px; align-items: center; margin-bottom: 24px; box-shadow: 0 4px 15px rgba(109, 40, 217, 0.15);}
.home-copilot-input { flex: 1; background: transparent; border: none; color: white; font-size: 1rem; outline: none; }
.home-copilot-btn { background: linear-gradient(135deg, #6d28d9, #2563eb); color: white; border: none; padding: 10px 20px; border-radius: 6px; font-weight: bold; cursor: pointer; transition: 0.2s;}
.home-copilot-btn:hover { transform: translateY(-2px); opacity: 0.9;}

.lists-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; margin-bottom: 24px; }
.list-container { background: #111827; border: 1px solid #1f2937; border-radius: 12px; padding: 20px; display: flex; flex-direction: column; }
.list-header { font-size: 1.2rem; font-weight: 700; margin-bottom: 15px; padding-bottom: 10px; border-bottom: 1px solid #1f2937; display: flex; justify-content: space-between; align-items: center;}
.list-header-title { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.heatmap-launch-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid rgba(37, 99, 235, 0.36);
    background: linear-gradient(145deg, rgba(37,99,235,0.14), rgba(15,23,42,0.94));
    color: #93c5fd;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
    flex-shrink: 0;
}
.heatmap-launch-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(96,165,250,0.85);
    color: #dbeafe;
    background: linear-gradient(145deg, rgba(37,99,235,0.28), rgba(17,24,39,0.98));
}
.list-item { display: flex; justify-content: space-between; align-items: center; padding: 12px 10px; border-radius: 8px; cursor: pointer; transition: 0.2s; border-bottom: 1px solid #1f2937; }
.list-item:hover { background: #1f2937; }
.list-sym { font-weight: bold; font-size: 1.1rem; }
.list-sub { font-size: 0.8rem; color: #9ca3af; margin-top: 2px;}
.list-price { font-weight: bold; }
.view-all-btn { width: 100%; padding: 10px; background: transparent; border: 1px solid #374151; color: #9ca3af; border-radius: 6px; cursor: pointer; margin-top: auto; font-weight: bold; transition: 0.2s; }
.view-all-btn:hover { background: #1f2937; color: white; }
.pricing-section { max-width: 1320px; margin: 22px auto 60px; padding: 0 18px; }
.pricing-header { text-align: center; margin-bottom: 50px; }
.pricing-header h1 { font-size: 3rem; margin-bottom: 10px; }
.pricing-hero {
    padding: 34px 0 28px;
    text-align: center;
    max-width: 860px;
    margin: 0 auto;
}
.pricing-kicker {
    display: inline-flex;
    align-items: flex-end;
    padding: 5px 10px;
    border-radius: 6px;
    border: 1px solid rgba(37,99,235,0.35);
    background: rgba(37,99,235,0.10);
    color: #60a5fa;
    font-size: 0.74rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 16px;
}
.pricing-hero h1,
.pricing-hero .pricing-title {
    font-size: clamp(2.1rem, 4vw, 4.2rem);
    line-height: 1.02;
    letter-spacing: -0.03em;
    margin-bottom: 16px;
}
.pricing-hero p {
    color: #94a3b8;
    font-size: 1.03rem;
    line-height: 1.65;
    max-width: 720px;
    margin: 0 auto;
}
.pricing-highlights {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 20px;
}
.pricing-highlights span {
    color: #cbd5e1;
    border: 1px solid rgba(148,163,184,0.18);
    background: rgba(15,23,42,0.72);
    border-radius: 6px;
    padding: 7px 10px;
    font-size: 0.78rem;
    font-weight: 800;
}
.modern-plan-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin: 16px 0 14px;
}
.modern-plan-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 445px;
    padding: 22px;
    border: 1px solid rgba(51,65,85,0.82);
    border-radius: 8px;
    background: linear-gradient(180deg, rgba(17,24,39,0.98), rgba(8,11,16,0.98));
    box-shadow: 0 16px 40px rgba(0,0,0,0.24);
}
.modern-plan-card.featured-plan {
    border-color: rgba(16,185,129,0.55);
    background: linear-gradient(180deg, rgba(13,31,30,0.98), rgba(8,11,16,0.98));
    box-shadow: 0 18px 48px rgba(16,185,129,0.12);
}
.modern-plan-card.essentials-plan {
    border-color: rgba(37,99,235,0.62);
    background:
        radial-gradient(circle at 92% 8%, rgba(251,191,36,0.10), transparent 28%),
        linear-gradient(180deg, rgba(15,30,58,0.98), rgba(9,13,23,0.98));
    box-shadow: 0 18px 48px rgba(37,99,235,0.13);
}
.modern-plan-card.essentials-plan .plan-cta {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    border-color: rgba(96,165,250,0.72);
}
.modern-plan-card.essentials-plan .plan-feature-list li::before {
    background: #60a5fa;
    box-shadow: 0 0 12px rgba(96,165,250,0.48);
}
.featured-ribbon {
    position: absolute;
    top: 14px;
    right: 14px;
    color: #00130b;
    background: #10b981;
    border-radius: 5px;
    padding: 4px 9px;
    font-size: 0.68rem;
    font-weight: 950;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.plan-topline {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    min-height: 86px;
}
.plan-name {
    color: #f8fafc;
    font-size: 1.25rem;
    font-weight: 950;
    letter-spacing: -0.01em;
}
.plan-desc {
    color: #64748b;
    font-size: 0.88rem;
    line-height: 1.5;
    margin-top: 6px;
    max-width: 285px;
}
.plan-pill {
    flex-shrink: 0;
    border-radius: 5px;
    padding: 5px 8px;
    font-size: 0.68rem;
    font-weight: 950;
    letter-spacing: 0.07em;
}
.plan-pill.muted { color: #94a3b8; background: rgba(148,163,184,0.10); border: 1px solid rgba(148,163,184,0.18); }
.plan-pill.gold { color: #fbbf24; background: rgba(251,191,36,0.10); border: 1px solid rgba(251,191,36,0.25); }
.plan-pill.pro { color: #07130f; background: #10b981; }
.plan-price {
    margin: 12px 0 18px;
    color: #f8fafc;
    font-size: 2.35rem;
    font-weight: 950;
    letter-spacing: -0.04em;
}
.plan-price span:not(.price-strike) {
    color: #64748b;
    font-size: 0.88rem;
    font-weight: 800;
    letter-spacing: 0;
    margin-left: 4px;
}
.price-strike {
    color: #64748b;
    font-size: 1rem;
    text-decoration: line-through;
    margin-right: 8px;
    letter-spacing: 0;
}
.plan-cta {
    width: 100%;
    min-height: 42px;
    border: 1px solid rgba(37,99,235,0.55);
    border-radius: 6px;
    background: #2563eb;
    color: #ffffff;
    font-weight: 900;
    cursor: pointer;
}
.plan-cta.secondary {
    background: rgba(148,163,184,0.08);
    border-color: rgba(148,163,184,0.22);
    color: #cbd5e1;
}
.plan-cta.pro-cta {
    background: #10b981;
    border-color: rgba(16,185,129,0.8);
    color: #00130b;
}
.plan-promo {
    margin: 10px 0 4px;
}
.plan-feature-list {
    list-style: none;
    margin-top: 18px;
    display: grid;
    gap: 11px;
}
.plan-feature-list li {
    color: #cbd5e1;
    font-size: 0.9rem;
    line-height: 1.45;
    display: grid;
    grid-template-columns: 18px 1fr;
    gap: 8px;
}
.plan-feature-list li::before {
    content: '';
    width: 8px;
    height: 8px;
    margin-top: 6px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 12px rgba(16,185,129,0.45);
}
.pricing-note {
    color: #64748b;
    font-size: 0.8rem;
    text-align: center;
    margin: 16px 0 24px;
}
.plan-value-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 24px 0 42px;
}
.value-card {
    border: 1px solid rgba(51,65,85,0.72);
    border-radius: 8px;
    background: rgba(15,23,42,0.62);
    padding: 18px;
}
.value-card span {
    display: inline-block;
    color: #60a5fa;
    font-size: 0.68rem;
    font-weight: 950;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 8px;
}
.value-card strong {
    display: block;
    color: #f8fafc;
    font-size: 1rem;
    margin-bottom: 7px;
}
.value-card p {
    color: #64748b;
    font-size: 0.86rem;
    line-height: 1.55;
}
.pricing-compare-section {
    margin-top: 58px;
}
.pricing-compare-section h2,
.pricing-faq h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 18px;
}
.pricing-faq {
    margin: 70px auto 0;
    max-width: 840px;
}
.faq-card {
    margin-bottom: 12px;
    padding: 22px;
    border-radius: 8px;
}
.faq-card h4 {
    font-size: 1.12rem;
    color: #f8fafc;
    margin-bottom: 8px;
}
.faq-card p {
    color: #94a3b8;
    line-height: 1.65;
}

@media (max-width: 960px) {
    .pricing-section {
        margin-top: 10px;
        padding: 0 14px;
    }
    .pricing-hero {
        padding-top: 18px;
        text-align: left;
    }
    .pricing-hero h1,
    .pricing-hero .pricing-title,
    .pricing-hero p {
        margin-left: 0;
        margin-right: 0;
    }
    .pricing-highlights {
        justify-content: flex-start;
    }
    .modern-plan-grid,
    .plan-value-row {
        grid-template-columns: 1fr;
    }
    .modern-plan-card {
        min-height: auto;
        padding: 20px;
    }
    .plan-topline {
        min-height: auto;
    }
    .featured-ribbon {
        position: static;
        align-self: flex-start;
        margin-bottom: 12px;
    }
    .pricing-compare-section {
        margin-top: 42px;
    }
    .pricing-compare-section h2,
    .pricing-faq h2 {
        text-align: left;
        font-size: 1.55rem;
    }
    .comp-table-wrap {
        overflow-x: auto;
    }
    .comp-table-wrap .comp-table {
        min-width: 760px;
    }
    .pricing-faq {
        margin-top: 48px;
    }
}
.comp-table { width: 100%; border-collapse: separate; border-spacing: 0; margin-bottom: 15px; }
.comp-table th, .comp-table td { padding: 20px; text-align: center; border-bottom: 1px solid #1f2937; }
.comp-table th { font-size: 1.2rem; font-weight: bold; color: #f3f4f6; }
.comp-table td:first-child, .comp-table th:first-child { text-align: left; font-weight: bold; font-size: 1.1rem; color: #d1d5db; }
#tierTable th:nth-child(4), #tierTable td:nth-child(4) { background-color: #111827; border-left: 1px solid #2563eb; border-right: 1px solid #2563eb; }
#tierTable th:nth-child(4) { border-top: 1px solid #2563eb; border-radius: 12px 12px 0 0; position: relative; }
#tierTable tr:last-child td:nth-child(4) { border-bottom: 1px solid #2563eb; border-radius: 0 0 12px 12px; }
.best-value-badge { position: absolute; top: -14px; left: 50%; transform: translateX(-50%); background: #fbbf24; color: #000; padding: 4px 14px; border-radius: 20px; font-size: 0.75rem; font-weight: 800; text-transform: uppercase; }
.svg-check { width: 24px; height: 24px; stroke: #10b981; stroke-width: 3; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.svg-dash { width: 24px; height: 24px; stroke: #4b5563; stroke-width: 3; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.dashboard-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; align-items: start; }
.panel { background: #111827; border-radius: 12px; border: 1px solid #1f2937; padding: 20px; }
.stock-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 20px; }
.symbol { font-size: 2.5rem; font-weight: 700; line-height: 1; margin-bottom: 4px; }
.company { color: #9ca3af; font-size: 1rem; }
.price { font-size: 2.5rem; font-weight: 700; line-height: 1; text-align: right; margin-bottom: 4px; transition: color 0.3s ease; }
.change { font-size: 1.1rem; text-align: right; font-weight: 500; }
.company-logo { width: 48px; height: 48px; min-width: 48px; max-width: 48px; border-radius: 50%; margin-right: 15px; background: white; padding: 2px; object-fit: contain; flex-shrink: 0; }
.action-bar { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap;}
.action-btn { padding: 8px 16px; border-radius: 6px; font-weight: 600; cursor: pointer; border: none; font-size: 0.9rem; }
.btn-watch { background: #374151; color: white; }
.btn-ai { background: linear-gradient(135deg, #4f46e5, #9333ea); color: white; display: flex; align-items: center; gap: 6px; }
.btn-copilot { background: rgba(30, 27, 75, 0.6); color: #ffffff; border: 1px solid #6d28d9; backdrop-filter: blur(4px); display: flex; align-items: center; gap: 6px; box-shadow: 0 0 10px rgba(109, 40, 217, 0.2); transition: all 0.2s;}
.btn-copilot:hover { transform: translateY(-2px); background: rgba(30, 27, 75, 0.9); box-shadow: 0 0 20px rgba(109, 40, 217, 0.5); border-color: #8b5cf6;}
.btn-locked { background: #374151; color: #9ca3af; cursor: not-allowed; box-shadow: none !important; border:none;}
.chart-container { height: 330px; width: 100%; display: block; position: relative; background: #111827; }

/* ── Chart loading skeleton ──────────────────────────────────────────────────
   Injected as a child of .chart-container by showChartSkeleton().
   Sits above the canvas via z-index and fades out when data loads.      */
.chart-skeleton {
    position: absolute;
    inset: 0;
    background: #111827;
    z-index: 10;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 0;
    overflow: hidden;
    border-radius: 0;
    opacity: 1;
    transition: opacity 0.22s ease;
}

/* Shimmer wave that sweeps across the skeleton */
.chart-skeleton-shimmer {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        rgba(255,255,255,0)     0%,
        rgba(255,255,255,0.045) 40%,
        rgba(255,255,255,0.07)  50%,
        rgba(255,255,255,0.045) 60%,
        rgba(255,255,255,0)     100%
    );
    background-size: 200% 100%;
    animation: chart-shimmer 1.6s ease-in-out infinite;
}

/* Fake baseline bar at the bottom of the skeleton — mimics the time axis */
.chart-skeleton::after {
    content: '';
    display: block;
    height: 2px;
    width: 100%;
    background: #1a2030;
    position: absolute;
    bottom: 28px;
    left: 0;
}

@keyframes chart-shimmer {
    0%   { background-position: 200% center; }
    100% { background-position: -200% center; }
}

/* Outer wrapper that unifies the timeframe bar and chart canvas */
.chart-wrap {
    border: 1px solid #1f2937;
    border-radius: 8px;
    overflow: hidden;
    background: #111827;
    margin-bottom: 20px;
}

/* Timeframe toggle row */
.chart-timeframe-row {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 6px 10px;
    border-bottom: 1px solid #1a2030;
    background: #111827;
}

/* Individual timeframe buttons */
.tf-btn {
    background: transparent;
    border: none;
    color: #6b7280;
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.4px;
    padding: 5px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
}
.tf-btn:hover { background: rgba(255,255,255,0.06); color: #d1d5db; }
.tf-btn.active { background: rgba(255,255,255,0.09); color: #ffffff; }

/* Extended-hours session badge — inline next to live price.
   Hidden by default. JS sets display:inline-flex for pre-market / after-hours. */
.extended-hours-badge {
    display: none;
    align-items: center;
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 0.58rem;
    font-weight: 500;
    letter-spacing: 0.9px;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 20px;
    background: rgba(167,139,250,0.10);
    color: #a78bfa;
    border: 1px solid rgba(167,139,250,0.28);
    white-space: nowrap;
    flex-shrink: 0;
    vertical-align: middle;
    line-height: 1;
}
.extended-hours-badge.pre-market {
    background: rgba(251,191,36,0.08);
    color: #fbbf24;
    border-color: rgba(251,191,36,0.25);
}
.extended-hours-badge.overnight {
    background: rgba(37,99,235,0.10);
    color: #60a5fa;
    border-color: rgba(37,99,235,0.30);
}
.metrics-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; }
.metric-box { border-top: 1px solid #374151; padding-top: 12px; }
.m-label { color: #9ca3af; font-size: 0.8rem; margin-bottom: 4px; text-transform: uppercase; }
.m-value { font-size: 1.1rem; font-weight: 600; }
.section-title { font-size: 1.1rem; font-weight: 600; padding-bottom: 10px; border-bottom: 1px solid #1f2937; margin-bottom: 15px; color: #f3f4f6; }
.news-item { display: block; text-decoration: none; color: inherit; padding: 12px 0; border-bottom: 1px solid #1f2937; cursor: pointer; }
.news-item:hover h4 { color: #2563eb; }
.news-headline { font-size: 0.95rem; margin-bottom: 6px; line-height: 1.4; transition: color 0.2s; }
.news-meta { font-size: 0.8rem; color: #6b7280; }
.watch-item { display: flex; justify-content: space-between; padding: 10px; background: #000; border-radius: 6px; border: 1px solid #1f2937; margin-bottom: 8px; }

/* MODALS */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.85); z-index: 2000; display: none; align-items: center; justify-content: center; }
.modal-box { background: #111827; padding: 30px; border-radius: 12px; max-width: 400px; width: 90%; border: 1px solid #374151; text-align: center; max-height: 90vh; overflow-y: auto;}
.upgrade-modal-overlay {
    padding: 18px;
    background:
        radial-gradient(circle at 24% 18%, rgba(37, 99, 235, 0.18), transparent 32%),
        radial-gradient(circle at 78% 78%, rgba(245, 158, 11, 0.12), transparent 26%),
        rgba(2, 6, 13, 0.86);
    backdrop-filter: blur(16px);
}

.upgrade-modal-box {
    position: relative;
    width: min(94vw, 440px);
    max-width: 440px;
    padding: 24px;
    overflow: hidden;
    text-align: left;
    border: 1px solid rgba(96, 165, 250, 0.24);
    border-radius: 16px;
    background:
        linear-gradient(145deg, rgba(17, 24, 39, 0.98), rgba(6, 11, 20, 0.98)),
        #0b1018;
    box-shadow: 0 28px 90px rgba(0, 0, 0, 0.58), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.upgrade-modal-box::before {
    content: '';
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    background: linear-gradient(90deg, #2563eb, #10b981, #f59e0b);
}

.upgrade-close-btn {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.72);
    color: #94a3b8;
    cursor: pointer;
    transition: 0.16s ease;
}

.upgrade-close-btn:hover {
    border-color: rgba(96, 165, 250, 0.52);
    color: #f8fafc;
    background: rgba(30, 41, 59, 0.96);
}

.upgrade-lock-icon {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    margin-bottom: 16px;
    border: 1px solid rgba(245, 158, 11, 0.34);
    border-radius: 14px;
    color: #fbbf24;
    background:
        radial-gradient(circle at 35% 20%, rgba(251, 191, 36, 0.24), transparent 42%),
        rgba(245, 158, 11, 0.08);
    box-shadow: 0 16px 34px rgba(245, 158, 11, 0.08);
}

.upgrade-lock-kicker {
    margin-bottom: 8px;
    color: #60a5fa;
    font-family: "Fira Code", monospace;
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.upgrade-modal-box h2 {
    margin: 0 38px 10px 0;
    color: #f8fafc;
    font-size: clamp(1.55rem, 4vw, 2rem);
    line-height: 1.1;
}

.upgrade-modal-box p {
    margin: 0 0 22px;
    color: #cbd5e1;
    font-size: 1rem;
    line-height: 1.55;
}

.upgrade-modal-box p b {
    color: #f8fafc;
}

.upgrade-lock-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.upgrade-primary-btn,
.upgrade-secondary-btn {
    min-height: 44px;
    border-radius: 8px;
    font-weight: 900;
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.upgrade-primary-btn {
    border: 1px solid rgba(37, 99, 235, 0.85);
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff;
    box-shadow: 0 14px 30px rgba(37, 99, 235, 0.24);
}

.upgrade-secondary-btn {
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(148, 163, 184, 0.08);
    color: #cbd5e1;
}

.upgrade-primary-btn:hover,
.upgrade-secondary-btn:hover {
    transform: translateY(-1px);
}

.upgrade-secondary-btn:hover {
    border-color: rgba(148, 163, 184, 0.36);
    background: rgba(148, 163, 184, 0.12);
    color: #f8fafc;
}
.auth-input { width: 100%; padding: 12px; margin: 8px 0; background: #000; border: 1px solid #374151; color: white; border-radius: 6px; }
.google-btn { display: flex; align-items: center; justify-content: center; gap: 10px; background: white; color: #000; border: none; padding: 10px; border-radius: 6px; width: 100%; font-weight: 600; cursor: pointer; margin-top: 15px; transition: background 0.2s; }
.google-btn:hover { background: #f3f4f6; }

.auth-modal-overlay {
    padding: 18px;
    background:
        radial-gradient(circle at 22% 18%, rgba(37, 99, 235, 0.18), transparent 30%),
        radial-gradient(circle at 80% 70%, rgba(16, 185, 129, 0.10), transparent 24%),
        rgba(2, 6, 13, 0.88);
    backdrop-filter: blur(14px);
}

.auth-modal-card {
    position: relative;
    width: min(94vw, 420px);
    max-height: min(92vh, 780px);
    overflow-y: auto;
    border: 1px solid rgba(59, 130, 246, 0.22);
    border-radius: 22px;
    background:
        linear-gradient(180deg, rgba(17, 24, 39, 0.98), rgba(6, 11, 20, 0.98)),
        #0b1018;
    color: #f8fafc;
    box-shadow: 0 28px 90px rgba(0, 0, 0, 0.58), 0 0 0 1px rgba(255, 255, 255, 0.025) inset;
}

.auth-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.74);
    color: #94a3b8;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    transition: 0.16s ease;
}

.auth-modal-close:hover {
    border-color: rgba(96, 165, 250, 0.55);
    color: #f8fafc;
    background: rgba(30, 41, 59, 0.96);
}

.auth-modal-header {
    padding: 34px 30px 20px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
    text-align: left;
}

.auth-modal-logo {
    margin-bottom: 22px;
    font-size: 2.05rem;
    font-weight: 950;
    letter-spacing: -0.06em;
    color: #fff;
}

.auth-modal-logo span {
    color: #2a7fff;
}

.auth-modal-title {
    margin: 0 0 8px;
    font-size: 1.85rem;
    line-height: 1;
    letter-spacing: -0.04em;
}

.auth-modal-subtitle {
    margin: 0;
    color: #8ea0b8;
    font-size: 0.9rem;
    line-height: 1.45;
}

.auth-modal-body {
    padding: 24px 30px 30px;
}

.auth-google-btn,
.auth-primary-btn {
    width: 100%;
    min-height: 48px;
    border: 0;
    border-radius: 13px;
    font-weight: 900;
    cursor: pointer;
}

.auth-google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #f8fafc;
    color: #0f172a;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

.auth-google-btn:hover {
    background: #ffffff;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 18px 0;
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.auth-divider span {
    height: 1px;
    flex: 1;
    background: rgba(148, 163, 184, 0.18);
}

.auth-divider em {
    font-style: normal;
}

.auth-field {
    display: block;
    margin-bottom: 14px;
    text-align: left;
}

.auth-field > span {
    display: block;
    margin: 0 0 7px;
    color: #cbd5e1;
    font-size: 0.78rem;
    font-weight: 900;
}

.auth-field-shell {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 12px;
    border: 1px solid rgba(71, 85, 105, 0.8);
    border-radius: 13px;
    background: rgba(2, 6, 14, 0.74);
    transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.auth-field-shell:focus-within {
    border-color: rgba(42, 127, 255, 0.8);
    box-shadow: 0 0 0 3px rgba(42, 127, 255, 0.13);
    background: rgba(7, 12, 22, 0.96);
}

.auth-field-icon,
.auth-reveal-btn {
    color: #64748b;
    flex: 0 0 auto;
}

.auth-field-input {
    width: 100%;
    min-width: 0;
    height: 48px;
    border: 0;
    outline: 0;
    background: transparent;
    color: #f8fafc;
    font: inherit;
    font-size: 0.92rem;
    font-weight: 800;
}

.auth-field-input::placeholder {
    color: #475569;
}

.auth-reveal-btn {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.auth-reveal-btn:hover {
    color: #bfdbfe;
}

.auth-forgot-row {
    min-height: 24px;
    margin: -4px 0 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.auth-forgot-row button {
    border: 0;
    background: transparent;
    color: #7aa7ff;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 900;
    cursor: pointer;
}

.auth-forgot-row span {
    color: #94a3b8;
    font-size: 0.72rem;
    font-weight: 800;
}

.auth-terms-container {
    align-items: flex-start;
    gap: 9px;
    margin: 0 0 14px;
    padding: 12px;
    border: 1px solid rgba(59, 130, 246, 0.18);
    border-radius: 12px;
    background: rgba(37, 99, 235, 0.06);
    color: #94a3b8;
    font-size: 0.76rem;
    line-height: 1.4;
    text-align: left;
}

.auth-terms-container input {
    margin-top: 2px;
    cursor: pointer;
}

.auth-terms-container span {
    color: #60a5fa;
    cursor: pointer;
    font-weight: 900;
    text-decoration: underline;
}

.auth-error {
    margin: 0 0 14px;
    color: #ef4444;
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1.4;
    text-align: left;
}

.auth-feature-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 6px 0 18px;
    padding: 14px;
    border: 1px solid rgba(42, 127, 255, 0.25);
    border-radius: 16px;
    background:
        linear-gradient(135deg, rgba(37, 99, 235, 0.17), rgba(16, 185, 129, 0.06)),
        rgba(15, 23, 42, 0.72);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
    text-align: left;
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.auth-feature-card.is-swapping {
    opacity: 0.42;
    transform: translateY(2px);
}

.auth-feature-icon {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 36px;
    border: 1px solid rgba(96, 165, 250, 0.35);
    border-radius: 12px;
    background: rgba(37, 99, 235, 0.16);
    color: #8b5cf6;
}

.auth-feature-card strong {
    display: block;
    margin-bottom: 3px;
    color: #f8fafc;
    font-size: 0.86rem;
}

.auth-feature-card p {
    margin: 0;
    color: #9fb1ca;
    font-size: 0.78rem;
    line-height: 1.38;
}

.auth-primary-btn {
    color: #fff;
    background: linear-gradient(135deg, #2a7fff, #6d35ff);
    box-shadow: 0 14px 34px rgba(42, 127, 255, 0.28);
    transition: filter 0.16s ease, transform 0.16s ease;
}

.auth-primary-btn:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
}

.auth-google-btn:disabled,
.auth-primary-btn:disabled {
    cursor: wait;
    opacity: 0.68;
    filter: saturate(0.75);
    transform: none;
}

.auth-switch-prompt {
    margin-top: 16px;
    display: flex;
    justify-content: center;
    gap: 7px;
    color: #8ea0b8;
    font-size: 0.84rem;
    font-weight: 800;
}

.auth-switch-prompt button {
    border: 0;
    background: transparent;
    color: #60a5fa;
    font: inherit;
    font-weight: 950;
    cursor: pointer;
}

.auth-switch-prompt button:hover {
    color: #93c5fd;
}

body.terms-gated #mainAppContainer {
    filter: blur(2px);
    pointer-events: none;
    user-select: none;
}

.terms-gate-modal {
    z-index: 5000;
    background: rgba(2, 6, 23, 0.88);
    backdrop-filter: blur(9px);
    -webkit-backdrop-filter: blur(9px);
}

.terms-gate-box {
    max-width: 520px;
    text-align: left;
    border-color: rgba(37, 99, 235, 0.42);
    background: linear-gradient(180deg, #111827 0%, #090f1b 100%);
    box-shadow: 0 30px 90px rgba(0,0,0,0.7), 0 0 0 1px rgba(37,99,235,0.12) inset;
}

.terms-gate-icon {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #60a5fa;
    background: rgba(37, 99, 235, 0.14);
    border: 1px solid rgba(96, 165, 250, 0.25);
    margin-bottom: 16px;
}

.terms-gate-kicker {
    color: #93c5fd;
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-weight: 900;
    margin-bottom: 8px;
}

.terms-gate-box h2 {
    margin: 0 0 10px;
    color: #f8fafc;
    font-size: 1.7rem;
}

.terms-gate-copy,
.terms-gate-note {
    color: #a9b7cc;
    line-height: 1.55;
}

.terms-gate-copy {
    margin-bottom: 16px;
}

.terms-gate-note {
    margin: 14px 0 0;
    font-size: 0.86rem;
}

.terms-gate-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.terms-gate-links a {
    color: #dbeafe;
    text-decoration: none;
    padding: 8px 11px;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.12);
    border: 1px solid rgba(96, 165, 250, 0.24);
    font-size: 0.82rem;
    font-weight: 800;
}

.terms-gate-links a:hover {
    background: rgba(37, 99, 235, 0.22);
    border-color: rgba(96, 165, 250, 0.42);
}

.terms-gate-error {
    margin-top: 14px;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid rgba(239, 68, 68, 0.35);
    background: rgba(127, 29, 29, 0.22);
    color: #fecaca;
    font-size: 0.86rem;
    font-weight: 700;
}

.terms-gate-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 20px;
}

.terms-gate-actions button {
    width: 100%;
    justify-content: center;
}

@media (max-width: 640px) {
    .terms-gate-box {
        width: calc(100% - 28px);
        padding: 24px;
    }
    .terms-gate-actions {
        grid-template-columns: 1fr;
    }
}

.sector-map-modal {
    z-index: 2500;
    background: rgba(0,0,0,0.86);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.sector-map-panel {
    width: min(1180px, calc(100vw - 34px));
    max-height: min(860px, calc(100vh - 34px));
    background: linear-gradient(180deg, #0f1724 0%, #080c13 100%);
    border: 1px solid rgba(37,99,235,0.28);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 34px 90px rgba(0,0,0,0.76), 0 0 0 1px rgba(15,23,42,0.9) inset;
    display: flex;
    flex-direction: column;
}
.sector-map-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding: 20px 22px 16px;
    border-bottom: 1px solid rgba(31,41,55,0.95);
}
.sector-map-kicker {
    color: #60a5fa;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.74rem;
    font-weight: 900;
    margin-bottom: 6px;
}
.sector-map-header h2 {
    margin: 0;
    color: #f8fafc;
    font-size: 1.55rem;
    letter-spacing: -0.02em;
}
.sector-map-close {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid rgba(51,65,85,0.9);
    background: rgba(15,23,42,0.82);
    color: #cbd5e1;
    font-size: 1.45rem;
    line-height: 1;
    cursor: pointer;
}
.sector-map-close:hover {
    border-color: rgba(96,165,250,0.7);
    color: #ffffff;
}
.sector-map-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 22px 10px;
}
.sector-map-tabs,
.sector-map-groups {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: thin;
}
.sector-map-groups {
    padding: 0 22px 12px;
}
.sector-map-tab,
.sector-map-group {
    border: 1px solid rgba(51,65,85,0.9);
    background: rgba(15,23,42,0.68);
    color: #94a3b8;
    border-radius: 8px;
    padding: 8px 11px;
    font-size: 0.78rem;
    font-weight: 900;
    white-space: nowrap;
    cursor: pointer;
}
.sector-map-tab.active,
.sector-map-group.active {
    color: #eff6ff;
    border-color: rgba(37,99,235,0.9);
    background: linear-gradient(135deg, rgba(37,99,235,0.34), rgba(16,185,129,0.12));
    box-shadow: 0 0 0 1px rgba(37,99,235,0.12) inset;
}
.sector-map-note {
    color: #64748b;
    padding: 0 22px 12px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}
.sector-map-grid {
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 8px;
    padding: 0 22px 22px;
    overflow-y: auto;
    min-height: 430px;
}
.sector-map-tile {
    --tile-grow: 3;
    flex: var(--tile-grow) 1 126px;
    min-width: 112px;
    min-height: 106px;
    border: 1px solid rgba(51,65,85,0.9);
    border-radius: 8px;
    background: #101722;
    color: #e5e7eb;
    cursor: pointer;
    display: grid;
    grid-template-rows: auto auto auto 1fr;
    align-items: start;
    justify-items: start;
    gap: 4px;
    padding: 12px;
    text-align: left;
    position: relative;
    overflow: hidden;
    transition: transform 0.15s ease, border-color 0.15s ease, filter 0.15s ease;
}
.sector-map-tile::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 72% 20%, rgba(255,255,255,0.12), transparent 34%);
    opacity: 0.45;
    pointer-events: none;
}
.sector-map-tile:hover {
    transform: translateY(-2px);
    border-color: rgba(226,232,240,0.45);
    filter: brightness(1.07);
}
.sector-map-logo {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(2,6,23,0.5);
    border: 1px solid rgba(255,255,255,0.16);
    color: #dbeafe;
    font-size: 0.72rem;
    font-weight: 950;
    letter-spacing: -0.02em;
    position: relative;
    z-index: 1;
}
.sector-map-symbol {
    color: #e2e8f0;
    font-size: 1.08rem;
    font-weight: 950;
    position: relative;
    z-index: 1;
}
.sector-map-tile strong {
    color: #e2e8f0;
    font-size: 1rem;
    font-weight: 950;
    position: relative;
    z-index: 1;
}
.sector-map-tile small {
    align-self: end;
    color: rgba(226,232,240,0.72);
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    position: relative;
    z-index: 1;
}
.sector-map-tile.surge { background: linear-gradient(145deg, #059669, #063d2d); border-color: rgba(16,185,129,0.75); }
.sector-map-tile.up { background: linear-gradient(145deg, #047857, #092d25); border-color: rgba(16,185,129,0.52); }
.sector-map-tile.soft-up { background: linear-gradient(145deg, #12382f, #0d1f1d); border-color: rgba(16,185,129,0.32); }
.sector-map-tile.flat { background: linear-gradient(145deg, #172033, #101827); }
.sector-map-tile.soft-down { background: linear-gradient(145deg, #3a1820, #191018); border-color: rgba(248,113,113,0.28); }
.sector-map-tile.down { background: linear-gradient(145deg, #7f1d1d, #2a1117); border-color: rgba(248,113,113,0.46); }
.sector-map-tile.drop { background: linear-gradient(145deg, #b91c1c, #3a1118); border-color: rgba(248,113,113,0.72); }
.sector-map-tile.unavailable { opacity: 0.72; filter: grayscale(0.35); }
.sector-map-tile.skeleton {
    cursor: default;
    min-height: 106px;
    border-color: rgba(51,65,85,0.5);
}
.sector-map-empty {
    width: 100%;
    min-height: 180px;
    border: 1px dashed rgba(51,65,85,0.9);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    font-weight: 800;
}

.sector-map-panel {
    width: min(1460px, calc(100vw - 28px));
    max-height: min(930px, calc(100vh - 24px));
    background: #05070b;
    border-color: rgba(42, 127, 255, 0.32);
}

.sector-map-header {
    align-items: center;
    padding: 14px 16px 12px;
    background: #070b12;
}

.sector-map-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sector-map-camera {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(42, 127, 255, 0.42);
    border-radius: 9px;
    background: linear-gradient(135deg, rgba(42, 127, 255, 0.18), rgba(16, 185, 129, 0.08));
    color: #dbeafe;
    padding: 0 12px;
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 900;
    cursor: pointer;
}

.sector-map-camera:hover {
    border-color: rgba(96, 165, 250, 0.74);
    color: #fff;
}

.sector-map-toolbar {
    padding: 10px 16px 8px;
    background: #05070b;
}

.sector-map-groups {
    padding: 0 16px 10px;
    background: #05070b;
}

.sector-map-note {
    padding: 0 16px 8px;
    color: #64748b;
}

.sector-map-scale {
    display: flex;
    justify-content: flex-end;
    gap: 4px;
    padding: 0 16px 10px;
    background: #05070b;
}

.sector-map-scale span {
    min-width: 52px;
    padding: 7px 8px;
    border-radius: 4px;
    color: #f8fafc;
    text-align: center;
    font-family: "Fira Code", monospace;
    font-size: 0.72rem;
    font-weight: 900;
}

.scale-drop { background: #f23645; }
.scale-down { background: #b93943; }
.scale-soft-down { background: #85323c; }
.scale-flat { background: #3c4656; }
.scale-soft-up { background: #2f574b; }
.scale-up { background: #087a45; }
.scale-surge { background: #0b9f55; }

.sector-map-grid {
    display: block;
    padding: 0 10px 12px;
    overflow: hidden;
    min-height: 0;
    flex: 1;
}

.market-map-board {
    position: relative;
    width: 100%;
    height: min(70vh, 730px);
    min-height: 520px;
    background: #05070b;
    border: 1px solid rgba(15, 23, 42, 0.98);
    overflow: hidden;
}

.market-map-sector {
    position: absolute;
    min-width: 0;
    min-height: 0;
    border: 1px solid #05070b;
    background: #080c12;
    overflow: hidden;
}

.market-map-sector-title {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 0 5px;
    background: rgba(3, 7, 12, 0.82);
    color: #e5e7eb;
    font-family: "Fira Code", monospace;
    font-size: 0.58rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    z-index: 2;
}

.market-map-sector-title span {
    color: #64748b;
    font-size: 0.54rem;
}

.market-map-sector-inner {
    position: absolute;
    left: 1px;
    right: 1px;
    top: 19px;
    bottom: 1px;
}

.market-map-tile {
    position: absolute;
    container-type: size;
    min-width: 0;
    min-height: 0;
    border: 1px solid rgba(3, 7, 12, 0.86);
    border-radius: 0;
    color: #f8fafc;
    cursor: pointer;
    overflow: hidden;
    padding: 4px;
    font-family: inherit;
    text-align: center;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 1px;
    transition: filter 0.12s ease, box-shadow 0.12s ease, transform 0.12s ease;
}

.market-map-tile:hover {
    z-index: 5;
    filter: brightness(1.16);
    box-shadow: 0 0 0 1px rgba(255,255,255,0.44), 0 16px 30px rgba(0,0,0,0.28);
}

.market-map-tile.surge { background: #0b9f55; }
.market-map-tile.up { background: #087a45; }
.market-map-tile.soft-up { background: #2f574b; }
.market-map-tile.flat { background: #3c4656; }
.market-map-tile.soft-down { background: #5a3038; }
.market-map-tile.down { background: #b93943; }
.market-map-tile.drop { background: #f23645; }
.market-map-tile.unavailable { background: #283142; color: #94a3b8; }

.market-map-logo {
    width: clamp(18px, 12cqw, 30px);
    height: clamp(18px, 12cqw, 30px);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(255,255,255,0.9);
    color: #0f172a;
    font-size: clamp(0.46rem, 2.8cqw, 0.66rem);
    font-weight: 950;
}

.market-map-tile strong {
    color: #fff;
    max-width: 96%;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: clamp(0.5rem, min(13cqw, 22cqh), 1.65rem);
    font-weight: 950;
    line-height: 1;
    text-shadow: 0 1px 2px rgba(0,0,0,0.22);
}

.market-map-tile em {
    color: #fff;
    font-style: normal;
    font-family: "Fira Code", monospace;
    font-size: clamp(0.46rem, min(4.8cqw, 8cqh), 0.82rem);
    font-weight: 900;
    line-height: 1;
    text-shadow: 0 1px 2px rgba(0,0,0,0.22);
}

.market-map-tile small {
    color: rgba(255,255,255,0.72);
    font-size: clamp(0.46rem, 3.4cqw, 0.66rem);
    font-weight: 800;
    line-height: 1.1;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.market-map-tile.mega .market-map-logo,
.market-map-tile.large .market-map-logo {
    width: clamp(26px, 7cqw, 38px);
    height: clamp(26px, 7cqw, 38px);
    font-size: clamp(0.58rem, 2.2cqw, 0.78rem);
    margin-bottom: 3px;
}

.market-map-tile.mega strong { font-size: clamp(1.05rem, min(13cqw, 26cqh), 2.85rem); }
.market-map-tile.large strong { font-size: clamp(0.88rem, min(12cqw, 23cqh), 2rem); }
.market-map-tile.medium strong { font-size: clamp(0.66rem, min(10cqw, 18cqh), 1.12rem); }
.market-map-tile.medium .market-map-logo {
    width: clamp(18px, 8cqw, 25px);
    height: clamp(18px, 8cqw, 25px);
}
.market-map-tile.small .market-map-logo,
.market-map-tile.tiny .market-map-logo,
.market-map-tile.small small,
.market-map-tile.tiny small,
.market-map-tile.tiny em {
    display: none;
}

.market-map-tile.small {
    padding: 2px;
}

.market-map-tile.small strong {
    font-size: clamp(0.52rem, min(12cqw, 24cqh), 0.8rem);
}

.market-map-tile.small em {
    font-size: clamp(0.42rem, min(7cqw, 13cqh), 0.58rem);
}

.market-map-tile.tiny {
    padding: 1px;
}

.market-map-tile.tiny strong {
    font-size: clamp(0.42rem, min(14cqw, 26cqh), 0.58rem);
}

.skeleton-board {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-auto-rows: 1fr;
    gap: 2px;
    padding: 2px;
}

.market-map-skeleton-tile {
    min-height: 54px;
    background: linear-gradient(90deg, rgba(30,41,59,0.75), rgba(51,65,85,0.46), rgba(30,41,59,0.75));
    background-size: 200% 100%;
    animation: shimmer 1.2s infinite;
    animation-delay: var(--skel-delay, 0s);
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.share-card-modal.heatmap-share-modal {
    z-index: 2700;
}

.heatmap-share-panel {
    max-width: 1120px;
}

.heatmap-share-preview img {
    width: min(100%, 980px);
}

/* CHECKOUT & T&C MODALS */
.checkout-modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.7); z-index: 9999; justify-content: center; align-items: center; }
.checkout-modal-content { background-color: #ffffff; color: #333333; padding: 30px; border-radius: 12px; max-width: 450px; text-align: center; font-family: sans-serif; box-shadow: 0px 10px 30px rgba(0,0,0,0.5); }
.modal-text { font-size: 16px; margin-bottom: 15px; line-height: 1.5; text-align: left; }
.red-warning { color: #cc0000; font-weight: bold; background-color: #ffeeee; padding: 10px; border-radius: 6px; border-left: 4px solid #cc0000; }
.modal-button-container { display: flex; justify-content: space-between; margin-top: 25px; }
.btn-cancel { background-color: #dddddd; color: #333; border: none; padding: 10px 20px; border-radius: 6px; cursor: pointer; font-weight: bold; transition: background-color 0.2s; }
.btn-cancel:hover { background-color: #cccccc; }
.btn-continue { background-color: #007bff; color: white; border: none; padding: 10px 20px; border-radius: 6px; cursor: pointer; font-weight: bold; transition: background-color 0.2s; }
.btn-continue:hover { background-color: #0056b3; }
.tc-content h4 { color: white; margin-top: 20px; margin-bottom: 8px; font-size: 1.05rem; }
.tc-content p, .tc-content ul { color: #9ca3af; margin-bottom: 10px; font-size: 0.9rem; line-height: 1.6; }
.tc-content ul { padding-left: 20px; }
.tc-content li { margin-bottom: 6px; }
.view-hidden { display: none !important; }
.pos { color: #10b981; } .neg { color: #ef4444; }
.spinner { border: 3px solid #1f2937; border-top: 3px solid #2563eb; border-radius: 50%; width: 24px; height: 24px; animation: spin 1s linear infinite; margin: 40px auto; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }


/* =========================================
   QUAN TERMINAL — INSTITUTIONAL REDESIGN
   Palette:  bg=#0A0D14  surface=#0F1520  border=#242B3D
   Accent:   blue=#2563eb  green=#10b981  amber=#f59e0b
   Font:     Fira Code for all financial data/tickers
   ========================================= */

/* ── Modal overlay ── */
#copilotModal {
    z-index: 2147483647 !important;
    background: rgba(0, 0, 0, 0.82) !important;
    backdrop-filter: blur(6px) !important;
    -webkit-backdrop-filter: blur(6px) !important;
}

/* ── Main window ──
   Desktop: wider (1140px), taller (88vh), sharper radius (6px).
   The purple border is replaced with a dark structural border. */
#copilotModal .copilot-box {
    background: #0A0D14 !important;
    width: 98%;
    max-width: 1580px;
    height: 94vh;
    max-height: 1150px;
    border-radius: 6px !important;
    border: 1px solid #242B3D !important;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow:
        0 0 0 1px rgba(36,43,61,0.6),
        0 40px 90px -15px rgba(0, 0, 0, 0.85) !important;
    text-align: left;
    margin: auto !important;
}

/* ── Header — glassmorphism sticky bar ──
   Uses backdrop-filter so chat content blurs behind it when scrolling. */
.copilot-header {
    padding: 14px 22px;
    border-bottom: 1px solid #1A2030;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(10, 13, 20, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    flex-shrink: 0;
    gap: 12px;
    position: relative;
    z-index: 30;
}

.copilot-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.quan-title-wordmark {
    font-weight: 900;
    letter-spacing: -0.02em;
    color: #f8fafc;
    white-space: nowrap;
}

.quan-title-wordmark span {
    color: #2a7fff;
}

.quan-title-logo {
    display: block;
    width: auto;
    height: 26px;
    object-fit: contain;
}

.copilot-close,
.copilot-new-chat {
    background: transparent;
    border: 1px solid #242B3D;
    color: #4b5563;
    width: 30px;
    height: 30px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.copilot-close:hover,
.copilot-new-chat:hover {
    border-color: #374151;
    color: #e5e7eb;
    background: #1a2030;
}

/* ── Chat area ── */
.copilot-chat-area {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0;
    scroll-behavior: smooth;
    background: #0A0D14;
    position: relative;
    z-index: 1;
}

/* Slim, dark scrollbar — terminal aesthetic */
.copilot-chat-area::-webkit-scrollbar { width: 4px; }
.copilot-chat-area::-webkit-scrollbar-track { background: transparent; }
.copilot-chat-area::-webkit-scrollbar-thumb {
    background: #1e2840;
    border-radius: 2px;
}
.copilot-chat-area::-webkit-scrollbar-thumb:hover { background: #2A3143; }

/* ── Welcome state ── */
.copilot-welcome {
    text-align: center;
    margin: auto 0;
    padding: 40px 32px;
}

.copilot-greeting {
    font-family: 'Fira Code', monospace;
    font-size: 1.4rem;
    font-weight: 600;
    letter-spacing: -0.5px;
    color: #e5e7eb;
    margin-bottom: 8px;
    /* Subtle gradient text — less cartoonish than the old version */
    background: linear-gradient(135deg, #c0cfe8 0%, #7b9fd4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.copilot-sub-greeting {
    color: #4b5563;
    font-size: 0.9rem;
    margin-bottom: 28px;
    letter-spacing: 0.2px;
}

/* ── Quick-start chips ── */
.copilot-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    max-width: 680px;
    margin: 0 auto;
}

.chip {
    background: #0F1520;
    border: 1px solid #242B3D;
    color: #9ca3af;
    padding: 8px 14px;
    border-radius: 4px;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    letter-spacing: 0.2px;
}
.chip:hover {
    background: #1a2233;
    border-color: #2563eb;
    color: #e5e7eb;
    transform: translateY(-1px);
}

/* ── Message rows — flat, full-width, no bubble ──
   Both user and AI messages span the full chat width.
   Differentiated by background and left-border accent,
   NOT by alignment or rounded corners. */
.chat-bubble {
    width: 100%;
    max-width: 100%;
    padding: 16px 28px;
    border-radius: 0;
    font-size: 0.93rem;
    line-height: 1.65;
    position: relative;
    align-self: stretch;
    box-sizing: border-box;
}

/* User message — left-side blue indicator strip */
.chat-user {
    background: rgba(37, 99, 235, 0.04);
    color: #93afd4;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
    border-left: 3px solid #2563eb;
    padding-left: 28px;
    font-size: 0.88rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

/* AI message — glassmorphic premium panel */
.chat-ai {
    background: linear-gradient(180deg, rgba(23, 25, 27, 0.6) 0%, rgba(15, 21, 32, 0.4) 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    border-left: 3px solid #fbbf24; /* Gold accent */
    color: #cbd5e1;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 4px 20px rgba(0, 0, 0, 0.25);
}

/* Section headers rendered by the AI (**THE BOTTOM LINE:** etc) */
.chat-ai b {
    color: #f59e0b;
    font-weight: 600;
}

/* Italic follow-up questions */
.chat-ai i {
    color: #6b7280;
    font-style: italic;
}

/* ── Financial highlight spans (injected by renderMarkdown()) ── */

/* Ticker symbols: $AAPL, $NVDA — monospace, blue */
.hl-ticker {
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 0.85em;
    font-weight: 500;
    color: #60a5fa;
    letter-spacing: 0.3px;
}

/* Positive percentages: +12.4% — green */
.hl-pct-pos {
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 0.87em;
    font-weight: 500;
    color: #10b981;
}

/* Negative percentages: -8.1% — red */
.hl-pct-neg {
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 0.87em;
    font-weight: 500;
    color: #ef4444;
}

/* ── Chat Markdown Styles ── */
.chat-markdown-h1 {
    color: #ffffff;
    font-size: 1.35rem;
    font-weight: 700;
    margin-top: 24px;
    margin-bottom: 12px;
    font-family: 'Outfit', sans-serif;
}
.chat-markdown-h2 {
    color: #ffffff;
    font-size: 1.2rem;
    font-weight: 600;
    margin-top: 20px;
    margin-bottom: 10px;
    font-family: 'Outfit', sans-serif;
}
.chat-markdown-h3 {
    color: #fbbf24; /* Amber Gold */
    font-size: 1.05rem;
    font-weight: 600;
    margin-top: 18px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Outfit', sans-serif;
}
.chat-markdown-h3::before {
    content: "";
    display: inline-block;
    width: 3px;
    height: 13px;
    background: #fbbf24;
    border-radius: 2px;
}
.chat-markdown-p {
    margin-bottom: 8px;
    line-height: 1.6;
}
.chat-markdown-gap {
    height: 8px;
}
.chat-markdown-ul {
    margin: 8px 0 14px 18px;
    padding: 0;
    list-style-type: none;
}
.chat-markdown-li {
    position: relative;
    margin-bottom: 6px;
    line-height: 1.55;
    padding-left: 14px;
    font-size: 0.91rem;
}
.chat-markdown-li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: #fbbf24;
    font-weight: bold;
}

/* ── Input area — glassmorphism sticky footer ── */
.quan-source-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    max-width: 100%;
    margin: 0 3px;
    padding: 3px 8px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: #cbd5e1;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1.25;
    text-decoration: none;
    vertical-align: 0.08em;
    white-space: nowrap;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.quan-source-pill:hover {
    background: rgba(96, 165, 250, 0.18);
    border-color: rgba(96, 165, 250, 0.5);
    color: #eff6ff;
    transform: translateY(-1px);
}

.quan-source-pill-disabled {
    cursor: default;
    opacity: 0.72;
}

.quan-source-pill-broad {
    border-color: rgba(245, 158, 11, 0.36);
    color: #fcd34d;
}

.quan-source-pill-broad .quan-source-dot {
    background: #f59e0b;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.65);
}

.quan-source-pill-disabled:hover {
    transform: none;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(148, 163, 184, 0.22);
    color: #cbd5e1;
}

.quan-source-dot {
    width: 6px;
    height: 6px;
    flex: 0 0 6px;
    border-radius: 50%;
    background: #60a5fa;
    box-shadow: 0 0 10px rgba(96, 165, 250, 0.65);
}

.quan-answer-highlight {
    display: inline;
    padding: 1px 5px 2px;
    border-radius: 5px;
    background: linear-gradient(90deg, rgba(30, 64, 175, 0.78), rgba(15, 23, 42, 0.92));
    color: #eaf2ff;
    font-weight: 800;
    box-shadow: inset 0 -1px 0 rgba(96, 165, 250, 0.45);
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}

.app-legal-links {
    width: min(100%, 1320px);
    margin: 22px auto 38px;
    padding: 0 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    color: #475569;
    font-size: 0.72rem;
    font-weight: 800;
}

.app-legal-links a {
    color: #64748b;
    text-decoration: none;
}

.app-legal-links a:hover {
    color: #93c5fd;
}

#copilotModal.copilot-layout-side .quan-source-pill,
#copilotModal.copilot-layout-split .quan-source-pill {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.copilot-md-table-wrap {
    width: 100%;
    overflow-x: auto;
    margin: 14px 0;
    border: 1px solid rgba(42, 127, 255, 0.22);
    border-radius: 10px;
    background: rgba(7, 12, 22, 0.72);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
}

.copilot-md-table {
    width: 100%;
    min-width: 620px;
    border-collapse: collapse;
    font-size: 0.84rem;
    line-height: 1.45;
}

.copilot-md-table th,
.copilot-md-table td {
    padding: 12px 14px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.copilot-md-table th {
    color: #93c5fd;
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    background: rgba(37, 99, 235, 0.08);
}

.copilot-md-table tr:last-child td {
    border-bottom: none;
}

.copilot-md-table td {
    color: #dbeafe;
}

.copilot-md-table td:last-child {
    color: #fbbf24;
    font-weight: 700;
}

.quan-visual-stack {
    display: grid;
    gap: 12px;
    margin-top: 16px;
    max-width: 100%;
}

.quan-visual-card {
    border: 1px solid rgba(42, 127, 255, 0.25);
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(8, 13, 22, 0.98));
    border-radius: 10px;
    overflow: hidden;
    max-width: 100%;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
}

.quan-visual-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(42, 127, 255, 0.16);
}

.quan-visual-header div { min-width: 0; }

.quan-visual-header span {
    display: block;
    color: #60a5fa;
    font-family: "Fira Code", monospace;
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 900;
    margin-bottom: 3px;
}

.quan-visual-header strong {
    display: block;
    color: #f8fafc;
    font-size: 0.95rem;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.quan-visual-toggle {
    flex-shrink: 0;
    border: 1px solid rgba(96, 165, 250, 0.35);
    background: rgba(42, 127, 255, 0.12);
    color: #bfdbfe;
    border-radius: 999px;
    min-height: 30px;
    padding: 0 11px;
    font-size: 0.72rem;
    font-weight: 900;
    cursor: pointer;
}

.quan-visual-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.quan-visual-fullscreen {
    position: relative;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    border: 1px solid rgba(148, 163, 184, 0.34);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.72);
    cursor: pointer;
}

.quan-visual-fullscreen span,
.quan-visual-fullscreen::before,
.quan-visual-fullscreen::after {
    position: absolute;
    inset: 9px;
    content: '';
    border: 2px solid #bfdbfe;
    border-radius: 2px;
}

.quan-visual-fullscreen span {
    border-left: 0;
    border-bottom: 0;
}

.quan-visual-fullscreen::before {
    border-right: 0;
    border-top: 0;
}

.quan-visual-fullscreen::after {
    border: 0;
}

.quan-visual-body {
    padding: 14px;
    max-width: 100%;
    overflow-x: auto;
}

.quan-document-summary {
    display: grid;
    gap: 14px;
}

.quan-doc-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: start;
    padding: 14px;
    border: 1px solid rgba(96, 165, 250, 0.2);
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(30, 64, 175, 0.18), rgba(15, 23, 42, 0.72));
}

.quan-doc-hero span,
.quan-doc-section h4 {
    display: block;
    margin: 0 0 6px;
    color: #93c5fd;
    font-family: "Fira Code", monospace;
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.quan-doc-hero strong {
    display: block;
    color: #f8fafc;
    font-size: 1rem;
    line-height: 1.42;
    overflow-wrap: anywhere;
}

.quan-doc-source {
    display: grid;
    justify-items: end;
    gap: 6px;
    min-width: 150px;
}

.quan-doc-source em {
    color: #94a3b8;
    font-size: 0.72rem;
    font-style: normal;
}

.quan-doc-layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    align-items: start;
}

.quan-doc-column {
    display: grid;
    gap: 12px;
    align-content: start;
    min-width: 0;
}

.quan-doc-section {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.quan-doc-section > div {
    display: grid;
    gap: 8px;
}

.quan-doc-item {
    display: grid;
    gap: 5px;
    padding: 11px 12px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.035);
}

.quan-doc-item.pos {
    border-color: rgba(16, 185, 129, 0.28);
}

.quan-doc-item.warn {
    border-color: rgba(251, 191, 36, 0.28);
}

.quan-doc-item span {
    color: #dbeafe;
    font-size: 0.8rem;
    font-weight: 900;
}

.quan-doc-item strong {
    color: #f8fafc;
    font-family: "Fira Code", monospace;
    font-size: 0.95rem;
}

.quan-doc-item p {
    margin: 0;
    color: #cbd5e1;
    font-size: 0.86rem;
    line-height: 1.48;
}

.quan-doc-spotlight-grid {
    display: grid;
    gap: 8px;
}

.quan-doc-spotlight {
    display: grid;
    gap: 6px;
    min-height: 96px;
    padding: 12px;
    border: 1px solid rgba(96, 165, 250, 0.22);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(42, 127, 255, 0.12), rgba(15, 23, 42, 0.58)),
        rgba(255, 255, 255, 0.035);
}

.quan-doc-spotlight.pos {
    border-color: rgba(16, 185, 129, 0.28);
}

.quan-doc-spotlight.warn,
.quan-doc-spotlight.neg {
    border-color: rgba(251, 191, 36, 0.28);
}

.quan-doc-spotlight span {
    color: #93c5fd;
    font-size: 0.72rem;
    font-weight: 900;
    text-transform: uppercase;
}

.quan-doc-spotlight strong {
    color: #f8fafc;
    font-family: "Fira Code", monospace;
    font-size: 1.05rem;
}

.quan-doc-spotlight p {
    margin: 0;
    color: #cbd5e1;
    font-size: 0.84rem;
    line-height: 1.45;
}

.quan-doc-loading {
    display: grid;
    gap: 14px;
    width: min(960px, 100%);
    padding: 14px;
    border: 1px solid rgba(42, 127, 255, 0.22);
    border-radius: 10px;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.96), rgba(8, 13, 22, 0.96));
}

.quan-doc-loading-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.quan-doc-loading-head span {
    display: block;
    color: #60a5fa;
    font-family: "Fira Code", monospace;
    font-size: 0.62rem;
    text-transform: uppercase;
    font-weight: 900;
    margin-bottom: 4px;
}

.quan-doc-loading-head strong {
    display: block;
    color: #e8f2ff;
    font-size: 0.92rem;
    line-height: 1.3;
}

.quan-doc-loading-hero,
.quan-doc-loading-col i,
.quan-doc-loading-col em,
.quan-doc-loading-hero i,
.quan-doc-loading-hero b {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    background: rgba(30, 41, 59, 0.72);
}

.quan-doc-loading-hero::after,
.quan-doc-loading-col i::after,
.quan-doc-loading-col em::after,
.quan-doc-loading-hero i::after,
.quan-doc-loading-hero b::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    animation: skeleton-shimmer 1.25s ease-in-out infinite;
}

.quan-doc-loading-hero {
    display: grid;
    gap: 10px;
    padding: 14px;
    min-height: 96px;
    border: 1px solid rgba(96, 165, 250, 0.14);
    background: rgba(15, 23, 42, 0.74);
}

.quan-doc-loading-hero i {
    width: 38%;
    height: 12px;
}

.quan-doc-loading-hero b {
    width: 76%;
    height: 24px;
}

.quan-doc-loading-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.quan-doc-loading-col {
    display: grid;
    gap: 10px;
}

.quan-doc-loading-col em {
    width: 48%;
    height: 12px;
}

.quan-doc-loading-col i {
    height: 72px;
    border: 1px solid rgba(148, 163, 184, 0.1);
}

body.quan-doc-modal-open {
    overflow: hidden;
}

.quan-doc-modal {
    position: fixed;
    inset: 0;
    z-index: 2147483648 !important;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 22px;
    background: rgba(2, 6, 23, 0.82);
}

.quan-doc-modal.is-open {
    display: flex;
}

.quan-doc-modal-panel {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    width: min(1060px, 96vw);
    max-height: min(900px, 92vh);
    overflow: hidden;
    border: 1px solid rgba(96, 165, 250, 0.24);
    border-radius: 12px;
    background: #08111f;
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.48);
}

.quan-doc-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px 18px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.quan-doc-modal-header span {
    display: block;
    color: #93c5fd;
    font-family: "Fira Code", monospace;
    font-size: 0.68rem;
    font-weight: 900;
    text-transform: uppercase;
}

.quan-doc-modal-header strong {
    color: #f8fafc;
    font-size: 1rem;
}

.quan-doc-modal-close {
    border: 1px solid rgba(148, 163, 184, 0.32);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.74);
    color: #e2e8f0;
    min-height: 34px;
    padding: 0 13px;
    font-weight: 900;
    cursor: pointer;
}

.quan-doc-modal-body {
    overflow: auto;
    padding: 18px;
}

@media (max-width: 720px) {
    .quan-visual-header {
        align-items: flex-start;
    }

    .quan-visual-actions {
        gap: 6px;
    }

    .quan-doc-hero,
    .quan-doc-layout,
    .quan-doc-layout.is-full {
        grid-template-columns: 1fr;
    }

    .quan-doc-source {
        justify-items: start;
        min-width: 0;
    }

    .quan-doc-loading-grid {
        grid-template-columns: 1fr;
    }

    .quan-doc-modal {
        padding: 10px;
    }

    .quan-doc-modal-panel {
        width: 100%;
        max-height: 94vh;
        border-radius: 10px;
    }

    .quan-doc-modal-header {
        padding: 13px;
    }

    .quan-doc-modal-body {
        padding: 12px;
    }
}

.quan-visual-card.is-collapsed .quan-visual-body {
    max-height: 168px;
    overflow: hidden;
    position: relative;
}

.quan-visual-card.is-collapsed .quan-visual-body::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 46px;
    background: linear-gradient(to bottom, rgba(8,13,22,0), rgba(8,13,22,0.98));
    pointer-events: none;
}

/* Quan 3.4 authoritative Decision Intelligence */
.quan-di-panel { display:grid; gap:14px; color:#dbe7f7; }
.quan-di-hero { display:flex; align-items:center; flex-wrap:wrap; gap:10px; }
.quan-di-hero > strong { color:#f8fbff; font-size:1.18rem; letter-spacing:-.02em; }
.quan-di-hero > span:not(.quan-di-status) { color:#91a6c5; font-size:.78rem; }
.quan-di-status { margin-left:auto; border:1px solid rgba(148,163,184,.28); border-radius:999px; padding:4px 8px; font-size:.62rem; font-weight:800; letter-spacing:.08em; text-transform:uppercase; }
.quan-di-status.complete { color:#52d5a4; background:rgba(16,185,129,.10); border-color:rgba(16,185,129,.3); }
.quan-di-status.degraded { color:#f8c66a; background:rgba(245,158,11,.10); border-color:rgba(245,158,11,.3); }
.quan-di-status.insufficient { color:#f38b8b; background:rgba(239,68,68,.09); border-color:rgba(239,68,68,.28); }
.quan-di-panel p { margin:0; color:#b9c8dc; line-height:1.55; }
.quan-di-panel code { color:#7f96b8; font-size:.68rem; }
.quan-di-metrics { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
.quan-di-metrics > div { padding:10px; border:1px solid rgba(148,163,184,.14); border-radius:10px; background:rgba(15,23,42,.34); }
.quan-di-metrics small,.quan-di-list > small { display:block; color:#7087a9; font-size:.61rem; letter-spacing:.09em; text-transform:uppercase; margin-bottom:5px; }
.quan-di-metrics strong { color:#eef5ff; font-size:.8rem; }
.quan-di-list { display:grid; gap:6px; }
.quan-di-list span { color:#aebed3; border-left:2px solid rgba(94,234,212,.35); padding-left:9px; font-size:.74rem; line-height:1.45; }
.quan-di-warning { border:1px solid rgba(245,158,11,.24); background:rgba(245,158,11,.07); border-radius:9px; padding:9px 10px; color:#e7bd72 !important; }
.quan-di-probabilities,.quan-di-signals { display:grid; gap:8px; }
.quan-di-probabilities > div { display:grid; grid-template-columns:minmax(100px,1fr) minmax(90px,2fr) 54px 72px; gap:8px; align-items:center; font-size:.7rem; text-transform:capitalize; }
.quan-di-signals > div { display:grid; grid-template-columns:minmax(90px,1fr) minmax(80px,1.4fr) 54px minmax(210px,2fr); gap:8px; align-items:center; font-size:.7rem; text-transform:capitalize; }
.quan-di-probabilities > div { grid-template-columns:minmax(120px,1fr) minmax(100px,2fr) 54px; }
.quan-di-probabilities i,.quan-di-signals i { display:block; height:6px; border-radius:999px; overflow:hidden; background:rgba(148,163,184,.14); }
.quan-di-probabilities i b,.quan-di-signals i b { display:block; height:100%; background:linear-gradient(90deg,#5eead4,#60a5fa); }
.quan-di-signals .unavailable { opacity:.55; }
.quan-di-signals small { color:#7184a2; text-align:right; }
.quan-di-risk-table,.quan-di-backtest { display:grid; overflow-x:auto; gap:1px; border-radius:10px; background:rgba(148,163,184,.12); }
.quan-di-risk-table > div { display:grid; grid-template-columns:minmax(150px,1.4fr) repeat(2,minmax(90px,1fr)); gap:1px; }
.quan-di-risk-table.quan-di-action-table > div { grid-template-columns:minmax(90px,1fr) minmax(110px,1.2fr) repeat(3,minmax(86px,1fr)) minmax(140px,1.4fr); }
.quan-di-backtest > div { display:grid; grid-template-columns:minmax(135px,1.5fr) repeat(5,minmax(72px,1fr)); gap:1px; min-width:600px; }
.quan-di-risk-table > div > *, .quan-di-backtest > div > * { padding:9px; background:#111b2c; font-size:.68rem; }
.quan-di-risk-table .head > *, .quan-di-backtest .head > * { color:#7186a7; font-size:.59rem; text-transform:uppercase; letter-spacing:.08em; }
.quan-di-method { color:#758aa7 !important; font-size:.67rem; word-break:break-word; }
.quan-di-meta { margin-top:10px; padding:10px 12px; display:flex; gap:14px; flex-wrap:wrap; align-items:center; border:1px solid rgba(94,234,212,.13); border-radius:11px; background:rgba(8,15,27,.7); }
.quan-di-meta > div { display:grid; gap:2px; }
.quan-di-meta span,.quan-di-meta summary { color:#6f84a3; font-size:.58rem; letter-spacing:.08em; text-transform:uppercase; }
.quan-di-meta strong,.quan-di-meta code { color:#b9c9dd; font-size:.67rem; }
.quan-di-meta details { flex-basis:100%; }
.quan-di-meta summary { cursor:pointer; }
.quan-di-trace { display:flex; flex-wrap:wrap; gap:6px; margin-top:8px; }
.quan-di-trace a,.quan-di-trace code,.quan-di-trace span { padding:4px 7px; border-radius:6px; background:rgba(148,163,184,.08); color:#8ea7ca; font-size:.61rem; text-transform:none; letter-spacing:0; }
@media (max-width:700px) {
    .quan-di-metrics { grid-template-columns:1fr; }
    .quan-di-probabilities > div { grid-template-columns:105px 1fr 48px; }
    .quan-di-signals > div { grid-template-columns:90px 1fr 48px; }
    .quan-di-signals small { display:none; }
    .quan-di-status { margin-left:0; }
}

.quan-scenario-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.quan-scenario-card {
    border: 1px solid rgba(51, 65, 85, 0.8);
    background: rgba(15, 23, 42, 0.78);
    border-radius: 8px;
    padding: 12px;
    min-width: 0;
}

.quan-scenario-card.bull { border-color: rgba(16,185,129,0.38); background: rgba(6, 78, 59, 0.18); }
.quan-scenario-card.base { border-color: rgba(96,165,250,0.34); background: rgba(30, 64, 175, 0.14); }
.quan-scenario-card.bear { border-color: rgba(248,113,113,0.34); background: rgba(127, 29, 29, 0.16); }

.quan-scenario-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
}

.quan-scenario-top span,
.quan-level-row span,
.quan-analyst-row span {
    color: #94a3b8;
    font-family: "Fira Code", monospace;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 900;
}

.quan-scenario-top strong {
    color: #f8fafc;
    font-size: 1rem;
}

.quan-scenario-meta {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin: 10px 0;
}

.quan-scenario-meta em {
    color: #cbd5e1;
    font-style: normal;
    font-size: 0.78rem;
}

.quan-scenario-meta b {
    color: #7bf16f;
    font-family: "Fira Code", monospace;
}

.quan-scenario-card p,
.quan-timeline-content p {
    color: #cbd5e1;
    font-size: 0.86rem;
    line-height: 1.48;
    margin: 0 0 8px;
}

.quan-scenario-card small {
    color: #94a3b8;
    line-height: 1.45;
    display: block;
}

.quan-timeline {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

.quan-timeline-event {
    position: relative;
    display: grid;
    grid-template-columns: 18px 1fr;
    gap: 8px;
    min-width: 0;
}

.quan-timeline-dot {
    width: 12px;
    height: 12px;
    margin-top: 5px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 0 5px rgba(16,185,129,0.12);
}

.quan-timeline-event.neg .quan-timeline-dot {
    background: #ef4444;
    box-shadow: 0 0 0 5px rgba(239,68,68,0.12);
}

.quan-timeline-content {
    min-width: 0;
    border-left: 1px solid rgba(51,65,85,0.8);
    padding-left: 10px;
}

.quan-timeline-content span {
    color: #64748b;
    font-family: "Fira Code", monospace;
    font-size: 0.68rem;
    font-weight: 800;
}

.quan-timeline-content strong {
    display: block;
    color: #f8fafc;
    font-size: 0.92rem;
    line-height: 1.35;
    margin: 3px 0 6px;
    overflow-wrap: anywhere;
}

.quan-level-map { display: grid; gap: 12px; }

.quan-level-rail {
    height: 10px;
    border-radius: 999px;
    background: linear-gradient(90deg, #ef4444, #334155 48%, #10b981);
    position: relative;
}

.quan-level-current {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #f8fafc;
    border: 3px solid #2563eb;
    box-shadow: 0 0 18px rgba(37,99,235,0.45);
}

.quan-level-list { display: grid; gap: 7px; }

.quan-level-row {
    display: grid;
    grid-template-columns: 96px 86px 1fr;
    gap: 10px;
    align-items: center;
    border: 1px solid rgba(51,65,85,0.64);
    background: rgba(15,23,42,0.72);
    border-radius: 7px;
    padding: 8px 10px;
}

.quan-level-row.current { border-color: rgba(96,165,250,0.55); }
.quan-level-row.support strong { color: #10b981; }
.quan-level-row.resistance strong { color: #ef4444; }
.quan-level-row.current strong { color: #bfdbfe; }

.quan-level-row strong,
.quan-analyst-row strong {
    font-family: "Fira Code", monospace;
    color: #f8fafc;
}

.quan-level-row em,
.quan-level-invalidation {
    color: #94a3b8;
    font-style: normal;
    font-size: 0.78rem;
    line-height: 1.35;
}

.quan-level-invalidation {
    border: 1px solid rgba(251,191,36,0.28);
    background: rgba(251,191,36,0.08);
    border-radius: 7px;
    padding: 9px 10px;
}

.quan-analyst-split { display: grid; gap: 12px; }

.quan-analyst-verdict,
.quan-target-strip {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    border: 1px solid rgba(51,65,85,0.64);
    background: rgba(15,23,42,0.72);
    border-radius: 8px;
    padding: 10px 12px;
}

.quan-analyst-verdict span {
    color: #f8fafc;
    font-weight: 950;
}

.quan-analyst-verdict strong,
.quan-target-strip span {
    color: #94a3b8;
    font-size: 0.78rem;
}

.quan-target-strip strong { color: #bfdbfe; }
.quan-analyst-bars { display: grid; gap: 8px; }

.quan-analyst-row {
    display: grid;
    grid-template-columns: 48px 1fr 34px;
    align-items: center;
    gap: 10px;
}

.quan-analyst-row div {
    height: 9px;
    border-radius: 999px;
    background: rgba(51,65,85,0.72);
    overflow: hidden;
}

.quan-analyst-row i {
    display: block;
    height: 100%;
    border-radius: inherit;
}

.quan-analyst-row.pos i { background: #10b981; }
.quan-analyst-row.hold i { background: #f59e0b; }
.quan-analyst-row.neg i { background: #ef4444; }

.quan-visual-sources {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.quan-risk-radar {
    display: grid;
    grid-template-columns: 112px 1fr;
    gap: 14px;
    align-items: start;
}

.quan-risk-score {
    aspect-ratio: 1;
    border-radius: 50%;
    border: 1px solid rgba(96,165,250,0.34);
    background: radial-gradient(circle, rgba(37,99,235,0.18), rgba(15,23,42,0.8));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.quan-risk-score span,
.quan-band-top span,
.quan-tradeoff-card span,
.quan-move-main span,
.quan-earnings-cell span {
    color: #94a3b8;
    font-family: "Fira Code", monospace;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 900;
}

.quan-risk-score strong {
    color: #f8fafc;
    font-size: 2rem;
    line-height: 1;
}

.quan-risk-score em {
    color: #cbd5e1;
    font-style: normal;
    font-size: 0.72rem;
    margin-top: 4px;
}

.quan-risk-bars {
    display: grid;
    gap: 9px;
}

.quan-risk-row {
    display: grid;
    gap: 5px;
}

.quan-risk-row div {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.quan-risk-row b {
    color: #f8fafc;
    font-family: "Fira Code", monospace;
}

.quan-risk-row i {
    height: 8px;
    border-radius: 999px;
    background: rgba(51,65,85,0.74);
    overflow: hidden;
}

.quan-risk-row u {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #10b981, #f59e0b, #ef4444);
    text-decoration: none;
}

.quan-risk-row small,
.quan-valuation-band p,
.quan-earnings-cell p,
.quan-move-driver p {
    color: #cbd5e1;
    font-size: 0.8rem;
    line-height: 1.45;
}

.quan-valuation-band {
    display: grid;
    gap: 12px;
}

.quan-band-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.quan-band-top strong {
    color: #f8fafc;
}

.quan-band-rail {
    position: relative;
    height: 16px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(16,185,129,0.9), rgba(51,65,85,0.9), rgba(239,68,68,0.9));
}

.quan-band-rail i {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 3px;
    height: 28px;
    border-radius: 999px;
    background: #f8fafc;
}

.quan-band-rail i.current {
    width: 16px;
    height: 16px;
    border: 3px solid #2563eb;
    background: #f8fafc;
    box-shadow: 0 0 18px rgba(37,99,235,0.45);
}

.quan-band-rail i span {
    position: absolute;
    top: 22px;
    left: 50%;
    transform: translateX(-50%);
    color: #94a3b8;
    font-size: 0.62rem;
    font-style: normal;
    font-weight: 800;
}

.quan-band-labels {
    display: flex;
    justify-content: space-between;
    color: #94a3b8;
    font-family: "Fira Code", monospace;
    font-size: 0.72rem;
    padding-top: 8px;
}

.quan-earnings-matrix {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
}

.quan-earnings-cell {
    border: 1px solid rgba(51,65,85,0.74);
    border-radius: 8px;
    padding: 11px;
    background: rgba(15,23,42,0.76);
}

.quan-earnings-cell.pos { border-color: rgba(16,185,129,0.28); }
.quan-earnings-cell.neg { border-color: rgba(239,68,68,0.28); }
.quan-earnings-cell.active {
    box-shadow: 0 0 0 1px rgba(96,165,250,0.45), 0 0 22px rgba(37,99,235,0.16);
}

.quan-earnings-cell strong {
    display: block;
    color: #f8fafc;
    margin: 6px 0;
}

.quan-matrix-watch {
    grid-column: 1 / -1;
    border: 1px solid rgba(251,191,36,0.28);
    background: rgba(251,191,36,0.08);
    border-radius: 8px;
    color: #fef3c7;
    padding: 9px 10px;
    font-size: 0.8rem;
    font-weight: 800;
}

.quan-tradeoff-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.quan-tradeoff-card {
    border: 1px solid rgba(51,65,85,0.74);
    border-radius: 8px;
    padding: 11px;
    background: rgba(15,23,42,0.76);
}

.quan-tradeoff-card.pos { border-color: rgba(16,185,129,0.32); }
.quan-tradeoff-card.warn { border-color: rgba(245,158,11,0.32); }
.quan-tradeoff-card.neg { border-color: rgba(239,68,68,0.32); }

.quan-tradeoff-card strong {
    display: block;
    color: #f8fafc;
    margin: 5px 0 8px;
}

.quan-tradeoff-card ul {
    margin: 0;
    padding-left: 16px;
    color: #cbd5e1;
    font-size: 0.8rem;
    line-height: 1.45;
}

.quan-tradeoff-card li + li {
    margin-top: 5px;
}

.quan-move-attribution {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 12px;
    align-items: stretch;
}

.quan-move-main,
.quan-move-driver {
    border: 1px solid rgba(51,65,85,0.74);
    border-radius: 8px;
    background: rgba(15,23,42,0.76);
    padding: 12px;
}

.quan-move-attribution.pos .quan-move-main { border-color: rgba(16,185,129,0.38); }
.quan-move-attribution.neg .quan-move-main { border-color: rgba(239,68,68,0.38); }

.quan-move-main strong {
    display: block;
    color: #f8fafc;
    font-family: "Fira Code", monospace;
    font-size: 1.45rem;
    margin: 6px 0;
}

.quan-move-main em {
    display: block;
    color: #94a3b8;
    font-size: 0.76rem;
    font-style: normal;
    line-height: 1.4;
}

.quan-move-driver b {
    color: #bfdbfe;
    display: block;
    margin-bottom: 6px;
}

.quan-portfolio-exposure {
    display: grid;
    grid-template-columns: 136px 1fr;
    gap: 14px;
    align-items: center;
}

.quan-portfolio-donut {
    width: 132px;
    aspect-ratio: 1;
    border-radius: 50%;
    padding: 14px;
    box-shadow: inset 0 0 0 1px rgba(148,163,184,0.18), 0 18px 30px rgba(0,0,0,0.24);
}

.quan-portfolio-donut div {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(8,13,22,0.96);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 10px;
}

.quan-portfolio-donut span,
.quan-portfolio-summary span,
.quan-concentration-top span,
.quan-concentration-focus span,
.quan-action-card span {
    color: #94a3b8;
    font-family: "Fira Code", monospace;
    font-size: 0.66rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 900;
}

.quan-portfolio-donut strong {
    color: #f8fafc;
    font-size: 1.48rem;
    line-height: 1;
    margin-top: 4px;
}

.quan-portfolio-slices {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.quan-portfolio-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    border: 1px solid rgba(51,65,85,0.7);
    border-radius: 8px;
    background: rgba(15,23,42,0.72);
    padding: 9px 10px;
}

.quan-portfolio-summary strong {
    color: #bfdbfe;
    font-family: "Fira Code", monospace;
    font-size: 0.78rem;
}

.quan-portfolio-slice-row {
    display: grid;
    grid-template-columns: 10px minmax(0, 1fr) 58px;
    gap: 9px;
    align-items: center;
    border: 1px solid rgba(51,65,85,0.56);
    border-radius: 8px;
    background: rgba(15,23,42,0.52);
    padding: 8px 10px;
}

.quan-portfolio-slice-row i {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    box-shadow: 0 0 12px currentColor;
}

.quan-portfolio-slice-row strong,
.quan-action-card strong {
    display: block;
    color: #f8fafc;
    overflow-wrap: anywhere;
}

.quan-portfolio-slice-row small {
    display: block;
    color: #94a3b8;
    font-size: 0.74rem;
    line-height: 1.35;
    margin-top: 2px;
}

.quan-portfolio-slice-row b {
    color: #dbeafe;
    font-family: "Fira Code", monospace;
    font-size: 0.78rem;
    text-align: right;
}

.quan-concentration-visual {
    display: grid;
    gap: 11px;
}

.quan-concentration-top,
.quan-concentration-focus {
    border: 1px solid rgba(51,65,85,0.7);
    border-radius: 8px;
    background: rgba(15,23,42,0.72);
    padding: 10px 12px;
}

.quan-concentration-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.quan-concentration-top strong {
    color: #f8fafc;
    font-family: "Fira Code", monospace;
    font-size: 1.25rem;
}

.quan-concentration-meter {
    height: 12px;
    border-radius: 999px;
    background: rgba(51,65,85,0.76);
    overflow: hidden;
}

.quan-concentration-meter i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #10b981, #f59e0b, #ef4444);
}

.quan-concentration-focus strong {
    display: block;
    margin: 4px 0;
    color: #f8fafc;
}

.quan-concentration-focus p,
.quan-action-card p,
.quan-action-summary {
    margin: 0;
    color: #cbd5e1;
    font-size: 0.8rem;
    line-height: 1.45;
}

.quan-concentration-list {
    display: grid;
    gap: 7px;
}

.quan-concentration-row {
    display: grid;
    grid-template-columns: 54px 1fr 54px;
    gap: 9px;
    align-items: center;
}

.quan-concentration-row span {
    color: #bfdbfe;
    font-weight: 900;
    overflow: hidden;
    text-overflow: ellipsis;
}

.quan-concentration-row i {
    height: 8px;
    border-radius: 999px;
    background: rgba(51,65,85,0.72);
    overflow: hidden;
}

.quan-concentration-row u {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: #2a7fff;
    text-decoration: none;
}

.quan-concentration-row strong {
    color: #f8fafc;
    font-family: "Fira Code", monospace;
    font-size: 0.76rem;
    text-align: right;
}

.quan-action-plan {
    display: grid;
    gap: 9px;
}

.quan-action-summary {
    border: 1px solid rgba(96,165,250,0.24);
    border-radius: 8px;
    background: rgba(37,99,235,0.09);
    padding: 10px;
}

.quan-action-card {
    display: grid;
    gap: 7px;
    border: 1px solid rgba(51,65,85,0.7);
    border-radius: 8px;
    background: rgba(15,23,42,0.72);
    padding: 11px;
}

.quan-action-card.high { border-color: rgba(239,68,68,0.32); }
.quan-action-card.medium { border-color: rgba(245,158,11,0.32); }
.quan-action-card.low { border-color: rgba(16,185,129,0.32); }

.quan-action-card div {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: baseline;
}

.quan-action-card small {
    color: #94a3b8;
    font-size: 0.72rem;
    font-weight: 800;
}

.copilot-input-area {
    padding: 14px 18px;
    border-top: 1px solid #1A2030;
    background: rgba(10, 13, 20, 0.94);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    gap: 10px;
    align-items: center;
    flex-shrink: 0;
}

.quan-limit-banner {
    margin: 12px 18px 0;
    padding: 10px 12px;
    border: 1px solid rgba(245, 158, 11, 0.34);
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(120, 53, 15, 0.32), rgba(15, 23, 42, 0.92));
    color: #fef3c7;
    font-size: 0.82rem;
    line-height: 1.35;
    font-weight: 700;
    flex-shrink: 0;
}

.quan-limit-banner span {
    color: #fbbf24;
}

.copilot-file-input {
    display: none;
}

.copilot-attach {
    width: 42px;
    height: 42px;
    border-radius: 4px;
    border: 1px solid #242B3D;
    background: #0F1520;
    color: #7f91ad;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex: 0 0 42px;
    transition: border-color 0.15s, color 0.15s, background 0.15s, transform 0.1s;
}

.copilot-attach:hover {
    color: #dbeafe;
    border-color: rgba(42, 127, 255, 0.58);
    background: #111827;
}

.copilot-attach:active {
    transform: scale(0.96);
}

.copilot-attachment-chip {
    max-width: 190px;
    min-height: 42px;
    padding: 7px 9px;
    border-radius: 6px;
    border: 1px solid rgba(42, 127, 255, 0.32);
    background: rgba(42, 127, 255, 0.1);
    color: #c7d2fe;
    font-size: 0.72rem;
    line-height: 1.25;
    display: flex;
    align-items: center;
    gap: 8px;
    box-sizing: border-box;
}

.copilot-attachment-chip span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.copilot-attachment-remove {
    border: none;
    background: transparent;
    color: #8ea4c7;
    cursor: pointer;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    flex: 0 0 20px;
}

.copilot-attachment-remove:hover {
    color: #ffffff;
}

.copilot-input {
    flex: 1;
    background: #0F1520;
    border: 1px solid #242B3D;
    color: #e5e7eb;
    padding: 12px 16px;
    border-radius: 4px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.15s, background 0.15s;
    font-family: inherit;
    letter-spacing: 0.2px;
    min-width: 0;
    min-height: 42px;
    height: 42px;
    max-height: 112px;
    line-height: 1.35;
    resize: none;
    overflow-y: hidden;
    box-sizing: border-box;
}

.copilot-input::placeholder { color: #374151; }

.copilot-input:focus {
    border-color: #2563eb;
    background: #111827;
}

/* Send button — flat square, not a circle */
.copilot-send {
    background: #1d4ed8;
    color: white;
    border: none;
    width: 42px;
    height: 42px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    flex-shrink: 0;
}

.copilot-send:hover { background: #2563eb; }
.copilot-send:active { transform: scale(0.96); }


/* =========================================
   MOBILE RESPONSIVENESS & FULLSCREEN
   ========================================= */
@media (max-width: 850px) {
    .copilot-input-area {
        gap: 8px;
        padding: 12px;
    }

    .copilot-attach,
    .copilot-send {
        width: 40px;
        height: 40px;
        flex-basis: 40px;
    }

    .copilot-attachment-chip {
        max-width: 112px;
        min-height: 40px;
        font-size: 0.66rem;
        padding: 6px 7px;
    }

    .top-bar { flex-direction: column; align-items: flex-start; gap: 15px; }
    .search-group { width: 100%; flex-wrap: wrap; justify-content: space-between; }
    .search-container { width: 100%; margin-bottom: 10px; }
    .home-content-grid, .lists-grid, .dashboard-grid, .profile-grid { grid-template-columns: 1fr; }
    .market-pulse-grid { grid-template-columns: 1fr; gap: 15px; }
    .ai-market-banner { flex-direction: column; align-items: flex-start; gap: 15px; text-align: left; }
    .ai-market-btn { width: 100%; justify-content: center; }
    .stock-header { flex-direction: column; align-items: flex-start; gap: 15px; }
    .price, .change { text-align: left; }
    .metrics-grid { grid-template-columns: 1fr 1fr; }

    /* Hero mobile fix */
    .hero-section { padding: 50px 20px; }
    .hero-title { font-size: 2rem; letter-spacing: -0.5px; }
    .hero-subtitle { font-size: 1rem; }
    .hero-section .preview-btn { width: auto; }

    /* Pricing tables: scroll-wrap on mobile */
    .pricing-section { padding: 0 5px; }
    .comp-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 10px; }
    .comp-table { min-width: 560px; }

    /* Tier table card layout on small screens */
    #tierTable { display: none; }
    .tier-cards { display: flex; flex-direction: column; gap: 16px; margin-bottom: 15px; }
    .stack-ai-blurb { flex-direction: column; text-align: center; }
}

@media (max-width: 768px) {
    .quan-title-logo {
        height: 22px;
    }

    #copilotLayoutControls {
        display: none !important;
    }

    #copilotModal {
        align-items: stretch !important;
        justify-content: stretch !important;
        padding: 0 !important;
        background: rgba(0, 0, 0, 0.82) !important;
        backdrop-filter: blur(6px) !important;
        -webkit-backdrop-filter: blur(6px) !important;
        pointer-events: auto !important;
    }

    #copilotModal .copilot-box {
        width: 100vw !important;
        height: 100dvh !important;
        max-width: none !important;
        max-height: none !important;
        border-radius: 0 !important;
        margin: 0 !important;
        border: none !important;
    }

    #copilotModal .copilot-title {
        display: flex !important;
    }

    #copilotModal .copilot-header {
        padding-top: max(14px, env(safe-area-inset-top)) !important;
    }

    #copilotModal .copilot-close {
        position: static !important;
        margin: 0 !important;
    }

    #copilotModal .copilot-chat-area {
        flex-grow: 1 !important;
        height: auto !important;
        max-height: none !important;
    }

    /* On mobile, restore a bit of padding on message rows */
    .chat-bubble { padding: 14px 18px; }
    .chat-user   { padding-left: 16px; }
}
@supports (-webkit-touch-callout: none) {
  .ios-standalone #mainAppContainer {
    padding-top: max(60px, env(safe-area-inset-top)) !important;
  }
}
/* =========================================
   APPLE iOS HOME SCREEN ONLY
   Dynamic Island Safe Area Fix
========================================= */

@supports (-webkit-touch-callout: none) {
  @media (display-mode: standalone) {

    #mainAppContainer {
      padding-top: env(safe-area-inset-top);
    }

  }
}
@supports (-webkit-touch-callout: none) {
  .ios-standalone #mainAppContainer {
    padding-top: env(safe-area-inset-top);
  }
}
/* =========================================
   EOY PREDICTION WIDGET
   ========================================= */
.prediction-container {
    padding: 15px 0;
    text-align: center;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.prediction-unclear {
    font-size: 1.2rem;
    font-weight: bold;
    color: #6b7280;
    font-style: italic;
    /* Forces Windows/Desktop to use a clean, modern font stack */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.prediction-price {
    font-size: 2.2rem;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 5px;
    line-height: 1;
}

.prediction-metrics {
    font-size: 1.1rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 6px;
}

.prediction-disclaimer {
    font-size: 0.75rem;
    color: #4b5563;
    text-align: center;
    border-top: 1px solid #1f2937;
    padding-top: 12px;
    margin-top: 10px;
    line-height: 1.4;
}
.eoy-click-widget {
    cursor: pointer;
    transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}
.eoy-click-widget:hover {
    border-color: rgba(42,127,255,0.45);
    background: linear-gradient(135deg, rgba(42,127,255,0.08), rgba(15,23,42,0.62));
}
.eoy-click-widget:focus-visible {
    outline: 2px solid rgba(42,127,255,0.75);
    outline-offset: 2px;
}

.share-card-modal {
    position: fixed;
    inset: 0;
    z-index: 2300;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(2, 6, 12, 0.72);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.share-card-panel {
    width: min(920px, calc(100vw - 32px));
    max-height: calc(100dvh - 40px);
    overflow-y: auto;
    border: 1px solid rgba(42,127,255,0.28);
    border-radius: 10px;
    background: linear-gradient(180deg, rgba(13,17,23,0.98), rgba(8,11,16,0.98));
    box-shadow: 0 26px 70px rgba(0,0,0,0.62), 0 0 0 1px rgba(42,127,255,0.12);
}

.share-card-header {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    padding: 16px 18px;
    border-bottom: 1px solid rgba(42,127,255,0.16);
}

.share-card-session-toggles {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px;
    border: 1px solid rgba(42,127,255,0.18);
    border-radius: 9px;
    background: rgba(12,18,28,0.74);
}

.share-card-session-toggles.is-hidden {
    display: none;
}

.share-card-timeframe-tabs {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    border: 1px solid rgba(42,127,255,0.18);
    border-radius: 9px;
    background: rgba(12,18,28,0.74);
}

.share-timeframe-toggle {
    min-height: 30px;
    min-width: 38px;
    padding: 0 9px;
    border: 1px solid transparent;
    border-radius: 7px;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 950;
    cursor: pointer;
}

.share-timeframe-toggle.active {
    border-color: rgba(42,127,255,0.42);
    background: linear-gradient(135deg, rgba(42,127,255,0.28), rgba(124,58,237,0.16));
    color: #fff;
}

.share-timeframe-toggle:hover {
    color: #fff;
}

.share-session-toggle {
    min-height: 30px;
    padding: 0 10px;
    border: 1px solid transparent;
    border-radius: 7px;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 900;
    cursor: pointer;
}

.share-session-toggle.active {
    border-color: rgba(42,127,255,0.38);
    background: linear-gradient(135deg, rgba(42,127,255,0.24), rgba(124,58,237,0.14));
    color: #eaf2ff;
}

.share-session-toggle:hover {
    color: #fff;
}

.share-card-header span {
    display: block;
    color: var(--accent-blue);
    font-family: "Fira Code", monospace;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.share-card-header strong {
    display: block;
    margin-top: 4px;
    color: var(--text-primary);
    font-size: 1rem;
}

.share-card-close {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface-2);
    color: var(--text-secondary);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
}

.share-card-preview {
    min-height: 360px;
    padding: 18px;
    display: grid;
    place-items: center;
    background: radial-gradient(circle at 50% 0%, rgba(42,127,255,0.09), transparent 42%);
}

.share-card-preview img {
    width: 100%;
    max-width: 820px;
    border-radius: 8px;
    border: 1px solid rgba(148,163,184,0.15);
    box-shadow: 0 18px 50px rgba(0,0,0,0.45);
}

.share-card-actions {
    display: flex;
    justify-content: center;
    gap: 14px;
    padding: 2px 18px 16px;
}

.share-card-actions button {
    position: relative;
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(42,127,255,0.32);
    border-radius: 50%;
    background:
        radial-gradient(circle at 30% 20%, rgba(255,255,255,0.12), transparent 36%),
        linear-gradient(135deg, rgba(42,127,255,0.18), rgba(12,18,28,0.94));
    color: #dbeafe;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(0,0,0,0.28), inset 0 0 0 1px rgba(255,255,255,0.03);
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.share-card-actions button span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.share-card-actions button:hover {
    transform: translateY(-2px);
    border-color: rgba(96,165,250,0.62);
    background:
        radial-gradient(circle at 30% 20%, rgba(255,255,255,0.16), transparent 36%),
        linear-gradient(135deg, rgba(42,127,255,0.28), rgba(124,58,237,0.16));
    color: #fff;
}

.share-card-status {
    padding: 0 18px 18px;
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 1.45;
}

.share-card-error {
    color: var(--accent-red);
    font-weight: 800;
}

.profile-usage-panel {
    display: grid;
    gap: 13px;
}

.usage-meter-card {
    padding: 13px;
    border: 1px solid rgba(42,127,255,0.18);
    border-radius: 9px;
    background: rgba(12,18,28,0.62);
}

.usage-meter-card.is-hidden {
    display: none;
}

.usage-meter-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 10px;
}

.usage-meter-head span {
    display: block;
    color: var(--text-muted);
    font-family: "Fira Code", monospace;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.usage-meter-head strong {
    display: block;
    margin-top: 3px;
    color: var(--text-primary);
    font-size: 1.12rem;
}

.usage-meter-head small {
    max-width: 150px;
    color: #71839b;
    font-size: 0.72rem;
    line-height: 1.35;
    text-align: right;
}

.usage-meter-track {
    height: 9px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(30,41,59,0.92);
    box-shadow: inset 0 0 0 1px rgba(148,163,184,0.08);
}

.usage-meter-fill {
    width: 0%;
    height: 100%;
    border-radius: inherit;
    transition: width 0.25s ease, background 0.25s ease;
}

.usage-meter-fill.quan {
    background: linear-gradient(90deg, #2563eb, #8b5cf6);
}

.usage-meter-fill.finnhub {
    background: linear-gradient(90deg, #10b981, #60a5fa);
}

.usage-meter-fill.warn {
    background: linear-gradient(90deg, #f59e0b, #ef4444);
}

.usage-meter-note {
    margin: 9px 0 0;
    color: #64748b;
    font-size: 0.72rem;
    line-height: 1.4;
}

@media (max-width: 720px) {
    .share-card-modal {
        align-items: flex-end;
        padding: 0;
    }
    .share-card-panel {
        width: 100%;
        max-height: 92dvh;
        border-radius: 14px 14px 0 0;
    }
    .share-card-header {
        flex-wrap: wrap;
        gap: 10px;
    }
    .share-card-session-toggles {
        order: 4;
        width: 100%;
        justify-content: space-between;
        margin-left: 0;
    }
    .share-card-timeframe-tabs {
        order: 3;
        width: 100%;
        justify-content: space-between;
        margin-left: 0;
    }
    .share-timeframe-toggle {
        flex: 1;
        min-width: 0;
        padding: 0 4px;
    }
    .share-session-toggle {
        flex: 1;
    }
    .share-card-preview {
        min-height: 230px;
        padding: 12px;
    }
    .share-card-actions {
        gap: 10px;
        padding: 0 12px 12px;
    }
    .share-card-actions button {
        width: 52px;
        height: 52px;
    }
    .share-card-status {
        padding: 0 12px 14px;
    }
}

.eoy-widget-hint {
    margin-top: 6px;
    color: var(--text-muted);
    font-size: 0.72rem;
}
.eoy-pending {
    font-size: 0.92rem;
    font-style: normal;
}
.eoy-explanation-modal {
    z-index: 2105;
    background: transparent;
    pointer-events: none;
    align-items: flex-end;
    justify-content: flex-end;
    padding: var(--copilot-rail-top, 88px) var(--copilot-rail-right, 24px) 22px 0;
    box-sizing: border-box;
}
.eoy-explanation-box {
    pointer-events: auto;
    width: min(var(--copilot-rail-width, 360px), calc(100vw - 32px));
    height: calc(100dvh - var(--copilot-rail-top, 88px) - 22px);
    overflow-y: auto;
    border: 1px solid rgba(42,127,255,0.28);
    border-radius: 10px;
    background: linear-gradient(180deg, rgba(13,17,23,0.98), rgba(8,11,16,0.98));
    box-shadow: 0 0 0 1px rgba(42,127,255,0.16), 0 24px 60px rgba(0,0,0,0.55);
}
.eoy-explanation-box::-webkit-scrollbar { width: 5px; }
.eoy-explanation-box::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 4px; }
.eoy-explain-header {
    display: flex;
    gap: 12px;
    justify-content: space-between;
    align-items: flex-start;
    padding: 18px;
    border-bottom: 1px solid var(--border);
}
.eoy-explain-header > div {
    min-width: 0;
    flex: 1 1 auto;
}
.eoy-kicker {
    display: inline-flex;
    margin-bottom: 8px;
    color: var(--accent-blue);
    font-family: "Fira Code", monospace;
    font-size: 0.62rem;
    font-weight: 900;
    letter-spacing: 1px;
    text-transform: uppercase;
}
.eoy-explain-header h2 {
    margin: 0 0 8px;
    color: var(--text-primary);
    font-size: 1.25rem;
    line-height: 1.15;
}
.eoy-explain-header p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.84rem;
    line-height: 1.5;
}
.eoy-close {
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: sticky;
    top: 10px;
    z-index: 3;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(15,23,42,0.7);
    color: var(--text-muted);
    font-size: 1.4rem;
    cursor: pointer;
}
.eoy-target-hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin: 14px;
    padding: 14px;
    border: 1px solid rgba(16,185,129,0.26);
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(16,185,129,0.12), rgba(37,99,235,0.08));
}
.eoy-target-hero.pending {
    border-color: rgba(148,163,184,0.2);
    background: rgba(148,163,184,0.06);
}
.eoy-target-hero span,
.eoy-target-hero small {
    display: block;
    color: var(--text-muted);
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.7px;
}
.eoy-target-hero strong {
    display: block;
    margin-top: 4px;
    color: var(--text-primary);
    font-family: "Fira Code", monospace;
    font-size: 1.18rem;
}
.eoy-target-hero .pos { color: var(--accent-green); font-size: 1rem; }
.eoy-target-hero .neg { color: var(--accent-red); font-size: 1rem; }
.eoy-explain-section {
    padding: 4px 16px 14px;
}
.eoy-explain-section h3 {
    margin: 10px 0 8px;
    color: var(--text-primary);
    font-size: 0.82rem;
    letter-spacing: 0.6px;
    text-transform: uppercase;
}
.eoy-explain-section ul {
    margin: 0;
    padding-left: 17px;
    color: var(--text-secondary);
    font-size: 0.82rem;
    line-height: 1.55;
}
.eoy-institution-table {
    display: grid;
    gap: 8px;
}
.eoy-institution-row {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr 0.7fr 0.9fr;
    gap: 8px;
    align-items: center;
    padding: 9px;
    border: 1px solid rgba(148,163,184,0.12);
    border-radius: 7px;
    background: rgba(15,23,42,0.48);
    color: var(--text-secondary);
    font-size: 0.72rem;
}
.eoy-institution-row strong {
    display: block;
    color: var(--text-primary);
    font-size: 0.76rem;
}
.eoy-institution-row span {
    display: block;
    margin-top: 2px;
    color: var(--text-muted);
    line-height: 1.25;
}
.eoy-empty-note {
    color: var(--text-muted);
    border: 1px dashed rgba(148,163,184,0.18);
    border-radius: 8px;
    padding: 10px;
    font-size: 0.78rem;
    line-height: 1.45;
}
.eoy-scenario-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 0 14px 12px;
}
.eoy-scenario-card {
    padding: 10px;
    border: 1px solid rgba(148,163,184,0.12);
    border-radius: 8px;
    background: rgba(15,23,42,0.48);
}
.eoy-scenario-card span {
    color: var(--text-muted);
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.7px;
}
.eoy-scenario-card strong {
    display: block;
    margin: 3px 0;
    color: var(--text-primary);
    font-family: "Fira Code", monospace;
}
.eoy-scenario-card p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.78rem;
    line-height: 1.4;
}
.eoy-scenario-card.bear { border-color: rgba(239,68,68,0.2); }
.eoy-scenario-card.base { border-color: rgba(59,130,246,0.22); }
.eoy-scenario-card.bull { border-color: rgba(16,185,129,0.22); }
.eoy-review-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 0 14px 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.7rem;
}
/* =========================================
   RESTORE PROFILE PAGE LAYOUT
   ========================================= */
.profile-header { font-size: 2rem; font-weight: bold; margin-bottom: 20px; border-bottom: 1px solid #1f2937; padding-bottom: 15px; }
.profile-grid { display: grid; grid-template-columns: 3fr 2fr; gap: 24px; align-items: start; }
.profile-detail { color: #9ca3af; margin-bottom: 15px; font-size: 1.1rem; }
.profile-detail span { color: white; font-weight: bold; }
.danger-btn { background: transparent; border: 1px solid #ef4444; color: #ef4444; padding: 10px 20px; border-radius: 8px; cursor: pointer; font-weight: bold; margin-top: 20px; transition: 0.2s; }
.danger-btn:hover { background: #ef4444; color: white; }

/* Constrain Profile Page Width on Desktop */
#view-profile {
    max-width: 900px;
    margin: 0 auto;
}

/* =========================================
   FORCE DESKTOP MODAL TO CENTER
   ========================================= */
#copilotModal {
    align-items: center !important;
    justify-content: center !important;
}

.copilot-layout-controls {
    display: none;
    align-items: center;
    gap: 4px;
    padding: 3px;
    border: 1px solid #242B3D;
    border-radius: 6px;
    background: rgba(15, 21, 32, 0.86);
    flex-shrink: 0;
}

.copilot-layout-btn {
    border: 0;
    background: transparent;
    color: #6b7280;
    width: 28px;
    height: 28px;
    padding: 0;
    border-radius: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.copilot-layout-btn svg {
    width: 15px;
    height: 15px;
}

.copilot-layout-btn:hover {
    color: #dbeafe;
    background: rgba(42, 127, 255, 0.11);
}

.copilot-layout-btn.active {
    color: #ffffff;
    background: linear-gradient(135deg, #2563eb, #6d28d9);
    box-shadow: 0 0 14px rgba(42, 127, 255, 0.25);
}

#copilotModal.copilot-layout-side,
#copilotModal.copilot-layout-split {
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    pointer-events: none;
    align-items: flex-end !important;
    justify-content: flex-end !important;
    padding: var(--copilot-rail-top, 88px) var(--copilot-rail-right, 24px) 22px 0;
    box-sizing: border-box;
}

#copilotModal.copilot-layout-side .copilot-box,
#copilotModal.copilot-layout-split .copilot-box {
    pointer-events: auto;
    width: min(var(--copilot-rail-width, 330px), calc(100vw - 32px)) !important;
    margin: 0 !important;
    border-radius: 10px !important;
    border-color: rgba(42, 127, 255, 0.28) !important;
    box-shadow:
        0 0 0 1px rgba(42,127,255,0.16),
        0 24px 60px rgba(0,0,0,0.55) !important;
}

#copilotModal.copilot-layout-side .copilot-box {
    height: calc(100dvh - var(--copilot-rail-top, 88px) - 22px) !important;
    max-height: none !important;
}

#copilotModal.copilot-layout-split .copilot-box {
    height: min(54dvh, 560px) !important;
    max-height: 560px !important;
}

#copilotModal.copilot-layout-side .copilot-header,
#copilotModal.copilot-layout-split .copilot-header {
    padding: 11px 12px;
    gap: 8px;
    flex-wrap: nowrap;
}

#copilotModal.copilot-layout-side .copilot-title,
#copilotModal.copilot-layout-split .copilot-title {
    display: none;
}

#copilotModal.copilot-layout-side .copilot-title img,
#copilotModal.copilot-layout-split .copilot-title img {
    height: 30px !important;
}

#copilotModal.copilot-layout-side .version-btn,
#copilotModal.copilot-layout-split .version-btn {
    height: 32px;
    padding: 0 9px;
    font-size: 0.72rem;
}

#copilotModal.copilot-layout-side .copilot-layout-controls,
#copilotModal.copilot-layout-split .copilot-layout-controls {
    margin-left: auto;
    justify-content: center;
}

#copilotModal.copilot-layout-side .copilot-layout-btn,
#copilotModal.copilot-layout-split .copilot-layout-btn {
    flex: 0 0 28px;
}

#copilotModal.copilot-layout-side .copilot-chat-area,
#copilotModal.copilot-layout-split .copilot-chat-area {
    overflow-y: auto !important;
    overflow-x: hidden;
}

#copilotModal.copilot-layout-side .copilot-input-area,
#copilotModal.copilot-layout-split .copilot-input-area {
    gap: 7px;
    padding: 11px 12px;
}

#copilotModal.copilot-layout-side .copilot-input,
#copilotModal.copilot-layout-split .copilot-input {
    max-height: 66px;
}

#copilotModal.copilot-layout-side .quan-limit-banner,
#copilotModal.copilot-layout-split .quan-limit-banner {
    margin: 10px 12px 0;
    font-size: 0.76rem;
    padding: 9px 10px;
}

#copilotModal.copilot-layout-side .copilot-attachment-chip,
#copilotModal.copilot-layout-split .copilot-attachment-chip {
    display: none !important;
}

#copilotModal.copilot-layout-side .chat-bubble,
#copilotModal.copilot-layout-split .chat-bubble {
    padding: 13px 15px;
    font-size: 0.83rem;
}

#copilotModal.copilot-layout-side .copilot-md-table,
#copilotModal.copilot-layout-split .copilot-md-table {
    min-width: 560px;
}

#copilotModal.copilot-layout-side .quan-visual-stack,
#copilotModal.copilot-layout-split .quan-visual-stack {
    gap: 10px;
}

#copilotModal.copilot-layout-side .quan-visual-header,
#copilotModal.copilot-layout-split .quan-visual-header {
    align-items: flex-start;
    padding: 11px;
}

#copilotModal.copilot-layout-side .quan-visual-body,
#copilotModal.copilot-layout-split .quan-visual-body {
    padding: 11px;
}

#copilotModal.copilot-layout-side .quan-scenario-grid,
#copilotModal.copilot-layout-split .quan-scenario-grid,
#copilotModal.copilot-layout-side .quan-timeline,
#copilotModal.copilot-layout-split .quan-timeline {
    grid-template-columns: 1fr;
}

#copilotModal.copilot-layout-side .quan-level-row,
#copilotModal.copilot-layout-split .quan-level-row {
    grid-template-columns: 1fr;
    gap: 4px;
}

#copilotModal.copilot-layout-side .quan-target-strip,
#copilotModal.copilot-layout-split .quan-target-strip,
#copilotModal.copilot-layout-side .quan-analyst-verdict,
#copilotModal.copilot-layout-split .quan-analyst-verdict {
    align-items: flex-start;
    flex-direction: column;
}

#copilotModal.copilot-layout-side .quan-risk-radar,
#copilotModal.copilot-layout-split .quan-risk-radar,
#copilotModal.copilot-layout-side .quan-move-attribution,
#copilotModal.copilot-layout-split .quan-move-attribution,
#copilotModal.copilot-layout-side .quan-portfolio-exposure,
#copilotModal.copilot-layout-split .quan-portfolio-exposure {
    grid-template-columns: 1fr;
}

#copilotModal.copilot-layout-side .quan-risk-score,
#copilotModal.copilot-layout-split .quan-risk-score,
#copilotModal.copilot-layout-side .quan-portfolio-donut,
#copilotModal.copilot-layout-split .quan-portfolio-donut {
    width: 108px;
    justify-self: center;
}

#copilotModal.copilot-layout-side .quan-earnings-matrix,
#copilotModal.copilot-layout-split .quan-earnings-matrix,
#copilotModal.copilot-layout-side .quan-tradeoff-grid,
#copilotModal.copilot-layout-split .quan-tradeoff-grid {
    grid-template-columns: 1fr;
}

#copilotModal.copilot-layout-side .quan-action-card div,
#copilotModal.copilot-layout-split .quan-action-card div,
#copilotModal.copilot-layout-side .quan-portfolio-summary,
#copilotModal.copilot-layout-split .quan-portfolio-summary {
    align-items: flex-start;
    flex-direction: column;
}

#copilotModal.copilot-layout-side .dca-chart-wrap,
#copilotModal.copilot-layout-split .dca-chart-wrap,
#copilotModal.copilot-layout-side .dca-chart-container,
#copilotModal.copilot-layout-split .dca-chart-container,
#copilotModal.copilot-layout-side .copilot-md-table-wrap,
#copilotModal.copilot-layout-split .copilot-md-table-wrap {
    max-width: 100%;
    overflow-x: auto;
}

#copilotModal.copilot-layout-side .dca-chart-container canvas,
#copilotModal.copilot-layout-split .dca-chart-container canvas {
    min-width: 520px;
}

#copilotModal.copilot-layout-full {
    align-items: center !important;
    justify-content: center !important;
}

#copilotModal.copilot-layout-full .copilot-box {
    width: 98% !important;
    max-width: 1680px !important;
    height: 96vh !important;
    max-height: 1250px !important;
}
/* =========================================
   MOBILE RESPONSIVENESS: PROFILE PAGE
   ========================================= */
@media screen and (max-width: 768px) {

    /* #view-profile sits OUTSIDE .container so has no padding — add it back */
    #view-profile {
        padding: 0 16px;
        box-sizing: border-box;
        width: 100%;
        overflow-x: hidden;
    }

    /* Switch the grid to a simple stacking flex column — much more reliable
       than trying to override grid-template-columns from outside the container */
    .profile-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 20px;
        width: 100%;
    }

    /* Both column wrappers fill the full width */
    .profile-grid > div {
        width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 20px !important;
    }

    /* Every panel fills its column */
    .profile-grid .panel {
        width: 100% !important;
        box-sizing: border-box !important;
        min-width: 0 !important;
        margin-bottom: 0 !important;   /* gap on parent handles spacing */
        margin-top: 0 !important;
    }

    /* Inputs fill their panel */
    #profileEmail,
    #profileApiKeyInput,
    .auth-input {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    /* Buttons fill width */
    #view-profile button,
    #billingManageBtn,
    #view-profile a.auth-btn {
        width: 100% !important;
        box-sizing: border-box !important;
        margin-top: 10px;
    }
}
/* --- PREVIEW BUTTON (Main Page Hero) --- */
.preview-btn {
    background: transparent;
    color: #3b82f6; /* StockUp Blue */
    border: 2px solid #3b82f6;
    padding: 10px 20px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: bold;
    font-size: 1rem;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    margin-left: 10px; /* Adds space if it sits next to another button */
    cursor: pointer;
}

.preview-btn:hover {
    background: rgba(59, 130, 246, 0.1); /* Slight blue glow on hover */
    color: #60a5fa;
    border-color: #60a5fa;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.3);
}

@media screen and (max-width: 768px) {
    .preview-btn {
        margin-left: 0;
        margin-top: 15px;
        width: 100%;
        justify-content: center;
        box-sizing: border-box;
    }
}

/* --- PROMO CODE BOXES --- */
.promo-box {
    margin-top: 12px;
    background: rgba(31, 41, 55, 0.5); /* Subtle dark background */
    border: 1px dashed #4b5563; /* Dashed border for a 'coupon' feel */
    border-radius: 8px;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
}

.promo-label {
    color: #9ca3af;
    margin-right: 5px;
}

.promo-code {
    color: #fbbf24; /* Defaults to yellow for Essentials */
    font-family: monospace;
    font-weight: bold;
    letter-spacing: 0.5px;
    flex-grow: 1;
    text-align: left;
}

.copy-btn {
    background: #374151;
    color: #f3f4f6;
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 0.75rem;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.copy-btn:hover {
    background: #4b5563;
}

.copy-btn.copied {
    background: #10b981; /* Turns green when clicked */
    color: #000;
}

/* --- LIVE SEARCH DROPDOWN --- */
.search-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 100%;
    background: rgba(12, 18, 27, 0.98);
    border: 1px solid rgba(55, 75, 104, 0.9);
    border-radius: 8px;
    margin-top: 0;
    z-index: 1000;
    overflow: hidden;
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.48);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.search-item {
    min-height: 48px;
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid rgba(55, 65, 81, 0.72);
    display: grid;
    grid-template-columns: minmax(70px, 0.34fr) minmax(0, 0.66fr);
    gap: 12px;
    align-items: center;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.search-item:last-child {
    border-bottom: none;
}

.search-item:hover {
    background: rgba(37, 99, 235, 0.13);
}

.search-item-sym {
    color: #f8fafc;
    font-size: 0.94rem;
    font-weight: 900;
    letter-spacing: 0.01em;
}

.search-item-desc {
    color: #94a3b8;
    font-size: 0.82rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: right;
}

.search-item-muted {
    cursor: default;
    background: rgba(15, 23, 42, 0.72);
}

.search-item-muted:hover {
    background: rgba(15, 23, 42, 0.72);
}

.search-item-muted .search-item-sym {
    color: #60a5fa;
}

.search-item-muted .search-item-desc {
    color: #64748b;
}

.search-group-label {
    padding: 8px 14px 7px;
    background: rgba(2, 6, 23, 0.62);
    border-bottom: 1px solid rgba(51, 65, 85, 0.64);
    color: #60a5fa;
    font-family: "Fira Code", monospace;
    font-size: 0.64rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.international-search-item {
    grid-template-columns: minmax(92px, 0.34fr) minmax(0, 0.66fr);
    background: rgba(14, 165, 233, 0.035);
}

.international-search-item:hover {
    background: rgba(14, 165, 233, 0.14);
}

.international-search-item .search-item-sym em {
    display: inline-block;
    margin-left: 5px;
    padding: 2px 5px;
    border: 1px solid rgba(125, 211, 252, 0.34);
    border-radius: 4px;
    color: #7dd3fc;
    background: rgba(14, 165, 233, 0.12);
    font-family: "Fira Code", monospace;
    font-size: 0.54rem;
    font-style: normal;
    font-weight: 900;
    text-transform: uppercase;
    vertical-align: middle;
}

/* =========================================
   PREMIUM UI UPGRADES
   ========================================= */

/* 1. SKELETON LOADING SCREENS */
@keyframes skeletonPulse {
    0% { background-color: #1f2937; }
    50% { background-color: #374151; }
    100% { background-color: #1f2937; }
}
.skeleton-box { 
    animation: skeletonPulse 1.5s infinite ease-in-out; 
    border-radius: 8px; 
}
.skel-header { height: 60px; width: 40%; margin-bottom: 20px; }
.skel-chart { height: 400px; width: 100%; margin-bottom: 20px; }
.skel-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; }
.skel-metric { height: 60px; width: 100%; }

/* 2. WEBSOCKET PRICE FLASHES */
@keyframes flashGreen { 
    0% { background-color: rgba(16, 185, 129, 0.4); box-shadow: 0 0 20px rgba(16, 185, 129, 0.4); border-radius: 8px; } 
    100% { background-color: transparent; box-shadow: none; border-radius: 8px; } 
}
@keyframes flashRed { 
    0% { background-color: rgba(239, 68, 68, 0.4); box-shadow: 0 0 20px rgba(239, 68, 68, 0.4); border-radius: 8px;} 
    100% { background-color: transparent; box-shadow: none; border-radius: 8px;} 
}
.flash-pos { animation: flashGreen 0.6s ease-out; padding: 0 10px; margin-right: -10px; }
.flash-neg { animation: flashRed 0.6s ease-out; padding: 0 10px; margin-right: -10px; }

.price-box-flash-pos {
    animation: priceBoxFlashGreen 0.82s ease-out;
}

.price-box-flash-neg {
    animation: priceBoxFlashRed 0.82s ease-out;
}

.home-price-flash-pos {
    display: inline-block;
    border-radius: 5px;
    animation: homePriceFlashGreen 0.82s ease-out;
}

.home-price-flash-neg {
    display: inline-block;
    border-radius: 5px;
    animation: homePriceFlashRed 0.82s ease-out;
}

@keyframes priceBoxFlashGreen {
    0% { border-color: rgba(16,185,129,0.95); box-shadow: 0 0 0 1px rgba(16,185,129,0.35), 0 0 26px rgba(16,185,129,0.38); background: rgba(16,185,129,0.10); }
    100% { border-color: rgba(255,255,255,0.08); box-shadow: none; background: transparent; }
}

@keyframes priceBoxFlashRed {
    0% { border-color: rgba(239,68,68,0.95); box-shadow: 0 0 0 1px rgba(239,68,68,0.35), 0 0 26px rgba(239,68,68,0.36); background: rgba(239,68,68,0.10); }
    100% { border-color: rgba(255,255,255,0.08); box-shadow: none; background: transparent; }
}

@keyframes homePriceFlashGreen {
    0% { background: rgba(16,185,129,0.16); box-shadow: 0 0 0 6px rgba(16,185,129,0.08), 0 0 18px rgba(16,185,129,0.34); }
    100% { background: transparent; box-shadow: none; }
}

@keyframes homePriceFlashRed {
    0% { background: rgba(239,68,68,0.16); box-shadow: 0 0 0 6px rgba(239,68,68,0.08), 0 0 18px rgba(239,68,68,0.30); }
    100% { background: transparent; box-shadow: none; }
}

.quote-chip.neutral {
    color: #93c5fd;
    background: rgba(37,99,235,0.12);
    border-color: rgba(96,165,250,0.30);
}

.chart-live-spark {
    position: absolute;
    top: 10%;
    right: 5%;
    width: 86px;
    height: 80%;
    pointer-events: none;
    z-index: 7;
    background: radial-gradient(circle at 72% 50%, rgba(96,165,250,0.42), rgba(16,185,129,0.18) 32%, transparent 64%);
    filter: blur(1px);
    opacity: 0;
    animation: chartLiveSpark 0.82s ease-out;
}

.chart-live-spark::after {
    content: '';
    position: absolute;
    top: 14%;
    right: 22px;
    width: 2px;
    height: 72%;
    border-radius: 999px;
    background: linear-gradient(180deg, transparent, rgba(255,255,255,0.92), transparent);
    box-shadow: 0 0 16px rgba(96,165,250,0.72), 0 0 28px rgba(16,185,129,0.36);
}

@keyframes chartLiveSpark {
    0% { opacity: 0; transform: translateX(18px) scaleX(0.7); }
    20% { opacity: 1; }
    100% { opacity: 0; transform: translateX(-18px) scaleX(1.08); }
}

/* 3. AI SENTIMENT GAUGE */
.gauge-wrapper { display: flex; flex-direction: column; align-items: center; margin: 15px 0 25px 0; }
.gauge-arc { 
    width: 200px; height: 100px; 
    background: conic-gradient(from 270deg at 50% 100%, #ef4444 0deg, #ef4444 60deg, #fbbf24 60deg, #fbbf24 120deg, #10b981 120deg, #10b981 180deg); 
    border-radius: 100px 100px 0 0; 
    position: relative; display: flex; justify-content: center; align-items: flex-end; 
}
.gauge-inner { 
    width: 160px; height: 80px; 
    background: #111827; /* Matches modal background */
    border-radius: 80px 80px 0 0; position: absolute; bottom: 0; 
}
.gauge-needle { 
    width: 4px; height: 90px; background: #ffffff; position: absolute; bottom: 0; 
    transform-origin: bottom center; border-radius: 4px; 
    transition: transform 1.2s cubic-bezier(0.4, 2.0, 0.2, 1); 
}
.gauge-needle::after { 
    content: ''; width: 14px; height: 14px; background: #ffffff; 
    border-radius: 50%; position: absolute; bottom: -5px; left: -5px; 
}
.gauge-label { font-size: 1.6rem; font-weight: 800; margin-top: 15px; letter-spacing: 1px;}

/* --- PORTFOLIO UI ADDITIONS --- */
.btn-portfolio { 
    background: rgba(16, 185, 129, 0.1); 
    border-color: #10b981 !important; 
    color: #10b981 !important; 
    transition: 0.2s;
}
.btn-portfolio:hover { 
    background: #10b981; 
    color: black !important; 
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.4); 
}
.btn-nav-quan {
    position: relative;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    min-width: 88px;
    padding: 8px 17px;
    overflow: hidden;
    background: #f8fafc !important;
    border-color: #76a9ed !important;
    color: #111827 !important;
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.12), 0 5px 14px rgba(0, 0, 0, 0.3);
    transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}
.btn-nav-quan:hover {
    transform: translateY(-1px);
    background: #ffffff !important;
    border-color: #2563eb !important;
    color: #0b1220 !important;
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.2), 0 8px 20px rgba(0, 0, 0, 0.38);
}
.btn-nav-quan:active {
    transform: translateY(0);
    background: #e8eef7 !important;
    border-color: #4b8ee6 !important;
    box-shadow: inset 0 2px 4px rgba(15, 23, 42, 0.18);
}
.btn-nav-quan:focus-visible {
    outline: 2px solid #93c5fd;
    outline-offset: 3px;
}
.quan-nav-label {
    font-size: 0.98rem;
    font-weight: 850;
    letter-spacing: 0;
    line-height: 1;
}
.quan-nav-accent {
    color: #2563eb;
}
.port-header { margin-bottom: 30px; }
.port-title { color: #9ca3af; font-size: 1.1rem; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 5px; }
.port-balance { font-size: 3.5rem; font-weight: 800; line-height: 1; margin-bottom: 10px; }
.port-return { font-size: 1.2rem; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.return-badge { padding: 4px 10px; border-radius: 20px; font-size: 0.9rem; }
.holding-item { display: flex; justify-content: space-between; align-items: center; padding: 15px 0; border-bottom: 1px solid #1f2937; }
.holding-item:last-child { border-bottom: none; }
.account-badge { background: #374151; color: #d1d5db; font-size: 0.7rem; padding: 3px 8px; border-radius: 6px; margin-left: 10px; font-weight: 600; letter-spacing: 0.5px; text-transform: uppercase; }

@media (max-width: 768px) {
    /* Forces the 3 buttons to sit on the same line and share space equally */
    .search-group { 
        display: flex; 
        flex-wrap: wrap; 
        gap: 8px; 
        justify-content: space-between; 
        width: 100%;
    }
    
    .plan-selector { 
        order: 1; 
        flex: 1; 
        justify-content: center; 
        padding: 8px 5px;
        font-size: 0.85rem;
    }
    
    .btn-portfolio { 
        order: 2; 
        flex: 1; 
        display: flex; /* Overrides the old block display */
        justify-content: center;
        align-items: center;
        padding: 8px 5px;
        font-size: 0.85rem;
        margin-top: 0 !important; /* Kills the top margin */
        width: auto !important; 
    }

    .btn-nav-quan {
        order: 2;
        flex: 1 1 100%;
        padding: 9px 5px;
        font-size: 0.85rem;
    }
    
    #authToggleBtn { 
        order: 4; 
        flex: 1; 
        padding: 8px 5px;
        font-size: 0.85rem;
    }
}
#view-portfolio {
    max-width: 1440px;
    margin: 0 auto;
    padding: 24px 28px 64px;
}

/* These views sit outside .container so need their own mobile padding */
@media (max-width: 768px) {
    #view-portfolio,
    #view-pricing,
    #view-compare {
        padding-left: 16px;
        padding-right: 16px;
        box-sizing: border-box;
        width: 100%;
        overflow-x: hidden;
    }
}



/* --- QUAN VERSION DROPDOWN --- */
.version-dropdown-container {
    position: relative;
    margin: 0 15px;
    z-index: 60;
}
.version-btn {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(21, 28, 44, 0.96));
    border: 1px solid rgba(96, 165, 250, 0.28);
    color: white;
    padding: 7px 11px 7px 8px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: bold;
    cursor: pointer;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
    box-shadow: 0 10px 24px rgba(0,0,0,0.28);
}
.version-btn:hover {
    background: linear-gradient(135deg, rgba(17, 24, 39, 1), rgba(30, 41, 59, 1));
    border-color: rgba(42, 127, 255, 0.74);
    box-shadow: 0 0 0 3px rgba(42,127,255,0.12), 0 14px 30px rgba(0,0,0,0.34);
}
.version-btn:active { border-color: #a78bfa; }
.version-chip-icon {
    width: 22px;
    height: 22px;
    border-radius: 7px;
    flex: 0 0 22px;
    display: block;
    object-fit: cover;
    background: rgba(42, 127, 255, 0.1);
    border: 1px solid rgba(255,255,255,0.12);
    box-shadow: 0 0 0 2px rgba(42,127,255,0.08);
}
.version-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    transform: none;
    background: rgba(8, 13, 22, 0.98);
    border: 1px solid rgba(42, 127, 255, 0.28);
    border-radius: 14px;
    width: 306px;
    box-shadow: 0 24px 60px rgba(0,0,0,0.72), 0 0 0 1px rgba(255,255,255,0.04);
    z-index: 2147483647;
    overflow: hidden;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}
.version-dropdown-menu.show {
    display: block;
    animation: quanMenuIn 0.14s ease-out;
}
.version-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 15px;
    cursor: pointer;
    border-bottom: 1px solid rgba(31, 41, 55, 0.9);
    transition: background 0.16s ease, transform 0.16s ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
    min-height: 48px;
}
.version-option:last-child { border-bottom: none; }
.version-option:hover {
    background: linear-gradient(90deg, rgba(42, 127, 255, 0.16), rgba(109, 40, 217, 0.12));
}
.version-option:active { background: rgba(42, 127, 255, 0.22); }
.version-option-mark {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    flex: 0 0 32px;
    display: block;
    object-fit: cover;
    background: rgba(42, 127, 255, 0.13);
    border: 1px solid rgba(42, 127, 255, 0.28);
}
.version-option-mark.pro {
    background: rgba(124, 58, 237, 0.16);
    border-color: rgba(192, 132, 252, 0.28);
}
.version-option-mark.research {
    background: rgba(245, 158, 11, 0.14);
    border-color: rgba(251, 191, 36, 0.3);
}
@keyframes quanMenuIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}
@media (max-width: 480px) {
    .version-dropdown-menu {
        left: auto;
        right: 0;
        transform: none;
        width: 260px;
    }
}
/* =========================================
   "HOW WE STACK UP" AI BLURB
   ========================================= */
.stack-ai-blurb {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(109, 40, 217, 0.08));
    border: 1px solid rgba(37, 99, 235, 0.3);
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 28px;
    color: #d1d5db;
    font-size: 0.95rem;
    line-height: 1.6;
}
.stack-ai-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #2563eb, #6d28d9);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    margin-top: 2px;
}
.stack-ai-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #60a5fa;
    margin-bottom: 4px;
}
.stack-ai-text strong { color: #f3f4f6; }
.stack-ai-text em { color: #a78bfa; font-style: normal; font-weight: 600; }

/* =========================================
   TIER CARD LAYOUT (mobile only)
   ========================================= */
.tier-cards { display: none; }

.tier-card {
    background: #111827;
    border: 1px solid #1f2937;
    border-radius: 12px;
    overflow: hidden;
}
.tier-card.tier-pro {
    border-color: #2563eb;
    box-shadow: 0 0 20px rgba(37, 99, 235, 0.15);
}
.tier-card-header {
    padding: 16px 20px;
    border-bottom: 1px solid #1f2937;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.tier-card-name {
    font-size: 1.2rem;
    font-weight: 800;
}
.tier-card-price {
    font-size: 0.9rem;
    color: #9ca3af;
    text-align: right;
}
.tier-card-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid #0d1117;
    font-size: 0.9rem;
}
.tier-card-row:last-child { border-bottom: none; }
.tier-card-feature { color: #d1d5db; font-weight: 500; }
.tier-card-val { display: flex; align-items: center; }
.tier-card-footer {
    padding: 16px 20px;
    border-top: 1px solid #1f2937;
    background: rgba(0,0,0,0.3);
}

/* Wrapper for scrollable competitor table */
.comp-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 10px;
}

@media (max-width: 850px) {
    #tierTable { display: none; }
    .tier-cards { display: flex; flex-direction: column; gap: 16px; margin-bottom: 15px; }
    .comp-table-wrap { overflow-x: auto; border-radius: 10px; }
    .comp-table-wrap .comp-table { min-width: 560px; }
}

/* =========================================
   MSN-STYLE STOCK PAGE ENHANCEMENTS
   ========================================= */

/* Stats category label */
.stats-cat-label {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #6b7280;
    margin-bottom: 10px;
    margin-top: 4px;
}

/* News items with images */
.news-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}
.news-img {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
    background: #1f2937;
}
.news-text {
    flex: 1;
    min-width: 0;
}

/* Async section placeholder pulse */
.async-section-loader {
    min-height: 2px;
}

/* Peer cards scroll */
#peers-cards::-webkit-scrollbar { height: 4px; }
#peers-cards::-webkit-scrollbar-track { background: transparent; }
#peers-cards::-webkit-scrollbar-thumb { background: #374151; border-radius: 2px; }

/* Valuation 3-col grid */
@media (max-width: 850px) {
    .metrics-grid[style*="repeat(3"] {
        grid-template-columns: 1fr 1fr !important;
    }
    .metrics-grid[style*="repeat(4"] {
        grid-template-columns: 1fr 1fr !important;
    }
    #section-earnings > div > div {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    #section-insiders .insider-grid {
        grid-template-columns: 1fr auto auto !important;
    }
}

/* =========================================
   SIDEBAR WIDGETS (Price Target, EPS, Peers)
   ========================================= */
.side-widget {
    margin-bottom: 24px;
    animation: fadeInWidget 0.3s ease-out;
}

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

.widget-title {
    font-size: 0.82rem !important;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #9ca3af !important;
    margin-bottom: 14px !important;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* =========================================
   DAY STATS STRIP
   ========================================= */
.day-stats-strip {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0;
    background: #0d1117;
    border: 1px solid #1f2937;
    border-radius: 10px;
    margin-bottom: 20px;
    overflow: hidden;
}

.day-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 8px;
    border-right: 1px solid #1f2937;
    gap: 3px;
}

.day-stat:last-child { border-right: none; }

.day-stat-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6b7280;
    font-weight: 700;
}

.day-stat-val {
    font-size: 0.88rem;
    font-weight: 700;
    color: white;
}

@media (max-width: 850px) {
    .day-stats-strip {
        grid-template-columns: repeat(3, 1fr);
    }
    .day-stat:nth-child(3) { border-right: none; }
    .day-stat:nth-child(4), .day-stat:nth-child(5), .day-stat:nth-child(6) {
        border-top: 1px solid #1f2937;
    }
}

/* =========================================
   ACCENT SECTION TITLES
   ========================================= */
.section-title {
    font-size: 1rem !important;
    font-weight: 700 !important;
    padding-bottom: 10px !important;
    border-bottom: 1px solid #1f2937 !important;
    margin-bottom: 15px !important;
    color: #f3f4f6 !important;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title::before {
    content: '';
    display: inline-block;
    width: 3px;
    height: 16px;
    background: linear-gradient(180deg, #2563eb, #7c3aed);
    border-radius: 2px;
    flex-shrink: 0;
}

/* Override: widget titles don't get the accent bar */
.widget-title::before { display: none; }

/* =========================================
   METRIC BOX POLISH
   ========================================= */
.metric-box {
    border-top: 1px solid #1a2332 !important;
    padding: 12px 10px 10px 10px !important;
    background: #0a0f1a;
    border-radius: 8px;
    transition: background 0.15s;
}

.metric-box:hover { background: #0d1117; }

.m-label {
    color: #6b7280 !important;
    font-size: 0.72rem !important;
    margin-bottom: 5px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    font-weight: 600 !important;
}

.m-value {
    font-size: 1rem !important;
    font-weight: 700 !important;
}

/* =========================================
   SECTION DIVIDER (subtle horizontal rule)
   ========================================= */
.section-divider {
    border: none;
    border-top: 1px solid #1f2937;
    margin: 28px 0 24px 0;
}

/* Peers widget rows scrollbar */
#widget-peers-content::-webkit-scrollbar { width: 3px; }
#widget-peers-content::-webkit-scrollbar-thumb { background: #374151; border-radius: 2px; }

/* =========================================
   SEARCH BAR HIDDEN — overrides any inline style
   ========================================= */
.search-bar-hidden { display: none !important; }

/* =========================================
   PORTFOLIO SUMMARY CARDS
   ========================================= */
#portfolioSummaryRow {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}
.summary-card { padding: 18px 20px; }
.mobile-perf-cards { display: none !important; }

@media (max-width: 900px) {
    /* Collapse top row to 1 column so 'Total Invested' is full width */
    #portfolioSummaryRow { grid-template-columns: 1fr !important; }
    
    /* Hide the top-row Best/Worst cards */
    .desktop-perf-card { display: none !important; }
    
    /* Reveal the mobile Best/Worst cards under the chart */
    .mobile-perf-cards { display: flex !important; }
}

@media (max-width: 600px) {
    /* Stack Best/Worst vertically on standard phone screens */
    .mobile-perf-cards { flex-direction: column; }
}

/* =========================================
   PORTFOLIO WORKSTATION REDESIGN
   ========================================= */
.portfolio-workspace {
    color: #dde5f0;
}

.portfolio-workspace .port-header {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: end;
    gap: 16px;
    margin-bottom: 22px;
}

.portfolio-workspace .port-title {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 1.4px;
    color: #4f6380;
    font-weight: 800;
    margin-bottom: 8px;
}

.portfolio-workspace .port-balance {
    font-family: 'Fira Code', monospace;
    font-size: clamp(2.25rem, 5vw, 3.6rem);
    line-height: 1;
    letter-spacing: -1px;
    color: #f8fafc;
}

.portfolio-workspace .port-return {
    margin-top: 10px;
    font-family: 'Fira Code', monospace;
    font-size: 0.98rem;
    font-weight: 800;
}

.portfolio-workspace .port-last-updated {
    margin-top: 8px;
    color: #4f6380;
    font-size: 0.76rem;
}

.portfolio-workspace .dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: 18px;
    align-items: start;
}

.portfolio-workspace .panel,
.portfolio-workspace .summary-card,
.portfolio-workspace .analytics-widget {
    background: #101520;
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 12px;
    box-shadow: none;
}

.portfolio-workspace .panel-title {
    color: #dde5f0 !important;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-size: 0.78rem !important;
}

#portfolioSummaryRow {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 18px;
}

.portfolio-workspace .summary-card {
    padding: 16px;
    min-height: 112px;
}

.portfolio-metric-label {
    font-size: 0.64rem;
    text-transform: uppercase;
    letter-spacing: 0.9px;
    color: #4f6380;
    font-weight: 900;
    margin-bottom: 9px;
}

.portfolio-metric-value {
    font-family: 'Fira Code', monospace;
    font-size: 1.35rem;
    color: #f8fafc;
    font-weight: 900;
    line-height: 1;
}

.portfolio-metric-sub {
    margin-top: 6px;
    color: #6e82a0;
    font-size: 0.72rem;
}

.portfolio-workspace .dashboard-grid > div:first-child > .panel:first-child {
    overflow: hidden;
    padding: 0 !important;
}

.portfolio-chart-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding: 16px 20px 0;
}

.portfolio-workspace .dashboard-grid > div:first-child > .panel:first-child .panel-title {
    padding: 0 !important;
    margin: 0 0 10px !important;
    border-bottom: 0 !important;
}

.portfolio-chart-note {
    color: #4f6380;
    font-size: 0.72rem;
    margin-top: -4px;
}

.portfolio-timeframe-tabs {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 8px;
    background: rgba(3,7,18,0.44);
    flex-shrink: 0;
}

.portfolio-timeframe-tabs button {
    border: none;
    background: transparent;
    color: #6e82a0;
    border-radius: 6px;
    padding: 6px 9px;
    font-family: 'Fira Code', monospace;
    font-size: 0.72rem;
    font-weight: 900;
    cursor: pointer;
}

.portfolio-timeframe-tabs button.active {
    color: #f8fafc;
    background: rgba(77,159,255,0.22);
}

.portfolio-workspace .dashboard-grid > div:first-child > .panel:first-child > div:last-child {
    height: 270px !important;
    padding: 4px 18px 18px;
}

.portfolio-chart-shell {
    height: 300px;
    width: 100%;
    position: relative;
}

.portfolio-lw-chart {
    width: 100%;
    height: 100%;
    min-height: 260px;
    overflow: hidden;
    border-radius: 8px;
    background: #0e131c;
}

.portfolio-insights-grid {
    display: none;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.portfolio-insight-card {
    background: #101520;
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 12px;
    padding: 15px;
}

.portfolio-insight-label {
    color: #4f6380;
    font-size: 0.64rem;
    text-transform: uppercase;
    letter-spacing: 0.9px;
    font-weight: 900;
    margin-bottom: 8px;
}

.portfolio-insight-value {
    color: #f8fafc;
    font-family: 'Fira Code', monospace;
    font-weight: 900;
    font-size: 1.08rem;
    line-height: 1.2;
}

.portfolio-insight-sub {
    color: #6e82a0;
    font-size: 0.72rem;
    line-height: 1.35;
    margin-top: 7px;
}

.portfolio-holdings-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 860px;
}

.portfolio-table-scroll {
    overflow-x: auto;
}

.portfolio-holdings-table th {
    color: #4f6380;
    font-size: 0.64rem;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    text-align: left;
    padding: 0 12px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
}

.portfolio-holdings-table td {
    padding: 13px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    vertical-align: middle;
}

.portfolio-holdings-table tr:hover td {
    background: rgba(255,255,255,0.025);
}

.portfolio-num {
    text-align: right !important;
    font-family: 'Fira Code', monospace;
}

.portfolio-ticker-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.portfolio-ticker-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(42,127,255,0.25);
    color: #60a5fa;
    font-family: 'Fira Code', monospace;
    font-size: 0.68rem;
    font-weight: 900;
    overflow: hidden;
    flex-shrink: 0;
}

.portfolio-ticker-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 5px;
    background: #f8fafc;
}

.portfolio-logo-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(42,127,255,0.13);
}

.portfolio-ticker-btn {
    background: none;
    border: none;
    padding: 0;
    color: #60a5fa;
    font-family: 'Fira Code', monospace;
    font-size: 0.95rem;
    font-weight: 900;
    cursor: pointer;
}

.portfolio-row-sub {
    color: #4f6380;
    font-size: 0.72rem;
    margin-top: 2px;
}

.portfolio-account-tag {
    display: inline-flex;
    border-radius: 4px;
    padding: 3px 8px;
    background: rgba(77,159,255,0.12);
    border: 1px solid rgba(77,159,255,0.2);
    color: #93c5fd;
    font-size: 0.68rem;
    font-weight: 800;
}

.portfolio-pnl.positive { color: #10b981; }
.portfolio-pnl.negative { color: #ef4444; }

.portfolio-weight-cell {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 120px;
}

.portfolio-weight-track {
    flex: 1;
    height: 5px;
    border-radius: 999px;
    background: #090c12;
    overflow: hidden;
}

.portfolio-weight-fill {
    height: 100%;
    border-radius: inherit;
    background: #00d4a0;
}

.portfolio-weight-cell span {
    width: 42px;
    text-align: right;
    color: #6e82a0;
    font-family: 'Fira Code', monospace;
    font-size: 0.72rem;
}

.portfolio-actions-head,
.portfolio-actions-cell {
    text-align: right !important;
}

.portfolio-actions-cell {
    white-space: nowrap;
}

.portfolio-actions-cell button {
    border-radius: 6px;
    padding: 6px 9px;
    cursor: pointer;
    font-size: 0.72rem;
    font-weight: 800;
    margin-left: 6px;
}

.portfolio-edit-btn {
    background: rgba(77,159,255,0.12);
    border: 1px solid rgba(77,159,255,0.25);
    color: #93c5fd;
}

.portfolio-remove-btn {
    background: rgba(239,68,68,0.08);
    border: 1px solid rgba(239,68,68,0.18);
    color: #f87171;
}

.portfolio-empty-state {
    color: #6e82a0;
    font-size: 0.9rem;
    padding: 18px;
}

.portfolio-allocation-list {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.portfolio-allocation-row {
    display: grid;
    grid-template-columns: 10px 44px 1fr 46px;
    gap: 8px;
    align-items: center;
}

.portfolio-allocation-dot {
    width: 8px;
    height: 8px;
    border-radius: 2px;
}

.portfolio-allocation-symbol,
.portfolio-allocation-row strong {
    font-family: 'Fira Code', monospace;
    font-size: 0.75rem;
}

.portfolio-allocation-track {
    height: 5px;
    border-radius: 999px;
    background: #090c12;
    overflow: hidden;
}

.portfolio-allocation-track div {
    height: 100%;
    border-radius: inherit;
}

.ai-risk-box {
    background: linear-gradient(135deg, rgba(15,30,48,0.95), rgba(16,26,38,0.95)) !important;
    border-color: rgba(0,212,160,0.2) !important;
}

.asset-modal-box {
    max-width: 420px;
}

.asset-cost-mode {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 10px;
    padding: 4px;
    border: 1px solid rgba(77,159,255,0.18);
    border-radius: 8px;
    background: rgba(7,12,20,0.78);
}

.asset-cost-mode button {
    border: none;
    border-radius: 6px;
    padding: 9px 10px;
    color: #6e82a0;
    background: transparent;
    font-size: 0.8rem;
    font-weight: 900;
    cursor: pointer;
}

.asset-cost-mode button.active {
    color: #e5e7eb;
    background: linear-gradient(135deg, rgba(37,99,235,0.9), rgba(16,185,129,0.55));
}

.asset-cost-hint {
    color: #6e82a0;
    font-size: 0.75rem;
    line-height: 1.4;
    margin: -6px 0 14px;
}

.asset-account-field {
    margin: 4px 0 15px;
    text-align: left;
}

.asset-account-field > label {
    display: block;
    margin: 0 0 7px 2px;
    color: #8fa3bf;
    font-size: 0.7rem;
    font-weight: 900;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.asset-account-select {
    position: relative;
    display: flex;
    align-items: center;
    border: 1px solid #334155;
    border-radius: 9px;
    background: linear-gradient(135deg, rgba(7,12,20,0.98), rgba(12,22,35,0.98));
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.asset-account-select:focus-within {
    border-color: #4d9fff;
    box-shadow: 0 0 0 3px rgba(77,159,255,0.12);
}

.asset-account-select select {
    width: 100%;
    padding: 13px 42px 13px 48px;
    border: 0;
    outline: 0;
    appearance: none;
    color: #eef4ff;
    background: transparent;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
}

.asset-account-select select option {
    color: #e5e7eb;
    background: #0b111b;
}

.asset-account-icon {
    position: absolute;
    left: 12px;
    display: grid;
    width: 26px;
    height: 26px;
    place-items: center;
    border: 1px solid rgba(77,159,255,0.24);
    border-radius: 7px;
    color: #60a5fa;
    background: rgba(37,99,235,0.12);
    pointer-events: none;
}

.asset-account-icon svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.asset-account-chevron {
    position: absolute;
    right: 14px;
    width: 16px;
    height: 16px;
    fill: none;
    stroke: #64748b;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
}

.asset-custom-account {
    display: none;
    margin: 9px 0 0;
}

.asset-custom-account.visible {
    display: block;
}

.asset-account-hint {
    margin: 7px 2px 0;
    color: #60738f;
    font-size: 0.72rem;
    line-height: 1.4;
}

.portfolio-account-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.portfolio-account-tag svg {
    width: 12px;
    height: 12px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

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

    #portfolioSummaryRow {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .portfolio-insights-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    #view-portfolio {
        padding: 18px 14px 48px;
    }

    .portfolio-workspace .port-header {
        grid-template-columns: 1fr;
    }

    #portfolioSummaryRow {
        grid-template-columns: 1fr;
    }

    .portfolio-workspace .summary-card {
        min-height: auto;
    }

    .portfolio-chart-shell {
        height: 250px;
    }

    .portfolio-chart-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .portfolio-timeframe-tabs {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(5, 1fr);
    }

    .portfolio-timeframe-tabs button {
        padding: 8px 4px;
    }

    .portfolio-insights-grid {
        display: none !important;
    }

    .portfolio-lw-chart {
        min-height: 230px;
    }

    .portfolio-table-scroll {
        margin: 0 -8px;
        padding: 0 8px 4px;
        overflow-x: visible;
    }

    .portfolio-holdings-table {
        min-width: 0;
        display: block;
    }

    .portfolio-holdings-table thead {
        display: none;
    }

    .portfolio-holdings-table tbody,
    .portfolio-holdings-table tr,
    .portfolio-holdings-table td {
        display: block;
        width: 100%;
    }

    .portfolio-holdings-table tr {
        border: 1px solid rgba(77,159,255,0.14);
        border-radius: 10px;
        background: rgba(11,16,24,0.92);
        margin-bottom: 12px;
        overflow: hidden;
    }

    .portfolio-holdings-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 14px;
        padding: 11px 13px;
        border-bottom: 1px solid rgba(255,255,255,0.055);
    }

    .portfolio-holdings-table td:first-child {
        justify-content: flex-start;
        padding-top: 14px;
    }

    .portfolio-holdings-table td:not(:first-child)::before {
        content: attr(data-label);
        color: #4f6380;
        font-size: 0.68rem;
        letter-spacing: 0.7px;
        text-transform: uppercase;
        font-weight: 900;
        font-family: 'Fira Code', monospace;
    }

    .portfolio-num {
        text-align: right !important;
    }

    .portfolio-weight-cell {
        width: min(58%, 190px);
    }

    .portfolio-actions-cell {
        justify-content: flex-end !important;
    }

    .portfolio-actions-cell::before {
        margin-right: auto;
    }

    .asset-modal-box {
        width: calc(100% - 24px) !important;
        max-width: 420px !important;
        margin: auto 12px !important;
    }
}
/* =========================================
   FUTURE VALUE WIDGET
   ========================================= */
.fv-expand-btn {
    background: none;
    border: 1px solid #374151;
    color: #9ca3af;
    padding: 5px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 600;
    transition: border-color 0.2s, color 0.2s;
    margin-top: 10px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.fv-expand-btn:hover { border-color: #6b7280; color: #d1d5db; }
.fv-year-select {
    background: #1f2937;
    border: 1px solid #374151;
    color: #9ca3af;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
}

/* =========================================
   REFRESH BUTTON
   ========================================= */
.refresh-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #6b7280;
    padding: 3px 5px;
    border-radius: 4px;
    transition: color 0.2s;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.refresh-btn:hover { color: #9ca3af; }
.refresh-btn.spinning svg { animation: spin-once 0.65s ease-in-out; }
@keyframes spin-once { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* =========================================
   LAST UPDATED LABEL
   ========================================= */
.port-last-updated {
    font-size: 0.72rem;
    color: #6b7280;
    margin-top: 4px;
    min-height: 1em;
}
/* =========================================
   TOGGLE SWITCHES (Profile Preferences)
   ========================================= */
.pref-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid #1f2937; color: #d1d5db; font-weight: 500; font-size: 0.95rem; }
.pref-row:last-child { border-bottom: none; }
.switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0;}
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #374151; transition: .3s; border-radius: 24px; }
.slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background-color: white; transition: .3s; border-radius: 50%; }
input:checked + .slider { background-color: #10b981; }
input:checked + .slider:before { transform: translateX(20px); }

/* =========================================
   MARKET STATUS REPORT MODAL
   ========================================= */
.report-modal-box {
    background-color: #0d1117; 
    width: 95%;
    max-width: 850px; 
    max-height: 85vh;
    border-radius: 12px;
    border: 1px solid #374151;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0,0,0,0.9);
    margin: auto;
}

.report-header {
    padding: 20px 24px;
    border-bottom: 1px solid #1f2937;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #111827; 
}

.report-content {
    padding: 30px;
    overflow-y: auto;
    background: #0d1117;
}

/* =========================================
   MARKET STATUS MODAL — MOBILE RESPONSIVE
   ========================================= */
@media (max-width: 768px) {
    #marketStatusModal {
        align-items: flex-end !important;
        padding: 0 !important;
    }

    .report-modal-box {
        width: 100% !important;
        max-width: 100% !important;
        /* Fill from bottom all the way up to just below the dynamic island / notch */
        max-height: calc(100dvh - env(safe-area-inset-top)) !important;
        height: calc(100dvh - env(safe-area-inset-top)) !important;
        border-radius: 0 !important;
        margin: 0 !important;
        border: none !important;
    }

    /* Push the header content below the notch */
    .report-header {
        padding-top: calc(20px + env(safe-area-inset-top)) !important;
    }

    .report-content {
        padding: 20px 18px !important;
    }

    .report-content h3 {
        font-size: 1.4rem !important;
    }

    .report-content p {
        font-size: 1rem !important;
    }
}

/* =========================================
   COMPARE BUTTON (action bar)
   ========================================= */
.btn-compare {
    background: linear-gradient(135deg, #0d9488, #0891b2);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    gap: 7px;
    font-weight: 700;
    letter-spacing: 0.01em;
    box-shadow: 0 0 0 0 rgba(8, 145, 178, 0);
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}
.btn-compare::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.12), transparent);
    pointer-events: none;
}
.btn-compare:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(13, 148, 136, 0.45);
    background: linear-gradient(135deg, #0f766e, #0e7490);
}
.btn-compare:active { transform: translateY(0); }

/* =========================================
   COMPARE PAGE — LAYOUT & CHROME
   ========================================= */
#view-compare {
    max-width: 1200px;
    margin: 0 auto;
    padding-bottom: 60px;
}

.compare-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid #1f2937;
}

.compare-page-title {
    display: flex;
    align-items: center;
    gap: 16px;
}

.compare-back-btn {
    background: #1f2937;
    border: 1px solid #374151;
    color: #9ca3af;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}
.compare-back-btn:hover { background: #374151; color: white; border-color: #4b5563; }

/* =========================================
   COMPARE — INPUT ROW
   ========================================= */
.compare-input-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 32px;
    background: #111827;
    border: 1px solid #1f2937;
    border-radius: 14px;
    padding: 20px 24px;
    flex-wrap: wrap;
}

.compare-input-card {
    flex: 1;
    min-width: 180px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.compare-input-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #6b7280;
}

.compare-slot-badge {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 800;
    flex-shrink: 0;
}

.compare-slot-a { background: rgba(14,165,233,0.15); color: #0ea5e9; border: 1px solid rgba(14,165,233,0.35); }
.compare-slot-b { background: rgba(249,115,22,0.15); color: #f97316; border: 1px solid rgba(249,115,22,0.35); }

.compare-ticker-input {
    width: 100%;
    padding: 11px 14px;
    background: #000;
    border: 1px solid #374151;
    border-radius: 8px;
    color: white;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 1px;
    outline: none;
    transition: border-color 0.2s;
}
.compare-ticker-input:focus { border-color: #0ea5e9; }
.compare-ticker-input::placeholder { color: #374151; font-weight: 400; letter-spacing: 0; }

.compare-vs-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: #4b5563;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 1px;
    flex-shrink: 0;
    padding: 0 4px;
}

.compare-run-btn {
    padding: 12px 28px;
    background: linear-gradient(135deg, #0d9488, #0891b2);
    border: none;
    border-radius: 10px;
    color: white;
    font-weight: 800;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    flex-shrink: 0;
    letter-spacing: 0.02em;
    box-shadow: 0 4px 15px rgba(8,145,178,0.3);
    position: relative;
    overflow: hidden;
}
.compare-run-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.12), transparent);
    pointer-events: none;
}
.compare-run-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(8,145,178,0.45); }
.compare-run-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* =========================================
   COMPARE — COLUMN LAYOUT (header + chart paired per stock)
   ========================================= */
.compare-columns-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
    align-items: start;
}

.compare-column {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.compare-chart-panel {
    /* inherits .panel base styles */
}

/* Keep old class name aliases in case any JS still references them */
.compare-stock-headers {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.compare-header-card {
    background: #111827;
    border: 1px solid #1f2937;
    border-radius: 12px;
    padding: 20px;
    position: relative;
    transition: border-color 0.2s;
}
.compare-header-a { border-top: 2px solid #0ea5e9; }
.compare-header-b { border-top: 2px solid #f97316; }

.compare-header-slot-badge {
    position: absolute;
    top: 12px;
    right: 14px;
    width: 26px;
    height: 26px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 800;
}

/* =========================================
   COMPARE — CHART LABEL
   ========================================= */
.compare-chart-label {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #6b7280;
    margin-bottom: 10px;
}

/* =========================================
   COMPARE — STATS TABLE
   ========================================= */
.compare-stats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #1f2937;
    flex-wrap: wrap;
    gap: 8px;
}

.compare-stats-col-labels {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    background: #0d1117;
    border-bottom: 1px solid #1f2937;
    gap: 0;
}

.compare-stat-col-label {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.compare-stat-row {
    display: flex;
    align-items: center;
    padding: 13px 20px;
    border-bottom: 1px solid #0d1117;
    gap: 0;
    transition: background 0.15s;
}
.compare-stat-row:last-of-type { border-bottom: none; }
.compare-stat-row:hover { background: rgba(255,255,255,0.02); }
.compare-stat-row-alt { background: rgba(13,17,23,0.5); }

.compare-stat-label {
    flex: 2;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.compare-stat-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: #4b5563;
    margin-top: 1px;
}

.compare-stat-val {
    flex: 1;
    font-size: 0.92rem;
    font-weight: 600;
    color: #d1d5db;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 6px;
    transition: background 0.15s;
}

.compare-stat-winner {
    background: rgba(16,185,129,0.08);
    border: 1px solid rgba(16,185,129,0.2);
    color: #f3f4f6;
}

.compare-win-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* =========================================
   COMPARE — MOBILE RESPONSIVE
   ========================================= */
@media (max-width: 850px) {
    .compare-input-row { flex-direction: column; align-items: stretch; padding: 16px; }
    .compare-vs-badge { flex-direction: row; padding: 4px 0; justify-content: center; }
    .compare-run-btn { width: 100%; justify-content: center; }
    /* Stack the two columns: A header → A chart → B header → B chart */
    .compare-columns-row { grid-template-columns: 1fr; }
    .compare-stats-col-labels .compare-stat-col-label:first-of-type { display: none; }
    .compare-stat-label { flex: 1.5; }
    .compare-stat-val { flex: 1; }
}

@media (max-width: 500px) {
    .compare-stat-row { padding: 10px 12px; }
    .compare-stats-header { padding: 12px; }
    .compare-stats-col-labels { padding: 8px 12px; }
}

/* =========================================
   PHASE 1.2 — ACCOUNT FILTER PILLS
   ========================================= */
#accountPillsContainer {
    display: none;
    flex-wrap: wrap;
    gap: 8px;
    padding-bottom: 18px;
}

.account-pill {
    background: #1f2937;
    border: 1px solid #374151;
    color: #9ca3af;
    padding: 5px 14px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s;
    white-space: nowrap;
}
.account-pill:hover {
    border-color: #6b7280;
    color: #d1d5db;
}
.account-pill.active {
    background: rgba(37, 99, 235, 0.15);
    border-color: #2563eb;
    color: #60a5fa;
    box-shadow: 0 0 10px rgba(37, 99, 235, 0.2);
}

/* =========================================
   PHASE 2 — ANALYTICS WIDGETS
   ========================================= */
.analytics-widgets-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 24px;
}
.analytics-widget {
    background: #111827;
    border: 1px solid #1f2937;
    border-radius: 12px;
    padding: 16px 18px;
}
.analytics-widget-label {
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #6b7280;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}
@media (max-width: 900px) {
    .analytics-widgets-row {
        grid-template-columns: 1fr;
    }
}

/* =========================================
   PHASE 3.1 — HOLDINGS NEWS FEED
   ========================================= */
.holdings-news-item {
    display: block;
    padding: 11px 0;
    border-bottom: 1px solid #1f2937;
    text-decoration: none;
    transition: 0.15s;
}
.holdings-news-item:last-child {
    border-bottom: none;
}
.holdings-news-item:hover .h-news-hl {
    color: #60a5fa;
}
.h-news-meta {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 5px;
}
.h-news-ticker {
    background: #2563eb;
    color: #fff;
    font-size: 0.62rem;
    padding: 2px 7px;
    border-radius: 5px;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    flex-shrink: 0;
}
.h-news-hl {
    color: #e5e7eb;
    font-size: 0.87rem;
    font-weight: 600;
    line-height: 1.4;
    transition: color 0.2s;
}

/* =========================================
   PHASE 3.2 — AI HEALTH CHECK BUTTON
   ========================================= */
.btn-health-check {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #10b981;
    background: rgba(16, 185, 129, 0.08);
    color: #10b981;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-health-check:hover {
    background: rgba(16, 185, 129, 0.18);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.25);
    transform: translateY(-1px);
}

/* ============================================================
   FEATURE 1: CORPORATE-SPEAK TRANSLATOR + AI POWER TOOLS PANEL
   ============================================================ */

/* AI Power Tools panel — homepage right sidebar */
.ai-tools-panel .section-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-tools-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 4px;
}

.ai-tool-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 13px;
    background: #0d1117;
    border: 1px solid #1f2937;
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.18s, background 0.18s, transform 0.15s;
    text-align: left;
    width: 100%;
    color: inherit;
    font-family: inherit;
}

.ai-tool-btn:hover:not(.ai-tool-coming-soon) {
    border-color: #374151;
    background: #111827;
    transform: translateX(3px);
}

.ai-tool-coming-soon {
    opacity: 0.4;
    cursor: default;
    pointer-events: none;
}

.ai-tool-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ai-tool-info {
    flex: 1;
    min-width: 0;
}

.ai-tool-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: #f3f4f6;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ai-tool-desc {
    font-size: 0.72rem;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ai-tool-soon-badge {
    font-size: 0.62rem;
    color: #4b5563;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #1f2937;
    padding: 2px 7px;
    border-radius: 4px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Corporate-Speak Translator textarea */
.corp-translator-textarea {
    width: 100%;
    padding: 14px 44px 14px 16px; /* right padding for char counter */
    border: 1px solid #374151;
    border-radius: 8px;
    background: #0d1117;
    color: #f3f4f6;
    font-size: 0.88rem;
    line-height: 1.65;
    resize: vertical;
    outline: none;
    transition: border-color 0.2s;
    font-family: inherit;
    min-height: 200px;
    display: block;
    box-sizing: border-box;
}

.corp-translator-textarea:focus {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.08);
}

.corp-translator-textarea::placeholder {
    color: #2d3748;
    font-size: 0.82rem;
    line-height: 1.7;
}

/* Spin Intensity badge — rendered inside Quan chat output.
   The AI outputs the text label; these classes are available for
   future rich rendering if the stream interceptor is enhanced. */
.spin-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.spin-accurate  { background: rgba(16,185,129,0.12);  color: #10b981; border: 1px solid rgba(16,185,129,0.4); }
.spin-mild      { background: rgba(251,191,36,0.12);  color: #fbbf24; border: 1px solid rgba(251,191,36,0.4); }
.spin-moderate  { background: rgba(249,115,22,0.12);  color: #f97316; border: 1px solid rgba(249,115,22,0.4); }
.spin-heavy     { background: rgba(239,68,68,0.12);   color: #ef4444; border: 1px solid rgba(239,68,68,0.4); }
.spin-critical  { background: rgba(239,68,68,0.18);   color: #ef4444; border: 1px solid rgba(239,68,68,0.6); animation: pulseGlow 2s infinite alternate; }

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .ai-tools-list { gap: 8px; }
    .corp-translator-textarea { min-height: 160px; font-size: 0.85rem; }
    .ai-tool-btn { padding: 10px 12px; }
}

/* ============================================================
   FEATURE 5: CAPITOL HILL SCANNER
   Scan mode toggle + performance grade badge styles
   ============================================================ */

/* Scan mode toggle buttons — Politician / Ticker */
.scan-mode-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid #374151;
    border-radius: 8px;
    background: #0d1117;
    color: #6b7280;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s;
    font-family: inherit;
}

.scan-mode-btn:hover {
    border-color: #4b5563;
    color: #9ca3af;
    background: #111827;
}

.scan-mode-btn.scan-mode-active {
    border-color: #d97706;
    background: rgba(217, 119, 6, 0.1);
    color: #fbbf24;
}

/* Performance grade badges — rendered in Quan output.
   The AI outputs the grade letter; these classes are available
   for future rich rendering enhancements. */
.grade-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 900;
    letter-spacing: -0.5px;
}

.grade-a { background: rgba(16,185,129,0.15);  color: #10b981; border: 1px solid rgba(16,185,129,0.4); }
.grade-b { background: rgba(132,204,22,0.12);  color: #84cc16; border: 1px solid rgba(132,204,22,0.4); }
.grade-c { background: rgba(251,191,36,0.12);  color: #fbbf24; border: 1px solid rgba(251,191,36,0.4); }
.grade-d { background: rgba(249,115,22,0.12);  color: #f97316; border: 1px solid rgba(249,115,22,0.4); }
.grade-f { background: rgba(239,68,68,0.12);   color: #ef4444; border: 1px solid rgba(239,68,68,0.4); }

@media (max-width: 768px) {
    .scan-mode-btn { padding: 7px 12px; font-size: 0.78rem; }
}

/* ============================================================
   FEATURE 3: HYPE VS. REALITY DIVERGENCE SCANNER
   Verdict badge + divergence score indicator styles.
   ============================================================ */

/* Hype scanner ticker input — monospace, uppercase lock */
.hype-ticker-input {
    font-family: "SF Mono", "Fira Code", "Consolas", monospace;
    letter-spacing: 2px;
}

/* Verdict badges — rendered inside Quan chat output.
   Available for future rich rendering when stream interceptor
   is enhanced to parse the AI's verdict label. */
.verdict-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.verdict-bull-trap {
    background: rgba(239,68,68,0.12);
    color: #ef4444;
    border: 1px solid rgba(239,68,68,0.4);
}

.verdict-bear-trap {
    background: rgba(16,185,129,0.12);
    color: #10b981;
    border: 1px solid rgba(16,185,129,0.4);
}

.verdict-aligned-bullish {
    background: rgba(37,99,235,0.12);
    color: #60a5fa;
    border: 1px solid rgba(37,99,235,0.35);
}

.verdict-aligned-bearish {
    background: rgba(107,114,128,0.12);
    color: #9ca3af;
    border: 1px solid rgba(107,114,128,0.35);
}

.verdict-inconclusive {
    background: rgba(251,191,36,0.1);
    color: #fbbf24;
    border: 1px solid rgba(251,191,36,0.3);
}

/* Divergence score bar — a visual 1-10 meter.
   Rendered by a future stream post-processor;
   base styles defined here for forward compatibility. */
.divergence-meter {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 8px 0;
}

.divergence-meter-track {
    flex: 1;
    height: 6px;
    background: #1f2937;
    border-radius: 3px;
    overflow: hidden;
}

.divergence-meter-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
    /* width set inline as a % of 10, e.g. score 7 = 70% */
}

/* Score 1-3: low divergence — blue */
.divergence-low  { background: linear-gradient(90deg, #2563eb, #3b82f6); }
/* Score 4-6: moderate — amber */
.divergence-mid  { background: linear-gradient(90deg, #d97706, #fbbf24); }
/* Score 7-10: high to extreme — red */
.divergence-high { background: linear-gradient(90deg, #dc2626, #ef4444); }

@media (max-width: 768px) {
    .hype-ticker-input { font-size: 0.95rem; }
}

/* ============================================================
   FEATURE 4: SYMPATHY PLAY ENGINE
   Conviction badge, catalyst magnitude, and timing lag styles.
   ============================================================ */

/* Conviction badges — HIGH / MEDIUM / LOW */
.conviction-badge {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.conviction-high   { background: rgba(16,185,129,0.15);  color: #10b981; border: 1px solid rgba(16,185,129,0.35); }
.conviction-medium { background: rgba(251,191,36,0.12);  color: #fbbf24; border: 1px solid rgba(251,191,36,0.35); }
.conviction-low    { background: rgba(107,114,128,0.12); color: #9ca3af; border: 1px solid rgba(107,114,128,0.3); }

/* Catalyst magnitude tier labels */
.catalyst-tier {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.catalyst-tier-1 { background: rgba(239,68,68,0.12);   color: #ef4444; border: 1px solid rgba(239,68,68,0.35); }
.catalyst-tier-2 { background: rgba(249,115,22,0.12);  color: #f97316; border: 1px solid rgba(249,115,22,0.35); }
.catalyst-tier-3 { background: rgba(107,114,128,0.1);  color: #9ca3af; border: 1px solid rgba(107,114,128,0.3); }

/* Sympathy lag labels */
.sympathy-lag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    background: rgba(56,189,248,0.1);
    color: #38bdf8;
    border: 1px solid rgba(56,189,248,0.25);
}

@media (max-width: 768px) {
    .conviction-badge, .catalyst-tier, .sympathy-lag { font-size: 0.65rem; }
}

/* ============================================================
   FEATURE 2: PORTFOLIO STRESS TESTER
   Scenario selector grid + stress rating badge styles.
   ============================================================ */

/* Six-scenario selector grid */
.stress-scenario-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.stress-scenario-btn {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 13px;
    background: #0d1117;
    border: 1px solid rgba(107,114,128,0.3);
    border-radius: 9px;
    cursor: pointer;
    text-align: left;
    font-size: 0.8rem;
    font-weight: 600;
    color: #9ca3af;
    transition: border-color 0.18s, background 0.18s, color 0.18s, transform 0.12s;
    font-family: inherit;
    line-height: 1.3;
}

.stress-scenario-btn:hover {
    border-color: rgba(129,140,248,0.45);
    color: #e5e7eb;
    transform: translateY(-1px);
}

.stress-scenario-btn.stress-scenario-active {
    color: #f3f4f6;
    font-weight: 700;
}

/* Portfolio stress rating badges — rendered in Quan chat output */
.stress-rating {
    display: inline-block;
    padding: 3px 11px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stress-critical  { background: rgba(239,68,68,0.14);  color: #ef4444; border: 1px solid rgba(239,68,68,0.45); }
.stress-high      { background: rgba(249,115,22,0.12); color: #f97316; border: 1px solid rgba(249,115,22,0.4); }
.stress-moderate  { background: rgba(251,191,36,0.12); color: #fbbf24; border: 1px solid rgba(251,191,36,0.4); }
.stress-low       { background: rgba(132,204,22,0.1);  color: #84cc16; border: 1px solid rgba(132,204,22,0.35); }
.stress-resilient { background: rgba(16,185,129,0.1);  color: #10b981; border: 1px solid rgba(16,185,129,0.35); }

@media (max-width: 768px) {
    .stress-scenario-grid { grid-template-columns: 1fr; }
    .stress-scenario-btn  { font-size: 0.78rem; padding: 9px 12px; }
}

/* ============================================================
   FEATURE 6: DCA VISUALIZER
   Chart container, summary metrics row, and metric cell styles.
   Rendered inside the Quan chat bubble by renderDcaChart().
   ============================================================ */

/* Outer wrapper injected after AI bubble text */
.dca-chart-container {
    margin-top: 18px;
    padding: 16px;
    background: #0d1117;
    border: 1px solid #1f2937;
    border-radius: 12px;
    overflow: hidden;
}

/* Header row: green arrow icon + title + optional subtitle */
.dca-chart-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid #1f2937;
}

/* Three-column summary stats row below the chart */
.dca-summary-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 4px;
}

.dca-options-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin: -2px 0 12px;
    padding: 9px 10px;
    background: rgba(17, 24, 39, 0.72);
    border: 1px solid #1f2937;
    border-radius: 8px;
}

.dca-drip-toggle,
.dca-yield-field {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #d1d5db;
    font-size: 0.74rem;
    font-weight: 700;
}

.dca-drip-toggle input {
    accent-color: #10b981;
}

.dca-yield-field span {
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-size: 0.66rem;
}

.dca-yield-field input {
    width: 64px;
    height: 28px;
    border: 1px solid #374151;
    border-radius: 6px;
    background: #0d1117;
    color: #f3f4f6;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 800;
    text-align: right;
    padding: 0 7px;
}

.dca-yield-field input:disabled {
    opacity: 0.42;
    cursor: not-allowed;
}

.dca-metric {
    background: #111827;
    border: 1px solid #1f2937;
    border-radius: 8px;
    padding: 10px 12px;
    text-align: center;
}

.dca-metric-label {
    font-size: 0.68rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-weight: 700;
    margin-bottom: 5px;
}

.dca-metric-value {
    font-size: 1.05rem;
    font-weight: 800;
    color: #f3f4f6;
    letter-spacing: -0.3px;
    white-space: nowrap;
}

@media (max-width: 480px) {
    .dca-summary-row   { grid-template-columns: 1fr 1fr; }
    .dca-metric-value  { font-size: 0.92rem; }
    .dca-chart-container { padding: 12px; }
}

/* ── DCA Expand button (inside chart container header) ── */
.dca-expand-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border: 1px solid #374151;
    border-radius: 6px;
    background: #111827;
    color: #9ca3af;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
    font-family: inherit;
}
.dca-expand-btn:hover {
    border-color: #10b981;
    color: #10b981;
    background: rgba(16,185,129,0.06);
}

/* ── DCA Expand Modal ──
   z-index sits ONE above copilotModal's max integer so it overlays
   the Quan panel directly. Background is a very dark semi-transparent
   scrim rather than solid black, so the user can see Quan behind it.
   Closing the modal returns the user straight back to the Quan chat. ── */
#dcaExpandModal {
    z-index: 2147483648 !important;
    background: rgba(0, 0, 0, 0.75) !important;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.dca-expand-box {
    background: #0a0a0a;
    border: 1px solid #1f2937;
    border-radius: 16px;
    width: 100%;
    max-width: 820px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 25px 60px -10px rgba(0,0,0,0.8);
}

.dca-expand-body {
    flex: 1;
    overflow-y: auto;
    padding: 0 22px 24px;
    scrollbar-width: thin;
    scrollbar-color: #374151 transparent;
}

.dca-expand-body::-webkit-scrollbar { width: 5px; }
.dca-expand-body::-webkit-scrollbar-track { background: transparent; }
.dca-expand-body::-webkit-scrollbar-thumb { background: #374151; border-radius: 3px; }

/* Six-column stats grid in expand modal */
.dca-expand-stats {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    margin-bottom: 18px;
}

.dca-expand-stat {
    background: #111827;
    border: 1px solid #1f2937;
    border-radius: 8px;
    padding: 10px 12px;
    text-align: center;
}

/* Milestone callouts row */
.dca-milestones-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.dca-milestone {
    background: rgba(16,185,129,0.07);
    border: 1px solid rgba(16,185,129,0.2);
    border-radius: 10px;
    padding: 10px 18px;
    text-align: center;
    min-width: 80px;
}

/* Year-by-year data table */
.dca-expand-table-wrap {
    max-height: 280px;
    overflow-y: auto;
    border: 1px solid #1f2937;
    border-radius: 8px;
    scrollbar-width: thin;
    scrollbar-color: #374151 transparent;
}

.dca-expand-table-wrap::-webkit-scrollbar { width: 4px; }
.dca-expand-table-wrap::-webkit-scrollbar-thumb { background: #374151; border-radius: 2px; }

.dca-expand-table-el {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.dca-expand-table-el thead th {
    position: sticky;
    top: 0;
    background: #111827;
    color: #6b7280;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-weight: 700;
    padding: 8px 12px;
    text-align: right;
    border-bottom: 1px solid #1f2937;
}

.dca-expand-table-el thead th:first-child { text-align: left; }

.dca-expand-table-el tbody tr {
    border-bottom: 1px solid #0d1117;
    transition: background 0.1s;
}

.dca-expand-table-el tbody tr:hover { background: #111827; }
.dca-expand-table-el tbody tr:nth-child(even) { background: rgba(31,41,55,0.25); }
.dca-expand-table-el tbody tr:nth-child(even):hover { background: #111827; }

.dca-expand-table-el tbody td {
    padding: 7px 12px;
    text-align: right;
    color: #d1d5db;
    font-variant-numeric: tabular-nums;
}

.dca-expand-table-el tbody td:first-child {
    text-align: left;
    font-weight: 600;
}

@media (max-width: 768px) {
    .dca-expand-stats      { grid-template-columns: repeat(3, 1fr); }
    .dca-expand-box        { max-height: 95vh; border-radius: 12px; }
    .dca-expand-body       { padding: 0 14px 20px; }
}

/* ============================================================
   PROFILE — STOCKUP CONNECT PANEL
   Social icon buttons + quick navigation link buttons
   ============================================================ */

/* Circular social icon buttons */
.social-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid #374151;
    background: #111827;
    text-decoration: none;
    transition: transform 0.15s, border-color 0.15s, background 0.15s;
    flex-shrink: 0;
}

.social-icon-btn:hover {
    transform: translateY(-2px);
}

/* X / Twitter — white icon, blue-tinted hover */
.social-btn-x {
    color: #f3f4f6;
}
.social-btn-x:hover {
    border-color: #1d9bf0;
    background: rgba(29,155,240,0.1);
    color: #1d9bf0;
}

/* LinkedIn — white icon, LinkedIn blue hover */
.social-btn-li {
    color: #f3f4f6;
}
.social-btn-li:hover {
    border-color: #0a66c2;
    background: rgba(10,102,194,0.1);
    color: #0a66c2;
}

/* Quick navigation link buttons */
.profile-nav-link-btn {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 14px;
    background: #111827;
    border: 1px solid #1f2937;
    border-radius: 8px;
    color: #d1d5db;
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
    font-family: inherit;
}

.profile-nav-link-btn:hover {
    border-color: #374151;
    background: #1f2937;
    color: #f3f4f6;
}

/* ============================================================
   STOCK PROFILE MOCKUP IMPLEMENTATION
   ============================================================ */
#view-dashboard #topAd,
#view-dashboard #sideAd {
    display: none !important;
}

#view-dashboard .dashboard-grid {
    display: block;
}

#view-dashboard {
    width: 100%;
    margin: 0;
    transform: none;
}

#view-dashboard .dashboard-grid > .sidebar {
    display: none;
}

.stockup-profile-panel {
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
}

.stockup-profile-shell {
    --surface: #0d1117;
    --surface-2: #111820;
    --surface-3: #161e28;
    --border: #1c2433;
    --border-2: #243040;
    --text-primary: #e8edf3;
    --text-secondary: #7a8a9e;
    --text-muted: #3d4e62;
    --accent-blue: #2a7fff;
    --accent-green: #0fc47a;
    --accent-red: #e8455a;
    --accent-amber: #f5a623;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    align-items: start;
    gap: 18px;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: visible;
    background: #080b10;
    padding: 16px;
}

.stockup-profile-shell .main-col {
    padding: 0;
    border-right: none;
    min-width: 0;
}

.stock-hero { display: flex; justify-content: space-between; gap: 18px; padding: 18px 20px; margin-bottom: 16px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.stock-identity { display: flex; align-items: center; gap: 14px; min-width: 0; }
.stock-logo { width: 44px; height: 44px; border-radius: 10px; background: var(--surface-3); border: 1px solid var(--border-2); display: flex; align-items: center; justify-content: center; font-family: "Fira Code", monospace; font-size: 0.75rem; font-weight: 700; color: var(--text-secondary); overflow: hidden; flex-shrink: 0; }
.stock-logo img { width: 100%; height: 100%; object-fit: contain; border-radius: 9px; background: #fff; }
.stock-ticker { font-family: "Fira Code", monospace; font-size: 1.5rem; font-weight: 800; color: var(--text-primary); line-height: 1.1; }
.stock-fullname { font-size: 0.85rem; color: var(--text-secondary); margin-top: 2px; }
.stock-meta-pills { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.meta-pill { font-size: 0.62rem; font-family: "Fira Code", monospace; letter-spacing: 0.4px; text-transform: uppercase; padding: 2px 7px; border-radius: 3px; border: 1px solid var(--border-2); color: var(--text-muted); background: var(--surface-2); }
.stock-hero-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
.action-icon-btn, .btn-add-watchlist, .btn-compare, .btn-share-card { border-radius: 6px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-secondary); cursor: pointer; transition: all 0.15s; }
.action-icon-btn { width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; }
.btn-add-watchlist, .btn-compare { min-height: 34px; padding: 7px 14px; font-size: 0.8rem; font-weight: 600; }
.btn-compare { border-color: var(--accent-blue); background: rgba(42,127,255,0.1); color: var(--accent-blue); }
.btn-share-card { color: #93c5fd; border-color: rgba(42,127,255,0.36); background: rgba(42,127,255,0.08); }
.action-icon-btn:hover, .btn-add-watchlist:hover, .btn-share-card:hover { border-color: var(--border-2); color: var(--text-primary); }
.btn-compare:hover { background: rgba(42,127,255,0.18); }
.quote-cluster { display: flex; align-items: center; gap: 7px; padding: 5px 8px; border: 1px solid var(--border); border-radius: 6px; background: #080b10; }
.quote-main { font-family: "Fira Code", monospace; font-size: 1.35rem; font-weight: 800; color: var(--text-primary); line-height: 1; }
.quote-chip { font-family: "Fira Code", monospace; font-size: 0.68rem; font-weight: 800; padding: 3px 7px; border-radius: 4px; background: rgba(255,255,255,0.05); white-space: nowrap; }
.quote-chip.pos { color: var(--accent-green); background: rgba(15,196,122,0.1); }
.quote-chip.neg { color: var(--accent-red); background: rgba(232,69,90,0.1); }
.quote-chip.muted { color: var(--text-muted); }

.intraday-strip { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); margin-bottom: 16px; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--surface); }
.intraday-cell { padding: 10px 14px; border-right: 1px solid var(--border); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.intraday-cell:last-child { border-right: none; }
.intraday-label, .range-label, .stats-section-title, .rsi-label, .about-meta-label { font-family: "Fira Code", monospace; letter-spacing: 0.7px; text-transform: uppercase; color: var(--text-muted); font-weight: 600; }
.intraday-label { font-size: 0.63rem; }
.intraday-val { font-family: "Fira Code", monospace; font-size: 0.82rem; font-weight: 700; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; }

.range-row { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; padding: 10px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; }
.range-label { font-size: 0.65rem; white-space: nowrap; }
.range-val, .range-pct { font-family: "Fira Code", monospace; font-size: 0.75rem; font-weight: 700; white-space: nowrap; }
.range-val.low { color: var(--accent-red); }
.range-val.high { color: var(--accent-green); }
.range-pct { color: var(--text-muted); font-weight: 500; }
.range-track { flex: 1; height: 4px; background: var(--surface-3); border-radius: 4px; position: relative; }
.range-fill-low { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, var(--accent-red), var(--accent-green)); border-radius: 4px; }
.range-thumb { position: absolute; top: 50%; transform: translate(-50%, -50%); width: 10px; height: 10px; border-radius: 50%; background: var(--text-primary); border: 2px solid #080b10; box-shadow: 0 0 0 1px var(--border-2); z-index: 2; }

.chart-section { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; margin-bottom: 28px; background: var(--surface); }
.chart-topbar { display: flex; align-items: center; justify-content: space-between; padding: 8px 14px; border-bottom: 1px solid var(--border); }
.chart-tf-row { display: flex; align-items: center; gap: 2px; }
.chart-topbar-actions { display: flex; align-items: center; gap: 10px; }
.chart-expand-btn {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px solid var(--border-2);
    border-radius: 6px;
    padding: 0 11px;
    background: #111820;
    color: var(--text-secondary);
    font-family: "Fira Code", monospace;
    font-size: 0.68rem;
    font-weight: 700;
    cursor: pointer;
}
.chart-expand-btn svg { width: 15px; height: 15px; }
.chart-expand-btn:hover { color: var(--text-primary); border-color: #355071; background: #162233; }
.chart-expand-btn:focus-visible { outline: 2px solid #60a5fa; outline-offset: 2px; }
.stockup-profile-shell .tf { font-family: "Fira Code", monospace; font-size: 0.72rem; padding: 4px 10px; border-radius: 4px; border: none; background: transparent; color: var(--text-muted); }
.stockup-profile-shell .tf:hover { color: var(--text-secondary); background: rgba(255,255,255,0.04); }
.stockup-profile-shell .tf.active { background: rgba(255,255,255,0.08); color: var(--text-primary); }
.chart-session-label { font-family: "Fira Code", monospace; font-size: 0.62rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.7px; }
.chart-session-marker {
    position: absolute;
    top: 42px;
    bottom: 18px;
    width: 1px;
    z-index: 4;
    pointer-events: none;
    border-left: 1px dashed rgba(147,197,253,0.28);
}
.chart-session-marker span {
    position: absolute;
    top: -20px;
    left: 6px;
    font-family: "Fira Code", monospace;
    font-size: 0.58rem;
    line-height: 1;
    color: rgba(147,197,253,0.62);
    text-transform: uppercase;
    letter-spacing: 0.7px;
    background: rgba(17,24,39,0.86);
    border: 1px solid rgba(147,197,253,0.16);
    border-radius: 999px;
    padding: 3px 6px;
}
.chart-canvas-area { height: 330px; position: relative; background: var(--surface); }
.chart-message { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 22px; text-align: center; color: var(--text-muted); font-size: 0.86rem; background: rgba(13,17,23,0.86); z-index: 8; }
.chart-message--status { inset: auto 12px 12px 12px; width: max-content; max-width: calc(100% - 24px); min-height: 34px; justify-content: flex-start; padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); box-shadow: 0 4px 18px rgba(0,0,0,.14); text-align: left; pointer-events: none; }
.chart-move-marker {
    position: absolute;
    width: 18px;
    height: 18px;
    transform: translate(-50%, -50%);
    border-radius: 999px;
    border: 4px solid #0b111b;
    z-index: 12;
    cursor: pointer;
    padding: 0;
    pointer-events: auto;
    box-shadow: 0 0 0 3px rgba(255,255,255,0.08), 0 0 18px rgba(255,255,255,0.12);
}
.chart-move-marker.up { background: var(--accent-green); box-shadow: 0 0 0 3px rgba(16,185,129,0.18), 0 0 18px rgba(16,185,129,0.34); }
.chart-move-marker.down { background: var(--accent-red); box-shadow: 0 0 0 3px rgba(239,68,68,0.18), 0 0 18px rgba(239,68,68,0.34); }
.chart-move-marker.active { width: 22px; height: 22px; border-color: #f8fafc; }

.move-context-panel {
    margin: -14px 0 20px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(17,24,39,0.98), rgba(13,17,23,0.96));
}
.move-context-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}
.move-context-head div { display: flex; align-items: center; gap: 8px; }
.move-context-head span {
    font-family: "Fira Code", monospace;
    font-size: 0.72rem;
    letter-spacing: 0.7px;
    text-transform: uppercase;
    color: var(--text-primary);
    font-weight: 800;
}
.move-context-head em {
    font-style: normal;
    font-size: 0.58rem;
    font-weight: 900;
    letter-spacing: 0.7px;
    text-transform: uppercase;
    color: #fbbf24;
    border: 1px solid rgba(251,191,36,0.28);
    background: rgba(251,191,36,0.08);
    border-radius: 999px;
    padding: 2px 6px;
}
.move-context-head small { color: var(--text-muted); font-size: 0.72rem; }
.move-context-empty {
    padding: 12px;
    border: 1px dashed rgba(148,163,184,0.18);
    border-radius: 7px;
    color: var(--text-muted);
    font-size: 0.84rem;
}
.move-context-latest {
    display: flex;
    width: 100%;
    gap: 12px;
    text-align: left;
    border: 1px solid rgba(148,163,184,0.16);
    border-radius: 8px;
    background: rgba(15,23,42,0.52);
    padding: 12px;
    color: var(--text-primary);
    cursor: pointer;
}
.move-context-latest.up { border-color: rgba(16,185,129,0.28); }
.move-context-latest.down { border-color: rgba(239,68,68,0.28); }
.move-context-latest.background-catalyst { background: linear-gradient(135deg, rgba(15,23,42,0.6), rgba(30,41,59,0.36)); }
.move-context-latest.technical-follow-through { border-color: rgba(147,197,253,0.22); }
.move-context-latest.retail-chatter { border-color: rgba(168,85,247,0.26); background: linear-gradient(135deg, rgba(88,28,135,0.16), rgba(15,23,42,0.5)); }
.move-context-latest.no-fresh-driver { border-color: rgba(148,163,184,0.16); }
.move-context-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    margin-top: 4px;
    flex: 0 0 auto;
    background: var(--accent-green);
}
.move-context-latest.down .move-context-dot { background: var(--accent-red); }
.move-context-copy { min-width: 0; }
.move-context-copy strong { font-size: 0.9rem; line-height: 1.35; }
.move-context-copy p { margin: 6px 0 8px; color: var(--text-secondary); font-size: 0.82rem; line-height: 1.45; }
.move-context-copy p a { color: #93c5fd; text-decoration: none; }
.move-context-copy p span { display: inline-block; margin-left: 6px; color: var(--text-muted); font-size: 0.74rem; }
.move-context-copy p small {
    display: block;
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 0.72rem;
}
.move-context-meta { display: flex; flex-wrap: wrap; gap: 8px; }
.move-context-meta span,
.move-context-chip {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    font-family: "Fira Code", monospace;
    font-size: 0.64rem;
    color: var(--text-muted);
    border: 1px solid rgba(148,163,184,0.14);
    border-radius: 999px;
    padding: 3px 7px;
}
.move-context-chip.primary-driver { color: #bfdbfe; border-color: rgba(59,130,246,0.3); background: rgba(59,130,246,0.08); }
.move-context-chip.background-catalyst { color: #fde68a; border-color: rgba(245,158,11,0.3); background: rgba(245,158,11,0.08); }
.move-context-chip.technical-follow-through { color: #93c5fd; border-color: rgba(147,197,253,0.3); background: rgba(147,197,253,0.08); }
.move-context-chip.retail-chatter,
.move-context-chip.social-chatter { color: #d8b4fe; border-color: rgba(168,85,247,0.32); background: rgba(168,85,247,0.1); }
.move-context-chip.no-fresh-driver,
.move-context-chip.technical { color: var(--text-muted); border-color: rgba(148,163,184,0.18); background: rgba(148,163,184,0.06); }
.move-context-actions { display: flex; justify-content: flex-end; margin-top: 10px; }
.move-context-actions button {
    border: 1px solid rgba(124,58,237,0.42);
    background: linear-gradient(135deg, rgba(124,58,237,0.24), rgba(37,99,235,0.18));
    color: #d8b4fe;
    border-radius: 7px;
    padding: 7px 11px;
    font-weight: 800;
    cursor: pointer;
}
.move-context-timeline {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px;
    margin-top: 10px;
}
.move-context-mini {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border: 1px solid rgba(148,163,184,0.14);
    background: rgba(8,11,16,0.55);
    border-radius: 7px;
    padding: 8px 9px;
    cursor: pointer;
}
.move-context-mini span, .move-context-mini em {
    font-family: "Fira Code", monospace;
    font-size: 0.62rem;
    color: var(--text-muted);
    font-style: normal;
}
.move-context-mini em {
    max-width: 86px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: right;
}
.move-context-mini strong { font-size: 0.75rem; color: var(--accent-green); }
.move-context-mini.down strong { color: var(--accent-red); }
.move-context-mini.active { border-color: rgba(147,197,253,0.42); background: rgba(37,99,235,0.12); }

/* ============================================================
   EXPANDED STOCK RESEARCH WORKSPACE
   ============================================================ */
body.stock-workspace-open { overflow: hidden; }

.stock-chart-workspace {
    --workspace-bg: #080b10;
    --workspace-panel: #0d1117;
    --workspace-raised: #111820;
    --workspace-border: #1c2a3b;
    --workspace-muted: #718096;
    --workspace-text: #eef4fb;
    --workspace-accent: #3b82f6;
    position: fixed;
    inset: 0;
    z-index: 10020;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    padding:
        env(safe-area-inset-top, 0)
        env(safe-area-inset-right, 0)
        env(safe-area-inset-bottom, 0)
        env(safe-area-inset-left, 0);
    background: var(--workspace-bg);
    color: var(--workspace-text);
}

.stock-chart-workspace[hidden] { display: none; }

.workspace-command-bar {
    min-height: 68px;
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto minmax(220px, 1fr);
    align-items: center;
    gap: 18px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--workspace-border);
    background: #090d13;
}

.workspace-stock-identity { display: flex; align-items: center; gap: 14px; min-width: 0; }
.workspace-stock-identity > div { display: flex; align-items: baseline; gap: 9px; min-width: 0; }
.workspace-stock-identity strong {
    color: var(--workspace-text);
    font-family: "Fira Code", monospace;
    font-size: 1.08rem;
    font-variant-numeric: tabular-nums;
}
.workspace-stock-identity > div span {
    overflow: hidden;
    color: var(--workspace-muted);
    font-size: 0.78rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.workspace-kicker {
    color: #60a5fa;
    font-family: "Fira Code", monospace;
    font-size: 0.6rem;
    font-weight: 800;
    text-transform: uppercase;
}

.workspace-live-quote { display: flex; align-items: center; gap: 9px; font-variant-numeric: tabular-nums; }
.workspace-live-quote strong { color: var(--workspace-text); font-family: "Fira Code", monospace; font-size: 1rem; }
.workspace-live-quote span { font-family: "Fira Code", monospace; font-size: 0.72rem; font-weight: 800; }
.workspace-live-quote span.pos { color: #10b981; }
.workspace-live-quote span.neg { color: #ef4444; }

.workspace-command-actions { display: flex; justify-content: flex-end; gap: 8px; }
.workspace-icon-btn {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--workspace-border);
    border-radius: 7px;
    background: var(--workspace-raised);
    color: #94a3b8;
    cursor: pointer;
}
.workspace-icon-btn svg { width: 18px; height: 18px; }
.workspace-icon-btn:hover { color: #f8fafc; border-color: #355071; background: #162233; }
.workspace-icon-btn:focus-visible,
.workspace-tool-strip button:focus-visible,
.workspace-tool-strip input:focus-visible,
.workspace-rail-tabs button:focus-visible {
    outline: 2px solid #60a5fa;
    outline-offset: 2px;
}

.workspace-tool-strip {
    min-height: 58px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 16px;
    border-bottom: 1px solid var(--workspace-border);
    background: #0b1017;
}

.workspace-compare-control { display: flex; align-items: center; gap: 7px; }
.workspace-compare-control > label,
.workspace-session-controls legend {
    color: var(--workspace-muted);
    font-family: "Fira Code", monospace;
    font-size: 0.6rem;
    font-weight: 800;
    text-transform: uppercase;
}
.workspace-compare-control input {
    width: 94px;
    min-height: 40px;
    border: 1px solid var(--workspace-border);
    border-radius: 6px;
    padding: 0 10px;
    background: #070b10;
    color: #f8fafc;
    font-family: "Fira Code", monospace;
    font-size: 0.75rem;
    text-transform: uppercase;
}
.workspace-compare-control button,
.workspace-tool-menu summary {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px solid var(--workspace-border);
    border-radius: 6px;
    padding: 0 11px;
    background: var(--workspace-raised);
    color: #cbd5e1;
    font-size: 0.74rem;
    font-weight: 800;
    cursor: pointer;
}
.workspace-compare-control button[type="submit"] { border-color: #2c5d99; color: #bfdbfe; }
.workspace-compare-control .workspace-tool-clear { color: #fda4af; }

.workspace-tool-menu { position: relative; }
.workspace-tool-menu summary { list-style: none; }
.workspace-tool-menu summary::-webkit-details-marker { display: none; }
.workspace-tool-menu summary span {
    min-width: 20px;
    min-height: 20px;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    background: #1e3a5f;
    color: #bfdbfe;
    font-family: "Fira Code", monospace;
    font-size: 0.62rem;
}
.workspace-tool-popover {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 10030;
    width: 270px;
    padding: 7px;
    border: 1px solid #2a3c52;
    border-radius: 8px;
    background: #0d141e;
    box-shadow: 0 16px 38px rgba(0, 0, 0, 0.42);
    transform-origin: top left;
    animation: workspace-popover-in 150ms ease-out;
}
.workspace-tool-popover label {
    min-height: 54px;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 8px 9px;
    border-radius: 6px;
    cursor: pointer;
}
.workspace-tool-popover label:hover { background: #162233; }
.workspace-tool-popover input { accent-color: var(--workspace-accent); }
.workspace-tool-popover label span { display: flex; flex-direction: column; gap: 3px; }
.workspace-tool-popover strong { color: #e5edf7; font-size: 0.78rem; }
.workspace-tool-popover small { color: var(--workspace-muted); font-family: "Fira Code", monospace; font-size: 0.64rem; }

.workspace-session-controls {
    min-width: 0;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 0;
    border: 0;
    padding: 0;
}
.workspace-session-controls legend { float: left; margin-right: 4px; }
.workspace-session-controls label { position: relative; }
.workspace-session-controls input { position: absolute; opacity: 0; pointer-events: none; }
.workspace-session-controls span {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--workspace-border);
    border-radius: 6px;
    padding: 0 9px;
    background: #0d141e;
    color: #718096;
    font-family: "Fira Code", monospace;
    font-size: 0.66rem;
    font-weight: 700;
    cursor: pointer;
}
.workspace-session-controls input:checked + span { border-color: #315f94; background: #12243a; color: #bfdbfe; }
.workspace-session-controls input:disabled + span { opacity: 0.38; cursor: not-allowed; }
.workspace-session-controls input:focus-visible + span { outline: 2px solid #60a5fa; outline-offset: 2px; }

.workspace-inline-status {
    min-width: 0;
    margin-left: auto;
    overflow: hidden;
    color: #94a3b8;
    font-size: 0.72rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.workspace-inline-status.error { color: #fda4af; }
.workspace-inline-status.success { color: #86efac; }

.workspace-stage {
    flex: 1;
    min-width: 0;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
}
.stock-chart-workspace.rail-collapsed .workspace-stage { grid-template-columns: minmax(0, 1fr) 62px; }
.workspace-chart-column {
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 12px;
    background: #080b10;
}
.workspace-chart-host { flex: 1; min-height: 280px; }
.workspace-chart-host .chart-section {
    height: 100%;
    display: flex;
    flex-direction: column;
    margin: 0;
    border-color: var(--workspace-border);
    border-radius: 7px;
}
.workspace-chart-host .chart-canvas-area { flex: 1; min-height: 240px; height: auto; }
.workspace-chart-host .chart-topbar { min-height: 48px; background: #0b1119; }
.workspace-chart-host .chart-expand-btn { display: none; }

.workspace-indicator-status {
    min-height: 0;
    padding: 0 4px;
    color: #fbbf24;
    font-size: 0.68rem;
}
.workspace-indicator-status:not(:empty) { padding-top: 7px; }
.workspace-rsi-panel {
    flex: 0 0 170px;
    margin-top: 10px;
    overflow: hidden;
    border: 1px solid var(--workspace-border);
    border-radius: 7px;
    background: var(--workspace-panel);
}
.workspace-rsi-panel header {
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    border-bottom: 1px solid var(--workspace-border);
}
.workspace-rsi-panel header span {
    color: #fbbf24;
    font-family: "Fira Code", monospace;
    font-size: 0.68rem;
    font-weight: 800;
}
.workspace-rsi-panel header small { color: var(--workspace-muted); font-size: 0.62rem; }
#workspaceRsiChart { height: 134px; }

.workspace-rail {
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--workspace-border);
    background: #0a0f16;
}
.workspace-rail-tabs {
    min-height: 54px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
    padding: 7px;
    border-bottom: 1px solid var(--workspace-border);
}
.workspace-rail-tabs button {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: #718096;
    font-size: 0.74rem;
    font-weight: 800;
    cursor: pointer;
}
.workspace-rail-tabs button[aria-selected="true"] { border-color: #2d5687; background: #11233a; color: #dbeafe; }
.workspace-tab-mark {
    color: #60a5fa;
    font-family: "Fira Code", monospace;
    font-size: 0.6rem;
}
.workspace-rail-panel { flex: 1; min-height: 0; overflow: auto; padding: 12px; }
.workspace-rail-panel[hidden] { display: none; }
.workspace-rail .move-context-panel { margin: 0; border: 0; padding: 0; background: transparent; }
.workspace-rail .move-context-head { margin-bottom: 12px; }
.workspace-rail .move-context-timeline { grid-template-columns: 1fr; }

.stock-chart-workspace.rail-collapsed .workspace-rail-tabs {
    grid-template-columns: 1fr;
    align-content: start;
}
.stock-chart-workspace.rail-collapsed .workspace-rail-tabs button { padding: 0; }
.stock-chart-workspace.rail-collapsed .workspace-rail-tabs button > span:last-child,
.stock-chart-workspace.rail-collapsed .workspace-rail-panel { display: none; }

.workspace-quan-context {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 9px;
}
.workspace-quan-context button {
    min-height: 28px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #29476c;
    border-radius: 999px;
    padding: 0 9px;
    background: #101f32;
    color: #bfdbfe;
    font-family: "Fira Code", monospace;
    font-size: 0.6rem;
    cursor: pointer;
}
.workspace-quan-context button::after { content: "×"; color: #718096; }
.workspace-quan-host { min-height: 0; height: calc(100% - 40px); }
.workspace-quan-host .copilot-box {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    margin: 0 !important;
    border: 1px solid var(--workspace-border) !important;
    border-radius: 7px !important;
    box-shadow: none !important;
}
.workspace-quan-host .copilot-title,
.workspace-quan-host .copilot-layout-controls,
.workspace-quan-host .copilot-close { display: none !important; }
.workspace-quan-host .copilot-header { padding: 9px; }
.workspace-quan-host .version-btn { height: 34px; }
.workspace-quan-host .copilot-chat-area { min-height: 0; }

@keyframes workspace-popover-in {
    from { opacity: 0; transform: translateY(-4px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 820px) {
    .workspace-command-bar {
        min-height: 60px;
        grid-template-columns: minmax(0, 1fr) auto;
        padding: 8px 10px;
    }
    .workspace-kicker,
    .workspace-stock-identity > div span,
    .workspace-live-quote { display: none; }
    .workspace-command-actions { grid-column: 2; grid-row: 1; }
    .workspace-tool-strip {
        min-height: 56px;
        overflow-x: auto;
        padding: 7px 10px;
        scrollbar-width: none;
    }
    .workspace-tool-strip::-webkit-scrollbar { display: none; }
    .workspace-inline-status { flex: 0 0 auto; max-width: 220px; }
    .workspace-stage,
    .stock-chart-workspace.rail-collapsed .workspace-stage { display: block; }
    .workspace-chart-column { height: 100%; padding: 8px; padding-bottom: 68px; }
    .workspace-chart-host .chart-topbar { overflow-x: auto; }
    .workspace-rsi-panel { flex-basis: 130px; }
    #workspaceRsiChart { height: 94px; }
    .workspace-rail {
        position: fixed;
        right: env(safe-area-inset-right, 0);
        bottom: env(safe-area-inset-bottom, 0);
        left: env(safe-area-inset-left, 0);
        z-index: 10025;
        height: min(52dvh, 480px);
        border-top: 1px solid #2d4664;
        border-left: 0;
        border-radius: 12px 12px 0 0;
        box-shadow: 0 -18px 48px rgba(0, 0, 0, 0.5);
        transform: translateY(0);
        transition: transform 180ms ease-out;
    }
    .stock-chart-workspace.rail-collapsed .workspace-rail { transform: translateY(calc(100% - 58px)); }
    .stock-chart-workspace.rail-collapsed .workspace-rail-tabs {
        grid-template-columns: 1fr 1fr;
        align-content: stretch;
    }
    .stock-chart-workspace.rail-collapsed .workspace-rail-tabs button > span:last-child { display: inline; }
}

@media (max-width: 560px) {
    .workspace-session-controls legend { display: none; }
    .workspace-session-controls span { min-height: 44px; padding: 0 8px; }
    .workspace-compare-control > label { display: none; }
    .workspace-compare-control input { min-height: 44px; }
    .workspace-compare-control button,
    .workspace-tool-menu summary { min-height: 44px; }
    .chart-expand-btn { min-height: 44px; }
    .chart-expand-btn span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .workspace-tool-popover { animation: none; }
    .workspace-rail { transition: none; }
}

.analyst-row { display: flex; align-items: center; gap: 14px; padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; margin-bottom: 18px; }
.analyst-verdict-badge, .sb-verdict-badge { font-family: "Fira Code", monospace; font-size: 0.75rem; font-weight: 800; letter-spacing: 1px; padding: 6px 14px; border-radius: 5px; background: rgba(15,196,122,0.12); color: var(--accent-green); border: 1px solid rgba(15,196,122,0.3); }
.analyst-bar-wrap { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.analyst-bar-row, .sb-mini-bar-row { display: flex; align-items: center; gap: 8px; }
.analyst-bar-label { font-size: 0.72rem; min-width: 32px; font-weight: 700; }
.analyst-bar-label.amber, .sb-mini-label.amber { color: var(--accent-amber); }
.analyst-bar-track, .sb-mini-bar-track { flex: 1; height: 4px; background: var(--surface-3); border-radius: 4px; overflow: hidden; }
.analyst-bar-fill, .sb-mini-bar-fill { height: 100%; border-radius: 4px; }
.analyst-bar-count, .analyst-total, .analyst-total span, .sb-mini-bar-row span:last-child { font-family: "Fira Code", monospace; font-size: 0.65rem; color: var(--text-muted); }
.analyst-total { text-align: right; line-height: 1.5; flex-shrink: 0; }

.stats-section, .about-section { margin-bottom: 18px; }
.stats-section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.stats-section-title { font-size: 0.68rem; }
.stats-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.stats-table { width: 100%; border-collapse: collapse; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--surface); }
.stats-table tr { border-bottom: 1px solid var(--border); }
.stats-table tr:last-child { border-bottom: none; }
.stats-table td { padding: 9px 14px; font-size: 0.83rem; }
.stats-table .stat-label { color: var(--text-secondary); width: 50%; }
.stats-table .stat-group { color: var(--text-muted); font-size: 0.62rem; font-family: "Fira Code", monospace; letter-spacing: 0.8px; text-transform: uppercase; }
.stats-table .stat-value { font-family: "Fira Code", monospace; font-weight: 700; color: var(--text-primary); text-align: right; font-size: 0.8rem; }

.about-desc { font-size: 0.875rem; line-height: 1.75; color: var(--text-secondary); margin-bottom: 14px; }
.about-meta-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.about-meta-cell { padding: 9px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; min-width: 0; }
.about-meta-label { font-size: 0.62rem; margin-bottom: 4px; }
.about-meta-value { font-size: 0.8rem; font-weight: 700; color: var(--text-primary); overflow-wrap: anywhere; }
.company-link a { display: inline-block; margin-top: 10px; color: var(--accent-blue); text-decoration: none; font-family: "Fira Code", monospace; font-size: 0.8rem; }

.stockup-side-panel { position: sticky; top: 20px; max-height: calc(100vh - 40px); overflow-y: auto; padding: 0; scrollbar-width: thin; scrollbar-color: var(--border-2) transparent; }
.stockup-side-panel::-webkit-scrollbar { width: 5px; }
.stockup-side-panel::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 3px; }
.sb-price-widget, .sb-widget { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 18px; margin-bottom: 16px; }
.sb-widget-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-family: "Fira Code", monospace; font-size: 0.62rem; letter-spacing: 1px; text-transform: uppercase; color: var(--text-muted); margin-bottom: 10px; }
.sb-link-btn { background: none; border: none; color: var(--accent-blue); cursor: pointer; font: inherit; text-transform: none; letter-spacing: 0; }
.sb-price-live { font-family: "Fira Code", monospace; font-size: 1.25rem; font-weight: 800; color: var(--text-primary); line-height: 1; margin-bottom: 5px; }
.sb-price-change { font-family: "Fira Code", monospace; font-size: 0.78rem; font-weight: 700; margin-bottom: 12px; }
.sb-mktcap-row { display: flex; justify-content: space-between; align-items: center; padding-top: 10px; border-top: 1px solid var(--border); }
.sb-mktcap-label { color: var(--text-muted); font-size: 0.72rem; }
.sb-mktcap-val { font-family: "Fira Code", monospace; font-size: 0.8rem; font-weight: 700; color: var(--text-primary); }
.sb-alert-box { background: rgba(232,69,90,0.08); border: 1px solid rgba(232,69,90,0.45); border-radius: 8px; padding: 12px 14px; margin-bottom: 12px; }
.sb-alert-title { color: var(--accent-red); font-family: "Fira Code", monospace; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.7px; text-transform: uppercase; margin-bottom: 6px; }
.sb-alert-text { color: var(--text-primary); font-size: 0.82rem; line-height: 1.45; }
.sb-alert-text a { color: inherit !important; text-decoration: none; }
.verdict-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 5px; background: rgba(15,196,122,0.1); border: 1px solid rgba(15,196,122,0.25); margin-bottom: 8px; }
.verdict-chip.copilot-ready { background: rgba(42,127,255,0.1); border-color: rgba(42,127,255,0.3); }
.verdict-chip.copilot-ready .verdict-text { color: var(--accent-blue); }
.verdict-text { font-family: "Fira Code", monospace; font-size: 0.68rem; font-weight: 800; color: var(--accent-green); letter-spacing: 0.8px; }
.verdict-sub { font-size: 0.78rem; line-height: 1.55; color: var(--text-secondary); }
.sb-analyst-mini { display: flex; gap: 12px; align-items: center; }
.sb-mini-bars { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.sb-mini-label { font-family: "Fira Code", monospace; font-size: 0.62rem; font-weight: 800; min-width: 10px; }
.eoy-display { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.eoy-price { font-family: "Fira Code", monospace; font-size: 0.96rem; font-weight: 800; color: var(--text-primary); }
.eoy-upside { font-family: "Fira Code", monospace; font-size: 0.72rem; font-weight: 800; }
.sb-copilot-widget {
    cursor: pointer;
    min-height: 168px;
    position: relative;
    overflow: hidden;
    border-color: rgba(42,127,255,0.45);
    background:
        linear-gradient(135deg, rgba(42,127,255,0.18), rgba(15,196,122,0.08) 52%, rgba(13,17,23,0.96)),
        var(--surface);
    box-shadow: 0 12px 28px rgba(42,127,255,0.12);
    transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.sb-copilot-widget:hover {
    transform: translateY(-1px);
    border-color: rgba(42,127,255,0.7);
    box-shadow: 0 16px 34px rgba(42,127,255,0.18);
}
.copilot-preview-text { min-height: 74px; color: #dbeafe; font-size: 0.88rem; line-height: 1.65; font-weight: 600; }
.copilot-preview-text.is-loading::before {
    content: '';
    display: inline-block;
    width: 42px;
    height: 6px;
    border-radius: 99px;
    background: linear-gradient(90deg, rgba(147,197,253,0.25), rgba(147,197,253,0.85), rgba(147,197,253,0.25));
}
.copilot-preview-cta { font-family: "Fira Code", monospace; font-size: 0.62rem; color: #93c5fd; text-transform: uppercase; letter-spacing: 0.7px; margin-top: 8px; }
.sb-earnings-date { font-family: "Fira Code", monospace; font-size: 1rem; font-weight: 800; color: var(--text-primary); }
.sb-copilot-strip { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 8px; border: 1px solid rgba(42,127,255,0.28); background: rgba(42,127,255,0.08); cursor: pointer; margin-bottom: 12px; }
.sb-copilot-icon { width: 28px; height: 28px; border-radius: 6px; background: var(--accent-blue); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.sb-copilot-text { min-width: 0; }
.sb-copilot-name { font-weight: 800; color: var(--text-primary); font-size: 0.82rem; }
.sb-copilot-sub { color: var(--text-muted); font-size: 0.72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mobile-stock-copilot { display: none; }
.policy-widget {
    border-color: rgba(245,158,11,0.26);
    background:
        linear-gradient(135deg, rgba(245,158,11,0.1), rgba(37,99,235,0.06) 46%, rgba(13,17,23,0.98)),
        var(--surface);
}
.policy-widget:not(.expanded) {
    padding-bottom: 14px;
}
.policy-score-wrap {
    display: grid;
    grid-template-columns: 82px 1fr;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
}
.policy-score {
    width: 74px;
    height: 74px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    align-content: center;
    background:
        radial-gradient(circle at center, #0d1117 56%, transparent 57%),
        conic-gradient(#f59e0b var(--score), rgba(148,163,184,0.16) 0);
    border: 1px solid rgba(245,158,11,0.22);
}
.policy-score strong {
    color: #f8fafc;
    font-family: "Fira Code", monospace;
    font-size: 1.15rem;
    line-height: 1;
}
.policy-score span {
    color: var(--text-muted);
    font-size: 0.58rem;
    line-height: 1.1;
    text-transform: uppercase;
}
.policy-flow {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 0;
}
.policy-chip {
    font-family: "Fira Code", monospace;
    font-size: 0.61rem;
    font-weight: 800;
    border-radius: 999px;
    border: 1px solid rgba(148,163,184,0.16);
    color: var(--text-secondary);
    background: rgba(148,163,184,0.06);
    padding: 4px 7px;
    white-space: nowrap;
}
.policy-chip.buy { color: #86efac; border-color: rgba(16,185,129,0.25); background: rgba(16,185,129,0.08); }
.policy-chip.sell { color: #fca5a5; border-color: rgba(239,68,68,0.25); background: rgba(239,68,68,0.08); }
.policy-chip.trump { color: #fcd34d; border-color: rgba(245,158,11,0.28); background: rgba(245,158,11,0.08); }
.policy-net-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    border-top: 1px solid rgba(148,163,184,0.12);
    border-bottom: 1px solid rgba(148,163,184,0.12);
    padding: 9px 0;
    margin-bottom: 10px;
}
.policy-expand-btn {
    width: 100%;
    min-height: 30px;
    border: 1px solid rgba(245,158,11,0.26);
    border-radius: 6px;
    background: rgba(245,158,11,0.07);
    color: #fcd34d;
    font-family: "Fira Code", monospace;
    font-size: 0.62rem;
    font-weight: 900;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    cursor: pointer;
}
.policy-expand-btn:hover {
    border-color: rgba(245,158,11,0.48);
    background: rgba(245,158,11,0.12);
}
.policy-expanded-panel {
    display: none;
    margin-top: 10px;
}
.policy-widget.expanded .policy-expanded-panel {
    display: block;
}
.policy-net-row span, .policy-row-side small, .policy-footnote {
    color: var(--text-muted);
    font-size: 0.68rem;
}
.policy-net-row strong {
    font-family: "Fira Code", monospace;
    font-size: 0.8rem;
}
.policy-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.policy-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 78px;
    gap: 10px;
    padding: 10px;
    border: 1px solid rgba(148,163,184,0.14);
    border-radius: 7px;
    background: rgba(8,11,16,0.52);
}
.policy-row.is-preview {
    position: relative;
    overflow: hidden;
}
.policy-row-main {
    min-width: 0;
}
.policy-row-main strong,
.policy-row-main span,
.policy-row-main small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
}
.policy-row-main strong {
    color: var(--text-primary);
    font-size: 0.82rem;
    white-space: nowrap;
}
.policy-row-main span {
    color: var(--text-secondary);
    font-size: 0.74rem;
    line-height: 1.35;
    margin-top: 3px;
    overflow-wrap: anywhere;
}
.policy-row-main small {
    color: var(--text-muted);
    font-size: 0.66rem;
    margin-top: 4px;
    white-space: nowrap;
}
.policy-row-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 3px;
    text-align: right;
    min-width: 0;
}
.policy-move {
    font-family: "Fira Code", monospace;
    font-style: normal;
    font-size: 0.78rem;
    font-weight: 900;
}
.policy-move.muted { color: var(--text-muted); }
.policy-row-side a,
.policy-row-side span {
    color: #93c5fd;
    font-family: "Fira Code", monospace;
    font-size: 0.62rem;
    text-decoration: none;
}
.policy-trump-row {
    border-color: rgba(245,158,11,0.22);
}
.policy-empty {
    border: 1px dashed rgba(148,163,184,0.18);
    border-radius: 7px;
    color: var(--text-muted);
    font-size: 0.8rem;
    line-height: 1.45;
    padding: 11px;
}
.policy-empty.error {
    color: #fecaca;
    border-color: rgba(239,68,68,0.24);
    background: rgba(239,68,68,0.06);
}
.policy-unlock-btn {
    width: 100%;
    margin-top: 10px;
    border: 1px solid rgba(37,99,235,0.62);
    border-radius: 6px;
    background: rgba(37,99,235,0.16);
    color: #bfdbfe;
    min-height: 34px;
    font-size: 0.76rem;
    font-weight: 900;
    cursor: pointer;
}
.policy-footnote {
    line-height: 1.45;
    margin-top: 10px;
}
.policy-footnote a {
    color: #93c5fd;
    text-decoration: none;
}
.policy-loading {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.policy-skel {
    height: 12px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(148,163,184,0.08), rgba(148,163,184,0.2), rgba(148,163,184,0.08));
}
.policy-skel-score {
    width: 74px;
    height: 74px;
    border-radius: 50%;
}
.policy-skel.short { width: 62%; }
.guest-policy-widget {
    position: relative;
    overflow: hidden;
}
.guest-policy-blur {
    filter: blur(4px);
    opacity: 0.5;
    user-select: none;
    pointer-events: none;
}
.guest-policy-widget::after {
    content: '';
    position: absolute;
    inset: 32px 0 0;
    background: radial-gradient(circle at 50% 42%, rgba(15,23,42,0.24), rgba(2,6,23,0.78));
    pointer-events: none;
}
.guest-policy-lock {
    position: absolute;
    inset: 36px 14px 14px;
    z-index: 2;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 8px;
    text-align: center;
}
.guest-policy-lock strong {
    color: #f8fafc;
    font-size: 0.84rem;
}
.guest-policy-lock button {
    min-height: 32px;
    padding: 0 12px;
    border: 1px solid rgba(37,99,235,0.62);
    border-radius: 6px;
    background: rgba(37,99,235,0.2);
    color: #bfdbfe;
    font-size: 0.72rem;
    font-weight: 900;
    cursor: pointer;
}
.guest-policy-lock button:hover {
    border-color: rgba(96,165,250,0.72);
    background: rgba(37,99,235,0.3);
}
.guest-policy-widget > .policy-footnote {
    position: relative;
    z-index: 3;
}
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }

.guest-preview-shell {
    align-items: start;
}

.guest-preview-banner {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    padding: 14px 16px;
    margin-bottom: 16px;
    border: 1px solid rgba(37,99,235,0.34);
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(37,99,235,0.16), rgba(16,185,129,0.06));
}

.guest-preview-banner span,
.guest-unlock-copy span {
    display: block;
    color: #60a5fa;
    font-family: "Fira Code", monospace;
    font-size: 0.66rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.guest-preview-banner strong {
    color: #f8fafc;
    font-size: 0.95rem;
}

.guest-preview-banner-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.guest-preview-banner-actions button,
.guest-cta-card button {
    border-radius: 6px;
    min-height: 36px;
    padding: 8px 12px;
    font-weight: 900;
}

.guest-preview-banner-actions button:first-child,
.guest-cta-card .search-btn {
    border: 1px solid rgba(37,99,235,0.7);
    background: #2563eb;
    color: #fff;
}

.guest-preview-banner-actions button:last-child,
.guest-cta-card .auth-btn {
    border: 1px solid rgba(148,163,184,0.22);
    background: rgba(148,163,184,0.08);
    color: #cbd5e1;
}

.guest-stock-hero {
    border-color: rgba(37,99,235,0.26);
}

.guest-logo {
    background: radial-gradient(circle at 30% 20%, rgba(96,165,250,0.35), rgba(15,23,42,0.98));
    border-color: rgba(96,165,250,0.32);
}

.guest-logo-text {
    color: #dbeafe;
    font-family: "Fira Code", monospace;
    font-size: 0.78rem;
    font-weight: 950;
}

.guest-chart-section {
    margin-bottom: 18px;
}

.international-beta-banner {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    padding: 14px 16px;
    margin-bottom: 16px;
    border: 1px solid rgba(14, 165, 233, 0.34);
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(14,165,233,0.14), rgba(16,185,129,0.06));
}

.international-beta-banner span {
    display: block;
    color: #7dd3fc;
    font-family: "Fira Code", monospace;
    font-size: 0.66rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.international-beta-banner strong {
    color: #f8fafc;
    font-size: 0.95rem;
}

.international-beta-banner a {
    color: #e0f2fe;
    border: 1px solid rgba(125,211,252,0.32);
    border-radius: 6px;
    padding: 8px 11px;
    background: rgba(14,165,233,0.12);
    font-size: 0.8rem;
    font-weight: 900;
    text-decoration: none;
    white-space: nowrap;
}

.international-stock-hero {
    border-color: rgba(14,165,233,0.26);
}

.international-info-card {
    border-color: rgba(14,165,233,0.28);
    background: linear-gradient(180deg, rgba(14,165,233,0.10), rgba(15,23,42,0.94));
}

.international-info-card strong {
    display: block;
    color: #f8fafc;
    font-size: 1.05rem;
    margin-bottom: 8px;
}

.international-info-card p {
    color: #94a3b8;
    font-size: 0.82rem;
    line-height: 1.55;
}

.guest-unlock-section {
    border: 1px solid rgba(51,65,85,0.72);
    border-radius: 8px;
    padding: 18px;
    background: linear-gradient(180deg, rgba(15,23,42,0.72), rgba(8,11,16,0.94));
    margin-bottom: 18px;
}

.guest-unlock-copy h3 {
    color: #f8fafc;
    font-size: 1.15rem;
    margin-bottom: 14px;
}

.guest-locked-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.guest-locked-card {
    display: grid;
    grid-template-columns: 42px 1fr auto;
    align-items: center;
    gap: 12px;
    min-height: 86px;
    padding: 13px;
    border: 1px solid rgba(51,65,85,0.74);
    border-radius: 8px;
    background: rgba(2,6,23,0.34);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, transform 0.15s;
}

.guest-locked-card:hover {
    transform: translateY(-1px);
    border-color: rgba(96,165,250,0.46);
    background: rgba(37,99,235,0.10);
}

.guest-lock-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    color: #93c5fd;
    background: rgba(37,99,235,0.12);
    border: 1px solid rgba(96,165,250,0.22);
    font-family: "Fira Code", monospace;
    font-size: 0.62rem;
    font-weight: 950;
}

.guest-locked-card strong {
    display: block;
    color: #f8fafc;
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.guest-locked-card p,
.guest-cta-card p,
.guest-cliffhanger-card p {
    color: #94a3b8;
    font-size: 0.8rem;
    line-height: 1.5;
}

.guest-locked-card > span {
    color: #60a5fa;
    font-family: "Fira Code", monospace;
    font-size: 0.66rem;
    font-weight: 900;
    text-transform: uppercase;
}

.guest-cta-card {
    border-color: rgba(37,99,235,0.34);
    background: linear-gradient(180deg, rgba(37,99,235,0.13), rgba(15,23,42,0.94));
}

.guest-cta-card strong {
    display: block;
    color: #f8fafc;
    font-size: 1.35rem;
    margin-bottom: 8px;
}

.guest-cta-card .search-btn,
.guest-cta-card .auth-btn {
    display: block;
    width: 100%;
    margin-top: 10px;
    text-align: center;
}

.guest-cliffhanger-card h3 {
    color: #f8fafc;
    font-size: 1.05rem;
    margin-bottom: 8px;
}

.guest-blur-widget {
    position: relative;
    min-height: 132px;
    overflow: hidden;
    cursor: pointer;
    border-color: rgba(96,165,250,0.22);
    background: linear-gradient(180deg, rgba(15,23,42,0.84), rgba(8,11,16,0.96));
    transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}

.guest-blur-widget:hover {
    transform: translateY(-1px);
    border-color: rgba(96,165,250,0.46);
    box-shadow: 0 16px 34px rgba(37,99,235,0.12);
}

.guest-blur-widget .sb-widget-label span {
    color: #60a5fa;
}

.guest-blur-content {
    filter: blur(4px);
    opacity: 0.58;
    user-select: none;
    pointer-events: none;
}

.guest-blur-widget::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 40%, rgba(15,23,42,0.28), rgba(2,6,23,0.76));
    pointer-events: none;
}

.guest-blur-lock {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 8px;
    padding: 18px;
    text-align: center;
}

.guest-blur-lock-icon {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    color: #dbeafe;
    background: rgba(37,99,235,0.28);
    border: 1px solid rgba(96,165,250,0.38);
    box-shadow: 0 0 24px rgba(37,99,235,0.22);
}

.guest-blur-lock strong {
    color: #f8fafc;
    font-size: 0.84rem;
}

.guest-fake-answer b,
.guest-fake-target strong {
    display: block;
    color: #f8fafc;
    font-size: 0.94rem;
    margin-bottom: 6px;
}

.guest-fake-answer p,
.guest-fake-target span,
.guest-fake-risk {
    color: #94a3b8;
    font-size: 0.8rem;
    line-height: 1.5;
}

.guest-fake-input {
    margin-top: 12px;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid rgba(51,65,85,0.8);
    color: #64748b;
    background: rgba(2,6,23,0.5);
    font-size: 0.78rem;
}

.guest-fake-move {
    display: grid;
    grid-template-columns: 10px 1fr;
    gap: 9px;
    align-items: center;
}

.guest-fake-move span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 14px rgba(16,185,129,0.5);
}

.guest-fake-move b {
    color: #e2e8f0;
    font-size: 0.84rem;
}

.guest-fake-move em {
    grid-column: 2;
    color: #64748b;
    font-style: normal;
    font-size: 0.74rem;
}

.guest-fake-timeline {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-top: 14px;
}

.guest-fake-timeline i,
.guest-fake-scenarios i,
.guest-fake-headline,
.guest-fake-bars p {
    display: block;
    border-radius: 999px;
    background: rgba(96,165,250,0.18);
}

.guest-fake-timeline i {
    height: 24px;
}

.guest-fake-scenarios {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-top: 12px;
}

.guest-fake-scenarios i {
    color: #cbd5e1;
    font-style: normal;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 8px 6px;
    text-align: center;
}

.guest-fake-bars {
    display: grid;
    gap: 9px;
}

.guest-fake-bars p {
    height: 8px;
    background: rgba(51,65,85,0.88);
    overflow: hidden;
}

.guest-fake-bars span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #10b981, #60a5fa);
}

.guest-fake-row {
    display: flex;
    justify-content: space-between;
    color: #94a3b8;
    font-size: 0.72rem;
    margin-top: 10px;
}

.guest-fake-headline {
    height: 10px;
    margin-bottom: 11px;
}

.guest-fake-headline.short {
    width: 64%;
}

.guest-fake-stats {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 9px 14px;
    color: #94a3b8;
    font-size: 0.78rem;
}

.guest-fake-stats b {
    color: #f8fafc;
}

.guest-fake-donut {
    width: 72px;
    height: 72px;
    margin: 0 auto 12px;
    border-radius: 50%;
    background: conic-gradient(#60a5fa 0 45%, #10b981 45% 72%, #334155 72% 100%);
    box-shadow: inset 0 0 0 18px #0f172a;
}

.guest-preview-error {
    max-width: 620px;
    margin: 44px auto;
    padding: 28px;
    border: 1px solid rgba(51,65,85,0.82);
    border-radius: 10px;
    background: linear-gradient(180deg, rgba(15,23,42,0.8), rgba(8,11,16,0.96));
    text-align: center;
}

.guest-preview-error h2 {
    color: #f8fafc;
    margin-bottom: 10px;
}

.guest-preview-error p {
    color: #94a3b8;
    line-height: 1.6;
}

.guest-preview-kicker {
    color: #60a5fa;
    font-family: "Fira Code", monospace;
    font-size: 0.7rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.guest-preview-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

@media (max-width: 1100px) {
    .stockup-profile-shell { grid-template-columns: 1fr; }
    .stockup-profile-shell .main-col { border-right: none; border-bottom: none; padding-right: 0; }
    .stockup-side-panel { position: static; max-height: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; padding-left: 0; }
    .stockup-side-panel > * { margin-bottom: 0; }
    .guest-side-panel { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
    .container { padding: 12px; }
    #view-dashboard { width: 100%; margin-left: 0; transform: none; }
    .stockup-profile-shell { padding: 10px; border-radius: 10px; background: transparent; border: none; }
    .stockup-profile-shell .main-col { display: flex; flex-direction: column; padding: 0; }
    .stock-hero { flex-direction: column; }
    .stock-identity { align-items: flex-start; }
    .stock-logo { width: 52px; height: 52px; border-radius: 12px; }
    .stock-ticker { font-size: 1.9rem; }
    .stock-fullname { font-size: 0.95rem; }
    .stock-meta-pills { display: none; }
    .stock-hero-actions { width: 100%; flex-wrap: wrap; justify-content: stretch; }
    .action-icon-btn { width: 44px; height: 44px; }
    .quote-cluster { order: -1; width: 100%; justify-content: flex-start; gap: 8px; padding: 12px; flex-wrap: wrap; }
    .quote-main { font-size: 2rem; width: 100%; }
    .quote-chip { font-size: 0.78rem; }
    .btn-add-watchlist, .btn-compare { flex: 1; }
    .chart-section { order: 2; margin-bottom: 14px; }
    .move-context-panel { order: 3; margin: 0 0 14px; padding: 12px; }
    .move-context-head { align-items: flex-start; }
    .move-context-head small { text-align: right; }
    .move-context-latest { padding: 11px; gap: 10px; }
    .move-context-copy strong { font-size: 0.84rem; }
    .move-context-copy p { font-size: 0.78rem; }
    .move-context-actions { justify-content: stretch; }
    .move-context-actions button { width: 100%; }
    .international-beta-banner { align-items: flex-start; flex-direction: column; }
    .international-beta-banner a { width: 100%; text-align: center; }
    .move-context-timeline { grid-template-columns: 1fr; }
    .intraday-strip { order: 3; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 14px; }
    .range-row { order: 4; }
    .analyst-row { order: 5; }
    .mobile-stock-copilot { order: 6; }
    .stats-section { order: 7; }
    .about-section { order: 8; }
    .intraday-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .intraday-cell:nth-child(2n) { border-right: none; }
    .stats-two-col, .about-meta-grid, .stockup-side-panel { grid-template-columns: 1fr; }
    .analyst-row {
        align-items: stretch;
        flex-direction: column;
        gap: 18px;
        padding: 22px 18px;
        margin-bottom: 14px;
    }
    .analyst-verdict-badge {
        width: 118px;
        min-height: 48px;
        display: grid;
        place-items: center;
        font-size: 1rem;
        align-self: flex-start;
    }
    .analyst-bar-wrap {
        width: 100%;
        gap: 14px;
    }
    .analyst-bar-row {
        display: grid;
        grid-template-columns: 56px minmax(0, 1fr) 42px;
        gap: 12px;
        min-height: 34px;
    }
    .analyst-bar-label {
        min-width: 0;
        font-size: 0.9rem;
    }
    .analyst-bar-track {
        height: 8px;
    }
    .analyst-bar-count {
        font-size: 0.82rem;
        text-align: right;
    }
    .analyst-total {
        text-align: left;
        font-size: 0.82rem;
        padding-left: 96px;
    }
    .analyst-total span {
        font-size: 0.74rem;
    }
    .range-row { flex-wrap: wrap; }
    .range-track { flex-basis: 100%; order: 3; }
    .stockup-side-panel { margin-top: 14px; }
    .sb-widget { padding: 18px; }
    .sb-analyst-widget, .stockup-side-panel .sb-copilot-widget, #widget-eps, #widget-peers { display: none !important; }
    #widget-price-target { display: block !important; }
    .eoy-explanation-modal {
        background: rgba(0,0,0,0.84);
        pointer-events: auto;
        align-items: stretch;
        justify-content: stretch;
        padding: 0;
    }
    .eoy-explanation-box {
        width: 100vw;
        height: 100dvh;
        border-radius: 0;
        border-left: 0;
        border-right: 0;
    }
    .eoy-institution-row {
        grid-template-columns: 1fr;
        gap: 5px;
    }
    .mobile-stock-copilot {
        display: block;
        min-height: 150px;
        margin-bottom: 14px !important;
    }
    .guest-preview-banner {
        align-items: stretch;
        flex-direction: column;
    }
    .guest-preview-banner-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
    .guest-locked-grid,
    .guest-side-panel {
        grid-template-columns: 1fr;
    }
    .guest-locked-card {
        grid-template-columns: 38px 1fr;
    }
    .guest-locked-card > span {
        grid-column: 2;
    }
    .guest-preview-actions {
        flex-direction: column;
    }
}

/* =====================================================
   HOMEPAGE REDESIGN - PUBLIC MARKET DESK
   ===================================================== */
.container {
    max-width: 1440px;
    padding: 18px 22px 32px;
}

.top-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    min-height: 58px;
    padding: 10px 0 14px;
    margin-bottom: 0;
    background: rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.logo {
    font-size: 2.15rem;
    letter-spacing: -0.04em;
}

.search-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

#searchBarWrapper {
    align-items: stretch !important;
}

.search-container {
    width: min(430px, 44vw);
    background: #0d141f;
    border: 1px solid #263346;
    border-radius: 8px;
    padding: 5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-input {
    min-width: 0;
    background: transparent;
    border: 0;
    color: #eef3fb;
    font-size: 0.95rem;
    font-weight: 650;
    letter-spacing: 0;
}

.search-btn {
    border-radius: 6px;
    padding: 10px 18px;
    background: #2a6df5;
    font-weight: 800;
}

.plan-selector,
.auth-btn {
    min-height: 42px;
    border-radius: 8px;
    border-color: #263346;
    background: #121b28;
}

#view-homepage {
    padding-top: 12px;
}

.public-market-strip {
    min-height: 38px;
    display: flex;
    align-items: center;
    overflow: hidden;
    border: 1px solid #1b2636;
    border-radius: 8px;
    background: #0b1119;
    margin-bottom: 18px;
}

.market-status-badge {
    height: 100%;
    min-height: 38px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 14px;
    color: #7f91a8;
    border-right: 1px solid #1b2636;
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    white-space: nowrap;
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: #10b981;
    box-shadow: 0 0 12px rgba(16,185,129,0.7);
}

.public-ticker-scroll {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 5px 8px;
}

.public-ticker-scroll::-webkit-scrollbar {
    display: none;
}

.public-ticker-loading {
    color: #66788f;
    font-size: 0.82rem;
    padding-left: 8px;
}

.home-ticker-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 28px;
    padding: 0 10px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: #e5edf7;
    cursor: pointer;
    white-space: nowrap;
    font-family: inherit;
}

.home-ticker-chip:hover {
    background: #121b28;
    border-color: #253349;
}

.home-ticker-chip span {
    font-weight: 900;
    font-size: 0.78rem;
}

.home-ticker-chip strong {
    font-size: 0.78rem;
}

.home-ticker-chip em {
    font-style: normal;
    font-size: 0.76rem;
    font-weight: 800;
}

.hero-section {
    text-align: left;
    padding: 28px;
    margin-bottom: 18px;
    border: 1px solid #1b2636;
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(42,109,245,0.17), rgba(16,185,129,0.06) 42%, rgba(8,12,18,0.98)),
        #0d141f;
}

.hero-section::before {
    display: none;
}

.hero-badge {
    width: fit-content;
    margin: 0 0 16px;
    border-radius: 6px;
}

.hero-title {
    max-width: 880px;
    font-size: clamp(2rem, 4vw, 4.4rem);
    letter-spacing: 0;
}

.hero-subtitle {
    max-width: 680px;
    margin-left: 0;
    color: #94a3b8;
}

.hero-cta-group {
    justify-content: flex-start;
}

.market-pulse-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.pulse-card,
.list-container,
.panel {
    border-radius: 8px;
    border-color: #1b2636;
    background: #0d141f;
}

.pulse-card {
    padding: 18px;
    min-height: 96px;
}

.pulse-card:hover,
.list-item:hover,
.panel:hover {
    border-color: #2b3a50;
}

.pulse-name,
.section-title,
.list-header {
    color: #f0f5fb;
}

.pulse-symbol,
.news-meta,
.list-sub {
    color: #6f829a;
}

.pulse-price {
    font-size: 1.42rem;
}

.home-content-grid {
    grid-template-columns: minmax(0, 1.85fr) minmax(280px, 0.82fr);
    align-items: start;
    gap: 18px;
}

.ai-market-banner {
    border-radius: 8px;
    border-color: rgba(42,109,245,0.38);
    background: linear-gradient(135deg, rgba(42,109,245,0.24), rgba(18,27,40,0.96));
    margin-bottom: 14px;
}

.home-copilot-widget {
    border-radius: 8px;
    border: 1px solid rgba(124,110,253,0.36);
    background:
        linear-gradient(135deg, rgba(124,110,253,0.18), rgba(42,109,245,0.10)),
        #0d141f;
    box-shadow: 0 16px 38px rgba(42,109,245,0.10);
}

.home-copilot-input {
    color: #f4f7fb;
}

.lists-grid {
    gap: 18px;
    margin-bottom: 18px;
}

.list-container {
    padding: 18px;
}

.list-header {
    font-size: 1rem;
    letter-spacing: 0;
}

.list-item {
    min-height: 58px;
    border-color: #182334;
}

.stock-list-head {
    display: grid;
    grid-template-columns: minmax(58px, 1fr) 64px minmax(66px, auto);
    gap: 8px;
    padding: 6px 6px 7px;
    border-bottom: 1px solid #1c2433;
    color: #526176;
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.stock-list-head span:nth-child(2) {
    text-align: center;
}

.stock-list-head span:nth-child(3) {
    text-align: right;
}

#divListContainer {
    display: block !important;
}

.list-price {
    font-size: 1.05rem;
}

.news-item {
    border-radius: 7px;
}

.news-preview-tag {
    width: fit-content;
    margin-top: 8px;
    padding: 3px 7px;
    border: 1px solid rgba(42,109,245,0.25);
    border-radius: 5px;
    color: #73a7ff;
    background: rgba(42,109,245,0.08);
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.view-all-btn {
    border-radius: 6px;
}

@media (max-width: 980px) {
    .container {
        padding: 16px;
    }

    .top-bar {
        position: relative;
        gap: 12px;
    }

    .search-container {
        width: 100%;
    }

    .home-content-grid,
    .lists-grid,
    .market-pulse-grid {
        grid-template-columns: 1fr;
    }

    .hero-section {
        padding: 22px;
    }
}

@media (max-width: 640px) {
    .logo {
        font-size: 1.65rem;
    }

    .search-group {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    #searchBarWrapper {
        grid-column: 1 / -1;
        width: 100%;
    }

    .plan-selector,
    .auth-btn {
        justify-content: center;
        width: 100%;
    }

    .public-market-strip {
        align-items: stretch;
    }

    .market-status-badge {
        min-width: 124px;
        font-size: 0.65rem;
        padding: 0 10px;
    }

    .hero-title {
        font-size: 2rem;
    }

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

    .hero-cta-primary,
    .hero-cta-secondary,
    .hero-cta-ghost {
        width: 100%;
        justify-content: center;
    }

    #divListContainer {
        grid-template-columns: 1fr !important;
    }
}

/* =====================================================
   HOMEPAGE MOCKUP ALIGNMENT PASS
   ===================================================== */
body {
    background: #080b10;
}

.container {
    max-width: none;
    width: 100%;
    padding: 0 22px 28px;
}

.top-bar {
    min-height: 54px;
    padding: 8px 0;
    border-bottom-color: #1c2433;
    background: rgba(8, 11, 16, 0.94);
}

.logo {
    font-size: 1.8rem;
    letter-spacing: -0.03em;
}

.search-container {
    background: #111820;
    border-color: #1c2433;
    border-radius: 6px;
    padding: 4px;
}

.search-input {
    font-size: 0.86rem;
}

.search-btn,
.plan-selector,
.auth-btn,
.home-copilot-btn,
.ai-market-btn,
.view-all-btn {
    border-radius: 6px;
}

#view-homepage {
    max-width: 1180px;
    margin: 0 auto;
    padding-top: 8px;
}

#view-homepage .hero-section {
    display: none !important;
}

.public-market-strip {
    display: none !important;
}

.market-pulse-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    margin-bottom: 8px;
    border: 1px solid #1c2433;
    border-radius: 8px;
    overflow: hidden;
    background: #0d1117;
}

.pulse-card {
    min-height: 78px;
    padding: 12px 14px;
    border: 0;
    border-right: 1px solid #1c2433;
    border-radius: 0;
    background: #0d1117;
    display: grid;
    grid-template-columns: minmax(82px, 1fr) minmax(88px, 120px) minmax(96px, 1fr);
    align-items: center;
    gap: 12px;
}

.pulse-card:last-child {
    border-right: 0;
}

.pulse-card:hover {
    transform: none;
    background: #111820;
}

.pulse-name {
    color: #e8edf3;
    font-size: 0.78rem;
}

.pulse-symbol {
    color: #526176;
    font-size: 0.68rem;
    letter-spacing: 0.08em;
}

.pulse-price {
    font-size: 1.2rem;
    letter-spacing: 0;
}

.pulse-change {
    font-size: 0.72rem;
}

.pulse-left {
    min-width: 0;
}

.pulse-chart {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
}

.pulse-right {
    display: grid;
    justify-items: end;
    gap: 2px;
    min-width: 96px;
}

.home-sparkline {
    display: block;
    opacity: 0.95;
}
.home-sparkline-unavailable { color:#64748b; font-size:1rem; line-height:1; }

.home-content-grid {
    grid-template-columns: minmax(0, 1fr) 248px;
    gap: 8px;
    align-items: start;
}

.home-content-grid > div:first-child {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.home-content-grid > div[style*="flex-direction"] {
    gap: 8px !important;
}

.ai-market-banner,
.home-copilot-widget,
.list-container,
.panel {
    margin-bottom: 0 !important;
    border-radius: 8px;
    border-color: #1c2433;
    background: #0d1117;
}

.ai-market-banner {
    padding: 13px 15px;
    background:
        linear-gradient(135deg, rgba(42,127,255,0.16), rgba(13,17,23,0.98) 62%),
        #0d1117;
}

.ai-market-text h3 {
    font-size: 1.05rem;
}

.ai-market-text p {
    color: #7a8a9e;
    font-size: 0.86rem;
    line-height: 1.45;
}

.home-copilot-widget {
    padding: 10px 12px;
    background:
        linear-gradient(135deg, rgba(124,110,253,0.16), rgba(42,127,255,0.09)),
        #0d1117;
}

.lists-grid {
    gap: 8px;
    margin-bottom: 0;
}

.list-container,
.panel {
    padding: 13px;
}

.list-header,
.section-title {
    margin-bottom: 6px;
    padding-bottom: 7px;
    border-bottom-color: #1c2433;
    color: #e8edf3;
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.list-item {
    min-height: 42px;
    padding: 7px 6px;
    border-bottom-color: #172130;
    display: grid;
    grid-template-columns: minmax(58px, 1fr) 64px minmax(66px, auto);
    gap: 8px;
}

.list-sym {
    font-size: 0.86rem;
}

.list-sub {
    font-size: 0.68rem;
}

.list-price {
    font-size: 0.88rem;
}

.list-main {
    min-width: 0;
}

.list-mini-chart {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 22px;
}

.list-price-group {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.news-item {
    padding: 9px 8px;
    background: transparent;
    border-bottom: 1px solid #172130;
}

.news-headline {
    font-size: 0.82rem;
    line-height: 1.35;
}

.ai-tools-list {
    gap: 6px;
}

.ai-tool-btn {
    padding: 8px;
}

.ai-tool-name {
    font-size: 0.76rem;
}

.ai-tool-desc {
    font-size: 0.66rem;
}

@media (max-width: 980px) {
    .container {
        padding: 12px;
    }

    #view-homepage {
        padding-top: 10px;
    }

    .market-pulse-grid {
        grid-template-columns: 1fr;
    }

    .pulse-card {
        border-right: 0;
        border-bottom: 1px solid #1c2433;
    }

    .pulse-card:last-child {
        border-bottom: 0;
    }

    .home-content-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .container {
        padding: 10px;
    }

    .top-bar {
        padding-bottom: 12px;
    }

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

/* =====================================================
   HOMEPAGE FEATURE EXPANSION PASS
   ===================================================== */
#view-homepage {
    width: 100%;
    max-width: none;
}

.container {
    padding-left: 12px;
    padding-right: 12px;
}

.top-bar {
    margin-bottom: 8px;
}

.plan-badge.plan-pro {
    background: rgba(15, 196, 122, 0.14) !important;
    border: 1px solid rgba(15, 196, 122, 0.65);
    color: #0fc47a;
    box-shadow: 0 0 0 1px rgba(15, 196, 122, 0.08) inset;
}

.plan-badge.plan-essentials {
    background: rgba(245, 166, 35, 0.14) !important;
    border: 1px solid rgba(245, 166, 35, 0.56);
    color: #f5a623;
}

.market-pulse-grid {
    margin-bottom: 8px;
}

.pulse-card {
    min-height: 92px;
    padding: 16px 18px;
}

.pulse-price {
    font-size: 1.38rem;
}

.market-micro-row {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: 8px;
    margin-bottom: 8px;
}

.market-module {
    min-width: 0;
    border: 1px solid #1c2433;
    border-radius: 8px;
    background: #0d1117;
    padding: 10px;
}

.module-kicker {
    margin-bottom: 8px;
    color: #526176;
    font-size: 0.62rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.top-movers-strip {
    display: flex;
    align-items: center;
    gap: 7px;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 1px;
}

.top-movers-strip::-webkit-scrollbar {
    display: none;
}

.mover-pill {
    display: grid;
    grid-template-columns: minmax(74px, auto) 92px;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-width: 204px;
    height: 64px;
    padding: 10px 12px;
    border: 1px solid #243040;
    border-radius: 12px;
    background: #111820;
    color: #e8edf3;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.mover-pill strong {
    color: #73a7ff;
    font-size: 0.9rem;
    letter-spacing: 0.02em;
}

.mover-pill span {
    width: fit-content;
    margin-top: 5px;
    font-size: 0.72rem;
    font-weight: 900;
}

.mover-main {
    display: grid;
    justify-items: start;
}

.mover-chart {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    min-width: 82px;
    overflow: hidden;
}

.mover-pill.pos.light {
    background: linear-gradient(135deg, rgba(15,196,122,0.12), rgba(17,24,32,0.96));
    border-color: rgba(15,196,122,0.26);
}

.mover-pill.pos.medium {
    background: linear-gradient(135deg, rgba(15,196,122,0.24), rgba(8,92,58,0.18));
    border-color: rgba(15,196,122,0.42);
}

.mover-pill.pos.strong {
    background: linear-gradient(135deg, rgba(15,196,122,0.45), rgba(2,68,43,0.62));
    border-color: rgba(15,196,122,0.70);
}

.mover-pill.neg.light {
    background: linear-gradient(135deg, rgba(232,69,90,0.12), rgba(17,24,32,0.96));
    border-color: rgba(232,69,90,0.26);
}

.mover-pill.neg.medium {
    background: linear-gradient(135deg, rgba(232,69,90,0.22), rgba(93,18,31,0.20));
    border-color: rgba(232,69,90,0.42);
}

.mover-pill.neg.strong {
    background: linear-gradient(135deg, rgba(232,69,90,0.42), rgba(78,10,23,0.64));
    border-color: rgba(232,69,90,0.66);
}

.mover-pill.pos span {
    color: #58f0a6;
}

.mover-pill.neg span {
    color: #ff7384;
}

.sector-heatmap {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
}

.sector-heat-cell {
    min-width: 0;
    min-height: 32px;
    border: 1px solid #243040;
    border-radius: 6px;
    background: #111820;
    color: #e8edf3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 0 9px;
    font-family: inherit;
    cursor: pointer;
}

.sector-heat-cell span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #9aa9bb;
    font-size: 0.7rem;
    font-weight: 800;
}

.sector-heat-cell strong {
    font-size: 0.7rem;
}

.sector-heat-cell.hot {
    background: rgba(15, 196, 122, 0.16);
    border-color: rgba(15, 196, 122, 0.36);
}

.sector-heat-cell.up {
    background: rgba(15, 196, 122, 0.08);
}

.sector-heat-cell.down {
    background: rgba(232, 69, 90, 0.08);
}

.sector-heat-cell.cold {
    background: rgba(232, 69, 90, 0.16);
    border-color: rgba(232, 69, 90, 0.36);
}

.sector-heat-cell.hot strong,
.sector-heat-cell.up strong {
    color: #0fc47a;
}

.sector-heat-cell.cold strong,
.sector-heat-cell.down strong {
    color: #e8455a;
}

.home-content-grid {
    grid-template-columns: minmax(0, 1fr) 300px;
}

.list-container:has(#techListContainer) .list-header svg,
.list-container:has(#energyListContainer) .list-header svg,
.list-container:has(#divListContainer) .list-header svg {
    width: 24px;
    height: 24px;
    padding: 4px;
    border-radius: 6px;
    background: rgba(42, 127, 255, 0.10);
    border: 1px solid rgba(42, 127, 255, 0.24);
}

.list-container:has(#energyListContainer) .list-header svg {
    background: rgba(15, 196, 122, 0.10);
    border-color: rgba(15, 196, 122, 0.24);
}

.list-container:has(#divListContainer) .list-header svg {
    background: rgba(245, 166, 35, 0.10);
    border-color: rgba(245, 166, 35, 0.24);
}

.list-item {
    min-height: 56px;
    padding: 9px 8px;
    grid-template-columns: minmax(72px, 1fr) minmax(70px, 100px) minmax(78px, auto);
}

.stock-list-head {
    grid-template-columns: minmax(72px, 1fr) minmax(70px, 100px) minmax(78px, auto);
}

.list-sym {
    color: #73a7ff;
    font-size: 0.95rem;
}

.list-sub {
    margin-top: 2px;
    font-size: 0.72rem;
}

.percent-chip {
    display: inline-flex;
    align-items: center;
    min-height: 18px;
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 0.66rem;
    font-weight: 950;
    line-height: 1;
    letter-spacing: 0.01em;
}

.percent-chip.pos.light {
    color: #58f0a6;
    background: linear-gradient(135deg, rgba(15,196,122,0.12), rgba(15,196,122,0.04));
    border: 1px solid rgba(15,196,122,0.24);
}

.percent-chip.pos.medium {
    color: #7dffc0;
    background: linear-gradient(135deg, rgba(15,196,122,0.24), rgba(15,196,122,0.08));
    border: 1px solid rgba(15,196,122,0.42);
}

.percent-chip.pos.strong {
    color: #d8ffed;
    background: linear-gradient(135deg, rgba(15,196,122,0.45), rgba(2,68,43,0.45));
    border: 1px solid rgba(15,196,122,0.64);
}

.percent-chip.neg.light {
    color: #ff7384;
    background: linear-gradient(135deg, rgba(232,69,90,0.12), rgba(232,69,90,0.04));
    border: 1px solid rgba(232,69,90,0.24);
}

.percent-chip.neg.medium {
    color: #ff98a4;
    background: linear-gradient(135deg, rgba(232,69,90,0.24), rgba(232,69,90,0.08));
    border: 1px solid rgba(232,69,90,0.42);
}

.percent-chip.neg.strong {
    color: #ffe0e4;
    background: linear-gradient(135deg, rgba(232,69,90,0.42), rgba(78,10,23,0.50));
    border: 1px solid rgba(232,69,90,0.62);
}

.percent-chip.dividend {
    color: #ffd27a;
    background: rgba(245,166,35,0.12);
    border: 1px solid rgba(245,166,35,0.34);
}

.list-price {
    font-size: 0.96rem;
}

.sentiment-gauge {
    display: grid;
    gap: 10px;
}

.sentiment-score-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sentiment-score {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    border: 1px solid rgba(15, 196, 122, 0.42);
    background: radial-gradient(circle, rgba(15,196,122,0.18), rgba(13,17,23,0.98));
    color: #e8edf3;
    font-size: 1.25rem;
    font-weight: 950;
}

.sentiment-label {
    color: #e8edf3;
    font-weight: 900;
}

.sentiment-source {
    margin-top: 3px;
    color: #526176;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.sentiment-meter {
    position: relative;
    height: 7px;
    border-radius: 999px;
    background: linear-gradient(90deg, #e8455a, #f5a623, #0fc47a);
}

.sentiment-meter span {
    position: absolute;
    top: 50%;
    width: 14px;
    height: 14px;
    transform: translate(-50%, -50%);
    border: 2px solid #e8edf3;
    border-radius: 50%;
    background: #0d1117;
}

.sentiment-scale {
    display: flex;
    justify-content: space-between;
    color: #526176;
    font-size: 0.66rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.recently-viewed-shelf {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.recent-chip {
    min-width: 0;
    flex: 1 1 120px;
    display: grid;
    gap: 2px;
    padding: 8px 9px;
    border: 1px solid #243040;
    border-radius: 7px;
    background: #111820;
    color: #e8edf3;
    text-align: left;
    cursor: pointer;
}

.recent-chip strong {
    font-size: 0.8rem;
}

.recent-chip span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #6f829a;
    font-size: 0.68rem;
}

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

.news-ticker-tags {
    display: inline-flex;
    gap: 5px;
}

.news-ticker-tag {
    padding: 2px 6px;
    border: 1px solid rgba(42, 127, 255, 0.28);
    border-radius: 4px;
    background: rgba(42, 127, 255, 0.08);
    color: #73a7ff;
    font-size: 0.62rem;
    font-weight: 900;
    cursor: pointer;
}

.skeleton {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    background: #111820;
    border: 1px solid #1c2433;
}

.skeleton::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.07), transparent);
    animation: skeleton-shimmer 1.25s ease-in-out infinite;
}

@keyframes skeleton-shimmer {
    100% { transform: translateX(100%); }
}

.skeleton-index {
    min-height: 92px;
    border-radius: 0;
    border-top: 0;
    border-bottom: 0;
    border-left: 0;
}

.skeleton-mover {
    min-width: 204px;
    height: 64px;
    border-radius: 12px;
    flex: 0 0 auto;
}

.skeleton-heat {
    min-height: 32px;
}

.skeleton-row {
    height: 56px;
    margin-top: 6px;
}

.skeleton-head {
    opacity: 0.75;
}

.skeleton-gauge {
    width: 100%;
    height: 58px;
}

.skeleton-meter {
    width: 100%;
    height: 12px;
    border-radius: 999px;
}

.skeleton-news {
    height: 42px;
    margin-bottom: 7px;
}

.watch-skeleton-list {
    display: grid;
    gap: 8px;
}

.skeleton-watch {
    height: 58px;
}

.home-watch-row {
    cursor: pointer;
    display: grid;
    grid-template-columns: minmax(60px, 1fr) 72px 24px;
    align-items: center;
    gap: 8px;
    padding: 10px;
    border: 1px solid #1c2433;
    border-radius: 8px;
    background: #080b10;
    transition: background 0.2s, border-color 0.2s;
}

.home-watch-row:hover {
    background: #111820;
    border-color: #243040;
}

.watch-main {
    min-width: 0;
}

.watch-main b {
    color: #73a7ff;
    font-size: 0.95rem;
}

.watch-main div {
    margin-top: 2px;
    font-size: 0.74rem;
    font-weight: 900;
}

.watch-main .pos {
    color: #0fc47a;
}

.watch-main .neg {
    color: #e8455a;
}

.watch-mini-chart {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-width: 0;
    overflow: hidden;
}

.watch-remove {
    width: 24px;
    height: 24px;
    border: 0;
    background: transparent;
    color: #ef4444;
    font-size: 1.15rem;
    cursor: pointer;
}

.mobile-nav-head {
    display: contents;
}

.mobile-menu-btn,
.mobile-nav-menu {
    display: none;
}

@media (max-width: 760px) {
    .top-bar {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .mobile-nav-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
    }

    .mobile-menu-btn {
        width: 42px;
        height: 38px;
        display: inline-grid;
        place-items: center;
        gap: 4px;
        padding: 8px;
        border: 1px solid #243040;
        border-radius: 8px;
        background: #111820;
        cursor: pointer;
    }

    .mobile-menu-btn span {
        width: 18px;
        height: 2px;
        border-radius: 2px;
        background: #e8edf3;
    }

    .mobile-nav-menu {
        display: none;
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 10px;
        border: 1px solid #1c2433;
        border-radius: 8px;
        background: #0d1117;
    }

    body.mobile-menu-open .mobile-nav-menu {
        display: grid;
    }

    .mobile-nav-menu button {
        min-height: 40px;
        border: 1px solid #243040;
        border-radius: 7px;
        background: #111820;
        color: #e8edf3;
        font-weight: 850;
    }

    .search-group .plan-selector,
    .search-group #navQuanBtn,
    .search-group #navPortfolioBtn,
    .search-group #authToggleBtn {
        display: none !important;
    }

    .search-group {
        display: block;
        width: 100%;
    }

    #searchBarWrapper {
        width: 100%;
    }

    .search-container {
        width: 100%;
    }

    #view-homepage {
        display: flex;
        flex-direction: column;
    }

    .market-pulse-grid {
        order: 1;
    }

    .home-content-grid,
    .home-content-grid > div {
        display: contents !important;
    }

    .lists-grid {
        order: 2;
    }

    .list-container:has(#divListContainer) {
        order: 3;
    }

    #homeWatchlist {
        order: 4;
    }

    #homeWatchlist,
    #homeWatchlist > * {
        width: 100%;
    }

    #homeWatchlist:before {
        content: "My Watchlist";
        display: block;
        margin-bottom: 8px;
        color: #e8edf3;
        font-size: 0.76rem;
        font-weight: 900;
        letter-spacing: 0.08em;
        text-transform: uppercase;
    }

    .home-content-grid .panel:has(#homeWatchlist) {
        display: contents !important;
    }

    .home-content-grid .panel:has(#homeWatchlist) > .section-title {
        display: none !important;
    }

    .ai-market-banner {
        order: 5;
    }

    .home-copilot-widget {
        order: 6;
    }

    .market-micro-row {
        order: 7;
    }

    .panel:has(#homeNewsFeed) {
        order: 8;
    }

    #homePortfolioWidget { order: 9; }
    #homeSentimentPanel { order: 10; }
    .recently-viewed-panel { order: 11; }
    #globalMarketStatusBanner { order: 12; }
    .ai-tools-panel { order: 13; }

    .pulse-card {
        min-height: 68px;
        padding: 10px 12px;
        grid-template-columns: minmax(64px, 0.9fr) minmax(70px, 90px) minmax(82px, 1fr);
        gap: 8px;
    }

    .pulse-name {
        font-size: 0.72rem;
    }

    .pulse-symbol {
        font-size: 0.6rem;
    }

    .pulse-price {
        font-size: 1.02rem;
    }

    .pulse-change {
        font-size: 0.66rem;
    }

    .pulse-chart .home-sparkline {
        width: 76px;
        height: 26px;
    }

    .stockup-side-panel {
        display: flex !important;
        flex-direction: column;
    }

    .stockup-side-panel .sb-analyst-widget {
        display: none !important;
    }

    .stockup-side-panel .sb-copilot-widget {
        order: 1;
        min-height: 150px;
    }

    .stockup-side-panel #widget-price-target { order: 2; }
    .stockup-side-panel #widget-eps { order: 3; }
    .stockup-side-panel #widget-peers { order: 4; }

    .sb-analyst-widget {
        padding: 18px !important;
    }

    .sb-analyst-mini {
        align-items: stretch;
        gap: 14px;
    }

    .sb-verdict-badge {
        width: 100%;
        min-height: 42px;
        display: grid;
        place-items: center;
        font-size: 0.9rem;
    }

    .sb-mini-bars {
        gap: 10px;
    }

    .sb-mini-bar-row {
        gap: 10px;
        min-height: 28px;
    }

    .sb-mini-label {
        min-width: 34px;
        font-size: 0.72rem;
    }

    .sb-mini-bar-track {
        height: 7px;
    }

    .sb-mini-bar-row span:last-child {
        min-width: 28px;
        text-align: right;
        font-size: 0.72rem;
    }
}

@media (max-width: 1100px) {
    .home-content-grid {
        grid-template-columns: 1fr;
    }

    .market-micro-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .container {
        padding-left: 10px;
        padding-right: 10px;
    }

    .top-bar {
        align-items: stretch;
    }

    .market-module {
        padding: 9px;
    }

    .top-movers-strip {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        overflow: visible;
    }

    .mover-pill {
        min-width: 0;
        width: 100%;
        grid-template-columns: minmax(70px, 1fr) 80px;
    }

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

    .market-pulse-grid {
        grid-template-columns: 1fr;
    }

    .pulse-card {
        min-height: 82px;
        padding: 13px;
    }

    .home-copilot-widget,
    .ai-market-banner {
        align-items: stretch;
        gap: 10px;
    }

    .home-copilot-widget {
        display: grid;
        grid-template-columns: 24px minmax(0, 1fr);
    }

    .home-copilot-btn {
        grid-column: 1 / -1;
        width: 100%;
    }

    .ai-market-banner {
        flex-direction: column;
    }

    .ai-market-btn {
        width: 100%;
        justify-content: center;
    }

    .list-item,
    .stock-list-head {
        grid-template-columns: minmax(62px, 1fr) 68px minmax(70px, auto);
    }

    .list-container,
    .panel {
        padding: 11px;
    }

    .home-watch-row {
        grid-template-columns: minmax(72px, 1fr) 72px 24px;
    }
}

@media (max-width: 430px) {
    .top-movers-strip,
    .sector-heatmap {
        grid-template-columns: 1fr;
    }

    .list-item,
    .stock-list-head {
        grid-template-columns: minmax(70px, 1fr) 66px minmax(74px, auto);
    }

    .list-mini-chart { display: flex; }

    .pulse-right {
        min-width: 86px;
    }

    .mover-pill {
        grid-template-columns: minmax(80px, 1fr) 82px;
    }

    .home-watch-row {
        grid-template-columns: minmax(74px, 1fr) 56px 24px;
        gap: 6px;
    }
}

@media (max-width: 760px) {
    #view-homepage .market-pulse-grid .pulse-card {
        min-height: 66px;
        padding: 9px 11px;
    }

    #view-homepage .market-pulse-grid .pulse-price {
        font-size: 1rem;
    }

    #view-homepage .market-pulse-grid .pulse-right {
        gap: 0;
    }

    #view-homepage .market-pulse-grid .pulse-card {
        grid-template-columns: minmax(64px, 0.9fr) minmax(70px, 86px) minmax(82px, 1fr);
    }

    #view-homepage {
        gap: 10px;
    }

    #view-homepage > .market-pulse-grid,
    #view-homepage > .market-micro-row {
        margin-bottom: 0;
    }

    #view-homepage .ai-market-banner,
    #view-homepage .home-copilot-widget,
    #view-homepage .lists-grid,
    #view-homepage .list-container,
    #view-homepage .market-micro-row,
    #view-homepage .panel,
    #homeWatchlist {
        margin-top: 0 !important;
        margin-bottom: 10px !important;
    }

    #view-homepage .lists-grid {
        gap: 10px;
    }

    #view-homepage .market-micro-row {
        gap: 10px;
    }

    #homeWatchlist .home-watch-row + .home-watch-row {
        margin-top: 8px;
    }
}

@media (max-width: 768px) {
    .quan-scenario-grid,
    .quan-timeline {
        grid-template-columns: 1fr;
    }

    .quan-visual-card {
        border-radius: 9px;
    }

    .quan-visual-header {
        padding: 11px;
        align-items: flex-start;
    }

    .quan-visual-header strong {
        font-size: 0.88rem;
    }

    .quan-visual-body {
        padding: 11px;
    }

    .quan-level-row {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .quan-target-strip,
    .quan-analyst-verdict {
        align-items: flex-start;
        flex-direction: column;
    }

    .quan-analyst-row {
        grid-template-columns: 44px 1fr 30px;
    }

    .quan-risk-radar,
    .quan-move-attribution,
    .quan-portfolio-exposure {
        grid-template-columns: 1fr;
    }

    .quan-risk-score,
    .quan-portfolio-donut {
        width: 108px;
        justify-self: center;
    }

    .quan-earnings-matrix,
    .quan-tradeoff-grid {
        grid-template-columns: 1fr;
    }

    .quan-action-card div,
    .quan-portfolio-summary {
        align-items: flex-start;
        flex-direction: column;
    }

    .heatmap-launch-btn {
        width: 34px;
        height: 34px;
    }

    .sector-map-modal {
        align-items: flex-end;
        justify-content: center;
    }

    .sector-map-panel {
        width: 100%;
        max-height: 94vh;
        min-height: 88vh;
        border-radius: 18px 18px 0 0;
        border-left: none;
        border-right: none;
        border-bottom: none;
    }

    .sector-map-header {
        padding: 18px 16px 12px;
    }

    .sector-map-header h2 {
        font-size: 1.32rem;
    }

    .sector-map-toolbar {
        flex-direction: column;
        align-items: stretch;
        padding: 12px 16px 8px;
    }

    .sector-map-tabs,
    .sector-map-groups {
        width: 100%;
        padding-bottom: 2px;
    }

    .sector-map-groups {
        padding-left: 16px;
        padding-right: 16px;
    }

    .sector-map-note {
        padding-left: 16px;
        padding-right: 16px;
        line-height: 1.45;
    }

    .sector-map-grid {
        padding: 0 12px max(18px, env(safe-area-inset-bottom));
        gap: 7px;
        min-height: 520px;
    }

    .sector-map-tile {
        flex-basis: 104px;
        min-width: 94px;
        min-height: 98px;
        padding: 10px;
    }

    .sector-map-logo {
        width: 27px;
        height: 27px;
    }

    .sector-map-symbol {
        font-size: 0.98rem;
    }

    .sector-map-tile strong {
        font-size: 0.92rem;
    }
}

@media (max-width: 768px) {
    .sector-map-header {
        align-items: flex-start;
        gap: 12px;
    }

    .sector-map-actions {
        align-self: flex-start;
    }

    .sector-map-camera span {
        display: none;
    }

    .sector-map-camera,
    .sector-map-close {
        width: 38px;
        height: 38px;
        padding: 0;
        justify-content: center;
    }

    .sector-map-scale {
        justify-content: flex-start;
        overflow-x: auto;
        padding-left: 16px;
        padding-right: 16px;
    }

    .sector-map-scale span {
        min-width: 46px;
        padding: 6px 7px;
        font-size: 0.66rem;
    }

    .sector-map-grid {
        display: block;
        padding: 0 8px max(12px, env(safe-area-inset-bottom));
        min-height: 0;
        overflow: hidden;
    }

    .market-map-board {
        height: 66vh;
        min-height: 520px;
    }

    .market-map-sector-title {
        height: 16px;
        font-size: 0.48rem;
        padding: 0 3px;
    }

    .market-map-sector-inner {
        top: 17px;
    }

    .market-map-tile {
        padding: 2px;
    }

    .market-map-logo,
    .market-map-tile.small .market-map-logo,
    .market-map-tile.medium .market-map-logo {
        display: none;
    }

    .market-map-tile strong {
        font-size: clamp(0.52rem, 2.2vw, 1rem);
    }

    .market-map-tile em {
        font-size: clamp(0.48rem, 1.7vw, 0.72rem);
    }

    .market-map-tile small,
    .market-map-tile.small small,
    .market-map-tile.tiny small {
        display: none;
    }
}


/* QUAN 3.4 INSIGHTS DASHBOARD WIDGET STYLING */
.quan34-dashboard-container {
  width: 100%;
  margin: 16px 0;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(23, 25, 27, 0.95);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  font-family: Inter, system-ui, sans-serif;
}

.border-top {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.q34-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  background: linear-gradient(90deg, rgba(42, 127, 255, 0.08) 0%, transparent 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.q34-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.q34-logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, #2563eb 0%, #a78bfa 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.q34-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
  color: #fff;
}

.q34-subtitle {
  font-family: 'Space Mono', monospace;
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.4);
}

.q34-ticker {
  font-family: 'Space Mono', monospace;
  font-size: 0.72rem;
  font-weight: bold;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  color: #38bdf8;
}

.q34-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  padding: 18px;
}

@media(min-width: 640px) {
  .q34-grid {
    grid-template-columns: 200px 1fr;
  }
}

.q34-score-widget {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.q34-widget-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.4);
  margin-bottom: 12px;
  display: block;
}

.q34-gauge-wrap {
  position: relative;
  width: 110px;
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.q34-svg-gauge {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.q34-gauge-fill {
  transition: stroke-dashoffset 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.q34-gauge-fill.score-high {
  stroke: #10b981;
}

.q34-gauge-fill.score-medium {
  stroke: #f59e0b;
}

.q34-gauge-fill.score-low {
  stroke: #ef4444;
}

.q34-gauge-text {
  position: absolute;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 1px;
}

.q34-score-num {
  font-size: 2.2rem;
  font-weight: 900;
  font-family: 'Outfit', sans-serif;
}

.q34-score-num.score-high {
  color: #10b981;
}

.q34-score-num.score-medium {
  color: #f59e0b;
}

.q34-score-num.score-low {
  color: #ef4444;
}

.q34-score-max {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.3);
}

.q34-health-desc {
  font-size: 0.7rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 10px;
  text-align: center;
}

.q34-catalysts-widget {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.q34-tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  padding: 2px;
}

.q34-tab-btn {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.q34-tab-btn.active {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.q34-catalyst-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 180px;
  overflow-y: auto;
  padding-right: 4px;
}

.q34-cat-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.72rem;
}

.q34-cat-item.bull {
  background: rgba(16, 185, 129, 0.06);
  border: 1px solid rgba(16, 185, 129, 0.1);
}

.q34-cat-item.bear {
  background: rgba(239, 68, 68, 0.06);
  border: 1px solid rgba(239, 68, 68, 0.1);
}

.q34-cat-icon {
  font-size: 0.8rem;
  margin-top: 1px;
}

.q34-cat-item.bull .q34-cat-icon {
  color: #10b981;
}

.q34-cat-item.bear .q34-cat-icon {
  color: #ef4444;
}

.q34-cat-item p {
  margin: 0;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.4;
}

.q34-section {
  padding: 16px 18px;
}

.q34-guidance-list, .q34-anomaly-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.q34-detail-card {
  padding: 12px;
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 8px;
}

.q34-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.q34-detail-header strong {
  font-size: 0.75rem;
  font-weight: 700;
  color: #a78bfa;
}

.q34-badge {
  font-size: 0.6rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.q34-badge.badge-positive {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.q34-badge.badge-negative {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.q34-badge.badge-neutral {
  background: rgba(255, 255, 255, 0.08);
  color: #9ca3af;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.q34-badge.badge-severity-high {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.q34-badge.badge-severity-medium {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.q34-badge.badge-severity-low {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
  border: 1px solid rgba(59, 130, 246, 0.25);
}

.q34-detail-values {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  padding-bottom: 8px;
  margin-bottom: 8px;
}

.val-label {
  font-size: 0.6rem;
  color: rgba(255, 255, 255, 0.35);
  display: block;
}

.val-num {
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
}

.q34-detail-desc {
  font-size: 0.7rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.5);
  margin: 0;
  font-style: italic;
}

.q34-audit {
  background: rgba(0, 0, 0, 0.15);
}

.q34-audit-toggle {
  width: 100%;
  background: transparent;
  border: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  font-family: 'Space Mono', monospace;
  font-size: 0.65rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  transition: color 0.15s ease;
}

.q34-audit-toggle:hover {
  color: rgba(255, 255, 255, 0.65);
}

.q34-audit-content {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 18px 16px 18px;
  font-family: 'Space Mono', monospace;
  font-size: 0.6rem;
}

.q34-audit-row {
  display: flex;
  gap: 8px;
}

.row-num {
  color: rgba(99, 102, 241, 0.7);
  user-select: none;
}

.row-text {
  color: rgba(255, 255, 255, 0.45);
}

/* DEEP HORIZON RESEARCH STYLES */
.q34-progress-widget {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  margin: 10px 0;
  background: rgba(30, 41, 59, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  backdrop-filter: blur(10px);
  max-width: fit-content;
}

.q34-progress-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(56, 189, 248, 0.2);
  border-top-color: #38bdf8;
  border-radius: 50%;
  animation: q34-spin 0.8s linear infinite;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
}

.q34-progress-text {
  font-family: 'Space Mono', monospace;
  font-size: 0.7rem;
  color: #38bdf8;
  letter-spacing: 0.5px;
  animation: q34-pulse 1.8s ease-in-out infinite;
}

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

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

.q34-deep-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  margin-bottom: 16px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(168, 85, 247, 0.05) 100%);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.1);
}

.q34-badge-icon {
  font-size: 1.2rem;
}

.q34-badge-title {
  font-family: 'Outfit', sans-serif;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #a5b4fc;
}

.q34-badge-subtitle {
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.5);
}

/* INTERACTIVE CITATIONS */
.q34-citation-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 4px;
  color: #38bdf8 !important;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 5px;
  margin: 0 2px;
  vertical-align: super;
  text-decoration: none !important;
  cursor: pointer;
  transition: all 0.2s ease;
}

.q34-citation-link:hover {
  background: #38bdf8;
  color: #0f172a !important;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.5);
  transform: translateY(-1px);
}

.q34-citation-tooltip {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  bottom: 130%;
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  width: 220px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 8px 10px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.68rem;
  line-height: 1.35;
  text-align: left;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  z-index: 100;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.q34-citation-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 5px;
  border-style: solid;
  border-color: rgba(15, 23, 42, 0.95) transparent transparent transparent;
}

.q34-citation-link:hover .q34-citation-tooltip {
  visibility: visible;
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* SOURCES CARD */
.q34-sources-card {
  margin-top: 20px;
  padding-top: 16px;
}

.q34-sources-title {
  font-family: 'Space Mono', monospace;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.35);
  margin-bottom: 12px;
}

.q34-sources-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.q34-source-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: 6px;
}

.q34-source-index {
  font-family: 'Space Mono', monospace;
  font-size: 0.68rem;
  font-weight: 700;
  color: #38bdf8;
  margin-top: 1px;
}

.q34-source-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.q34-source-anchor {
  font-size: 0.72rem;
  font-weight: 600;
  color: #a5b4fc !important;
  text-decoration: none;
}

.q34-source-anchor:hover {
  text-decoration: underline !important;
}

.q34-source-meta {
  font-family: 'Space Mono', monospace;
  font-size: 0.58rem;
  color: rgba(255, 255, 255, 0.35);
  word-break: break-all;
}

/* FAST REASONING PROGRESS BAR */
.q34-progress-bar-container {
  width: 120px;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.q34-progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #38bdf8, #818cf8, #a78bfa);
  border-radius: 3px;
  animation: q34-progress-fill-anim 10s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.5);
}

.q34-progress-text-fast {
  font-family: 'Space Mono', monospace;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.85);
  letter-spacing: 0.5px;
}

.q34-fast-label {
  color: #38bdf8;
  font-weight: 700;
}

@keyframes q34-progress-fill-anim {
  0% { width: 0%; }
  30% { width: 45%; }
  60% { width: 75%; }
  90% { width: 92%; }
  100% { width: 100%; }
}

/* =========================================
   SEARCH RESULTS PAGE
   ========================================= */
.search-results-container {
    max-width: 1360px;
    margin: 20px auto 60px;
    padding: 0 20px;
    min-height: 80vh;
}

.search-results-header {
    margin-bottom: 28px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding-bottom: 16px;
}

.search-results-header h2 {
    font-size: 2.2rem;
    font-weight: 800;
    color: #ffffff;
    margin: 0;
    letter-spacing: -0.5px;
}

.search-results-header p {
    font-size: 1rem;
    color: #9ca3af;
    margin: 6px 0 0 0;
}

.search-results-grid {
    display: grid;
    grid-template-columns: 1.8fr 1fr;
    gap: 32px;
    align-items: start;
}

@media (max-width: 1024px) {
    .search-results-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

/* Primary Preview Card */
.search-primary-preview-card {
    background: linear-gradient(145deg, rgba(20, 26, 38, 0.85), rgba(11, 15, 24, 0.95));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(12px);
    cursor: pointer;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.25s, box-shadow 0.25s;
    position: relative;
    overflow: hidden;
}

.search-primary-preview-card:hover {
    border-color: rgba(59, 130, 246, 0.5);
    transform: translateY(-3px);
    box-shadow: 0 20px 45px rgba(59, 130, 246, 0.15);
}

.preview-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding-bottom: 20px;
}

.preview-company-details h3 {
    font-size: 1.8rem;
    font-weight: 800;
    color: #ffffff;
    margin: 0;
    letter-spacing: -0.3px;
}

.preview-company-details .preview-ticker-badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 0.8rem;
    font-weight: 800;
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 6px;
    margin-top: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.preview-meta-tag {
    font-size: 0.9rem;
    color: #9ca3af;
    margin-top: 6px;
}

.preview-price-container {
    text-align: right;
}

.preview-price-value {
    font-size: 2.4rem;
    font-weight: 800;
    color: #ffffff;
    font-feature-settings: "tnum";
    letter-spacing: -1px;
}

.preview-price-change {
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: 6px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
}

.preview-price-change.pos { color: #10b981; }
.preview-price-change.neg { color: #ef4444; }

/* Large Sparkline Chart Container */
.preview-chart-wrapper {
    height: 200px;
    margin: 24px 0;
    background: rgba(8, 12, 20, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.preview-chart-wrapper svg {
    width: 100%;
    height: 100%;
}

/* Key Stats Grid */
.preview-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin: 24px 0;
}

.preview-stat-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    padding: 14px 18px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.preview-stat-label {
    font-size: 0.88rem;
    color: #9ca3af;
    font-weight: 500;
}

.preview-stat-value {
    font-size: 1.05rem;
    color: #ffffff;
    font-weight: 700;
    font-feature-settings: "tnum";
}

.preview-cta-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
    font-weight: 700;
    font-size: 1.05rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.search-primary-preview-card:hover .preview-cta-btn {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45);
}

/* News Context Section */
.preview-news-section {
    margin: 28px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 20px;
}

.preview-news-section h4 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #d1d5db;
    margin: 0 0 16px 0;
    letter-spacing: -0.2px;
}

.preview-news-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.preview-news-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    padding: 14px 16px;
    text-decoration: none;
    display: block;
    transition: all 0.2s;
}

.preview-news-item:hover {
    background: rgba(59, 130, 246, 0.08);
    border-color: rgba(59, 130, 246, 0.25);
}

.preview-news-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #f3f4f6;
    line-height: 1.45;
}

.preview-news-item:hover .preview-news-title {
    color: #60a5fa;
}

.preview-news-meta {
    font-size: 0.8rem;
    color: #9ca3af;
    margin-top: 6px;
}

/* Similar Items List */
.search-similar-container h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 20px 0;
    letter-spacing: -0.3px;
}

.search-similar-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.search-results-container {
    max-width: 1180px;
}

.search-results-grid {
    grid-template-columns: 1fr;
    gap: 18px;
}

.search-primary-preview-card {
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    backdrop-filter: none;
    cursor: default;
    overflow: visible;
}

.search-primary-preview-card:hover {
    border-color: transparent;
    transform: none;
    box-shadow: none;
}

.best-match-kicker {
    color: #60a5fa;
    font-family: "Fira Code", monospace;
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.search-similar-container {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.search-similar-container h3 {
    margin-bottom: 2px;
}

.search-result-section {
    border: 1px solid rgba(51, 65, 85, 0.72);
    border-radius: 8px;
    background: rgba(8, 12, 20, 0.54);
    overflow: hidden;
}

.search-result-section.empty {
    padding: 0;
}

.search-result-section.empty p {
    color: #64748b;
    font-size: 0.86rem;
    margin: 0;
    padding: 14px 16px 18px;
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 16px;
    border-bottom: 1px solid rgba(51, 65, 85, 0.64);
    background: rgba(2, 6, 23, 0.42);
}

.section-heading h3 {
    color: #f8fafc;
    font-size: 0.95rem;
    font-weight: 900;
    margin: 0;
}

.section-heading span {
    color: #64748b;
    font-family: "Fira Code", monospace;
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
}

.search-result-list {
    display: grid;
    gap: 0;
}

.search-result-card {
    width: 100%;
    min-height: 104px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(230px, 0.34fr);
    gap: 18px;
    align-items: center;
    padding: 15px 16px;
    border: 0;
    border-bottom: 1px solid rgba(51, 65, 85, 0.58);
    background: rgba(15, 23, 42, 0.20);
    color: inherit;
    cursor: pointer;
    font: inherit;
    text-align: left;
    transition: background 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}

.search-result-card:last-child {
    border-bottom: 0;
}

.search-result-card:hover {
    background: rgba(37, 99, 235, 0.10);
}

.search-result-card.international:hover {
    background: rgba(14, 165, 233, 0.11);
}

.search-result-card.featured {
    min-height: 138px;
    border: 1px solid rgba(96, 165, 250, 0.28);
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.14), rgba(15, 23, 42, 0.72));
    box-shadow: 0 16px 38px rgba(0, 0, 0, 0.26);
}

.search-result-card.featured.international {
    border-color: rgba(14, 165, 233, 0.32);
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.13), rgba(15, 23, 42, 0.74));
}

.result-main {
    min-width: 0;
}

.result-symbol-lockup {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.result-logo-mark {
    width: 42px;
    height: 42px;
    border: 1px solid rgba(96, 165, 250, 0.24);
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: rgba(37, 99, 235, 0.10);
    color: #dbeafe;
    flex: 0 0 auto;
    font-family: "Fira Code", monospace;
    font-size: 0.66rem;
    font-weight: 950;
}

.search-result-card.international .result-logo-mark {
    border-color: rgba(125, 211, 252, 0.30);
    background: rgba(14, 165, 233, 0.11);
    color: #e0f2fe;
}

.result-symbol {
    color: #f8fafc;
    font-size: 1.22rem;
    font-weight: 950;
    letter-spacing: 0;
    line-height: 1.1;
}

.result-name {
    color: #cbd5e1;
    font-size: 0.88rem;
    line-height: 1.35;
    margin-top: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.result-badge-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.result-badge-row span {
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 5px;
    color: #94a3b8;
    background: rgba(148, 163, 184, 0.06);
    font-size: 0.68rem;
    font-weight: 800;
    padding: 3px 7px;
    white-space: nowrap;
}

.result-badge-row .result-market-badge.us {
    border-color: rgba(96, 165, 250, 0.26);
    color: #93c5fd;
    background: rgba(37, 99, 235, 0.10);
}

.result-badge-row .result-market-badge.intl,
.result-badge-row .result-beta-badge {
    border-color: rgba(125, 211, 252, 0.30);
    color: #7dd3fc;
    background: rgba(14, 165, 233, 0.11);
}

.result-meta {
    color: #64748b;
    font-size: 0.78rem;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.result-market-preview {
    display: grid;
    grid-template-columns: 86px minmax(110px, 1fr);
    grid-template-areas:
        "spark price"
        "spark route";
    gap: 4px 12px;
    align-items: center;
    justify-content: end;
}

.search-result-card.featured .result-market-preview {
    grid-template-columns: 178px minmax(130px, 1fr);
}

.result-sparkline {
    grid-area: spark;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
}

.result-spark-empty {
    width: 72px;
    height: 24px;
    border-radius: 6px;
    background: rgba(51, 65, 85, 0.42);
}

.result-price {
    grid-area: price;
    text-align: right;
}

.result-price strong {
    display: block;
    color: #f8fafc;
    font-size: 1rem;
    font-weight: 900;
    line-height: 1.15;
}

.search-result-card.featured .result-price strong {
    font-size: 1.24rem;
}

.result-price strong.muted {
    color: #94a3b8;
    font-size: 0.86rem;
}

.result-price span {
    display: block;
    color: #64748b;
    font-size: 0.76rem;
    font-weight: 800;
    margin-top: 4px;
}

.result-price span.pos { color: #10b981; }
.result-price span.neg { color: #ef4444; }

.result-route {
    grid-area: route;
    color: #60a5fa;
    font-family: "Fira Code", monospace;
    font-size: 0.64rem;
    font-weight: 900;
    text-align: right;
    text-transform: uppercase;
}

.search-empty-state {
    border: 1px solid rgba(51, 65, 85, 0.72);
    border-radius: 8px;
    padding: 24px;
    background: rgba(15, 23, 42, 0.48);
}

.search-empty-state span {
    color: #60a5fa;
    font-family: "Fira Code", monospace;
    font-size: 0.66rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.search-empty-state h3 {
    color: #f8fafc;
    margin: 8px 0 6px;
}

.search-empty-state p {
    color: #94a3b8;
    margin: 0;
}

.search-skeleton-compact {
    height: 138px;
}

@media (max-width: 760px) {
    .search-results-container {
        padding: 0;
        margin-top: 10px;
    }
    .search-results-header h2 {
        font-size: 1.45rem;
    }
    .search-result-card,
    .search-result-card.featured {
        grid-template-columns: 1fr;
        gap: 12px;
        min-height: 0;
    }
    .result-market-preview,
    .search-result-card.featured .result-market-preview {
        grid-template-columns: 86px 1fr;
        justify-content: stretch;
    }
    .result-route,
    .result-price {
        text-align: left;
    }
    .result-name,
    .result-meta {
        white-space: normal;
    }
}

.similar-item-card {
    background: rgba(20, 26, 38, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s;
}

.similar-item-card:hover {
    background: rgba(20, 26, 38, 0.8);
    border-color: rgba(59, 130, 246, 0.35);
    transform: translateX(3px);
}

.similar-item-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.similar-item-sym {
    font-size: 1.1rem;
    font-weight: 800;
    color: #ffffff;
    text-transform: uppercase;
}

.similar-item-name {
    font-size: 0.9rem;
    color: #d1d5db;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
}

.similar-item-exchange {
    font-size: 0.78rem;
    color: #9ca3af;
}

.similar-item-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.similar-item-chart {
    display: flex;
    align-items: center;
}

.similar-item-price-group {
    text-align: right;
    min-width: 80px;
}

.similar-item-price {
    font-size: 1rem;
    font-weight: 750;
    color: #ffffff;
    font-feature-settings: "tnum";
}

.similar-item-change {
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 3px;
}

.similar-item-change.pos { color: #10b981; }
.similar-item-change.neg { color: #ef4444; }

/* Skeleton loaders */
.search-skeleton-primary {
    height: 520px;
    background: linear-gradient(90deg, rgba(31, 41, 55, 0.4) 25%, rgba(55, 65, 81, 0.3) 37%, rgba(31, 41, 55, 0.4) 63%);
    background-size: 400% 100%;
    animation: skeleton-shimmer-anim 1.4s ease infinite;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.search-skeleton-similar {
    height: 84px;
    background: linear-gradient(90deg, rgba(31, 41, 55, 0.4) 25%, rgba(55, 65, 81, 0.3) 37%, rgba(31, 41, 55, 0.4) 63%);
    background-size: 400% 100%;
    animation: skeleton-shimmer-anim 1.4s ease infinite;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 12px;
}

@keyframes skeleton-shimmer-anim {
    0% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.search-bar-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.top-bar-link {
    font-size: 0.82rem;
    font-weight: 700;
    color: #9ca3af;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(31, 41, 55, 0.3);
    transition: all 0.2s ease-in-out;
    white-space: nowrap;
    cursor: pointer;
}

.top-bar-link:hover {
    color: #ffffff;
    border-color: rgba(59, 130, 246, 0.4);
    background: rgba(31, 41, 55, 0.7);
    transform: translateY(-1px);
}

.social-btn-rd {
    color: #f3f4f6;
}

.social-btn-rd:hover {
    border-color: #ff4500;
    background: rgba(255, 69, 0, 0.1);
    color: #ff4500;
}

@media (max-width: 767px) {
    .search-bar-row {
        flex-wrap: wrap;
        width: 100%;
        justify-content: flex-end;
    }
    .search-bar-row .top-bar-link {
        font-size: 0.75rem;
        padding: 4px 8px;
    }
}

/* Quan 3.4 Custom Stat Panels */
.quan-visual-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.quan-visual-stat {
    display: flex;
    flex-direction: column !important;
    gap: 4px;
    padding: 10px 12px;
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(51, 65, 85, 0.6);
    border-radius: 8px;
}

.quan-visual-stat span {
    color: #94a3b8;
    font-family: "Fira Code", monospace;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 900;
    display: block;
}

.quan-visual-stat strong {
    color: #f8fafc;
    font-size: 1.15rem;
    font-weight: 800;
    display: block;
}

.quan-visual-section-title {
    font-size: 0.72rem;
    font-weight: 900;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-family: "Fira Code", monospace;
    margin-top: 14px;
    margin-bottom: 8px;
}

/* ==========================================================================
   REASONING THINKING ENGINE ACCORDION (PREMIUM AESTHETIC - COMPACT)
   ========================================================================== */
.quan-thinking-accordion {
  margin: 6px 0;
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  overflow: hidden;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.03);
  max-width: fit-content;
}

.quan-thinking-accordion.completed {
  border-color: rgba(255, 255, 255, 0.03);
  background: rgba(15, 23, 42, 0.2);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.15);
}

.quan-thinking-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  background: rgba(167, 139, 250, 0.02);
  cursor: pointer;
  user-select: none;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 0.72rem;
  font-weight: 500;
  color: #c084fc;
  transition: background-color 0.2s ease;
  gap: 12px;
}

.quan-thinking-header:hover {
  background: rgba(167, 139, 250, 0.05);
}

.quan-thinking-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 320px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quan-thinking-header-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 12px;
  height: 12px;
}

.quan-thinking-header-text {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 0.7rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  overflow: hidden;
  text-overflow: ellipsis;
}

.quan-thinking-accordion.completed .quan-thinking-header-text {
  color: rgba(255, 255, 255, 0.6);
}

.quan-thinking-timer {
  color: rgba(255, 255, 255, 0.35);
  font-size: 0.65rem;
  font-family: 'Space Mono', monospace;
  margin-left: 2px;
}

.quan-thinking-header-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.quan-thinking-toggle-btn {
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.03);
  padding: 1px 6px;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.2s ease;
}

.quan-thinking-header:hover .quan-thinking-toggle-btn {
  color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.1);
}

.quan-thinking-header-arrow {
  font-size: 0.65rem;
  transition: transform 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
  color: rgba(255, 255, 255, 0.3);
}

.quan-thinking-accordion.collapsed .quan-thinking-header-arrow {
  transform: rotate(-90deg);
}

.quan-thinking-content {
  max-height: 350px;
  overflow-y: auto;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  transition: max-height 0.25s cubic-bezier(0.25, 0.8, 0.25, 1), padding 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.quan-thinking-accordion.collapsed .quan-thinking-content {
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  border-top-color: transparent;
  border-top-width: 0;
  overflow: hidden;
}

.quan-thinking-step {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.68rem;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.6);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.quan-thinking-step.completed {
  color: rgba(255, 255, 255, 0.4);
}

.quan-thinking-step.active {
  color: #e9d5ff;
  font-weight: 500;
}

.quan-thinking-step.pending {
  color: rgba(255, 255, 255, 0.18);
}

.quan-thinking-step-icon-container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  margin-top: 2px;
}

.quan-thinking-step-icon-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transition: all 0.2s ease;
}

.quan-thinking-step.completed .quan-thinking-step-icon-dot {
  background: #35d69f;
  box-shadow: 0 0 6px rgba(53, 214, 159, 0.3);
}

.quan-thinking-step.active .quan-thinking-step-icon-dot {
  background: #c084fc;
  box-shadow: 0 0 6px rgba(192, 132, 252, 0.5);
  animation: quan-pulse-dot-anim 1.2s infinite ease-in-out;
}

.quan-thinking-step.pending .quan-thinking-step-icon-dot {
  background: rgba(255, 255, 255, 0.08);
}

.quan-thinking-step-text {
  flex-grow: 1;
}

@keyframes quan-pulse-dot-anim {
  0%, 100% {
    transform: scale(1);
    opacity: 0.7;
  }
  50% {
    transform: scale(1.4);
    opacity: 1;
  }
}

.quan-thinking-spinner {
  width: 10px;
  height: 10px;
  border: 1.5px solid rgba(192, 132, 252, 0.2);
  border-top-color: #c084fc;
  border-radius: 50%;
  animation: quan-spin-loader-anim 0.75s linear infinite;
}

@keyframes quan-spin-loader-anim {
  to { transform: rotate(360deg); }
}

/* --- INSTITUTIONAL SCENARIO MAP STYLES --- */
.quan-scenario-spectrum-wrap {
    margin-bottom: 20px;
    padding: 18px 16px;
    background: linear-gradient(135deg, rgba(17, 24, 39, 0.75), rgba(15, 23, 42, 0.9));
    border-radius: 10px;
    border: 1px solid rgba(51, 65, 85, 0.45);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.05), 0 8px 32px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(12px);
    position: relative;
    overflow: visible;
}

.quan-scenario-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(51, 65, 85, 0.3);
    padding-bottom: 8px;
}

.quan-scenario-expected-badge {
    font-family: "Fira Code", monospace;
    font-size: 0.72rem;
    font-weight: 700;
    color: #34d399;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    display: flex;
    align-items: center;
    gap: 5px;
}

.quan-scenario-expected-badge.negative {
    color: #f87171;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.quan-scenario-horizon-badge {
    font-family: "Fira Code", monospace;
    font-size: 0.65rem;
    font-weight: 600;
    color: #94a3b8;
    background: rgba(148, 163, 184, 0.08);
    border: 1px solid rgba(148, 163, 184, 0.2);
    padding: 3px 8px;
    border-radius: 4px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Axis Map Scale */
.quan-scenario-axis-container {
    padding: 10px 12px 25px 12px;
    position: relative;
}

.quan-scenario-track {
    height: 6px;
    background: linear-gradient(to right, rgba(239, 68, 68, 0.25) 0%, rgba(148, 163, 184, 0.15) 50%, rgba(16, 185, 129, 0.25) 100%);
    border-radius: 4px;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

/* Axis ticks or grid lines */
.quan-scenario-track::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-50%);
}

.quan-scenario-anchor-line {
    position: absolute;
    top: -8px;
    width: 2px;
    height: 22px;
    background: rgba(148, 163, 184, 0.5);
    border-style: dotted;
    border-width: 0 2px 0 0;
    transform: translateX(-50%);
    z-index: 1;
}

.quan-scenario-anchor-label {
    position: absolute;
    top: -22px;
    left: 50%;
    transform: translateX(-50%);
    font-family: "Fira Code", monospace;
    font-size: 0.6rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    white-space: nowrap;
}

.quan-scenario-node {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.2s ease;
    z-index: 2;
    border: 2px solid #0b0f19;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
}

.quan-scenario-node.bull {
    background: #10b981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}
.quan-scenario-node.base {
    background: #3b82f6;
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.5);
}
.quan-scenario-node.bear {
    background: #ef4444;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}

/* Pulsing effect */
.quan-scenario-node::after {
    content: '';
    position: absolute;
    top: -2px; left: -2px; right: -2px; bottom: -2px;
    border-radius: 50%;
    border: 1.5px solid inherit;
    animation: quan-node-pulse 2.2s infinite ease-out;
    opacity: 0;
    pointer-events: none;
}
.quan-scenario-node.bull::after { border-color: rgba(16, 185, 129, 0.6); }
.quan-scenario-node.base::after { border-color: rgba(59, 130, 246, 0.6); }
.quan-scenario-node.bear::after { border-color: rgba(239, 68, 68, 0.6); }

@keyframes quan-node-pulse {
    0% { transform: scale(1); opacity: 0.7; }
    80% { transform: scale(1.75); opacity: 0; }
    100% { transform: scale(1.75); opacity: 0; }
}

.quan-scenario-node:hover,
.quan-scenario-node.is-active {
    transform: translate(-50%, -50%) scale(1.3);
    z-index: 10;
}
.quan-scenario-node.bull:hover, .quan-scenario-node.bull.is-active { box-shadow: 0 0 16px rgba(16, 185, 129, 0.9); }
.quan-scenario-node.base:hover, .quan-scenario-node.base.is-active { box-shadow: 0 0 16px rgba(59, 130, 246, 0.9); }
.quan-scenario-node.bear:hover, .quan-scenario-node.bear.is-active { box-shadow: 0 0 16px rgba(239, 68, 68, 0.9); }

.quan-scenario-node-label {
    position: absolute;
    bottom: -22px;
    font-family: "Fira Code", monospace;
    font-size: 0.62rem;
    font-weight: 700;
    color: #e2e8f0;
    white-space: nowrap;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
    pointer-events: none;
}

/* Tooltip on node */
.quan-scenario-node .quan-scenario-tooltip {
    position: absolute;
    bottom: 150%;
    left: 50%;
    transform: translateX(-50%) translateY(5px);
    background: rgba(15, 23, 42, 0.96);
    border: 1px solid rgba(99, 102, 241, 0.5);
    padding: 6px 10px;
    border-radius: 6px;
    font-family: "Outfit", sans-serif;
    font-size: 0.7rem;
    color: #f8fafc;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
    white-space: nowrap;
    z-index: 50;
    backdrop-filter: blur(8px);
}

.quan-scenario-node:hover .quan-scenario-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.quan-scenario-tooltip-title {
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.65rem;
    color: #94a3b8;
    margin-bottom: 2px;
}

.quan-scenario-tooltip-val {
    font-family: "Fira Code", monospace;
    color: #f3f4f6;
}

/* Skew / Asymmetry Meter */
.quan-scenario-asymmetry-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 15px;
    background: rgba(15, 23, 42, 0.35);
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid rgba(51, 65, 85, 0.25);
}

.asymmetry-label {
    font-family: "Space Grotesk", sans-serif;
    font-size: 0.72rem;
    font-weight: 600;
    color: #94a3b8;
    white-space: nowrap;
}

.asymmetry-track {
    flex-grow: 1;
    height: 5px;
    background: rgba(148, 163, 184, 0.1);
    border-radius: 3px;
    position: relative;
    overflow: hidden;
}

.asymmetry-fill {
    height: 100%;
    background: linear-gradient(to right, #3b82f6, #34d399);
    border-radius: 3px;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.asymmetry-val {
    font-family: "Fira Code", monospace;
    font-size: 0.72rem;
    font-weight: 700;
    color: #e2e8f0;
    white-space: nowrap;
}

/* Sensitivity Modeler Panel */
.quan-scenario-sensitivity-panel {
    margin-top: 15px;
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid rgba(51, 65, 85, 0.3);
    border-radius: 8px;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.quan-scenario-sensitivity-btn {
    width: 100%;
    background: transparent;
    border: none;
    padding: 10px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-family: "Space Grotesk", sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    color: #cbd5e1;
    transition: background 0.2s;
}

.quan-scenario-sensitivity-btn:hover {
    background: rgba(255, 255, 255, 0.02);
}

.quan-scenario-sensitivity-btn svg {
    transition: transform 0.2s;
    stroke: #94a3b8;
}

.quan-scenario-sensitivity-panel.expanded .quan-scenario-sensitivity-btn svg {
    transform: rotate(180deg);
}

.quan-scenario-sensitivity-content {
    padding: 0 14px 14px 14px;
    display: none;
    flex-direction: column;
    gap: 12px;
    border-top: 1px solid rgba(51, 65, 85, 0.2);
}

.quan-scenario-sensitivity-panel.expanded .quan-scenario-sensitivity-content {
    display: flex;
    margin-top: 5px;
    padding-top: 12px;
}

.sensitivity-row {
    display: grid;
    grid-template-columns: 70px 1fr 40px;
    align-items: center;
    gap: 12px;
}

.sensitivity-row span {
    font-family: "Fira Code", monospace;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sensitivity-row span.bear { color: #f87171; }
.sensitivity-row span.base { color: #60a5fa; }
.sensitivity-row span.bull { color: #34d399; }

.sensitivity-row input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    background: rgba(148, 163, 184, 0.15);
    border-radius: 2px;
    outline: none;
}

.sensitivity-row input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.1s ease;
}

.sensitivity-row.bear input[type="range"]::-webkit-slider-thumb { background: #ef4444; }
.sensitivity-row.base input[type="range"]::-webkit-slider-thumb { background: #3b82f6; }
.sensitivity-row.bull input[type="range"]::-webkit-slider-thumb { background: #10b981; }

.sensitivity-row input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.sensitivity-row strong {
    font-family: "Fira Code", monospace;
    font-size: 0.72rem;
    color: #cbd5e1;
    text-align: right;
}

/* Explanation Block styles */
.quan-scenario-explanation-card {
    margin-top: 15px;
    padding: 12px 14px;
    background: rgba(30, 41, 59, 0.25);
    border-radius: 8px;
    border: 1px dashed rgba(148, 163, 184, 0.2);
}

.quan-scenario-explanation-card p {
    font-family: "Outfit", sans-serif;
    font-size: 0.8rem;
    line-height: 1.5;
    color: #cbd5e1 !important;
    margin: 0 !important;
}

.quan-scenario-explanation-card .methodology-tip {
    margin-top: 8px;
    font-size: 0.65rem;
    color: #64748b;
    font-family: "Fira Code", monospace;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Card Linking highlight triggers */
.quan-scenario-card.is-highlighted {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    border-color: currentColor !important;
}

.quan-scenario-card.bull.is-highlighted {
    border-color: #10b981 !important;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.25);
}

.quan-scenario-card.base.is-highlighted {
    border-color: #3b82f6 !important;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.25);
}

.quan-scenario-card.bear.is-highlighted {
    border-color: #ef4444 !important;
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.25);
}

/* --- ACTION PLAN STYLES --- */
.quan-action-plan-card {
  margin: 16px 0 4px;
  border: 1px solid rgba(147, 197, 253, 0.24);
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.98), rgba(17, 24, 39, 0.94));
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.16);
  text-align: left;
}

.quan-action-plan-card.decision-buy { border-color: rgba(52, 211, 153, 0.38); }
.quan-action-plan-card.decision-wait { border-color: rgba(251, 191, 36, 0.34); }

.quan-action-plan-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 16px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.quan-action-eyebrow {
  color: #94a3b8;
  font-size: 0.61rem;
  font-weight: 750;
  letter-spacing: 0.12em;
}

.quan-action-decision {
  margin-top: 3px;
  color: #e5e7eb;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.quan-action-decision.buy { color: #34d399; }
.quan-action-decision.wait { color: #fbbf24; }
.quan-action-decision.hold { color: #93c5fd; }

.quan-action-badges { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
.quan-action-badge {
  padding: 4px 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  color: #cbd5e1;
  font-size: 0.57rem;
  font-weight: 750;
  letter-spacing: 0.04em;
}
.quan-action-badge.confidence-high, .quan-action-badge.evidence-verified { color: #6ee7b7; border-color: rgba(52, 211, 153, 0.36); }
.quan-action-badge.confidence-medium, .quan-action-badge.evidence-mixed { color: #bfdbfe; border-color: rgba(147, 197, 253, 0.35); }
.quan-action-badge.confidence-low, .quan-action-badge.evidence-thin, .quan-action-badge.evidence-unavailable { color: #fcd34d; border-color: rgba(251, 191, 36, 0.33); }

.quan-action-verdict {
  margin: 0;
  padding: 13px 16px 6px;
  color: #e2e8f0;
  font-size: 0.84rem;
  line-height: 1.55;
}

.quan-action-budget { padding: 4px 16px 12px; color: #94a3b8; font-size: 0.72rem; }
.quan-action-budget strong { margin-left: 4px; color: #f8fafc; font-size: 0.82rem; }
.quan-action-allocation-list { display: grid; gap: 8px; padding: 0 12px 12px; }
.quan-action-allocation { padding: 11px; border: 1px solid rgba(255, 255, 255, 0.07); border-radius: 9px; background: rgba(255, 255, 255, 0.025); }
.quan-action-allocation-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.quan-action-ticker { color: #f8fafc; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.8rem; font-weight: 800; }
.quan-action-name { margin-left: 7px; color: #94a3b8; font-size: 0.7rem; }
.quan-action-amount { display: flex; flex-direction: column; align-items: flex-end; color: #f8fafc; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.8rem; font-weight: 750; }
.quan-action-amount small { margin-top: 2px; color: #64748b; font-size: 0.62rem; font-family: inherit; }
.quan-action-allocation p { margin: 7px 0 0; color: #cbd5e1; font-size: 0.72rem; line-height: 1.45; }
.quan-action-allocation p b, .quan-action-change b, .quan-action-assumptions b { color: #94a3b8; font-weight: 700; }
.quan-action-window { display: inline-block; margin-left: 4px; color: #93c5fd; font-size: 0.64rem; }
.quan-action-invalidation { color: #fbbf24 !important; }
.quan-action-inline-sources { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.quan-action-inline-sources a, .quan-action-source { color: #93c5fd; font-size: 0.64rem; text-decoration: none; }
.quan-action-inline-sources a:hover, .quan-action-source:hover { color: #dbeafe; text-decoration: underline; }
.quan-action-change, .quan-action-assumptions { margin: 0 12px 10px; padding: 10px; border-radius: 8px; background: rgba(148, 163, 184, 0.08); color: #cbd5e1; font-size: 0.71rem; line-height: 1.45; }
.quan-action-conditional { margin: 0 12px 10px; padding: 10px; border: 1px solid rgba(251, 191, 36, 0.28); border-radius: 8px; background: rgba(251, 191, 36, 0.07); color: #fef3c7; font-size: 0.71rem; line-height: 1.45; }
.quan-action-conditional p { margin: 0; }
.quan-action-conditional p + p { margin-top: 7px; }
.quan-action-conditional b { color: #fbbf24; }
.quan-action-sources-toggle { width: 100%; padding: 10px 14px; border: 0; border-top: 1px solid rgba(255, 255, 255, 0.07); background: transparent; color: #94a3b8; cursor: pointer; font-size: 0.69rem; font-weight: 700; text-align: left; }
.quan-action-sources-toggle span { float: right; color: #cbd5e1; }
.quan-action-sources { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 14px 13px; }
.quan-action-source { padding: 5px 7px; border: 1px solid rgba(147, 197, 253, 0.18); border-radius: 6px; background: rgba(59, 130, 246, 0.07); }
.quan-action-source.disabled { color: #64748b; }

@media (max-width: 560px) {
  .quan-action-plan-header { flex-direction: column; }
  .quan-action-badges { justify-content: flex-start; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   EDITORIAL RESEARCH-NOTE LAYOUT — Quan analysis responses (main app)
   Flat surfaces, hairline rules, serif display for gravitas. No gradients,
   no accent-rail cards. Accent color spent sparingly (section markers only).
   Self-contained so it does not depend on app theme variables.
   ═══════════════════════════════════════════════════════════════════════════ */
.quan-response-content {
  --qn-serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --qn-mono: "SFMono-Regular", "Cascadia Mono", Consolas, ui-monospace, monospace;
  --qn-ink-hi: #f6f8fb;
  --qn-soft: #9aa4b3;
  --qn-muted: #616b7a;
  --qn-steel: #6f9bd1;
  --qn-amber: #d99a2b;
  --qn-amber-txt: #e6bd6b;
  --qn-hair: rgba(233,238,245,0.08);
  --qn-hair-2: rgba(233,238,245,0.16);
}

/* Opening paragraph → serif standfirst / verdict lede */
.quan-response-content .chat-markdown-lead {
  font-family: var(--qn-serif) !important;
  font-size: 1.16rem !important;
  line-height: 1.58 !important;
  color: var(--qn-ink-hi) !important;
  margin: 2px 0 22px !important;
  text-wrap: pretty;
}

/* Section headers → structured serif headings with a hairline rule */
.quan-response-content .chat-markdown-h2 {
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
  font-family: var(--qn-serif) !important;
  margin: 32px 0 4px !important;
  padding: 0 0 9px !important;
  border-bottom: 1px solid var(--qn-hair) !important;
}
.quan-response-content .cm-h2-kicker {
  order: -1;
  font-family: var(--qn-serif);
  font-style: italic;
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--qn-steel);
  letter-spacing: 0.2px;
}
.quan-response-content .cm-h2-title {
  font-family: var(--qn-serif);
  font-size: 1.22rem;
  font-weight: 600;
  color: var(--qn-ink-hi);
  letter-spacing: 0.1px;
}
.quan-response-content .cm-h2-sub {
  font-family: var(--qn-mono);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--qn-muted);
  margin-top: 2px;
}

/* Sub-headers → quiet serif, no accent bar */
.quan-response-content .chat-markdown-h3 {
  font-family: var(--qn-serif) !important;
  font-size: 1.06rem !important;
  font-weight: 600 !important;
  color: var(--qn-ink-hi) !important;
  margin: 22px 0 8px !important;
  display: block !important;
}
.quan-response-content .chat-markdown-h3::before { display: none !important; }

/* Body copy */
.quan-response-content .chat-markdown-p { line-height: 1.66 !important; margin-bottom: 10px !important; }

/* Bullets → square outline marker in the steel accent, generous rhythm */
.quan-response-content .chat-markdown-ul {
  margin: 15px 0 8px !important;
  padding: 0 !important;
  list-style: none !important;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.quan-response-content .chat-markdown-li {
  position: relative !important;
  padding-left: 20px !important;
  margin-bottom: 0 !important;
  line-height: 1.62 !important;
  font-size: 0.95rem !important;
}
.quan-response-content .chat-markdown-li::before {
  content: "" !important;
  position: absolute !important;
  left: 2px !important;
  top: 0.66em !important;
  width: 5px !important;
  height: 5px !important;
  background: transparent !important;
  border: 1px solid var(--qn-steel) !important;
  border-radius: 0 !important;
  color: transparent !important;
  font-weight: normal !important;
}
.quan-response-content .chat-markdown-li > b:first-child,
.quan-response-content .chat-markdown-li > strong:first-child {
  color: var(--qn-ink-hi);
  font-weight: 600;
}

/* Source pills → flat, squared, quiet; specific = steel, broad = amber */
.quan-response-content .quan-source-pill {
  border-radius: 4px !important;
  background: transparent !important;
  border: 1px solid var(--qn-hair-2) !important;
  color: var(--qn-soft) !important;
  padding: 1px 7px 1px 6px !important;
  font-size: 10px !important;
}
.quan-response-content .quan-source-pill .quan-source-dot { background: var(--qn-steel) !important; box-shadow: none !important; }
.quan-response-content .quan-source-pill-broad { color: var(--qn-amber-txt) !important; border-color: rgba(217,154,43,0.32) !important; }
.quan-response-content .quan-source-pill-broad .quan-source-dot { background: var(--qn-amber) !important; }

/* Claim-ledger verified chips (Decision Intelligence traceability markers) */
.quan-response-content .quan-claim-chip {
  display: inline-block;
  font-family: "SFMono-Regular", "Cascadia Mono", Consolas, ui-monospace, monospace;
  font-size: 9px;
  line-height: 1;
  padding: 2px 5px;
  border: 1px solid rgba(79,185,138,0.35);
  color: #4fb98a;
  border-radius: 3px;
  vertical-align: baseline;
  cursor: help;
  white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════════════════════════
   THINKING PANEL — premium "live" treatment (overrides base rules above)
   Cool, honest, and calm: breathing glow while active, shimmering active step,
   green check-in on completion. Respects reduced-motion.
   ═══════════════════════════════════════════════════════════════════════════ */
.quan-thinking-accordion {
  background: linear-gradient(180deg, rgba(24,20,40,0.55), rgba(15,17,26,0.55)) !important;
  border-radius: 12px !important;
}
.quan-thinking-accordion:not(.completed) {
  border-color: rgba(167,139,250,0.28) !important;
  box-shadow: 0 0 0 1px rgba(167,139,250,0.06), 0 6px 26px rgba(124,58,237,0.12) !important;
  animation: quanThinkBreath 3.2s ease-in-out infinite;
}
@keyframes quanThinkBreath {
  0%, 100% { box-shadow: 0 0 0 1px rgba(167,139,250,0.05), 0 5px 20px rgba(124,58,237,0.09); }
  50%      { box-shadow: 0 0 0 1px rgba(167,139,250,0.16), 0 8px 30px rgba(124,58,237,0.20); }
}

/* Header: shimmer the live status text so it reads as actively working */
.quan-thinking-accordion:not(.completed) .quan-thinking-header-text {
  background: linear-gradient(90deg, #b9a7f8 0%, #ffffff 45%, #b9a7f8 90%);
  background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  animation: quanThinkShimmer 2.2s linear infinite;
}
.quan-thinking-accordion.completed .quan-thinking-header-icon span { text-shadow: 0 0 8px rgba(53,214,159,0.5); }

/* Active step: same shimmer, so the eye tracks the current action */
.quan-thinking-step.active .quan-thinking-step-text {
  background: linear-gradient(90deg, #a78bfa 0%, #f5f3ff 50%, #a78bfa 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  font-weight: 500;
  animation: quanThinkShimmer 1.9s linear infinite;
}
@keyframes quanThinkShimmer { to { background-position: -200% 0; } }

/* Completed step: green check that pops in, text settles to quiet */
.quan-thinking-step-check {
  color: #35d69f;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
  text-shadow: 0 0 8px rgba(53,214,159,0.45);
  animation: quanCheckPop 0.32s cubic-bezier(0.2,1.4,0.4,1);
}
@keyframes quanCheckPop { from { transform: scale(0.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* Per-step spinner for the active row (replaces the plain dot) */
.quan-thinking-step-spinner {
  width: 9px; height: 9px;
  border: 1.5px solid rgba(167,139,250,0.25);
  border-top-color: #c084fc;
  border-radius: 50%;
  animation: quan-spin-loader-anim 0.7s linear infinite;
}

/* Refined header spinner: dual-tone, smoother */
.quan-thinking-spinner {
  border-color: rgba(167,139,250,0.18) !important;
  border-top-color: #c084fc !important;
  box-shadow: 0 0 8px rgba(192,132,252,0.35);
}

@media (prefers-reduced-motion: reduce) {
  .quan-thinking-accordion:not(.completed) { animation: none; }
  .quan-thinking-accordion:not(.completed) .quan-thinking-header-text,
  .quan-thinking-step.active .quan-thinking-step-text {
    animation: none; -webkit-text-fill-color: #e9d5ff; color: #e9d5ff; background: none;
  }
  .quan-thinking-step-check, .quan-thinking-step-spinner, .quan-thinking-spinner { animation: none; }
}
