/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   Company Profile â€” Neon Manawa Design System
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */


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

html, body {
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    background: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
    scrollbar-width: none;
}

/* Hide all scrollbars globally — scroll still works, bars are invisible */
* { scrollbar-width: none; }
*::-webkit-scrollbar { display: none; }

body { height: 100vh; }

a { color: var(--neon-cyan); text-decoration: none; }
a:hover { text-decoration: underline; }

/* â”€â”€ Layout â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
/* .app-shell: see sidebar layout section */

.app-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 24px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-header);
    backdrop-filter: blur(12px);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 64px;
    z-index: 1100;
    box-sizing: border-box;
}

.app-body {
    display: flex;
    flex: 1;
    min-height: 0;    /* allow flex child to shrink properly */
    overflow: hidden;
    position: relative;
}

/* ── Split View ───────────────────────────────────────────────────── */
.split-view {
    display: flex;
    flex-direction: row;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.split-pane {
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none !important;
    min-width: 0;
}

.split-pane::-webkit-scrollbar { display: none !important; }

.split-pane-left {
    flex: 2;
    min-width: 200px;
    /* Sole scroll lives on .markets-main so position:sticky (ticker tabs) works */
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    /* Contain sticky z-indexes so they can't paint over the split-divider arrows */
    position: relative;
    z-index: 0;
}

.split-pane-right {
    flex: 1;
    min-width: 0;
    display: none; /* hidden until split-view is active */
}

.split-view.active .split-pane-right {
    display: block;
}

.split-view.active .split-divider {
    display: flex;
}

/* Draggable Divider */
.split-divider {
    display: none;
    align-items: center;
    justify-content: center;
    width: 6px;
    min-width: 6px;
    cursor: col-resize;
    background: transparent;
    position: relative;
    flex-shrink: 0;
    /* Above pane content (incl. sticky ticker z-index:40) so ← → arrows stay clickable */
    z-index: 50;
    overflow: visible;
    transition: background 0.15s;
}

.split-divider:hover {
    background: rgba(0, 240, 255, 0.06);
}

.split-divider:active {
    background: rgba(0, 240, 255, 0.1);
}

.split-divider-line {
    width: 2px;
    height: 100%;
    background: var(--border);
    border-radius: 1px;
    transition: background 0.15s, width 0.15s;
}

.split-divider:hover .split-divider-line {
    background: var(--neon);
    width: 3px;
    box-shadow: 0 0 8px rgba(0, 240, 255, 0.3);
}

/* Investing pane: static/investing.css */



.main-content {
    flex: 1;
    padding: 24px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* â”€â”€ Search Bar â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.search-container {
    position: relative;
    flex: 1;
    max-width: 480px;
}

.search-input {
    width: 100%;
    padding: 8px 16px 8px 40px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 14px;
    outline: none;
    transition: var(--transition);
}

.search-input:focus {
    border-color: var(--border-active);
    box-shadow: var(--glow-sm);
}

.search-input::placeholder { color: var(--text-muted); }

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 14px;
}

.search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--glow-md);
    z-index: 1200;
    display: none;
    max-height: 300px;
    overflow-y: auto;
}

.search-dropdown.active { display: block; }

.search-result {
    padding: 8px 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: var(--transition);
}

.search-result:hover { background: var(--bg-hover); }

.search-group-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px 4px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    pointer-events: none;
    user-select: none;
    border-top: 1px solid var(--border);
    margin-top: 2px;
}
.search-group-header:first-child {
    border-top: none;
    margin-top: 0;
}

.search-result-logo {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    border-radius: 50%;
    overflow: hidden;
    background: var(--bg-hover);
}

.search-result-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.search-result-initials {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--text-muted);
    background: var(--bg-input);
}

.search-result-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.search-result-symbol {
    font-weight: 600;
    color: var(--neon-cyan);
    font-family: var(--font-mono);
    font-size: 13px;
}

.search-result-name {
    color: var(--text-muted);
    font-size: 11px;
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-result-category {
    flex-shrink: 0;
    font-size: 10px;
    font-weight: 600;
    font-family: var(--font-mono);
    padding: 2px 7px;
    border-radius: 4px;
    color: var(--cat-color, #4caf50);
    background: color-mix(in srgb, var(--cat-color, #4caf50) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--cat-color, #4caf50) 25%, transparent);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* â”€â”€ Ticker Header â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
/* Company name + tab nav stay pinned; price/content scrolls underneath.
   Sticky scrollport is .markets-main (see overflow rules above). */
.ticker-sticky {
    position: sticky;
    top: 0;
    z-index: 40;
    /* Same solid page bg as body — no blue-tinted overlay */
    background: var(--bg-primary);
    /* Pull into main-content horizontal padding so the bar is full-bleed */
    margin-left: -24px;
    margin-right: -24px;
    /* Match former main-content top breathing room when the bar is stuck */
    padding: 16px 24px 0;
}

.ticker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}

.ticker-header-id {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
    min-width: 0;
}

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

.ticker-actions-menu {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ticker-header-actions .ticker-actions-more {
    display: none;
    margin-right: 0;
}

.ticker-logo {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #fff;
    padding: 4px;
    object-fit: contain;
}

.ticker-name {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.ticker-exchange {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* â”€â”€ Price Display (Perplexity dual-box) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.overview-card {
    border: 1px solid var(--border);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    overflow: hidden;
    margin-bottom: 24px;
    border-top: none;
}

.overview-card .price-boxes {
    border: none;
    border-radius: 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0;
}

.overview-card .chart-toolbar {
    padding: 8px 16px 0;
    margin-bottom: -42px;
    position: relative;
    z-index: 2;
}

.overview-card .chart-container {
    padding: 0;
}

.overview-card .stats-grid {
    margin-top: 0;
    border-top: 1px solid var(--border);
}

.price-boxes {
    display: flex;
    gap: 0;
    margin-bottom: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    overflow: hidden;
}

.price-box {
    padding: 14px 20px;
    flex: 1;
}

.price-box + .price-box {
    border-left: 1px solid var(--border);
}

.price-box-main {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.price-current {
    font-size: 18px;
    font-weight: 700;
    font-family: var(--font-mono);
}

.price-change {
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-mono);
}

.price-ah-value {
    font-size: 18px;
    font-weight: 700;
    font-family: var(--font-mono);
}

.price-ah-change {
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-mono);
}

.price-box-timestamp {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Header price sits beside the name on every section. */
.ticker-header .price-boxes {
    margin: 0 0 0 22px;
    border: none;
    border-radius: 0;
    overflow: visible;
    flex: 0 0 auto;
    align-items: flex-start;
}
.ticker-header .price-box {
    padding: 0 0 0 16px;
    flex: 0 0 auto;
}
.ticker-header .price-box + .price-box {
    margin-left: 16px;
}
.ticker-header .price-boxes.is-ext #price-box-ah {
    margin-left: 0;
    border-left: none;
}
.ticker-header .price-box-main {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
}
/* First row matches the name line. The session is a dot at the top right of the figure. */
.ticker-header .price-figure {
    display: inline-flex;
    align-items: center;
    height: 1.5em;
    font-size: 24px;
    line-height: 1.5;
}
.ticker-header .price-num {
    position: relative;
    display: inline-block;
    padding-right: 11px;
    line-height: 1;
}
.ticker-header .price-current,
.ticker-header .price-ah-value {
    font-size: 18px;
    line-height: 1;
}
.ticker-header .price-box-timestamp {
    position: absolute;
    top: 0;
    right: 0;
    margin: 0;
    line-height: 0;
    font-size: 0;
}
.ticker-header .price-box-timestamp .ws-live-dot {
    display: block;
    margin: 0;
}
.ticker-header .price-change,
.ticker-header .price-ah-change {
    font-size: 13px;
    margin-top: 2px;
    line-height: 1.5;
}

/* â”€â”€ Digit-Flip Animation (WS live updates) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.price-digit {
    display: inline-block;
    position: relative;
    overflow: hidden;
    line-height: 1;
}

.price-digit.flip {
    animation: digitFlip 0.4s ease;
}

@keyframes digitFlip {
    0%   { transform: translateY(0);    opacity: 1; }
    40%  { transform: translateY(-80%); opacity: 0; }
    60%  { transform: translateY(80%);  opacity: 0; }
    100% { transform: translateY(0);    opacity: 1; }
}

/* Green/red flash on live price update */
.price-box.price-flash-gain {
    animation: flashGain 0.6s ease;
}
.price-box.price-flash-loss {
    animation: flashLoss 0.6s ease;
}

@keyframes flashGain {
    0%, 100% { background: transparent; }
    30%      { background: rgba(34, 197, 94, 0.08); }
}

@keyframes flashLoss {
    0%, 100% { background: transparent; }
    30%      { background: rgba(239, 68, 68, 0.08); }
}

/* WS live indicator dot */
.ws-live-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--gain);
    margin-right: 4px;
    animation: pulseDot 2s infinite;
    vertical-align: middle;
}

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

/* â”€â”€ Alert Button â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.alert-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 14px;
    background: rgba(0, 240, 255, 0.07);
    border: 1px solid rgba(0, 240, 255, 0.25);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: var(--neon-cyan);
    transition: var(--transition);
    white-space: nowrap;
    margin-right: 10px;
}

.alert-btn svg { flex-shrink: 0; }

.alert-btn:hover {
    background: rgba(0, 240, 255, 0.14);
    border-color: rgba(0, 240, 255, 0.5);
    box-shadow: 0 0 14px rgba(0, 240, 255, 0.18);
}

/* Header DeepDive chip — left of Add+: Run CTA, Queued status, or Custom badge */
.run-analysis-btn {
    background: rgba(45, 212, 191, 0.08);
    border-color: rgba(45, 212, 191, 0.35);
    color: #2dd4bf;
}
button.run-analysis-btn:hover {
    background: rgba(45, 212, 191, 0.16);
    border-color: rgba(45, 212, 191, 0.55);
    box-shadow: 0 0 14px rgba(45, 212, 191, 0.18);
}
.run-analysis-btn .run-analysis-queue { display: none; }
/* Custom Run / Working marks — label on header background, no button chrome */
.run-analysis-custom-wrap {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-right: 10px;
}
.run-analysis-custom,
.run-analysis-working {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0;
    margin-right: 0;
    background: none;
    border: none;
    box-shadow: none;
    cursor: default;
    pointer-events: none;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}
.run-analysis-custom { color: #a78bfa; }
.run-analysis-custom svg { flex-shrink: 0; color: #a78bfa; }
.run-analysis-working { color: #fbbf24; margin-right: 10px; }
.run-analysis-working svg { flex-shrink: 0; color: #fbbf24; }
.run-analysis-lock-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    padding: 0;
    border-radius: 6px;
    border: 1px solid rgba(167, 139, 250, 0.35);
    background: rgba(167, 139, 250, 0.08);
    color: #a78bfa;
    cursor: pointer;
    pointer-events: auto;
}
.run-analysis-lock-btn:hover { background: rgba(167, 139, 250, 0.18); }
.run-analysis-lock-btn.is-locked {
    border-color: rgba(251, 191, 36, 0.45);
    background: rgba(251, 191, 36, 0.12);
    color: #fbbf24;
}
.run-analysis-lock-btn:disabled { opacity: 0.55; cursor: default; }

/* Settings → Billing: custom workflow unlock logo grid */
.billing-custom-card { padding: 14px 16px 16px; }
.billing-custom-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.billing-custom-quota {
    font-size: 13px;
    color: var(--text-muted);
    flex: 1 1 auto;
    min-width: 140px;
}
.billing-custom-search {
    width: 160px;
    max-width: 100%;
    flex: 0 0 auto;
    padding: 7px 10px;
    font-size: 13px;
}
.billing-custom-unlocks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
    gap: 10px;
    max-height: 220px;
    overflow-y: auto;
    padding: 2px 2px 4px;
    scrollbar-width: thin;
}
.billing-custom-tile {
    position: relative;
    width: 48px;
    height: 48px;
    margin: 0 auto;
}
.billing-custom-tile-open {
    display: block;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    overflow: hidden;
    cursor: pointer;
}
.billing-custom-tile-open:hover {
    border-color: rgba(45, 212, 191, 0.45);
    box-shadow: 0 0 0 1px rgba(45, 212, 191, 0.2);
}
.billing-custom-tile-logo {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.04);
}
.billing-custom-tile-fallback {
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}
/* Lock badge: hidden when unlocked; visible on logo when locked.
   Hover reveals a lock control on unlocked tiles so users can pin. */
.billing-custom-tile-lock {
    position: absolute;
    right: -3px;
    bottom: -3px;
    width: 20px;
    height: 20px;
    padding: 0;
    border-radius: 999px;
    border: 1px solid rgba(0, 0, 0, 0.35);
    background: rgba(20, 24, 34, 0.92);
    color: #c4b5fd;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}
.billing-custom-tile:hover .billing-custom-tile-lock:not(.is-locked) {
    display: inline-flex;
    opacity: 0.92;
}
.billing-custom-tile-lock.is-locked {
    display: inline-flex;
    border-color: rgba(251, 191, 36, 0.55);
    background: rgba(40, 32, 12, 0.95);
    color: #fbbf24;
}
.billing-custom-tile-lock:disabled { opacity: 0.55; cursor: default; }
.billing-custom-tile.is-locked .billing-custom-tile-open {
    border-color: rgba(251, 191, 36, 0.35);
}

@media (max-width: 768px) {
    .ticker-header {
        align-items: flex-start;
        gap: 10px;
    }
    .ticker-header-id {
        gap: 10px;
        flex-wrap: nowrap;
        align-items: center;
    }
    .ticker-title {
        min-width: 0;
        flex: 1 1 auto;
    }
    .ticker-name {
        display: block;
        font-size: 16px;
        line-height: 1.2;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .ticker-exchange {
        font-size: 12px;
        margin-top: 3px;
    }
    .ticker-header-actions {
        position: relative;
        flex-direction: row;
        align-items: center;
        gap: 6px;
    }
    .ticker-header-actions .ticker-actions-more {
        display: inline-flex;
    }
    .ticker-header-actions:not(:has(.ticker-actions-menu button, .ticker-actions-menu .run-analysis-custom, .ticker-actions-menu .run-analysis-working)) .ticker-actions-more {
        display: none;
    }
    .ticker-actions-menu {
        display: none;
        position: absolute;
        top: calc(100% + 6px);
        right: 0;
        z-index: 5;
        padding: 6px;
        background: var(--bg-primary);
        border: 1px solid var(--border);
        border-radius: var(--radius-sm);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
    }
    .ticker-header-actions.is-open .ticker-actions-menu {
        display: flex;
    }
    .ticker-header .price-boxes {
        flex: 0 0 auto;
        flex-basis: auto;
        flex-direction: column;
        align-items: flex-start;
        margin: 0 0 0 8px;
    }
    .ticker-header .price-box {
        padding: 0;
    }
    .ticker-header .price-box + .price-box {
        margin-left: 0;
        margin-top: 2px;
    }
    .ticker-header .price-figure {
        font-size: 16px;
        line-height: 1.2;
        height: 1.2em;
    }
    .ticker-header .price-current,
    .ticker-header .price-ah-value {
        font-size: 16px;
    }
    .ticker-header .price-change,
    .ticker-header .price-ah-change {
        margin-top: 3px;
        font-size: 12px;
    }
    .ticker-header-actions .alert-btn,
    .ticker-header-actions .run-analysis-custom-wrap,
    .ticker-header-actions .run-analysis-working {
        margin-right: 0;
        justify-content: center;
        padding: 7px 8px;
        gap: 0;
    }
    .watchlist-btn-label {
        display: none;
    }
    .run-analysis-btn {
        padding: 7px 10px;
        margin-right: 6px;
        gap: 0;
    }
    .run-analysis-btn .run-analysis-label,
    .run-analysis-custom .run-analysis-label,
    .run-analysis-working .run-analysis-label {
        display: none;
    }
    .run-analysis-custom-wrap,
    .run-analysis-working {
        margin-right: 6px;
    }
}

/* â”€â”€ Price Alert Modal â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.alert-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.alert-modal {
    background: linear-gradient(145deg, #0e1520, #0a0f1a);
    border: 1px solid rgba(0, 240, 255, 0.2);
    border-radius: var(--radius-lg);
    width: 400px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.8), 0 0 40px rgba(0, 240, 255, 0.06);
    overflow: hidden;
}

.alert-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid rgba(0, 240, 255, 0.1);
    background: rgba(0, 240, 255, 0.03);
}

.alert-modal-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.alert-modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: var(--transition);
}
.alert-modal-close:hover { color: var(--text-primary); background: var(--bg-hover); }

.alert-modal-body { padding: 22px; }

.alert-modal-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.alert-modal-field { margin-bottom: 18px; }

/* Stock display row */
.alert-stock-display {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

/* Criteria toggle (Target Price / Movement Amount) */
.alert-criteria-toggle {
    display: flex;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 3px;
    gap: 3px;
}

.alert-criteria-btn {
    padding: 7px 14px;
    background: none;
    border: none;
    border-radius: 4px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.alert-criteria-btn.active {
    background: rgba(0, 240, 255, 0.12);
    color: var(--neon-cyan);
}

/* Above / Below toggle */
.alert-condition-toggle {
    display: flex;
    gap: 6px;
}

.alert-condition-btn {
    padding: 9px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.alert-condition-btn.active {
    background: rgba(0, 240, 255, 0.1);
    border-color: rgba(0, 240, 255, 0.4);
    color: var(--neon-cyan);
}

/* Movement direction +/- buttons */
.alert-dir-btn {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--text-muted);
    font-size: 20px;
    font-weight: 300;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.alert-dir-btn.active {
    background: rgba(0, 240, 255, 0.1);
    border-color: rgba(0, 240, 255, 0.4);
    color: var(--neon-cyan);
}

/* Price / % input */
.alert-price-input {
    width: 100%;
    padding: 10px 32px 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 15px;
    font-weight: 600;
    outline: none;
    transition: var(--transition);
}
.alert-price-input:focus {
    border-color: rgba(0, 240, 255, 0.4);
    box-shadow: 0 0 0 3px rgba(0, 240, 255, 0.08);
}

/* Notification select */
.alert-notif-select {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    font-family: var(--font-sans);
    outline: none;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.4)' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
    transition: var(--transition);
}
.alert-notif-select:focus { border-color: rgba(0, 240, 255, 0.4); }

/* Submit */
.alert-submit-btn {
    width: 100%;
    padding: 12px;
    background: var(--neon-cyan);
    border: none;
    border-radius: var(--radius-sm);
    color: #050a14;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 4px;
}
.alert-submit-btn:hover {
    background: #33f5ff;
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.35);
}

/* â”€â”€ Watchlist Button variant â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.watchlist-btn {
    background: rgba(138, 92, 246, 0.07);
    border-color: rgba(138, 92, 246, 0.25);
    color: #a78bfa;
}
.watchlist-btn:hover {
    background: rgba(138, 92, 246, 0.14);
    border-color: rgba(138, 92, 246, 0.5);
    box-shadow: 0 0 14px rgba(138, 92, 246, 0.18);
    color: #c4b5fd;
}

/* â”€â”€ Watchlist Modal â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.wl-modal {
    width: 380px;
}

.wl-modal-list {
    max-height: 280px;
    overflow-y: auto;
    padding: 8px 0;
}

.wl-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 22px;
    cursor: default;
    transition: background 0.15s;
}
.wl-item:hover {
    background: rgba(0, 240, 255, 0.04);
}

.wl-item-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.wl-item-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    text-transform: capitalize;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wl-item-add-btn {
    padding: 5px 14px;
    background: rgba(0, 240, 255, 0.08);
    border: 1px solid rgba(0, 240, 255, 0.2);
    border-radius: var(--radius-sm);
    color: var(--neon-cyan);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    flex-shrink: 0;
}
.wl-item-add-btn:hover {
    background: rgba(0, 240, 255, 0.15);
    border-color: rgba(0, 240, 255, 0.45);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.12);
}
.wl-item-add-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.wl-modal-status {
    padding: 0 22px 16px;
    font-size: 13px;
    min-height: 20px;
    text-align: center;
}

.alert-modal-subtitle {
    font-size: 13px;
    color: var(--neon-cyan);
    font-family: var(--font-mono);
    font-weight: 500;
    margin-top: 2px;
    opacity: 0.7;
}

.gain { color: var(--gain); }
.loss { color: var(--loss); }

/* â”€â”€ Tab Navigation â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.tab-nav {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
    /* Keep gap below tabs inside the sticky bar — price-boxes is often hidden */
    margin-bottom: 24px;
    overflow-x: auto;
    /* Hide the scrollbar but keep tab nav scrollable */
    scrollbar-width: none;
}
.tab-nav::-webkit-scrollbar { display: none; }

.tab-btn {
    padding: 10px 20px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

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

.tab-btn.active {
    color: var(--text-primary);
    border-bottom-color: var(--text-primary);
    font-weight: 600;
}

/* â”€â”€ Cards â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    backdrop-filter: blur(12px);
    transition: var(--transition);
}

.card:hover {
    border-color: var(--border-active);
    box-shadow: var(--glow-sm);
}

/* Stock-page panels keep their outline and sit on the page color. */
html[data-theme="light"] #ticker-section .tab-content .card,
html[data-theme="light"] #ticker-section .tab-content .card:hover,
html[data-theme="light"] #ticker-section .fin-row-chart,
html[data-theme="light"] #ticker-section .pm-card,
html[data-theme="light"] #ticker-section .pm-card:hover,
html[data-theme="light"] #ticker-section .stream-card,
html[data-theme="light"] #ticker-section .stream-card:hover,
html[data-theme="light"] #ticker-section .holders-dash-card,
html[data-theme="light"] #ticker-section .holders-dash-card:hover,
html[data-theme="light"] #ticker-section .ac-consensus-card,
html[data-theme="light"] #ticker-section .ac-consensus-card:hover {
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.card-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

/* â”€â”€ Key Stats Grid â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    margin-top: 20px;
}

.stat-cell {
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

/* Remove bottom border from the last row of 3 cells */
.stat-cell:nth-last-child(-n+3) {
    border-bottom: none;
}

.stat-cell:nth-child(3n+2) {
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
}

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

.stat-value {
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-mono);
    color: var(--text-primary);
}

/* Analyst Consensus stance + price-target figures */
.ac-stance-n,
.ac-pt-n {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  font-family: var(--font-mono);
}
.ac-stance-lab {
  font-size: 14px;
  font-weight: 500;
  margin-top: 4px;
}
.ac-pt-lab {
  font-size: 14px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
  margin-top: 4px;
}
.ac-pt-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.ac-pt-ring {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  border: 2px solid;
  box-sizing: content-box;
  flex-shrink: 0;
}
.ac-pt-ring-current {
  border-color: #ffffff;
}
.ac-stance-row,
.ac-pt-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}
.ac-stance-bar {
  gap: 4px;
  height: 10px;
  margin-bottom: -2px;
}
.ac-dual {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: auto 16px;
  column-gap: 32px;
  row-gap: 14px;
  align-items: end;
}
.ac-dual-stance-labs { grid-column: 1; grid-row: 1; }
.ac-dual-pt-labs { grid-column: 2; grid-row: 1; }
.ac-dual-stance-bar {
  grid-column: 1;
  grid-row: 2;
  margin: 0;
  height: 8px;
  align-self: center;
}
.ac-dual-pt-bar {
  grid-column: 2;
  grid-row: 2;
  margin: 0;
  height: 8px;
  align-self: center;
}
.ac-stance-bar .ac-bar-block {
  height: 100%;
}
@media (max-width: 760px) {
  .ac-consensus-card { padding: 14px 12px !important; }
  .ac-stance-n,
  .ac-pt-n { font-size: 16px; }
  .ac-stance-lab,
  .ac-pt-lab { font-size: 12px; margin-top: 3px; }
  .ac-dual {
    grid-template-columns: 1fr;
    grid-template-rows: auto 16px auto 16px;
    row-gap: 12px;
  }
  .ac-dual-stance-labs { grid-column: 1; grid-row: 1; }
  .ac-dual-stance-bar { grid-column: 1; grid-row: 2; }
  .ac-dual-pt-labs { grid-column: 1; grid-row: 3; }
  .ac-dual-pt-bar { grid-column: 1; grid-row: 4; }
}

/* FMP overall rating pill (Analysis tab) */
.fmp-rating-pill {
  margin-top: 32px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 24px;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
.fmp-rating-overall {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-right: 24px;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  min-width: 80px;
  flex-shrink: 0;
}
.fmp-rating-letter {
  font-size: 36px;
  font-weight: 700;
  line-height: 1;
}
.fmp-rating-overall-lab {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.fmp-rating-scores {
  flex: 1;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  flex-wrap: nowrap;
  padding: 0 32px;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.fmp-rating-scores::-webkit-scrollbar { display: none; }
.fmp-rating-metric {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 0 0 auto;
}
.fmp-rating-metric-v {
  font-size: 22px;
  font-weight: 600;
  font-family: var(--font-mono);
}
.fmp-rating-metric-v span {
  font-size: 14px;
  color: var(--text-muted);
}
.fmp-rating-metric-k {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 6px;
  font-weight: 500;
}
.fmp-rating-pill--solo { margin-top: 0; }
.val-consensus-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.val-consensus-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 10px;
}
.stock-predictions-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 40px;
  align-items: stretch;
}
@media (max-width: 760px) {
  .val-consensus-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .fmp-rating-pill {
    margin-top: 20px;
    padding: 14px 12px;
    gap: 12px;
    overflow-x: clip;
  }
  .fmp-rating-overall {
    padding-right: 12px;
    min-width: 56px;
  }
  .fmp-rating-letter { font-size: 28px; }
  .fmp-rating-overall-lab { font-size: 11px; margin-top: 6px; }
  .fmp-rating-scores {
    padding: 0 4px 2px;
    gap: 18px;
    justify-content: flex-start;
  }
  .fmp-rating-metric-v { font-size: 18px; }
  .fmp-rating-metric-v span { font-size: 12px; }
  .fmp-rating-metric-k { font-size: 12px; margin-top: 4px; }
}

/* â”€â”€ Analyst Consensus Card (Perplexity parity) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.analyst-consensus-card {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-top: 16px;
}

.ac-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.ac-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.ac-see-all {
    font-size: 13px;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}
.ac-see-all:hover { color: var(--text-secondary); }

.ac-badge-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.ac-badge {
    padding: 4px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.ac-badge-buy    { background: rgba(77,158,110,0.12); color: #4d9e6e; }
.ac-badge-sell   { background: rgba(176,82,82,0.12); color: #b05252; }
.ac-badge-neutral{ background: rgba(255,255,255,0.08); color: var(--text-secondary); }

.ac-analyst-count {
    font-size: 13px;
    color: var(--text-muted);
}

.ac-sentiment-labels {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
}
.ac-bearish { color: #b05252; }
.ac-neutral { color: var(--text-muted); }
.ac-bullish { color: #4d9e6e; }
.ac-label-text { font-weight: 500; }

.ac-bar {
    display: flex;
    gap: 2px;
    margin-bottom: 20px;
}
.ac-bar-block {
    flex: 1;
    height: 8px;
    border-radius: 2px;
}
.ac-bar-bearish { background: #b05252; }
.ac-bar-neutral { background: rgba(255,255,255,0.2); }
.ac-bar-bullish { background: #4d9e6e; }

/* Price target section */
.ac-pt-section {
    padding-top: 4px;
}

.ac-pt-labels {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.ac-pt-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.ac-pt-item:last-child { text-align: right; }

.ac-pt-price {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.ac-pt-dot-label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--text-muted);
}

.ac-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.ac-dot-low     { background: #b05252; }
.ac-dot-current { border: 2px solid #ffffff; background: transparent; width: 6px; height: 6px; }
.ac-dot-avg     { border: 2px solid #4d9e6e; background: transparent; width: 6px; height: 6px; }
.ac-dot-high    { background: #4d9e6e; }

/* Track bar */
.ac-pt-track {
    position: relative;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(90deg, #b05252 0%, rgba(255,255,255,0.15) 30%, rgba(255,255,255,0.15) 70%, #4d9e6e 100%);
    margin-top: 4px;
}

.ac-pt-track-fill {
    position: absolute;
    inset: 0;
    border-radius: 3px;
}

.ac-pt-marker {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
}
.ac-marker-low {
    width: 10px; height: 10px;
    background: #b05252;
}
.ac-marker-current {
    width: 14px; height: 14px;
    border: 2.5px solid #ffffff;
    background: var(--bg-surface);
    z-index: 2;
}
.ac-marker-avg {
    width: 14px; height: 14px;
    border: 2.5px solid #4d9e6e;
    background: var(--bg-surface);
    z-index: 1;
}
.ac-marker-high {
    width: 10px; height: 10px;
    background: #4d9e6e;
}

/* â”€â”€ Data Tables â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    padding: 10px 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
}

a.bm-peer-th {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}

a.bm-peer-th:hover {
    text-decoration: underline;
}

.data-table td {
    padding: 10px 12px;
    font-size: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.data-table tr:hover td {
    background: var(--bg-hover);
}

/* -- Key Financials Table ------------------------------------------------- */
.fin-ccy-status {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.45;
    margin: 0 0 12px;
}
.fin-ccy-status b { color: var(--text-primary); font-weight: 600; }

.fin-row-chart {
    margin: 0 0 14px;
    padding: 12px 14px 10px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
}
.fin-row-chart-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.fin-row-chart-heading { min-width: 0; flex: 1; }
.fin-row-chart-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 0;
}
.fin-row-chart-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}
.fin-row-chart-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.fin-row-chart-toggle .period-toggle-btn { padding: 4px 9px; font-size: 12px; }
.fin-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) max-content auto;
    column-gap: 8px;
    row-gap: 6px;
    align-items: center;
    margin-bottom: 16px;
}
.fin-toolbar-end { display: contents; }
.fin-toolbar > #fin-type-toggle { grid-column: 1; grid-row: 1; justify-self: start; }
.fin-toolbar > #fin-section-nav {
    grid-column: 1;
    grid-row: 2;
    min-width: 0;
    padding: 0;
    position: static;
    background: transparent;
}
.fin-toolbar > #fin-section-nav[hidden] { display: none; }
.fin-toolbar-end > #fin-period-toggle { grid-column: 2; grid-row: 1; }
.fin-toolbar-end > #fin-settings-wrap { grid-column: 3; grid-row: 1; }
.fin-toolbar-end > .fin-col-search { grid-column: 2; grid-row: 2; justify-self: stretch; }
.fin-row-chart-png,
.fin-row-chart-close,
.frc-series-x {
    border: none;
    background: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 15px;
    padding: 2px 6px;
    line-height: 1;
}
.fin-row-chart-png:not([hidden]) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.fin-row-chart-png:hover,
.fin-row-chart-close:hover,
.frc-series-x:hover { color: var(--text-primary); }
.fin-row-chart-canvas-wrap { position: relative; height: 220px; }
.fin-row-chart-legend {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}
.fin-row-chart-legend b { color: var(--text-primary); font-weight: 600; }
.fin-row-chart-legend .frc-muted { color: var(--text-muted); }
.frc-series {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 8px;
    min-height: 28px;
    padding: 2px 0;
    overflow-x: auto;
}
.frc-series-name {
    flex: 0 1 auto;
    min-width: 0;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.frc-series-meta {
    flex-shrink: 0;
    white-space: nowrap;
    font-size: 11px;
}
.frc-series-ctrls {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    flex-shrink: 0;
}
.frc-ico-group {
    display: inline-flex;
    align-items: center;
    gap: 1px;
    padding: 1px;
    border: 1px solid var(--border);
    border-radius: 6px;
}
.frc-ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
}
.frc-ico:hover { color: var(--text-primary); background: var(--bg-hover); }
.frc-ico.active {
    color: var(--text-primary);
    background: var(--bg-hover);
}
.frc-series-x {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
}
.frc-swatch {
    width: 8px;
    height: 8px;
    border-radius: 2px;
    background: var(--neon-cyan);
    display: inline-block;
    flex-shrink: 0;
}
.kf-table tr.fin-row-selected td { background: var(--bg-hover); }
.kf-table tr.fin-row-selected td:first-child {
    box-shadow: inset 3px 0 0 var(--frc-color, var(--neon-cyan));
}
.kf-table tr[data-fin-ri] { cursor: pointer; }

@media (max-width: 700px) {
    .fin-row-chart { padding: 10px 10px 8px; }
    .fin-row-chart-canvas-wrap { height: 160px; }
    .fin-row-chart-title { width: 100%; }
    .fin-row-chart-controls { justify-content: flex-start; }
}

.kf-table { border-collapse: collapse; }
.kf-table th { font-size: 13px; font-weight: 500; text-transform: none; letter-spacing: 0; padding: 10px 16px; color: var(--text-muted); white-space: nowrap; }
.kf-label-col { min-width: 180px; width: 180px; }
.kf-table td { padding: 8px 16px; font-size: 14px; font-family: var(--font-mono); cursor: pointer; }
.kf-label { font-family: var(--font-body) !important; color: var(--text-muted); cursor: default; }
.kf-val { text-align: right !important; }
.kf-row-primary .kf-label { color: var(--text-primary); font-weight: 600; }
.kf-row-primary .kf-val { font-weight: 600; color: var(--text-primary); }
.kf-row-sub .kf-label { padding-left: 32px !important; font-size: 13px; }
.kf-row-sub .kf-val { font-size: 13px; color: var(--text-muted); }
.kf-separator td { border-top: 1px solid rgba(255, 255, 255, 0.08); }
.kf-badge { display: inline-flex; align-items: center; padding: 1px 6px; margin-left: 6px; border-radius: 4px; font-size: 10px; font-weight: 600; font-family: var(--font-mono); background: rgba(255, 255, 255, 0.08); color: var(--text-muted); text-decoration: none; border: 1px solid rgba(255, 255, 255, 0.1); transition: all 0.15s; vertical-align: middle; }
.kf-badge:hover { background: rgba(255, 255, 255, 0.15); color: var(--text-primary); border-color: rgba(255, 255, 255, 0.2); }
.kf-estimate-col { color: rgba(255, 255, 255, 0.4) !important; }
.kf-est-icon { font-size: 11px; opacity: 0.5; }
.kf-estimate { color: rgba(255, 255, 255, 0.45) !important; font-style: italic; }
.kf-tooltip { position: absolute; z-index: 100; background: rgba(15, 23, 35, 0.96); border: 1px solid rgba(255, 255, 255, 0.15); border-radius: 10px; padding: 14px 16px; min-width: 240px; max-width: 320px; box-shadow: 0 12px 32px -4px rgba(0, 0, 0, 0.5); pointer-events: auto; font-family: var(--font-body); }
.kf-tip-title { font-weight: 700; font-size: 14px; color: var(--text-primary); margin-bottom: 4px; }
.kf-tip-desc { font-size: 12px; color: var(--text-muted); margin-bottom: 10px; line-height: 1.4; }
.kf-tip-formula { border-top: 1px solid rgba(255, 255, 255, 0.08); padding-top: 8px; }
.kf-tip-line { font-size: 12px; color: var(--text-secondary); margin-bottom: 4px; line-height: 1.5; }
.kf-tip-op { display: inline-block; width: 14px; font-weight: 600; color: var(--text-muted); }
.kf-tip-fval { font-family: var(--font-mono); font-size: 12px; color: var(--text-primary); font-weight: 500; }
.kf-tip-result { font-size: 12px; color: var(--text-secondary); margin-top: 6px; padding-top: 6px; border-top: 1px dashed rgba(255, 255, 255, 0.1); line-height: 1.5; }
.kf-tip-filing { margin-top: 10px; padding-top: 8px; border-top: 1px solid rgba(255, 255, 255, 0.08); font-size: 11px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.kf-section-nav { display: flex; gap: 6px; flex-wrap: wrap; padding: 10px 0 14px; position: sticky; top: 0; z-index: 10; background: var(--bg-primary); }
.kf-section-pill { padding: 6px 14px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--border); border-radius: var(--radius-full); color: var(--text-muted); font-family: var(--font-sans); font-size: 12px; font-weight: 500; cursor: pointer; transition: var(--transition); white-space: nowrap; }
.kf-section-pill:hover { color: var(--text-secondary); border-color: rgba(255, 255, 255, 0.18); background: rgba(255, 255, 255, 0.07); }
.kf-section-pill.active { color: var(--neon-cyan); border-color: rgba(0, 240, 255, 0.3); background: rgba(0, 240, 255, 0.08); box-shadow: 0 0 8px rgba(0, 240, 255, 0.1); }
.kf-info-icon { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; margin-left: 5px; font-size: 12px; color: var(--text-muted); opacity: 0.4; cursor: default; transition: opacity 0.15s, color 0.15s; vertical-align: middle; }
.kf-info-icon:hover { opacity: 1; color: var(--neon-cyan); }

/* â”€â”€ Badges â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font-mono);
}

.badge-gain {
    background: rgba(34, 197, 94, 0.12);
    color: var(--gain);
    border: 1px solid rgba(34, 197, 94, 0.20);
}

.badge-loss {
    background: rgba(239, 68, 68, 0.12);
    color: var(--loss);
    border: 1px solid rgba(239, 68, 68, 0.20);
}

.badge-dem {
    background: rgba(59, 130, 246, 0.15);
    color: var(--blue);
    border: 1px solid rgba(59, 130, 246, 0.25);
}

.badge-rep {
    background: rgba(239, 68, 68, 0.15);
    color: var(--loss);
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.badge-violet {
    background: rgba(168, 85, 247, 0.15);
    color: var(--neon-violet);
    border: 1px solid rgba(168, 85, 247, 0.25);
}

/* â”€â”€ AI Narrative Card â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.ai-card {
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.04), rgba(168, 85, 247, 0.04));
    border: 1px solid rgba(168, 85, 247, 0.15);
    border-radius: var(--radius-md);
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.ai-card::before {
    content: 'âœ¨';
    position: absolute;
    top: 12px;
    right: 14px;
    font-size: 16px;
    opacity: 0.5;
}

.ai-card-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--neon-violet);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ai-card p {
    font-size: 14px;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.80);
}

/* â”€â”€ Chart Container â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.chart-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 4px;
}

.chart-container {
    width: 100%;
    height: 320px;
    background: transparent;
    border: none;
    margin: 0;
    position: relative;
}

html[data-theme="light"] #price-chart.chart-container {
    background:
      radial-gradient(120% 90% at 8% 0%, rgba(14, 116, 144, 0.11), transparent 52%),
      linear-gradient(180deg, #e8f1f4 0%, #f4f7f9 48%, #f8fafc 100%);
    box-shadow: inset 0 1px 0 rgba(14, 116, 144, 0.10);
}

.chart-type-btns {
    display: flex;
    gap: 2px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 2px;
}

.chart-type-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px 8px;
    background: none;
    border: none;
    border-radius: 4px;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}

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

.chart-type-btn.active {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.move-analysis-btn-wrap {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  min-width: 0;
}
.move-analysis-btn {
  display: inline-flex !important;
  align-items: center;
  gap: 5px;
  padding: 0 8px !important;
  width: auto !important;
  min-width: 0;
  white-space: nowrap;
}
.move-analysis-btn .move-analysis-label,
.move-analysis-working .move-analysis-label {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 11px;
  letter-spacing: .04em;
  text-transform: uppercase;
  font-weight: 600;
}
.move-analysis-working {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 8px;
  color: var(--text-muted, #94a3b8);
  font-size: 12px;
}
.move-analysis-brain { flex-shrink: 0; }
.move-analysis-confirm {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.move-analysis-confirm-run,
.move-analysis-confirm-cancel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  padding: 5px 12px;
  border-radius: 6px;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s ease, opacity .15s ease;
}
.move-analysis-confirm-run {
  color: #3ddc97;
  background: rgba(61, 220, 151, .16);
  border: 1px solid rgba(61, 220, 151, .45);
}
.move-analysis-confirm-run:hover { background: rgba(61, 220, 151, .26); }
.move-analysis-confirm-run:disabled { opacity: .55; cursor: default; }
.move-analysis-confirm-cancel {
  color: #f87171;
  background: rgba(248, 113, 113, .12);
  border: 1px solid rgba(248, 113, 113, .4);
}
.move-analysis-confirm-cancel:hover { background: rgba(248, 113, 113, .22); }
.move-analysis-confirm-cancel:disabled { opacity: .55; cursor: default; }
.chart-controls-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* â”€â”€ Chart Popover (interval selector) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.chart-popover-wrap {
    position: relative;
}

.chart-popover {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 6px;
    background: #1e2020;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    min-width: 220px;
    z-index: 100;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.7);
}

.chart-popover.active {
    display: block;
}

.popover-section-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.popover-btn-row {
    display: flex;
    gap: 4px;
}

.popover-btn {
    padding: 6px 12px;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
}

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

.popover-btn.active {
    color: var(--neon-cyan);
    border-color: var(--neon-cyan);
    background: rgba(0, 240, 255, 0.06);
    font-weight: 600;
    box-shadow: 0 0 8px rgba(0, 240, 255, 0.12);
}

.fin-ccy-select:focus {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 0 1px rgba(0, 240, 255, 0.25);
}

/* â”€â”€ Financial Settings Select â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.fin-year-select {
    width: 100%;
    padding: 6px 10px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    appearance: auto;
}
.fin-year-select:focus {
    outline: none;
    border-color: var(--border-active);
}

.popover-btn-row {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.chart-periods {
    display: flex;
    gap: 2px;
    margin-bottom: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 2px;
    width: fit-content;
}

.chart-period-btn {
    padding: 4px 10px;
    background: none;
    border: none;
    border-radius: 4px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition);
}

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

.chart-period-btn.active {
    background: var(--bg-hover);
    color: var(--text-primary);
    font-weight: 600;
}

/* â”€â”€ Sidebar Components â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.sidebar-section {
    margin-bottom: 24px;
}

.sidebar-section-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.sidebar-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 14px;
}

.sidebar-row-label { color: var(--text-muted); font-size: 14px; }
.sidebar-row-value { color: var(--text-primary); font-weight: 500; font-size: 14px; }

/* â”€â”€ Action Buttons â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-primary);
}

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

.btn-primary {
    background: rgba(0, 240, 255, 0.08);
    border-color: rgba(0, 240, 255, 0.25);
    color: var(--neon-cyan);
}

.btn-primary:hover {
    background: rgba(0, 240, 255, 0.15);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.12);
}

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

/* â”€â”€ News Feed â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.news-item {
    display: flex;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

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

.news-item-image {
    width: 80px;
    height: 56px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    flex-shrink: 0;
}

.news-item-title {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    margin-bottom: 4px;
}

.news-item-meta {
    font-size: 11px;
    color: var(--text-muted);
}

/* â”€â”€ Loading / Empty States â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.skeleton {
    background: linear-gradient(90deg, var(--bg-surface) 25%, var(--bg-hover) 50%, var(--bg-surface) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
}

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

.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 32px;
    margin-bottom: 12px;
    opacity: 0.3;
}

/* â”€â”€ Scrollbar â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.20); }

/* â”€â”€ Tab Content Visibility â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.tab-content { display: none; }
.tab-content.active { display: block; }

/* â”€â”€ Period Toggle â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.period-toggle {
    display: inline-flex;
    gap: 6px;
    padding: 4px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.period-toggle-btn {
    padding: 6px 16px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--text-muted);
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    letter-spacing: 0.3px;
}

.period-toggle-btn:hover {
    color: var(--text-secondary);
    border-color: var(--border);
    background: var(--bg-hover);
}

.period-toggle-btn.active {
    color: var(--neon-cyan);
    border-color: var(--neon-cyan);
    background: rgba(0, 240, 255, 0.06);
    font-weight: 600;
    box-shadow: 0 0 8px rgba(0, 240, 255, 0.15);
}

/* â”€â”€ Underline variant (for financial statement type selectors) â”€â”€â”€â”€â”€ */
.period-toggle--underline {
    display: inline-flex;
    width: max-content;
    max-width: 100%;
    flex: 0 0 auto;
    align-self: flex-start;
    background: none;
    border: none;
    border-radius: 0;
    border-bottom: 1px solid var(--border);
    padding: 0;
    gap: 0;
}

.period-toggle--underline .period-toggle-btn {
    flex: 0 0 auto;
    width: auto;
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    padding: 8px 12px;
    font-size: 14px;
    letter-spacing: 0;
    color: var(--text-secondary);
}

.period-toggle--underline .period-toggle-btn:hover {
    background: none;
    border-color: transparent;
    color: var(--text-secondary);
}

.period-toggle--underline .period-toggle-btn.active {
    color: var(--text-primary);
    border-color: transparent;
    border-bottom-color: var(--text-primary);
    background: none;
    box-shadow: none;
}

/* â”€â”€ Analyst Consensus Bar (Perplexity-style) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.consensus-bar {
    display: flex;
    height: 6px;
    border-radius: 3px;
    overflow: hidden;
    margin: 8px 0;
}

.consensus-bar-segment {
    transition: width 0.3s ease;
}

.consensus-breakdown {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    margin-top: 4px;
}

.consensus-breakdown span { font-weight: 500; }

/* â”€â”€ Price Target Range Line (Perplexity-style) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.price-target-range {
    position: relative;
    margin: 16px 0 8px;
}

.price-target-labels {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    font-family: var(--font-mono);
    margin-bottom: 6px;
}

.price-target-labels .pt-label { color: var(--text-muted); }
.price-target-labels .pt-value { font-weight: 600; color: var(--text-primary); }

.price-target-line {
    position: relative;
    height: 4px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    margin: 4px 0;
}

.price-target-dot {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    top: -3px;
    transform: translateX(-50%);
}

.price-target-dot.dot-low   { background: var(--loss); }
.price-target-dot.dot-current { background: var(--text-primary); border: 2px solid var(--bg-primary); width: 12px; height: 12px; top: -4px; }
.price-target-dot.dot-avg   { background: var(--gain); }
.price-target-dot.dot-high  { background: var(--gain); }

/* â”€â”€ Earnings Quarter Chips (horizontal scroll) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.quarter-chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 12px;
    margin-bottom: 20px;
    scrollbar-width: thin;
}

.quarter-chip {
    flex-shrink: 0;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
    background: var(--bg-surface);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
    white-space: nowrap;
}

.quarter-chip:hover { border-color: var(--border-active); }

.quarter-chip.active {
    background: rgba(0, 240, 255, 0.08);
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
}

.quarter-chip .chip-move {
    font-size: 11px;
    font-family: var(--font-mono);
    font-weight: 600;
}

/* â”€â”€ Earnings Summary Card â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.earnings-summary {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1px;
    background: var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 24px;
}

.earnings-summary-cell {
    background: var(--bg-primary);
    padding: 16px;
}

.earnings-summary-cell .es-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.earnings-summary-cell .es-values {
    display: flex;
    gap: 16px;
    align-items: baseline;
}

.earnings-summary-cell .es-est {
    font-size: 14px;
    color: var(--text-muted);
}

.earnings-summary-cell .es-actual {
    font-size: 18px;
    font-weight: 700;
    font-family: var(--font-mono);
}

/* â”€â”€ Holders Summary Stats â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.holders-summary {
    display: flex;
    gap: 16px;
    align-items: center;
    padding: 10px 0;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-muted);
}

.holders-summary .hs-stat {
    font-weight: 600;
    color: var(--text-primary);
}

/* â”€â”€ Sidebar Consensus Card (enhanced) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.sidebar-consensus-badge {
    display: inline-flex;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
}

.sidebar-consensus-badge.buy {
    background: rgba(34, 197, 94, 0.15);
    color: var(--gain);
    border: 1px solid rgba(34, 197, 94, 0.25);
}

.sidebar-consensus-badge.neutral {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.sidebar-consensus-badge.sell {
    background: rgba(239, 68, 68, 0.15);
    color: var(--loss);
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.quarter-chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 12px;
    margin-bottom: 20px;
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

.quarter-chips::-webkit-scrollbar {
    display: none; /* Chrome, Safari and Opera */
}

.quarter-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text-muted);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.quarter-chip:hover {
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--text-secondary);
}

.quarter-chip.active {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
}

.eh-chart-well {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 24px;
    background: rgba(0, 0, 0, 0.2);
}

.eh-transcript {
    padding: 4px 0 16px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
}

.earnings-call-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.earnings-call-title { font-size: 18px; font-weight: 600; color: var(--text-primary); }
.listen-btn { display: inline-flex; align-items: center; gap: 6px; background: transparent; border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-primary); padding: 6px 12px; font-size: 13px; cursor: pointer; transition: all 0.2s; }
.listen-btn:hover { background: rgba(255,255,255,0.05); }
.listen-btn.earnings-docs-reload { padding: 6px; }
.listen-btn:disabled { opacity: 0.45; cursor: default; }
.earnings-date { font-size: 14px; color: var(--text-muted); margin-bottom: 24px; }

/* Earnings call summary — dual-grid card */
.earnings-dual-grid {
    display: flex;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: rgba(0, 0, 0, 0.15);
    margin-bottom: 24px;
    overflow: hidden;
}

.earnings-dual-grid-left {
    flex: 3;
    border-right: 1px solid var(--border);
}

.earnings-dual-grid-right {
    flex: 2;
}

.earnings-grid-row {
    display: grid;
    grid-template-columns: 100px 1fr 90px 120px;
    align-items: center;
    padding: 10px 20px;
    border-bottom: 1px solid var(--border);
    min-height: 44px;
}

.earnings-dual-grid-right .earnings-grid-row {
    grid-template-columns: 1fr auto;
}

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

@media (max-width: 768px) {
    .earnings-dual-grid {
        flex-direction: column;
    }
    .earnings-dual-grid-left {
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    .earnings-grid-row {
        grid-template-columns: 85px 1.1fr 0.9fr auto;
        padding: 10px 12px;
        gap: 8px;
    }
    .listen-btn-label { display: none; }
    .listen-btn { padding: 6px; gap: 0; }
}

.eg-label {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
}

.eg-val-est {
    font-size: 14px;
    color: var(--text-muted);
    text-align: right;
}

.eg-val-act {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    text-align: right;
    font-family: var(--font-mono);
}

.eg-val-diff {
    font-size: 14px;
    font-weight: 500;
    text-align: right;
}

.hide-scrollbar { scrollbar-width: none; -ms-overflow-style: none; }
.hide-scrollbar::-webkit-scrollbar { display: none; }
.stream-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--radius-full); background: var(--neon-cyan); color: #000; font-size: 10px; font-weight: 700; }



.app-shell {
    display: flex;
    flex-direction: row;
    height: 100vh;
    overflow: hidden;
}

/* ── Full-height App Sidebar ────────────────────────────────────────── */
.app-sidebar {
    width: 200px;
    min-width: 200px;
    height: 100vh;
    background: var(--bg-sidebar);
    border-right: none;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: width 0.22s cubic-bezier(.4,0,.2,1), min-width 0.22s cubic-bezier(.4,0,.2,1);
    overflow: hidden;
    z-index: 200;
    position: relative;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.4);
}

.app-sidebar.collapsed {
    width: 56px;
    min-width: 56px;
}

/* Logo / brand toggle area */
.sidebar-logo-area {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
    height: 58px;
    min-height: 58px;
    box-sizing: border-box;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    overflow: hidden;
    transition: background 0.15s;
    user-select: none;
    position: relative;
    z-index: 10;
}

.sidebar-logo-area:hover {
    background: rgba(0, 240, 255, 0.04);
}

.sidebar-logo-img {
    width: 28px;
    height: 28px;
    object-fit: contain;
    flex-shrink: 0;
}

.sidebar-brand {
    font-size: 14px;
    font-weight: 400;
    color: var(--text-secondary);
    white-space: nowrap;
    opacity: 1;
    max-width: 200px;
    overflow: hidden;
    transition: opacity 0.18s, max-width 0.18s;
    letter-spacing: 0.02em;
}

.app-sidebar.collapsed .sidebar-brand {
    opacity: 0;
    max-width: 0;
    overflow: hidden;
    pointer-events: none;
}

.app-sidebar.collapsed .sidebar-logo-area {
    justify-content: center;
    align-items: center;
    padding: 0;
    gap: 0;
}

/* ── App Right: header + content ──────────────────────────────────── */
.app-right {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ── Sidebar Sections Nav ─────────────────────────────────────────── */
.sidebar-sections {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0;
    scrollbar-width: none;
}

.sidebar-sections::-webkit-scrollbar { display: none; }

/* Market group */
.sidebar-group {
    position: relative;
    border: none;
}

/* Main group button: icon + label */
.sidebar-group-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 11px 14px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.15s, background 0.15s;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
}

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

.sidebar-group-btn.active {
    background: none;
}

.sidebar-group-btn.active .sidebar-group-icon {
    color: var(--neon-cyan);
}

.sidebar-group-btn.active .sidebar-group-label {
    color: var(--text-muted);
}

.sidebar-group-icon {
    width: 20px;
    min-width: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: inherit;
    flex-shrink: 0;
}

.sidebar-group-label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    opacity: 1;
    max-width: 200px;
    transition: opacity 0.18s, max-width 0.18s;
}

.app-sidebar.collapsed .sidebar-group-label {
    opacity: 0;
    max-width: 0;
    overflow: hidden;
    pointer-events: none;
}

.app-sidebar.collapsed .sidebar-group-btn {
    justify-content: center;
    align-items: center;
    padding: 11px 0;
    width: 100%;
}

/* Subsection items block */
.sidebar-group-items {
    overflow: hidden;
    background: rgba(0, 240, 255, 0.04);
    border-radius: 0 0 6px 6px;
}

/* Horizontal divider lines above/below subsections */
.sidebar-sub-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 2px 0;
}

/* Subsection links */
.sidebar-section-link {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 14px 8px 14px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 12px;
    font-weight: 400;
    transition: color 0.15s, background 0.15s;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-section-link:hover {
    color: var(--text-secondary);
    background: var(--bg-hover);
    text-decoration: none;
}

.sidebar-section-link.active {
    color: var(--neon-cyan);
    background: rgba(0, 240, 255, 0.06);
    font-weight: 500;
}

.sidebar-section-icon {
    width: 20px;
    min-width: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar-section-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    opacity: 1;
    max-width: 200px;
    transition: opacity 0.18s, max-width 0.18s;
}

/* Collapsed: hide labels, subsections still show as icon-only strip */
.app-sidebar.collapsed .sidebar-section-label {
    opacity: 0;
    max-width: 0;
    overflow: hidden;
    pointer-events: none;
}

.app-sidebar.collapsed .sidebar-section-link {
    justify-content: center;
    align-items: center;
    padding: 8px 0;
    width: 100%;
}

/* Tooltip via title attr - CSS enhancement for collapsed icons */
.app-sidebar.collapsed [title]:hover::after {
    content: attr(title);
    position: fixed;
    left: 62px;
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 9999;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

padding: 0 5px;
    border-radius: var(--radius-full);
    background: var(--neon-cyan);
    color: #000;
    font-size: 10px;
    font-weight: 700;
    font-family: var(--font-mono);
    margin-left: 6px;
    vertical-align: middle;
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(0, 240, 255, 0.4); }
    50% { box-shadow: 0 0 8px 2px rgba(0, 240, 255, 0.2); }
}

.stream-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    border: none;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    padding: 10px 4px;
    margin: 0;
    background: transparent;
}

.stream-card:hover {
    background: var(--bg-hover);
}

.stream-wire-ico {
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    flex-shrink: 0;
    padding-top: 1px;
    color: var(--neon-cyan);
    background: none;
    border: none;
}

.stream-wire-ico i {
    font-size: 16px;
    line-height: 1;
}

.stream-wire-dot {
    position: absolute;
    top: -3px;
    right: -4px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--neon-cyan);
    box-shadow: 0 0 0 2px var(--bg-primary);
    animation: streamDotBlink 1.1s ease-in-out infinite;
}

.stream-wire-fresh {
    animation: streamRowBlink 1.4s ease-in-out infinite;
}

@keyframes streamDotBlink {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.15; transform: scale(0.75); }
}

@keyframes streamRowBlink {
    0%, 100% { background: transparent; }
    50% { background: color-mix(in srgb, var(--cyan) 16%, transparent); }
}

@media (prefers-reduced-motion: reduce) {
    .stream-wire-dot,
    .stream-wire-fresh { animation: none; }
}

.stream-wire-type {
    width: 132px;
    flex-shrink: 0;
    padding-top: 2px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.45;
    color: var(--text-primary);
}

.stream-wire-summary {
    flex: 1;
    min-width: 0;
    padding-top: 2px;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.45;
    color: var(--text-primary);
}

.stream-wire-summary a {
    color: inherit;
    text-decoration: none;
}

.stream-wire-summary a:hover {
    text-decoration: underline;
}

.stream-wire-star {
    width: 16px;
    flex-shrink: 0;
    padding-top: 2px;
    font-size: 13px;
    line-height: 1.2;
    color: var(--text-primary);
}

@media (max-width: 720px) {
    .stream-wire {
        flex-wrap: wrap;
    }
    .stream-wire-type {
        width: auto;
        flex: 1;
    }
    .stream-wire-summary {
        flex-basis: 100%;
        order: 4;
    }
}

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

.stream-card-marks {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.stream-star {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

.stream-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
}

.stream-time {
    width: 72px;
    flex-shrink: 0;
    padding-top: 2px;
    text-align: right;
    font-size: 12px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.stream-card-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.5;
    margin-bottom: 4px;
}

.stream-card-title a {
    color: var(--text-primary);
    text-decoration: none;
}

.stream-card-title a:hover {
    color: var(--neon-cyan);
    text-decoration: underline;
}

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

.stream-card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

.stream-meta-badge {
    padding: 1px 8px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    font-size: 11px;
    font-weight: 500;
    text-transform: capitalize;
}

/* Stream card body & details */
.stream-card-body {
    padding: 2px 0 0;
}

.stream-news-body {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.stream-news-img {
    width: 80px;
    height: 56px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    border: 1px solid var(--border);
}

.stream-card-snippet {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-top: 4px;
}

.stream-ticker-pill {
    display: inline-flex;
    align-items: center;
    padding: 1px 6px;
    border-radius: 4px;
    background: rgba(0, 240, 255, 0.08);
    border: 1px solid rgba(0, 240, 255, 0.15);
    color: var(--neon-cyan);
    font-size: 10px;
    font-weight: 700;
    font-family: var(--font-mono);
    letter-spacing: 0.5px;
}

.stream-ticker-pill.small {
    font-size: 9px;
    padding: 0 4px;
}

/* ── Prediction market cards (theme-aware) ─────────────────────────── */
.pm-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 24px 22px 20px;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    box-sizing: border-box;
    box-shadow: var(--glow-md);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease, background 0.25s ease, opacity 0.5s ease;
}
.pm-card:hover {
    background: var(--bg-hover);
    transform: translateY(-5px);
    box-shadow: var(--glow-lg);
    border-color: var(--border-active);
}
.pm-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}
.pm-card-title {
    font-size: 15px;
    font-weight: 700;
    font-family: var(--font-sans);
    color: var(--text-primary);
    line-height: 1.35;
    min-height: 42px;
    overflow: hidden;
    flex: 1;
    letter-spacing: -0.01em;
}
.pm-card-vol {
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
    padding-top: 2px;
}
.pm-card-rows {
    display: flex;
    flex-direction: column;
    min-height: 114px;
}
.pm-card-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 38px;
}
.pm-card-row + .pm-card-row {
    border-top: 1px solid var(--border);
}
.pm-card-label {
    font-size: 14px;
    font-family: var(--font-sans);
    color: var(--text-secondary);
    font-weight: 500;
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    min-width: 0;
    padding-right: 8px;
}
.pm-card-vals {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.pm-card-prob {
    font-size: 16px;
    font-family: var(--font-sans);
    color: var(--text-primary);
    font-weight: 700;
    letter-spacing: -0.02em;
}
.pm-card-chg {
    padding: 2px 7px;
    border-radius: 5px;
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.pm-card-chg--pos { background: rgba(77, 158, 110, 0.12); color: var(--gain); }
.pm-card-chg--neg { background: rgba(176, 82, 82, 0.12); color: var(--loss); }
.pm-card-chg--flat { background: var(--bg-hover); color: var(--text-muted); }
.pm-card-ctx {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    font-size: 13px;
    font-family: var(--font-sans);
    line-height: 1.65;
    color: var(--text-secondary);
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
}
.pm-card-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}
.pm-card-resolve {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}
.pm-card-link {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--neon-cyan);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.stream-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 16px;
    margin-top: 8px;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.stream-detail-pair {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    padding: 2px 0;
}

.stream-detail-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.stream-detail-value {
    font-size: 12px;
    color: var(--text-primary);
    font-weight: 500;
    font-family: var(--font-mono);
    text-align: right;
}

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   Markets Dashboard â€” Navigation & Layout
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */

/* â”€â”€ Header Row (search + breadcrumb) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.header-row {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    justify-content: center;
}

/* Breadcrumb bar: top of markets-main, right-aligned */
.breadcrumb-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 6px 24px;
    background: transparent;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    white-space: nowrap;
    flex-shrink: 0;
}

.breadcrumb-item {
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
}

.breadcrumb-item:hover {
    color: var(--neon-cyan);
    text-decoration: none;
}

.breadcrumb-item.active {
    color: var(--text-primary);
    font-weight: 600;
    cursor: default;
}

.breadcrumb-sep {
    color: var(--text-muted);
    opacity: 0.5;
    font-size: 14px;
}

/* â”€â”€ Markets Sidebar â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.markets-sidebar {
    width: 190px;
    min-width: 190px;
    border-right: 1px solid var(--border);
    background: var(--bg-sidebar);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 53px;  /* below header */
    height: calc(100vh - 53px);
    overflow-y: auto;
    transition: width 0.25s ease, min-width 0.25s ease;
    z-index: 50;
}

.markets-sidebar.collapsed {
    width: 48px;
    min-width: 48px;
}

.markets-sidebar.collapsed .sidebar-group-label,
.markets-sidebar.collapsed .sidebar-section-label,
.markets-sidebar.collapsed .sidebar-chevron {
    display: none;
}

.markets-sidebar.collapsed .sidebar-group-items {
    display: none !important;
}

.markets-sidebar.collapsed .sidebar-group-btn {
    justify-content: center;
    padding: 10px 4px;
}

/* Sidebar Toggle Button */
.sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
}

.sidebar-toggle:hover {
    color: var(--neon-cyan);
    background: var(--bg-hover);
}

/* Sidebar Market Tabs â†’ Two-level tree menu */
.sidebar-group {
    border-bottom: 1px solid rgba(0, 240, 255, 0.04);
}

.sidebar-group-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 14px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
}

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

.sidebar-group-btn.active {
    background: none;
}

.sidebar-group-btn.active .sidebar-group-icon {
    color: var(--neon-cyan);
}

.sidebar-group-btn.active .sidebar-group-label {
    color: var(--text-muted);
}

.sidebar-group-icon {
    width: 18px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: inherit;
}

.sidebar-group-label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-chevron {
    flex-shrink: 0;
    transition: transform 0.2s ease;
    opacity: 0.4;
}

.sidebar-group.open .sidebar-chevron {
    transform: rotate(180deg);
    opacity: 0.7;
}

.sidebar-group-items {
    padding-bottom: 4px;
    background: rgba(0, 240, 255, 0.04);
    border-radius: 0 0 6px 6px;
}

/* Sidebar Section Links (nested subsections) */
.sidebar-sections {
    flex: 1;
    overflow-y: auto;
    padding: 4px 0;
}

.sidebar-section-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px 7px 28px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 12px;
    font-weight: 400;
    transition: var(--transition);
    border-left: 2px solid transparent;
}

.sidebar-section-link:hover {
    color: var(--text-secondary);
    background: var(--bg-hover);
    text-decoration: none;
}

.sidebar-section-link.active {
    color: var(--neon-cyan);
    border-left-color: var(--neon-cyan);
    background: rgba(0, 240, 255, 0.04);
    font-weight: 500;
}

.sidebar-section-icon {
    font-size: 14px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-section-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* â”€â”€ Markets Main Content â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.markets-main {
    flex: 1;
    min-width: 0;
    min-height: 0; /* required so this flex child can scroll instead of growing */
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    scrollbar-width: none;
}

.markets-main::-webkit-scrollbar { display: none; }

#markets-content {
    padding: 24px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* Market tab content visibility */
.market-tab-content {
    display: none;
}

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

/* â”€â”€ Market Sections â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.market-section {
    margin-bottom: 32px;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--border);
}

.market-section:has([id$="-ai"]:not([hidden]) .opt-scroll:last-child > .opt-table > tbody:empty) {
    border-bottom: none;
}

.market-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.section-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-body {
    min-height: 120px;
}

.section-loading {
    padding: 20px 0;
}

/* Overview sub-blocks (grouped within a single section) */
.overview-block {
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(0, 240, 255, 0.06);
}

.overview-block:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

/* Section sub-tabs (Flow, Segments) */
.flow-sub-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    padding: 4px;
    background: rgba(0, 240, 255, 0.03);
    border-radius: var(--radius-md);
    border: 1px solid rgba(0, 240, 255, 0.06);
}

.flow-tab {
    padding: 6px 14px;
    background: none;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.flow-tab:hover {
    color: var(--text-secondary);
    background: var(--bg-hover);
}

.flow-tab.active {
    color: var(--neon-cyan);
    background: rgba(0, 240, 255, 0.08);
    font-weight: 600;
}

/* â”€â”€ Index Cards â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.index-cards {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-top: 10px;
    margin-bottom: 0;
}

.index-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 14px 10px;
    font-family: var(--font-sans);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow: hidden;
}

.index-card:hover {
    border-color: rgba(0, 240, 255, 0.2);
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.05);
}

.index-card.active {
    border-color: rgba(0, 240, 255, 0.35);
    background: rgba(0, 240, 255, 0.04);
    box-shadow: 0 0 16px rgba(0, 240, 255, 0.08);
}

.index-card-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.index-card-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    flex-shrink: 0;
}

.index-card-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.index-card-symbol {
    font-size: 10px;
    color: var(--text-muted);
}

.index-card-change {
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
}

.index-card-change.gain { color: var(--gain); }
.index-card-change.loss { color: var(--loss); }

.index-card-periods {
    display: flex;
    gap: 6px;
    font-size: 9px;
    color: var(--text-muted);
}

/* â”€â”€ Heatmap Grid â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.heatmap-index-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.heatmap-index-bar #heatmap-index-toggle {
    margin-bottom: 0;
    flex: 1 1 auto;
    min-width: 0;
}
.heatmap-breadth-row {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 0 1 auto;
    min-width: 0;
}
.heatmap-breadth {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    font-size: 11px;
    font-weight: 600;
    font-family: var(--font-mono);
    letter-spacing: 0.02em;
}
.heatmap-breadth[hidden] { display: none; }
.heatmap-meter {
    display: grid;
    grid-template-columns: auto 96px;
    column-gap: 6px;
    row-gap: 3px;
    align-items: center;
}
.heatmap-meter .heatmap-meter-name { grid-column: 1; grid-row: 2; }
.heatmap-meter .heatmap-breadth-pcts { grid-column: 2; grid-row: 1; }
.heatmap-meter .heatmap-breadth-bar { grid-column: 2; grid-row: 2; width: 96px; }
.heatmap-meter-name {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 10px;
    letter-spacing: 0.04em;
}
.heatmap-breadth-meter {
    display: flex;
    flex-direction: column;
    gap: 3px;
    width: 96px;
}
.heatmap-breadth-pcts {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    line-height: 1;
}
.heatmap-breadth-bar {
    display: flex;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    overflow: hidden;
    background: var(--border);
}
.heatmap-breadth-up { background: #4d9e6e; height: 100%; }
.heatmap-breadth-down { background: var(--loss); height: 100%; }
.heatmap-breadth-up-n { color: #4d9e6e; }
.heatmap-breadth-down-n { color: var(--loss); }
.heatmap-breadth-empty { color: var(--text-muted); font-weight: 500; }
.heatmap-stats {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
    margin: 0;
    font-size: 11px;
    font-weight: 600;
    font-family: var(--font-mono);
    color: var(--text);
}
.heatmap-stats[hidden] { display: none; }
.heatmap-valuation {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.heatmap-stat-k { color: var(--text-muted); font-weight: 500; margin-right: 4px; }
.heatmap-stat-neg { color: var(--text-muted); font-weight: 500; font-size: 9px; }

.heatmap-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 6px;
}

.heatmap-sector {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px;
    text-align: center;
    transition: var(--transition);
    cursor: default;
}

.heatmap-sector.gain {
    background: rgba(0, 200, 83, 0.06);
    border-color: rgba(0, 200, 83, 0.15);
}

.heatmap-sector.loss {
    background: rgba(255, 68, 68, 0.06);
    border-color: rgba(255, 68, 68, 0.15);
}

.heatmap-sector-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.heatmap-sector-pct {
    font-size: 16px;
    font-weight: 700;
}

.heatmap-sector-pct.gain { color: var(--gain); }
.heatmap-sector-pct.loss { color: var(--loss); }

.heatmap-sector-count {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* â”€â”€ Movers Table â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.movers-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
    padding: 4px;
    background: rgba(0, 240, 255, 0.03);
    border-radius: var(--radius-md);
    border: 1px solid rgba(0, 240, 255, 0.06);
}


/* Sort header cursor — pointer, no text selection */
.movers-th-sort,
.cal-th-sort {
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}

.cal-date-header {
    cursor: default;
    user-select: none;
    -webkit-user-select: none;
}

.movers-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
}

.movers-table th {
    text-align: left;
    padding: 7px 8px;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
}

.movers-table td {
    padding: 7px 8px;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(0, 240, 255, 0.03);
}

.movers-table tr:hover td {
    background: var(--bg-hover);
}

.mover-symbol {
    font-weight: 600;
    color: var(--neon-cyan) !important;
}

.world-index-table td, .world-index-table th {
    padding: 7px 8px;
    font-size: 12.5px;
}


.mover-name {
    color: var(--text-muted) !important;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

td.gain, .gain { color: var(--gain) !important; }
td.loss, .loss { color: var(--loss) !important; }

/* â”€â”€ News Feed â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.news-feed {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.news-item {
    display: flex;
    gap: 14px;
    padding: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: var(--transition);
}

.news-item:hover {
    border-color: rgba(0, 240, 255, 0.2);
    text-decoration: none;
}

.news-thumb {
    width: 80px;
    height: 56px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.news-body {
    flex: 1;
    min-width: 0;
}

.news-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-meta {
    display: flex;
    gap: 10px;
    font-size: 11px;
    color: var(--text-muted);
}

.news-ticker {
    color: var(--neon-cyan);
    font-weight: 600;
}

.news-desc {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.4;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-type-badge {
    display: inline-flex;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(0, 240, 255, 0.08);
    color: var(--neon-cyan);
    border: 1px solid rgba(0, 240, 255, 0.15);
}


/* ═══════════════════════════════════════════════════════════════════════
   NEWS WALL — Metro Tile Layout v2
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Ticker bar at TOP ─────────────────────────────────────────── */
.nw-ticker-bar {
    width: 100%;
    height: 46px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    overflow: hidden;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    position: relative;
    margin-bottom: 8px;
    border-radius: 4px 4px 0 0;
}

/* Wrapper clips the scrolling track without constraining its width */
.nw-ticker-wrapper {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    height: 100%;
    display: flex;
    align-items: center;
}

.nw-ticker-track {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    animation: nw-scroll 480s linear infinite;
    /* No flex:1, no overflow — let the wrapper clip */
}

@keyframes nw-scroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

.nw-tb-ticker {
    font-size: 15px;
    font-weight: 900;
    margin-right: 6px;
    letter-spacing: 0.05em;
    padding: 2px 6px;
    border: 1px solid;
    border-radius: 3px;
    flex-shrink: 0;
    transition: background 0.15s, box-shadow 0.15s, opacity 0.15s;
    cursor: pointer;
}

.nw-tb-ticker:hover {
    brightness: 1.3;
    opacity: 0.85;
    background: rgba(255,255,255,0.12) !important;
    box-shadow: 0 0 8px currentColor;
    transition: all 0.15s;
}

.nw-tb-text {
    font-size: 15px;
    color: var(--text-secondary);
    margin-right: 8px;
}

.nw-tb-sep {
    font-size: 9px;
    color: var(--text-muted);
    margin: 0 14px;
    flex-shrink: 0;
}


/* Right side of ticker bar: timestamp + reload */
.nw-bar-right {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 8px 0 6px;
    flex-shrink: 0;
    background: var(--bg-primary);
    height: 100%;
}

/* "Last Updated" inline timestamp */
.nw-last-updated {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    white-space: nowrap;
}

/* Reload button */
.nw-reload-btn { display: none; /* hidden */

    background: none;
    border: 1px solid rgba(0,229,255,0.2);
    border-radius: 4px;
    color: rgba(0,229,255,0.55);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    transition: color 0.2s, border-color 0.2s, transform 0.2s;
    flex-shrink: 0;
}
.nw-reload-btn:hover {
    color: var(--neon-cyan, #00e5ff);
    border-color: rgba(0,229,255,0.5);
    transform: rotate(30deg);
}
.nw-reload-btn.nw-reload-spinning svg {
    animation: nw-spin 0.8s linear infinite;
}
@keyframes nw-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* ── Outer layout: ruler | tile grid ───────────────────────────── */
.nw-layout {
    display: flex;
    gap: 0;
    width: 100%;
    position: relative;
    min-height: 600px;
}

/* ── Relative-time Ruler ────────────────────────────────────────── */
.nw-timeline {
    width: 56px;
    flex-shrink: 0;
    align-self: flex-start;
    padding: 0;
    border-right: none;
    margin-right: 0;
    display: block;
    overflow: visible;
}

/* Simple thin vertical line — no glow */
.nw-timeline::before {
    content: '';
    position: absolute;
    right: 4px;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--border);
    opacity: 1;
}

/* Each tick row */
.nw-tl-tick {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 10px 10px 10px 6px;
    position: relative;
    cursor: default;
    flex: 1;
}

/* Horizontal tick mark — plain */
.nw-tl-mark {
    position: absolute;
    right: 0;
    width: 6px;
    height: 1px;
    background: var(--text-muted);
}

.nw-tl-tick--now .nw-tl-mark {
    width: 10px;
    background: var(--text-secondary);
}

/* Time label */
.nw-tl-label {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.02em;
    white-space: nowrap;
    text-align: right;
    flex: 1;
}

.nw-tl-tick--now .nw-tl-label {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 15px;
}

/* Count badge — hidden */
.nw-tl-count {
    display: none;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-hover);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0 5px;
    min-width: 16px;
    text-align: center;
    margin-right: 2px;
}

/* ── Tile Grid ─────────────────────────────────────────────────── */
.nw-wall {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-auto-rows: 160px;
    gap: 4px;
    align-content: start;
    margin-left: 4px;
}

/* ── Individual Tile ───────────────────────────────────────────── */
.nw-tile {
    display: block;
    position: relative;
    overflow: hidden;
    border-radius: 3px;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}
.nw-tile:hover {
    transform: scale(1.025);
    box-shadow: 0 8px 32px rgba(0,0,0,0.6);
    filter: brightness(1.1);
    z-index: 2;
}
html[data-theme="light"] .nw-tile:hover {
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
    filter: none;
}

.nw-tile-bg {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 9px;
}


/* Keep content above the scrim */
.nw-tile-top,
.nw-tile-bottom {
    position: relative;
    z-index: 1;
}


.nw-tile--hero .nw-tile-title { font-size: 15px; line-height: 1.35; }
.nw-tile--wide .nw-tile-title { font-size: 15px; line-height: 1.35; }
.nw-tile--tall .nw-tile-title { font-size: 15px; line-height: 1.35; }

.nw-tile-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
}

.nw-ticker-badge {
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0.06em;
    border: 1px solid;
    border-radius: 4px;
    padding: 4px 10px;
    text-transform: uppercase;
    white-space: nowrap;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    transition: opacity 0.15s;
    flex-shrink: 0;
}
.nw-ticker-badge:hover { opacity: 0.75; }

.nw-time {
    font-size: 15px;
    color: rgba(255,255,255,0.6);
    white-space: nowrap;
    margin-left: auto;
}
html[data-theme="light"] .nw-time {
    color: var(--text-muted);
}

.nw-tile-bottom {
    display: flex;
    flex-direction: column;
    gap: 3px;
    background: rgba(5, 10, 20, 0.62);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border-radius: 6px;
    padding: 6px 8px;
    margin: 0 -2px -2px;
}
html[data-theme="light"] .nw-tile-bottom {
    background: rgba(255, 255, 255, 0.9);
}


.nw-tile-title {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-shadow: 0 1px 5px rgba(0,0,0,0.7);
}
html[data-theme="light"] .nw-tile-title {
    color: var(--text-primary);
    text-shadow: none;
}
.nw-tile--hero .nw-tile-title { -webkit-line-clamp: 5; }
.nw-tile--tall .nw-tile-title { -webkit-line-clamp: 5; }

.nw-tile-src {
    font-size: 9px;
    font-weight: 600;
    color: rgba(255,255,255,0.4);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
html[data-theme="light"] .nw-tile-src {
    color: var(--text-muted);
}
.nw-tile--photo .nw-tile-bg {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}
.nw-tile--photo .nw-tile-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(5, 10, 20, 0.05) 20%, rgba(5, 10, 20, 0.88) 100%);
    pointer-events: none;
}
html[data-theme="light"] .nw-tile--photo .nw-tile-bg::before {
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.12) 28%, rgba(244, 246, 248, 0.94) 100%);
}

/* ── Section overrides ─────────────────────────────────────────── */
#section-news .section-title { margin-bottom: 6px; }
#section-news .section-body  { padding: 0; overflow: visible; }

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .nw-wall { grid-template-columns: repeat(5, 1fr); }
    .nw-timeline { display: none; }
}
@media (max-width: 540px) {
    .nw-wall { grid-template-columns: repeat(2, 1fr); }
}

/* ── Flow Sub-Tabs ────────────────────────────────────────────────────── */
.flow-sub-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.flow-tab {
    padding: 7px 18px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(255,255,255,0.10);
    background: transparent;
    color: var(--text-muted);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.02em;
}
.flow-tab:hover {
    background: rgba(255,255,255,0.05);
    color: var(--text-secondary);
    border-color: rgba(255,255,255,0.18);
}
.flow-tab.active {
    background: rgba(0,229,255,0.08);
    color: var(--neon-cyan);
    border-color: rgba(0,229,255,0.4);
}

/* Flow search input */
.flow-search.fin-col-search {
    /* 4px matches .period-toggle padding, so the field starts on Annual and ends on TTM */
    width: 0;
    min-width: calc(100% - 8px);
    margin: 0 0 0 4px;
    padding: 6px 10px;
    font-size: 12px;
    box-sizing: border-box;
}
.fin-toolbar-end:has(#fin-period-toggle[style*="display: none"]) > .fin-col-search,
.fin-toolbar-end:has(#fin-period-toggle[style*="display:none"]) > .fin-col-search {
    grid-column: 2;
    grid-row: 1;
    width: 220px;
    min-width: 220px;
    margin: 0;
}
.flow-search {
    width: 100%;
    padding: 10px 16px 10px 40px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s ease, background 0.2s ease;
    margin-bottom: 20px;
    box-sizing: border-box;
}
.flow-search:focus {
    border-color: rgba(0,229,255,0.4);
    background: rgba(255,255,255,0.06);
}
.flow-search::placeholder {
    color: var(--text-muted);
}

/* Flow stat card */
.flow-stat {
    flex: 1;
    min-width: 150px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
}
html[data-theme="light"] #section-funds .flow-stat {
    background: transparent;
}
.fund-quarter-select {
    padding: 6px 10px;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    background: rgba(255,255,255,0.04);
    color: var(--text-secondary);
    font-size: 15px;
    font-family: var(--font-sans);
    cursor: pointer;
    outline: none;
}
.fund-quarter-select option {
    background: #181825;
    color: var(--text-secondary);
}
.fund-name-link:hover {
    color: var(--neon-cyan) !important;
    text-decoration: underline;
}
.fund-two-col-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 20px;
}
.fund-two-col-grid.fund-two-col-grid--even {
    grid-template-columns: 1fr 1fr;
}
@media (max-width: 768px) {
    .fund-two-col-grid,
    .fund-two-col-grid.fund-two-col-grid--even {
        grid-template-columns: 1fr;
    }
}

.flow-stat-label {
    font-size: 20px;
    color: var(--text-primary);
    margin-bottom: 12px;
    font-weight: 600;
    font-family: var(--font-sans);
}
.flow-stat-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    font-family: var(--font-mono);
    line-height: 1;
}
.flow-stat-sub {
    font-size: 11.5px;
    font-weight: 500;
    color: var(--text-muted);
    margin-top: 6px;
}


/* -- Market Tape ---------------------------------------------------------------- */
.market-tape-wrap {
    overflow: hidden;
    position: relative;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--bg-card);
    padding: 10px 0;
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 5%, black 95%, transparent 100%);
    mask-image: linear-gradient(to right, transparent 0%, black 5%, black 95%, transparent 100%);
}

.market-tape-track {
    display: flex;
    gap: 10px;
    width: max-content;
    animation: tape-scroll linear infinite;
    padding: 0 10px;
}

.market-tape-track:hover {
    animation-play-state: paused;
}

@keyframes tape-scroll {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.tape-card {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 13px 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    min-width: 180px;
    max-width: 200px;
    cursor: pointer;
    flex-shrink: 0;
    transition: border-color 0.2s ease;
    font-family: var(--font-sans);
}

.tape-card:hover {
    border-color: rgba(0, 240, 255, 0.2);
}

.tape-card-header {
    display: flex;
    align-items: center;
    gap: 6px;
}

.tape-card-logo {
    width: 42px;
    height: 42px;
    border-radius: 4px;
    object-fit: contain;
    background: white;
    flex-shrink: 0;
}

.tape-card-sym {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
}

.tape-card-name {
    font-size: 15px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tape-card-bottom {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
}

.tape-card-price {
    font-size: 15px;
    font-weight: 300;
    color: var(--text-primary);
    white-space: nowrap;
}

.tape-card-chg {
    font-size: 14px;
    font-weight: 300;
    white-space: nowrap;
}

/* Inner scrollport so Overview / movers tables swipe on a phone
   instead of squeezing (same idea as .opt-scroll). */
.mkt-scroll {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
}
.mkt-scroll .movers-table,
.mkt-scroll .world-index-table,
#world-table-wrap .movers-table,
#world-table-wrap .world-index-table {
    width: max-content;
    min-width: 100%;
}
#section-overview,
#overview-tape,
#world-table-wrap {
    min-width: 0;
    max-width: 100%;
}
#world-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
}

/* -- Movers Table Redesign ---------------------------------------------------- */
.movers-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-sans);
}

.movers-table thead th {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 7px 8px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.movers-th-sort:hover { color: var(--text-secondary); }

.mover-row {
    border-bottom: 1px solid var(--border);
    transition: background 0.15s ease;
}

.mover-row:hover { background: var(--bg-hover); }
.mover-row.is-selected { background: var(--bg-hover); }
.mover-row:last-child { border-bottom: none; }

/* Logo cell */
.mover-logo-cell { padding: 10px 8px 10px 12px; width: 52px; }

.mover-logo-wrap {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--border);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mover-logo-img {
    width: 38px;
    height: 38px;
    object-fit: contain;
    display: block;
}

.mover-logo-init {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0;
}

/* Identity: name + ticker stacked */
.mover-identity {
    padding: 7px 8px;
    display: table-cell;
    vertical-align: middle;
}

.mover-name-text {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 240px;
}

.mover-sym-text {
    display: block;
    font-size: 12px;
    font-weight: 400;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Price, % change, volume cells */
.mover-price-cell {
    padding: 7px 8px;
    text-align: right;
    font-size: 12.5px;
    font-weight: 300;
    color: var(--text-primary);
    white-space: nowrap;
}

.mover-pct-cell {
    padding: 7px 8px;
    text-align: right;
    font-size: 12.5px;
    font-weight: 400;
    white-space: nowrap;
}

.mover-vol-cell {
    padding: 7px 8px;
    text-align: right;
    font-size: 12.5px;
    color: var(--text-muted);
    white-space: nowrap;
}

/* -- Movers 3-column side-by-side grid ------------------------------------- */
.movers-panels-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    align-items: start;
}

.movers-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}

.movers-panel-header {
    padding: 12px 16px 10px;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.01em;
    border-bottom: 1px solid var(--border);
    background: rgba(0, 240, 255, 0.03);
}

/* Compact variants for use inside the narrower 3-col panels */
.movers-table--compact thead th {
    font-size: 11px;
    padding: 7px 8px;
}
.movers-table .movers-sort-badge {
    font-size: 11px;
    padding: 0;
}

/* Sort-direction badge on the active column header (▼ 1D) */
.movers-sort-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary);
    transition: background 0.15s, color 0.15s;
}

.movers-sort-badge.active {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.mover-logo-cell--sm {
    padding: 7px 6px 7px 10px !important;
    width: 36px !important;
}

.mover-logo-wrap--sm {
    width: 30px !important;
    height: 30px !important;
    border-radius: 6px !important;
}

.mover-logo-init--sm {
    width: 30px !important;
    height: 30px !important;
    font-size: 11px !important;
}

.mover-identity--sm {
    padding: 7px 8px !important;
}

.mover-name-text--sm {
    font-size: 12.5px !important;
    max-width: 160px !important;
}

.mover-price-cell--sm {
    padding: 7px 8px !important;
    font-size: 12.5px !important;
}

.mover-pct-cell--sm {
    padding: 7px 8px !important;
    font-size: 12.5px !important;
}

/* World index table: name cell fills remaining space, % chips don't wrap */
.world-index-table td { vertical-align: middle; }
.world-index-table .mover-identity--sm { width: auto; }
.world-index-table .mover-pct-cell--sm { font-size: 12.5px !important; }

/* Region group separator row */
.world-group-row td {
    background: var(--bg-hover);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 8px 14px;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-primary);
    cursor: pointer;
}

/* Economy Indicators: 15-col desk — keep chrome smaller than the prints */
#econ-table-wrap .movers-table thead th {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.04em;
    padding: 6px 6px;
}
#econ-table-wrap .movers-sort-badge {
    font-size: 11px;
    font-weight: 500;
    padding: 1px 5px;
}
#econ-table-wrap .world-group-row td {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    padding: 5px 10px;
}
#econ-table-wrap .econ-indicators-table td:nth-child(2),
#econ-table-wrap .econ-indicators-table th:nth-child(2) {
    min-width: 220px;
}



/* Tape card: base border + smooth glow-fade transition */
.tape-card {
    border: 1px solid transparent;
    border-radius: 8px;
    transition: box-shadow 0.8s ease, border-color 0.8s ease;
}


/* Suppress jsvectormap's built-in purple country tooltip */
.jvm-tooltip { display: none !important; }

/* Period selector + jsvectormap zoom buttons */

#world-period-toggle .chart-period-btn {
    font-size: 15px;
    font-family: var(--font-sans);
}

.jvm-zoom-btn {
    font-size: 18px !important;
    font-family: var(--font-sans) !important;
    font-weight: 500 !important;
    line-height: 1 !important;
    width: 32px !important;
    height: 32px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    background: var(--bg-elevated) !important;
    border: 1px solid var(--border) !important;
    color: var(--text-primary) !important;
}

.jvm-zoom-btn.jvm-zoomin  { top: 10px !important; }
.jvm-zoom-btn.jvm-zoomout { top: 48px !important; }

/* Flag emoji rendered inside the stock-logo-style square box */
.world-flag-box {
    background: var(--bg-card) !important;
    border: 1px solid var(--border) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px;
}

.world-flag-emoji {
    font-size: 20px;
    line-height: 1;
    display: block;
}


@media (max-width: 860px) {
    .movers-panels-grid {
        grid-template-columns: 1fr;
    }
}

/* -- Index Cards (sparkline design) ---------------------------------------- */
.index-cards {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-bottom: 0;
}

.index-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 16px 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: border-color 0.4s ease, background 0.15s ease;
    overflow: hidden;
}

.index-card:hover { background: var(--bg-hover, rgba(255,255,255,0.04)); }

.ic-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 6px;
}

.ic-name {
    font-size: 18px;
    font-weight: 600;
    font-family: var(--font-sans);
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ic-pct {
    font-size: 18px;
    font-weight: 500;
    font-family: var(--font-sans);
    white-space: nowrap;
    flex-shrink: 0;
}

.ic-mid {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 6px;
}

.ic-price {
    font-size: 15px;
    font-weight: 300;
    font-family: var(--font-sans);
    color: var(--text-primary);
}

.ic-delta {
    font-size: 15px;
    font-weight: 400;
    font-family: var(--font-sans);
    white-space: nowrap;
}

.ic-spark {
    margin: 6px -16px -10px -16px;  /* bleed past card padding on all sides */
    line-height: 0;
    border-radius: 0 0 10px 10px;
    overflow: hidden;
}

.ic-spark svg { width: 100%; height: 36px; display: block; }

/* Tape card row layout: logo left, identity right */
.tape-card-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.tape-card-identity {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Currency Matrix — Premium Glass Design
   ═══════════════════════════════════════════════════════════════════════════ */

.fx-matrix-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.fx-matrix-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-sans);
    table-layout: fixed;
    min-width: 800px;
}

.fx-matrix-corner {
    width: 80px;
    background: var(--bg-header);
    border-bottom: 1px solid var(--border);
    border-right: 1px solid var(--border);
}

.fx-matrix-header-cell {
    padding: 10px 4px;
    text-align: center;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: var(--bg-header);
    border-bottom: 1px solid var(--border);
    border-right: 1px solid var(--border);
    white-space: nowrap;
}

.fx-matrix-header-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.fx-matrix-row-header {
    padding: 8px 10px;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: var(--bg-header);
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    position: sticky;
    left: 0;
    z-index: 2;
}

.fx-matrix-row-header .fx-matrix-header-inner {
    flex-direction: row;
    gap: 6px;
}

.fx-matrix-cell {
    padding: 8px 6px;
    text-align: center;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    transition: background 0.2s ease, transform 0.15s ease;
    cursor: default;
    position: relative;
}

.fx-matrix-cell:hover {
    background: var(--bg-hover) !important;
    z-index: 1;
}

.fx-matrix-rate {
    font-size: 15px;
    font-weight: 600;
    font-family: var(--font-sans);
    color: var(--text-primary);
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.fx-matrix-chg {
    font-size: 13px;
    font-weight: 500;
    line-height: 1.2;
    opacity: 0.85;
}

/* Diagonal cells — dark with subtle slash */
.fx-matrix-diag {
    background: var(--bg-hover) !important;
    cursor: default;
}

.fx-matrix-diag-line {
    display: block;
    width: 20px;
    height: 1px;
    background: var(--border);
    margin: 8px auto;
    transform: rotate(-45deg);
}

.fx-matrix-diag:hover {
    background: var(--bg-hover) !important;
}

/* Legend bar */
.fx-matrix-legend {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
    padding: 0 2px;
}

.fx-matrix-legend-bar {
    flex: 1;
    height: 10px;
    border-radius: 3px;
    background: linear-gradient(to right,
        rgb(196, 94, 94),
        #1e2028,
        rgb(93, 184, 127));
}
html[data-theme="light"] .fx-matrix-legend-bar {
    background: linear-gradient(to right,
        rgb(176, 82, 82),
        #c5cad3,
        rgb(45, 138, 88));
}

/* Responsive: smaller cells on narrow screens */
@media (max-width: 1100px) {
    .fx-matrix-table { min-width: 700px; }
    .fx-matrix-rate { font-size: 11px; }
    .fx-matrix-chg  { font-size: 9px; }
    .fx-matrix-cell { padding: 6px 4px; }
}


/* Source icon on cell hover */
.kf-src-icon { position: absolute; top: 2px; right: 2px; font-size: 11px; color: rgba(255,255,255,0.2); cursor: pointer; opacity: 0; transition: opacity 0.15s; line-height: 1; padding: 2px; }
td:hover .kf-src-icon { opacity: 1; color: rgba(0,180,220,0.7); }
.kf-src-icon:hover { color: rgba(0,200,240,1) !important; }
/* Tooltip source block (Perplexity-style) */
.kf-tip-source { margin-top: 10px; padding-top: 8px; border-top: 1px solid rgba(255,255,255,0.08); display: flex; gap: 10px; align-items: flex-start; }
.kf-badge-lg { padding: 4px 10px; font-size: 11px; min-width: 36px; text-align: center; }
.kf-tip-reported { font-size: 12px; color: var(--text-secondary); line-height: 1.6; }
/* Tooltip badge stack (filing type + section label) */
.kf-tip-badge-stack { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 50px; }
.kf-tip-section { font-size: 10px; color: rgba(255,255,255,0.35); text-align: center; line-height: 1.2; }
/* Cell hover highlight (border glow) */
.kf-cell-hover { outline: 1px solid rgba(255,255,255,0.25); outline-offset: -1px; background: rgba(255,255,255,0.04) !important; }
/* Input cells highlighted for computed rows (teal/cyan) */
.kf-cell-input { background: rgba(0,180,200,0.12) !important; outline: 1px solid rgba(0,180,200,0.3); outline-offset: -1px; }
/* Source icon repositioned LEFT of value */
.kf-src-icon { position: absolute; left: 4px; top: 50%; transform: translateY(-50%); display: flex; align-items: center; justify-content: center; width: 20px; height: 20px; font-size: 8px; font-weight: 700; font-family: var(--font-mono); color: rgba(255,255,255,0.2); cursor: pointer; opacity: 0; transition: opacity 0.15s; border: 1px solid rgba(255,255,255,0.15); border-radius: 50%; z-index: 2; }
td:hover .kf-src-icon { opacity: 1; color: rgba(0,240,255,0.9); border-color: rgba(0,240,255,0.4); text-shadow: 0 0 6px rgba(0,240,255,0.5); }
.kf-src-icon:hover { color: rgba(0,255,255,1) !important; border-color: rgba(0,255,255,0.6) !important; background: rgba(0,240,255,0.15); text-shadow: 0 0 8px rgba(0,255,255,0.7) !important; }

/* ── Integrated App Navigation & Responsive Styles ────────────────── */
.app-header {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 64px;
    background: var(--bg-header);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border); /* Horizontal line side to side */
    padding: 0 !important;
    display: flex !important;
    align-items: center;
    box-sizing: border-box;
    z-index: 1100;
}

.header-row {
    display: flex;
    align-items: center;
    width: 100%;
    height: 100% !important;
    gap: 12px;
}

.header-row .mobile-menu-toggle {
    flex-shrink: 0;
}

.header-row .search-container {
    flex: 1;
    max-width: 600px;
    margin: 0 auto;
}

/* Breadcrumbs inside header — positioned after logo + divider + hamburger */
.navbar-breadcrumb-container {
    display: flex;
    align-items: center;
    position: absolute;
    left: 130px;
}

/* Hide path before it collides with the centered search bar */
@media (max-width: 1200px) {
    .navbar-breadcrumb-container {
        display: none !important;
    }
}

/* Sidebar as a drawer underneath the header, no vertical border */
.app-sidebar {
    width: 260px !important;
    min-width: 260px !important;
    height: calc(100vh - 64px) !important;
    background: var(--bg-sidebar);
    border-right: none !important; /* No vertical line */
    display: flex !important;
    flex-direction: column;
    position: fixed;
    top: 64px;
    left: 0;
    z-index: 950;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 10px 10px 30px rgba(0, 0, 0, 0.4);
    box-sizing: border-box;
    padding-top: 12px;
}

.sidebar-sections {
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* Desktop: drawers overlay content — never resize .app-right */
@media (min-width: 769px) {
    .app-sidebar {
        transform: translateX(0);
    }

    body.sidebar-closed .app-sidebar {
        transform: translateX(-100%);
    }

    .app-right {
        padding-left: 0;
        padding-right: 0;
    }
}

/* Main app content area — no padding-top here, .app-body handles the 64px fixed header offset */
.app-right {
    margin-left: 0;
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    padding-top: 64px;
    box-sizing: border-box;
    overflow: hidden;
}

body.embedded .app-right {
    padding-top: 20px !important;
}

/* Subsection pills row — hidden per user preference */
.navbar-subsections-row {
    display: none !important;
}

.nav-subpill {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    padding: 6px 14px;
    border-radius: 20px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nav-subpill:hover {
    color: var(--text-primary);
    background: rgba(0, 240, 255, 0.03);
    border-color: rgba(0, 240, 255, 0.2);
}

.nav-subpill.active {
    color: #050a14;
    background: var(--neon-cyan);
    border-color: var(--neon-cyan);
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.4);
    font-weight: 600;
}

.nav-subpill-icon {
    font-size: 13px;
    display: flex;
    align-items: center;
}

/* Hamburger toggle button */
.mobile-menu-toggle {
    display: flex !important; /* Visible on desktop and mobile */
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    transition: all 0.2s ease;
}

.mobile-menu-toggle:hover {
    color: var(--neon-cyan);
    background: rgba(0, 240, 255, 0.05);
}

/* Fullscreen Mobile Menu Overlay */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--bg-primary);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.mobile-menu-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    height: 64px;
}

.mobile-menu-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-menu-close:hover {
    color: var(--loss);
    background: rgba(255, 255, 255, 0.05);
}

.mobile-menu-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.mobile-menu-nav {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Tree Navigation elements */
.nav-tree-group {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.nav-tree-category {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 12px 20px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
    gap: 12px;
}

.nav-tree-category:hover {
    color: var(--text-secondary);
    background: var(--bg-hover);
}

.nav-tree-category.active {
    color: var(--neon-cyan);
    background: rgba(0, 242, 254, 0.03);
}

.nav-tree-icon {
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.nav-tree-chevron {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    font-size: 11px;
    line-height: 1;
    color: var(--text-secondary);
    opacity: 0.85;
    border-radius: 4px;
    flex-shrink: 0;
    transform: rotate(-90deg);
    transform-origin: center center;
    transition: transform 0.15s ease, opacity 0.15s ease, color 0.15s ease;
}

.nav-tree-group.open .nav-tree-chevron {
    transform: rotate(0deg);
}

.nav-tree-chevron:hover {
    opacity: 1;
    color: var(--text-primary);
    background: var(--bg-hover);
}

.nav-tree-subsections {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 4px 0;
    background: var(--bg-hover);
}

.nav-tree-sub-divider {
    height: 1px;
    background: linear-gradient(90deg, rgba(0, 242, 254, 0.15), transparent);
    width: 80%;
    margin: 6px auto;
}

.nav-tree-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text-secondary);
    padding: 8px 36px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nav-tree-item:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
}

.nav-tree-item.active {
    color: var(--neon-cyan);
    font-weight: 600;
    background: rgba(0, 240, 255, 0.05);
}

.nav-tree-sub-icon {
    font-size: 13px;
    display: flex;
    align-items: center;
}

.nav-tree-load-more {
    color: var(--neon-cyan);
    opacity: 0.75;
    font-style: italic;
}

.nav-tree-load-more:hover {
    opacity: 1;
    background: rgba(0, 240, 255, 0.05);
}

/* ── Flow: Sector Filter Bar ─────────────────────────────────────────── */
.flow-sector-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding: 2px 0 6px;
    flex-wrap: nowrap;
}
.flow-sector-bar::-webkit-scrollbar { display: none; }

.flow-sector-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font-sans);
    font-size: 12px;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.flow-sector-pill:hover {
    color: var(--text-primary);
    border-color: rgba(0, 240, 255, 0.3);
    background: rgba(0, 240, 255, 0.04);
}

.flow-sector-pill.active {
    color: var(--neon-cyan);
    border-color: var(--neon-cyan);
    background: rgba(0, 240, 255, 0.08);
    box-shadow: 0 0 8px rgba(0, 240, 255, 0.15);
}

.flow-sector-count {
    font-size: 10px;
    font-family: var(--font-mono);
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.06);
    padding: 1px 5px;
    border-radius: 8px;
    line-height: 1.3;
}

.flow-sector-pill.active .flow-sector-count {
    color: var(--neon-cyan);
    background: rgba(0, 240, 255, 0.12);
}

@media (max-width: 768px) {
    .app-sidebar {
        display: none !important;
    }
    
    .app-right {
        padding-left: 0 !important;
    }
    
    .app-header {
        padding: 0 !important;
    }
    
    .search-dropdown {
        position: fixed !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        width: 100vw !important;
        max-width: 100vw !important;
        top: 64px !important;
        border-radius: 0 !important;
        box-sizing: border-box !important;
        max-height: calc(100vh - 64px) !important;
        margin-top: 0 !important;
    }
    
    .wl-search-dropdown,
    [id$="-search-dd"] {
        position: absolute !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        width: 100vw !important;
        max-width: 100vw !important;
        border-radius: 0 !important;
        border-left: none !important;
        border-right: none !important;
        box-sizing: border-box !important;
        z-index: 1200 !important;
    }
    
    .mobile-menu-toggle {
        display: flex;
        margin-right: 4px;
    }
    
    #markets-content {
        padding: 12px;
    }
    
    .main-content {
        padding: 12px;
    }

    .ticker-sticky {
        margin-left: -12px;
        margin-right: -12px;
        padding: 0 12px;
    }

    /* Index cards: 1 per line on mobile */
    .index-cards {
        grid-template-columns: 1fr !important;
        gap: 8px;
    }
    /* Overview tape: SPX / NDX / Dow / RUT two-across; odd leftover (VIX) spans the row */
    #section-indexes-body .index-cards {
        grid-template-columns: 1fr 1fr !important;
    }
    #section-indexes-body .index-cards > .index-card:last-child:nth-child(odd) {
        grid-column: 1 / -1;
    }

    /* Tables: horizontal scroll on mobile */
    .world-indexes,
    .overview-block,
    .market-section {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .world-index-table,
    .movers-table,
    table {
        min-width: 600px;
    }

    .world-index-table td, .world-index-table th {
        padding: 7px 8px;
        font-size: 12.5px;
        white-space: nowrap;
    }

    /* Calendar: day cards — swipeable carousel, 1 visible at a time */
    .cal-days {
        display: flex !important;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 8px;
        padding-bottom: 4px;
    }
    .cal-days::-webkit-scrollbar { display: none; }

    .cal-day-card {
        flex: 0 0 100%;
        scroll-snap-align: center;
        box-sizing: border-box;
    }

    /* Calendar: nav row wraps */
    .cal-nav {
        flex-wrap: wrap;
        gap: 6px;
    }
    .cal-week-label {
        font-size: 16px;
    }

    /* Calendar: tabs row wraps */
    .cal-tabs-row {
        flex-wrap: wrap;
        gap: 8px;
    }
    .cal-list-search-wrap {
        flex: 1 1 100%;
        max-width: none;
        order: 3;
    }

    /* Calendar: table scrolls horizontally — match world-index-table pattern */
    .cal-table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .cal-table-wrap::-webkit-scrollbar { display: none; }
    .cal-table {
        /* Override fixed layout — let table expand to content width */
        table-layout: auto !important;
        width: max-content !important;
        min-width: 1050px;
    }
    .cal-table td, .cal-table th {
        padding: 7px 8px;
        font-size: 12.5px;
        white-space: nowrap;
        overflow: visible;
    }
    .cal-company {
        max-width: 200px;
    }

    /* Prediction cards & movers panels: 1 per line on mobile — all sections */
    .movers-panels-grid,
    [id^="pm-grid-"],
    #predictions-grid,
    #stock-predictions-grid,
    [id$="-predictions-body"] > div[style*="grid"],
    [id$="-predictions-body"] > div > div[style*="grid"] {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    /* Flow section: swipeable carousel, 1 column at a time */
    #section-funds-body > div[style*="grid-template-columns"],
    #section-funds-body div[style*="repeat(4"] {
        display: flex !important;
        overflow-x: auto !important;
        scroll-snap-type: x mandatory !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
        gap: 10px !important;
        padding-bottom: 6px;
    }
    #section-funds-body > div[style*="grid-template-columns"]::-webkit-scrollbar,
    #section-funds-body div[style*="repeat(4"]::-webkit-scrollbar {
        display: none;
    }

    #section-funds-body .flow-stat {
        flex: 0 0 100% !important;
        scroll-snap-align: center;
        box-sizing: border-box;
    }

    /* ── Segments / Screener mobile ──────────────────────────── */

    /* Stack the two-column layout (pills left, controls right) vertically */
    #section-segments-body > div[style*="display:flex"][style*="gap:16px"] {
        flex-direction: column !important;
        gap: 12px !important;
    }

    /* Controls row: full width on top */
    #section-segments-body > div[style*="display:flex"][style*="gap:16px"] > div[style*="min-width:160px"] {
        width: 100% !important;
        min-width: 0 !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
    }

    /* Filter pills: smaller on mobile */
    .scr-pill-wrap button,
    #section-segments-body button[style*="border-radius:20px"] {
        font-size: 13px !important;
        padding: 5px 10px !important;
    }

    .scr-ai-expand-btn {
        font-size: 13px !important;
        padding: 8px 14px !important;
    }

    /* Screener data table: horizontal scroll */
    #scr-table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    #scr-table-wrap table {
        min-width: 700px;
    }

    /* ── Filter panel: full-screen modal on mobile ──────────────── */
    #scr-filter-overlay {
        top: 0 !important;         /* cover header too */
    }
    #scr-filter-drop {
        top: 0 !important;         /* full viewport from top */
        left: 0 !important;
        right: 0 !important;
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100dvh !important; /* dynamic viewport height — handles mobile browser chrome */
        border-left: none !important;
        border-radius: 0 !important;
        z-index: 2000 !important;
    }
    /* Safe-area padding at bottom for phones with home indicator */
    #scr-fdrop-inner {
        padding-bottom: env(safe-area-inset-bottom, 0) !important;
    }

    /* Flow sub-tabs and period toggles wrap on mobile — but NOT movers/sector bar,
       Valuation header, Financials DeepDive type bar, or the Options expiry row */
    .flow-sub-tabs,
    .period-toggle:not(#movers-index-toggle):not(#val-mode-toggle):not(#val-dcf-run-custom):not(#val-dcf-type-toggle):not(#fin-type-toggle):not(#opt-chain-exp),
    #flow-sub-tabs {
        flex-wrap: wrap !important;
    }

    /* Financials type bar: one scrollable row (DeepDive · Key Financials · …) */
    #fin-type-toggle {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        overscroll-behavior-x: contain;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        flex: 1 1 100%;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }
    #fin-type-toggle::-webkit-scrollbar { display: none; }
    #fin-type-toggle .period-toggle-btn {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    /* Movers + Heatmap filter bars: single scrollable row on mobile */
    .heatmap-index-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .heatmap-breadth-row {
        display: grid;
        grid-template-columns: auto auto;
        justify-content: center;
        align-items: center;
        width: 100%;
        gap: 8px 16px;
    }
    .heatmap-stats {
        display: contents;
    }
    .heatmap-valuation {
        grid-column: 1 / -1;
        justify-content: center;
    }
    #movers-index-toggle,
    #heatmap-index-toggle {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 4px;
        width: 100%;
    }
    #movers-index-toggle::-webkit-scrollbar,
    #heatmap-index-toggle::-webkit-scrollbar { display: none; }
    #movers-index-toggle .period-toggle-btn,
    #heatmap-index-toggle .period-toggle-btn {
        flex-shrink: 0;
        white-space: nowrap;
        font-size: 12px !important;
        padding: 6px 10px !important;
    }

    /* Valuation tab header: keep mode tabs + controls on one line by
       shrinking the mode tabs and collapsing Reset/Run/Unlevered/Levered
       to icon-only buttons */
    #tab-valuation > div[style*="justify-content:space-between"] {
        flex-wrap: nowrap !important;
        gap: 6px;
    }
    #val-mode-toggle {
        flex-shrink: 1;
        min-width: 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    #val-mode-toggle::-webkit-scrollbar { display: none; }
    #val-mode-toggle .period-toggle-btn {
        flex-shrink: 0;
        white-space: nowrap;
        font-size: 12px !important;
        padding: 8px 8px !important;
    }
    #val-dcf-model-controls {
        flex-shrink: 0;
        gap: 4px !important;
    }
    #val-dcf-model-controls .period-toggle-btn {
        padding: 6px 9px !important;
    }
    #val-dcf-model-controls .ptb-label {
        display: none;
    }
    #val-dcf-run-custom,
    #val-dcf-type-toggle {
        gap: 2px !important;
    }


    /* Data tables in general: horizontal scroll */
    .data-table {
        min-width: 700px;
    }
    div[style*="overflow-x:auto"] {
        -webkit-overflow-scrolling: touch;
    }

    /* Flow search inputs: full width */
    .flow-search,
    input[id^="flow-"] {
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Flow header rows with search: stack vertically */
    #section-funds-body > div[style*="display:flex"][style*="margin-bottom:14px"] {
        flex-wrap: wrap !important;
        gap: 8px !important;
    }
    #section-funds-body > div[style*="display:flex"][style*="margin-bottom:14px"] > div[style*="flex:0 0 260px"] {
        flex: 1 1 100% !important;
    }

    /* ── Economic Indicators mobile ─────────────────────────── */

    /* Table: scrollable horizontally */
    #econ-table-wrap {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }
    #econ-table-wrap table {
        min-width: 800px !important;
        table-layout: auto !important;
    }
    #econ-table-wrap td,
    #econ-table-wrap th {
        font-size: 13px !important;
        padding: 6px 8px !important;
        white-space: nowrap !important;
    }

    /* Chart: slightly shorter on mobile */
    #econ-chart-wrap {
        height: 180px !important;
    }

    /* Granularity toggle: wrap */
    #econ-gran-toggle {
        flex-wrap: wrap;
    }

    /* Performance tables in all sections: scrollable */
    [id$="-tbl"] {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    [id$="-tbl"] table {
        min-width: 600px;
    }

    /* Chart period buttons: wrap on mobile */
    .chart-periods {
        flex-wrap: wrap !important;
        gap: 4px !important;
    }

    /* Stock Overview key-stats: swipe instead of crushing the 3-col grid */
    #tab-overview {
        min-width: 0;
        max-width: 100%;
    }
    #tab-overview .stats-grid {
        max-width: 100%;
        min-width: 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
        grid-template-columns: repeat(3, minmax(9.5rem, 1fr));
    }
    #tab-overview .stat-cell {
        padding: 10px 12px;
    }

    /* Overview chart toolbar: keep Move analysis confirm usable on narrow screens */
    .overview-card .chart-toolbar {
        flex-wrap: wrap;
        gap: 8px;
        margin-bottom: -36px;
    }
    .overview-card .chart-controls-right {
        flex-wrap: wrap;
        gap: 6px;
        min-width: 0;
    }
    .move-analysis-confirm {
        gap: 5px;
    }
    .move-analysis-confirm-run,
    .move-analysis-confirm-cancel {
        min-width: 52px;
        padding: 6px 10px;
        font-size: 11px;
    }
    .move-analysis-btn .move-analysis-label {
        font-size: 10px;
    }

    /* World map: reduced height on mobile */
    [id^="wrm-map-"] {
        height: 280px !important;
    }

    /* ── Single stock: profile + description stacked ────────── */

    /* The parent flex row containing sidebar-profile and sidebar-description */
    #tab-overview > div[style*="display:flex"][style*="gap:24px"] {
        flex-direction: column !important;
        gap: 16px !important;
    }

    /* Profile table: full width instead of fixed 310px */
    #sidebar-profile {
        flex: 1 1 100% !important;
        width: 100% !important;
    }

    /* Description: full width */
    #sidebar-description {
        flex: 1 1 100% !important;
        width: 100% !important;
    }

    /* ── Technicals: gauges + tables stacked ─────────────────── */

    /* Gauges: horizontal scroll, one at a time */
    .ta-gauges-row {
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        scroll-snap-type: x mandatory !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        justify-content: flex-start !important;
        gap: 0 !important;
        padding-bottom: 4px;
    }
    .ta-gauges-row::-webkit-scrollbar {
        display: none;
    }
    .ta-gauge {
        flex: 0 0 100% !important;
        scroll-snap-align: center;
    }
    .ta-gauge-svg {
        width: 200px !important;
        height: 120px !important;
    }

    /* Tables: stack vertically */
    .ta-tables-row {
        flex-direction: column !important;
        gap: 16px !important;
    }

    /* Technicals toolbar: wrap */
    .ta-toolbar {
        flex-wrap: wrap !important;
        gap: 8px !important;
    }

    /* Chart indicators panel: horizontal scroll */
    .ta-indicators-panel {
        flex-direction: row !important;
        flex-wrap: wrap !important;
        gap: 6px !important;
    }

    /* Chart row: stack chart + indicators */
    .ta-chart-row {
        flex-direction: column !important;
    }

    /* ── Benchmark: peers table mobile ────────────────────────── */

    /* Benchmark chart section: no horizontal scroll needed now */
    #benchmark-chart-section {
        overflow-x: hidden !important;
    }

    /* Remove min-width */
    #benchmark-chart-section > div:last-child {
        min-width: 0 !important;
    }

    /* Peers table: hide $ change (child 5), 5D (7), 1M (8), YTD (9), 1Y (10) — keep Price (4) and 1D (6) */
    [data-bm-row] > div:nth-child(5),
    [data-bm-row] > div:nth-child(7),
    [data-bm-row] > div:nth-child(8),
    [data-bm-row] > div:nth-child(9),
    [data-bm-row] > div:nth-child(10) {
        display: none !important;
    }

    /* Same for the header row */
    div:has(> [data-bm-row]) > div:not([data-bm-row]) > div:nth-child(5),
    div:has(> [data-bm-row]) > div:not([data-bm-row]) > div:nth-child(7),
    div:has(> [data-bm-row]) > div:not([data-bm-row]) > div:nth-child(8),
    div:has(> [data-bm-row]) > div:not([data-bm-row]) > div:nth-child(9),
    div:has(> [data-bm-row]) > div:not([data-bm-row]) > div:nth-child(10) {
        display: none !important;
    }

    /* Growth / Quality / Valuation tables: logo only, hide ticker text */
    #benchmark-peers-section .card {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }
    #benchmark-peers-section .data-table {
        min-width: 0 !important;
    }
    #benchmark-peers-section .data-table th:not(:first-child) {
        font-size: 0 !important;
        min-width: 50px !important;
        padding: 8px 4px !important;
    }
    #benchmark-peers-section .data-table th img {
        font-size: 14px;
        width: 22px !important;
        height: 22px !important;
    }
    #benchmark-peers-section .data-table td {
        font-size: 11px !important;
        padding: 6px 4px !important;
        min-width: 50px !important;
    }
    #benchmark-peers-section .data-table td:first-child {
        font-size: 12px !important;
        min-width: 100px !important;
    }

    /* Period pills in benchmark: wrap */
    #benchmark-sub-tabs {
        flex-wrap: wrap !important;
    }
}

/* ═══════════════════════════════════════════════════════════════════════
   Header Logo + Neon Dividers
   ═══════════════════════════════════════════════════════════════════════ */

.header-logo {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 64px !important;
    height: 64px !important;
    flex-shrink: 0;
    padding: 0 !important;
    margin: 0 !important;
    cursor: pointer;
    transition: opacity 0.2s;
    box-sizing: border-box !important;
    border-right: 1px solid var(--border) !important;
}

.header-logo:hover {
    opacity: 0.8;
}

.header-logo-img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}
html[data-theme="light"] .header-logo-img {
    filter: brightness(0) saturate(100%) invert(22%) sepia(28%) saturate(1600%) hue-rotate(165deg) brightness(0.95);
}

/* Thin vertical neon line — full height of header bar */
.header-neon-divider {
    display: none !important;
}

.header-row > .header-neon-divider:first-of-type {
    display: none !important;
}

/* ═══════════════════════════════════════════════════════════════════════
   Auth Circle Button (matches login-button.tsx)
   ═══════════════════════════════════════════════════════════════════════ */

.auth-container {
    width: 64px !important;
    height: 64px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0;
    position: relative;
    margin: 0 !important;
    margin-left: 0 !important;
    box-sizing: border-box !important;
    border-left: 1px solid var(--border) !important;
}

/* Circle button — used for both login and avatar states */
.auth-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--neon-cyan);
    background: rgba(0, 240, 255, 0.10);
    color: var(--neon-cyan);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    padding: 0;
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.2);
}

.auth-circle:hover {
    background: rgba(0, 240, 255, 0.20);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.4);
}

.auth-circle svg {
    filter: drop-shadow(0 0 5px rgba(0, 240, 255, 0.5));
}

/* Avatar variant — shows user picture */
.auth-circle--avatar {
    padding: 0;
    overflow: hidden;
    border: 2px solid var(--neon-cyan);
    background: transparent;
}

.auth-avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

/* Initials fallback when no profile picture (like Manawa "F") */
.auth-avatar-initials {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 700;
    color: var(--neon-cyan);
    background: rgba(0, 240, 255, 0.08);
    text-shadow: 0 0 8px rgba(0, 240, 255, 0.5);
    letter-spacing: 0.5px;
}

/* Hover overlay with gear icon */
.auth-avatar-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.auth-avatar-overlay--gear {
    color: var(--neon-cyan);
}

.auth-circle--avatar:hover .auth-avatar-overlay {
    opacity: 1;
}

.auth-circle--avatar:hover {
    box-shadow: 0 0 12px rgba(0, 255, 200, 0.3);
}

/* Avatar wrap — relative container for dropdown */
.auth-avatar-wrap {
    position: relative;
}

/* Dropdown menu */
.auth-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    background: var(--bg-card);
    border: 1px solid rgba(0, 240, 255, 0.15);
    border-radius: 10px;
    padding: 12px 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transform: translateY(-4px);
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
    z-index: 500;
}

.auth-dropdown.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

.auth-dropdown-name {
    padding: 4px 16px 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.auth-dropdown-email {
    padding: 2px 16px 8px;
    font-size: 11px;
    color: rgba(0, 240, 255, 0.7);
}

.auth-dropdown-divider {
    border: none;
    border-top: 1px solid rgba(0, 240, 255, 0.10);
    margin: 4px 0;
}

.auth-dropdown-item {
    display: block;
    width: 100%;
    padding: 8px 16px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 13px;
    font-family: var(--font-sans);
    text-align: left;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.auth-dropdown-item:hover {
    background: rgba(0, 240, 255, 0.08);
    color: var(--text-primary);
}

.auth-dropdown-item--danger:hover {
    color: var(--loss);
    background: rgba(239, 68, 68, 0.08);
}

/* ═══════════════════════════════════════════════════════════════════════
   Settings Hub
   ═══════════════════════════════════════════════════════════════════════ */

.settings-page {
    flex: 1;
    min-height: 0; /* flex child must shrink so inner .settings-container can scroll */
    width: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 40px;
    position: relative;
}

.settings-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--text-muted);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 10;
}

.settings-close-btn:hover {
    color: var(--text-primary);
    background: rgba(0, 240, 255, 0.08);
    border-color: rgba(0, 240, 255, 0.3);
}

.settings-container {
    max-width: 860px;
    margin: 0 auto;
    width: 100%;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    scrollbar-width: none; /* scroll works; bar hidden */
    -ms-overflow-style: none;
}
.settings-container::-webkit-scrollbar {
    display: none;
}

/* ── Top-Level Tab Navigation ──────────────────────────────────────── */

.settings-nav {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 32px;
}

.settings-nav-btn {
    padding: 12px 24px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.settings-nav-btn:hover {
    color: var(--text-primary);
}

.settings-nav-btn.active {
    color: var(--text-primary);
    border-bottom-color: var(--neon-cyan);
    text-shadow: 0 0 8px rgba(0, 240, 255, 0.3);
}

/* ── Tab Content Panels ────────────────────────────────────────────── */

.settings-tab {
    display: none;
}

.settings-tab.active {
    display: block;
    animation: settings-fade-in 0.2s ease;
}

@keyframes settings-fade-in {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* API Keys gated (free) — blur + inline Upgrade Required (same as DeepDive locked) */
#stab-api-keys { position: relative; }
.settings-content-blurred {
    filter: blur(2.5px) saturate(.9);
    opacity: .55;
    user-select: none;
    pointer-events: none;
}
.settings-upgrade-gate {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 48px 20px 40px;
    background: linear-gradient(180deg, rgba(5,7,12,.22) 0%, rgba(5,7,12,.45) 28%, rgba(5,7,12,.72) 70%, rgba(5,7,12,.88) 100%);
}
.settings-upgrade-inline {
    margin-top: 24px !important;
}
/* Inline card styles (mirror ai-trigger locked empty state) */
.ai-upgrade-inline {
    max-width: 420px;
    width: 100%;
    text-align: center;
    padding: 36px 28px 28px;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,.1);
    background: rgba(14,18,28,.92);
    backdrop-filter: blur(8px);
    box-shadow: 0 20px 60px rgba(0,0,0,.45);
}
.ai-upgrade-inline-icon {
    width: 48px; height: 48px; margin: 0 auto 14px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(145deg, rgba(139,92,246,.25), rgba(59,130,246,.2));
    border: 1px solid rgba(255,255,255,.1); font-size: 22px; line-height: 1;
}
.ai-upgrade-inline-title { margin: 0 0 8px; font-size: 22px; font-weight: 700; color: var(--text-primary, #fff); }
.ai-upgrade-inline-msg { margin: 0 0 22px; font-size: 14px; line-height: 1.5; color: var(--text-secondary, #aaa); }
.ai-upgrade-inline-plans { display: flex; align-items: center; justify-content: center; gap: 16px; margin-bottom: 22px; }
.ai-upgrade-inline-label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted, #888); margin-bottom: 6px; }
.ai-upgrade-inline-badge { display: inline-block; padding: 6px 16px; border-radius: 20px; font-size: 13px; font-weight: 600; text-transform: capitalize; }
.ai-upgrade-inline-badge.current { background: rgba(255,255,255,.08); color: var(--text-muted, #888); border: 1px solid rgba(255,255,255,.12); }
.ai-upgrade-inline-badge.required { background: linear-gradient(135deg, #8b5cf6, #3b82f6); color: #fff; border: none; }
.ai-upgrade-inline-arrow { color: var(--text-muted, #666); font-size: 20px; padding-top: 16px; }
.ai-upgrade-inline-cta {
    display: block; width: 100%; padding: 14px 24px; border: none; border-radius: 10px;
    background: linear-gradient(135deg, #8b5cf6, #3b82f6); color: #fff;
    font-size: 15px; font-weight: 600; cursor: pointer; box-sizing: border-box;
}
.ai-upgrade-inline-cta:hover { filter: brightness(1.06); box-shadow: 0 8px 24px rgba(139,92,246,.35); }
html[data-theme="light"] .settings-upgrade-gate {
    background: linear-gradient(180deg, rgba(244,246,248,.28) 0%, rgba(244,246,248,.55) 28%, rgba(244,246,248,.82) 70%, rgba(244,246,248,.94) 100%);
}
html[data-theme="light"] .ai-upgrade-inline {
    background: #ffffff;
    border-color: var(--border);
    box-shadow: var(--glow-md);
}
html[data-theme="light"] .ai-upgrade-inline-icon {
    background: #f3e8ff;
    border-color: #e9d5ff;
}
html[data-theme="light"] .ai-upgrade-inline-badge.current {
    background: #e8ecf0;
    color: var(--text-secondary);
    border-color: var(--border);
}

html[data-theme="light"] .playground-header,
html[data-theme="light"] .mini-usage-bar {
    background: var(--bg-hover);
}
html[data-theme="light"] .playground-textarea,
html[data-theme="light"] .playground-output,
html[data-theme="light"] .dev-docs-block {
    background: var(--bg-input);
    color: var(--text-primary);
}
html[data-theme="light"] .dev-docs-block pre,
html[data-theme="light"] .dev-docs-table td,
html[data-theme="light"] .integration-step {
    border-bottom-color: var(--border);
    color: var(--text-primary);
}
html[data-theme="light"] .integration-example {
    color: var(--text-secondary) !important;
}
html[data-theme="light"] .code-string {
    color: var(--gain);
}

/* ── Sub-Tab Navigation (API Keys) ─────────────────────────────────── */

.settings-sub-nav {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
    margin: 32px 0 24px;
}

.settings-sub-nav-btn {
    padding: 10px 20px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: all 0.2s;
}

.settings-sub-nav-btn:hover {
    color: var(--text-secondary);
}

.settings-sub-nav-btn.active {
    color: var(--neon-cyan);
    border-bottom-color: var(--neon-cyan);
}

.settings-subtab {
    display: none;
}

.settings-subtab.active {
    display: block;
    animation: settings-fade-in 0.2s ease;
}

/* ── Shared Section Styles ─────────────────────────────────────────── */

.settings-section {
    margin-bottom: 32px;
}

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

.settings-section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.settings-section-desc {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.settings-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
}

/* ── Profile Row ───────────────────────────────────────────────────── */

.settings-profile-row {
    display: flex;
    align-items: center;
    gap: 16px;
}

.settings-profile-avatar {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
}

.settings-profile-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.settings-profile-email {
    font-size: 14px;
    color: var(--neon-cyan);
    margin-top: 2px;
}
html[data-theme="light"] .settings-profile-email {
    color: #0e7490;
}

.settings-logout-btn {
    margin-left: auto;
    padding: 8px 20px;
    background: none;
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-sm);
    color: var(--loss);
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: all 0.2s;
}

.settings-logout-btn:hover {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.5);
}

.settings-keys-empty p {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 8px;
}

/* ── Skeleton Loading ────────────────────────────────────────────── */
.skeleton-row {
    display: grid;
    grid-template-columns: 1fr 140px 100px 100px 40px;
    align-items: center;
    padding: 14px 16px;
    gap: 8px;
    border-bottom: 1px solid var(--border);
}

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

.skeleton-bar {
    height: 14px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.03) 25%, rgba(255, 255, 255, 0.08) 50%, rgba(255, 255, 255, 0.03) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

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

/* ═══════════════════════════════════════════════════════════════════════
   Integrations Tab
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Toggle Switches ───────────────────────────────────────────────── */

.settings-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.settings-toggle-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.settings-toggle-row:first-child {
    padding-top: 0;
}

.settings-toggle-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    display: block;
}

.settings-toggle-desc {
    font-size: 12px;
    color: var(--text-muted);
    display: block;
    margin-top: 2px;
}

/* Neon segmented control + select (Currency settings) */
.settings-seg {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
    width: max-content;
    max-width: 100%;
    padding: 4px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
}

.settings-seg-btn {
    padding: 8px 14px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--text-muted);
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    letter-spacing: 0.2px;
}

.settings-seg-btn:hover {
    color: var(--text-secondary);
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
}

.settings-seg-btn.active {
    color: var(--neon-cyan);
    border-color: var(--neon-cyan);
    background: rgba(0, 240, 255, 0.08);
    font-weight: 600;
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.18);
}

.settings-select,
.settings-select--neon {
    width: 100%;
    max-width: 280px;
    padding: 10px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 13px;
    font-family: var(--font-sans);
    cursor: pointer;
    appearance: auto;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.settings-select:hover,
.settings-select--neon:hover {
    border-color: rgba(0, 240, 255, 0.35);
}

.settings-select:focus,
.settings-select--neon:focus {
    outline: none;
    border-color: var(--neon-cyan);
    box-shadow: 0 0 0 1px rgba(0, 240, 255, 0.35), 0 0 12px rgba(0, 240, 255, 0.12);
}

.settings-select option {
    background: var(--bg-primary);
    color: var(--text-primary);
}

.settings-switch {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.settings-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.settings-switch-slider {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    cursor: pointer;
    transition: all 0.3s;
}

.settings-switch-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    bottom: 3px;
    background: var(--text-muted);
    border-radius: 50%;
    transition: all 0.3s;
}

.settings-switch input:checked + .settings-switch-slider {
    background: rgba(0, 240, 255, 0.3);
}

.settings-switch input:checked + .settings-switch-slider::before {
    transform: translateX(20px);
    background: var(--neon-cyan);
    box-shadow: 0 0 8px rgba(0, 240, 255, 0.5);
}

.settings-switch--disabled {
    opacity: 0.4;
    pointer-events: none;
}

/* ═══════════════════════════════════════════════════════════════════════
   Billing Tab
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Usage Bars ────────────────────────────────────────────────────── */

.billing-usage-bars {
    display: flex;
    gap: 16px;
}

.billing-usage-card {
    flex: 1;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
}

.billing-usage-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.billing-usage-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
}

.billing-usage-count {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    font-family: var(--font-mono);
}

.billing-usage-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 8px;
}

.billing-usage-fill {
    height: 100%;
    border-radius: 8px;
    background: linear-gradient(90deg, var(--neon-cyan), #00c896);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 8px rgba(0, 240, 255, 0.3);
}

.billing-usage-fill--warn {
    background: linear-gradient(90deg, #fbbf24, #f59e0b);
    box-shadow: 0 0 8px rgba(251, 191, 36, 0.3);
}

.billing-usage-fill--danger {
    background: linear-gradient(90deg, #ef4444, #dc2626);
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.3);
}

.billing-usage-bar--credits .billing-usage-fill,
.billing-usage-fill--credits {
    background: linear-gradient(90deg, #a78bfa, #7c3aed);
    box-shadow: 0 0 8px rgba(167, 139, 250, 0.3);
}

.billing-usage-plan {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

.billing-usage-meter {
    display: flex;
    align-items: center;
    gap: 10px;
}
.billing-usage-meter-segs {
    display: flex;
    gap: 3px;
    flex: 1;
    height: 6px;
}
.billing-usage-meter-seg {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: var(--bg-hover);
    transition: background 0.4s ease;
}
.billing-usage-reset {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

.billing-topup-btn-sm {
    background: none;
    border: 1px solid rgba(167, 139, 250, 0.3);
    color: #a78bfa;
    font-size: 11px;
    font-weight: 600;
    font-family: var(--font-sans);
    padding: 2px 10px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.billing-topup-btn-sm:hover {
    background: rgba(167, 139, 250, 0.1);
    border-color: rgba(167, 139, 250, 0.5);
}

/* ── Package Cards ─────────────────────────────────────────────────── */

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

.billing-downgrade-banner {
    background: linear-gradient(135deg, rgba(245,158,11,0.14), rgba(245,158,11,0.07));
    border: 1px solid rgba(245,158,11,0.32);
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.billing-downgrade-keep-btn {
    background: rgba(245,158,11,0.18);
    border: 1px solid rgba(245,158,11,0.38);
    color: #f5c842;
    border-radius: 6px;
    padding: 6px 14px;
    cursor: pointer;
    font-size: 0.8rem;
    white-space: nowrap;
    font-family: inherit;
    transition: background 0.2s;
}
.billing-downgrade-keep-btn:hover {
    background: rgba(245,158,11,0.28);
}

.billing-pkg-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 28px 24px;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: all 0.3s;
}

.billing-pkg-card:hover {
    border-color: rgba(0, 240, 255, 0.2);
    transform: translateY(-2px);
}

.billing-pkg-card.active {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.1), inset 0 0 20px rgba(0, 240, 255, 0.03);
}
html[data-theme="light"] .billing-pkg-card.active {
    background: #f0f7f8;
    border-color: var(--neon-cyan);
    box-shadow: var(--glow-md);
}
html[data-theme="light"] .billing-pkg-card:hover {
    border-color: rgba(14, 116, 144, 0.35);
}
html[data-theme="light"] .billing-pkg-card--featured {
    background: linear-gradient(180deg, #eef6f8 0%, var(--bg-card) 48%);
    border-color: rgba(14, 116, 144, 0.28);
}
html[data-theme="light"] .billing-pkg-popular {
    background: var(--neon-cyan);
    color: #ffffff;
}
html[data-theme="light"] .billing-pkg-badge {
    color: #ffffff;
}
html[data-theme="light"] .billing-pkg-was {
    color: var(--text-muted);
    text-decoration-color: var(--text-muted);
}
html[data-theme="light"] .billing-pkg-btn--featured {
    color: #ffffff;
}
html[data-theme="light"] .billing-pkg-btn--featured:hover:not(:disabled) {
    background: #155e75;
    color: #ffffff;
    box-shadow: var(--glow-md);
}

/* Card that will become active after a pending downgrade */
.billing-pkg-card.upcoming {
    border: 1px dashed rgba(200, 140, 0, 0.5);
    box-shadow: 0 0 14px rgba(200, 140, 0, 0.06);
    opacity: 0.85;
}
.billing-pkg-card.upcoming .billing-pkg-badge {
    background: rgba(200, 140, 0, 0.85);
    color: #fff8e1;
}

.billing-pkg-card--featured {
    border-color: rgba(0, 240, 255, 0.3);
    background: linear-gradient(180deg, rgba(0, 240, 255, 0.04) 0%, transparent 40%);
}

.billing-pkg-badge {
    position: absolute;
    top: -1px;
    right: 16px;
    background: var(--neon-cyan);
    color: #000;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 10px;
    border-radius: 0 0 6px 6px;
}

.billing-pkg-popular {
    position: absolute;
    top: -1px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(90deg, var(--neon-cyan), #00c896);
    color: #000;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 12px;
    border-radius: 0 0 6px 6px;
}

.billing-pkg-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 8px 0 4px;
}

.billing-pkg-price {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0;
    margin-bottom: 20px;
}

.billing-pkg-amount {
    font-size: 36px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -1px;
}

.billing-pkg-period {
    font-size: 14px;
    color: var(--text-muted);
    margin-left: 2px;
}

.billing-pkg-was {
    font-size: 1.15rem;
    color: rgba(255,255,255,0.45);
    text-decoration: line-through;
    text-decoration-color: rgba(255,255,255,0.55);
    text-decoration-thickness: 2px;
    margin-left: 8px;
    align-self: flex-end;
    font-weight: 500;
    padding-bottom: 2px;
}

.billing-pkg-tagline {
    margin: -10px 0 16px;
    font-size: 14px;
    font-weight: 600;
    color: var(--neon-cyan);
}

.billing-pkg-features {
    list-style: none;
    padding: 0;
    margin: 0 0 24px;
    flex: 1;
}

.billing-pkg-features li {
    font-size: 14px;
    color: var(--text-secondary);
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    display: flex;
    align-items: center;
    gap: 8px;
}

.billing-pkg-features li::before {
    content: '✓';
    color: var(--neon-cyan);
    font-weight: 700;
    font-size: 12px;
}

.billing-pkg-features li.billing-feat-no {
    color: var(--text-secondary);
}

.billing-pkg-features li.billing-feat-no::before {
    content: '✕';
    color: var(--neon-cyan);
}

.billing-pkg-btn {
    width: 100%;
    padding: 12px;
    border: 1px solid rgba(0, 240, 255, 0.2);
    border-radius: var(--radius-sm);
    background: rgba(0, 240, 255, 0.06);
    color: var(--neon-cyan);
    font-size: 14px;
    font-weight: 700;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: all 0.2s;
}

.billing-pkg-btn:hover:not(:disabled) {
    background: rgba(0, 240, 255, 0.12);
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.2);
}

.billing-pkg-btn--current {
    background: rgba(0, 240, 255, 0.08);
    border-color: var(--neon-cyan);
    cursor: default;
    opacity: 0.7;
}

.billing-pkg-btn--featured {
    background: var(--neon-cyan);
    color: #000;
    border-color: var(--neon-cyan);
}

.billing-pkg-btn--featured:hover:not(:disabled) {
    background: #33f5ff;
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.4);
}

.billing-pkg-btn--confirm {
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.6);
    color: #4ade80;
    animation: confirmPulse 1s ease-in-out infinite alternate;
}

.billing-pkg-btn--confirm:hover:not(:disabled) {
    background: rgba(34, 197, 94, 0.22);
    box-shadow: 0 0 16px rgba(34, 197, 94, 0.35);
}

.billing-pkg-btn--confirm-danger {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.5);
    color: #f87171;
    animation: confirmPulseDanger 1s ease-in-out infinite alternate;
}

.billing-pkg-btn--confirm-danger:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.18);
    box-shadow: 0 0 16px rgba(239, 68, 68, 0.3);
}

.billing-pkg-btn--danger {
    border-color: rgba(239, 68, 68, 0.3);
    color: #f87171;
    background: rgba(239, 68, 68, 0.06);
}

@keyframes confirmPulse {
    from { box-shadow: 0 0 4px rgba(34, 197, 94, 0.1); }
    to   { box-shadow: 0 0 16px rgba(34, 197, 94, 0.3); }
}

@keyframes confirmPulseDanger {
    from { box-shadow: 0 0 4px rgba(239, 68, 68, 0.1); }
    to   { box-shadow: 0 0 16px rgba(239, 68, 68, 0.3); }
}

/* ── Credits Section ───────────────────────────────────────────────── */

.billing-credit-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.billing-credit-balance {
    font-size: 28px;
    font-weight: 800;
    color: #a78bfa;
    font-family: var(--font-mono);
}

.billing-credit-equiv {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 4px;
}

.billing-topup-btn {
    padding: 10px 24px;
    background: linear-gradient(135deg, rgba(167, 139, 250, 0.15), rgba(124, 58, 237, 0.1));
    border: 1px solid rgba(167, 139, 250, 0.3);
    border-radius: var(--radius-sm);
    color: #a78bfa;
    font-size: 14px;
    font-weight: 700;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: all 0.2s;
}

.billing-topup-btn:hover {
    background: linear-gradient(135deg, rgba(167, 139, 250, 0.25), rgba(124, 58, 237, 0.15));
    box-shadow: 0 0 16px rgba(167, 139, 250, 0.2);
}

.billing-topup-btn:disabled,
.billing-pkg-btn:disabled,
.settings-btn-primary:disabled,
.settings-btn-outline:disabled,
.settings-btn-danger:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* ── Promo Code ────────────────────────────────────────────────────── */

.billing-promo-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.billing-promo-input {
    flex: 1;
    font-family: var(--font-mono);
    font-size: 14px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.billing-promo-msg {
    margin-top: 10px;
    font-size: 13px;
    min-height: 18px;
    transition: color 0.2s;
}

.billing-promo-msg--success {
    color: var(--gain);
}

.billing-promo-msg--error {
    color: var(--loss);
}

/* ── Billing Toasts ─────────────────────────────────────────────────── */

.billing-toast {
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 12px;
    animation: slideInDown 0.3s ease;
}

@keyframes slideInDown {
    from { transform: translateY(-8px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.billing-toast--success {
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #4ade80;
}

.billing-toast--error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #f87171;
}


/* ── Usage Chart ───────────────────────────────────────────────────── */

.billing-chart-container {
    width: 100%;
    height: 200px;
    position: relative;
}

.billing-chart-container canvas {
    width: 100% !important;
    height: 100% !important;
}

/* ── Usage Chart Skeleton ────────────────────────────────────────── */
.billing-chart-skeleton {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    padding: 20px 16px 30px 40px; /* same as chart drawing context */
    box-sizing: border-box;
    background: transparent;
    pointer-events: none;
}

.billing-chart-skeleton-bar {
    flex: 1;
    margin: 0 2px;
    background: linear-gradient(90deg, rgba(0, 240, 255, 0.04) 25%, rgba(0, 240, 255, 0.15) 50%, rgba(0, 240, 255, 0.04) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 2px 2px 0 0;
}

/* ── Payment & Invoices ────────────────────────────────────────────── */

.billing-payment-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.billing-payment-card {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-secondary);
    font-size: 14px;
}

.billing-payment-card svg {
    color: var(--text-muted);
}

.billing-invoices-list {
    max-height: 300px;
    overflow-y: auto;
}

/* ── Buttons ───────────────────────────────────────────────────────── */

.settings-btn-outline {
    padding: 8px 16px;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: all 0.2s;
}

.settings-btn-outline:hover {
    border-color: rgba(0, 240, 255, 0.3);
    color: var(--text-primary);
}

.settings-btn-primary {
    padding: 8px 20px;
    background: var(--neon-cyan);
    border: none;
    border-radius: var(--radius-sm);
    color: #000;
    font-size: 14px;
    font-weight: 700;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: all 0.2s;
}

.settings-btn-primary:hover {
    background: #33f5ff;
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.4);
}

.settings-btn-danger {
    padding: 10px 24px;
    background: none;
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-sm);
    color: var(--loss);
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: all 0.2s;
}

.settings-btn-danger:hover {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.5);
}

/* Small inline button (for Telegram link/unlink etc.) */
.settings-btn-sm {
    padding: 5px 12px;
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.35);
    border-radius: var(--radius-sm);
    color: #a5b4fc;
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.settings-btn-sm:hover {
    background: rgba(99, 102, 241, 0.22);
    border-color: rgba(99, 102, 241, 0.55);
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.25);
}

.settings-btn-sm--ghost {
    background: none;
    border-color: var(--border);
    color: var(--text-muted);
}

.settings-btn-sm--ghost:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.15);
    color: var(--text-secondary);
    box-shadow: none;
}

/* Thin horizontal divider inside settings-card between toggle rows */
.settings-toggle-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.05);
    margin: 4px 0;
}

/* ═══════════════════════════════════════════════════════════════════════
   API Keys Tab
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Create Key Button ─────────────────────────────────────────────── */

.settings-create-key-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(0, 240, 255, 0.10);
    border: 1px solid var(--neon-cyan);
    border-radius: var(--radius-sm);
    color: var(--neon-cyan);
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: all 0.2s;
}

.settings-create-key-btn:hover {
    background: rgba(0, 240, 255, 0.20);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.3);
}

.settings-create-key-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ── Create Key Modal ──────────────────────────────────────────────── */

.settings-create-modal {
    margin: 16px 0;
}

.settings-create-modal-body {
    background: var(--bg-card);
    border: 1px solid rgba(0, 240, 255, 0.2);
    border-radius: var(--radius-md);
    padding: 24px;
}

.settings-create-modal-body h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 16px;
}

.settings-input-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.settings-input {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    font-family: var(--font-sans);
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.settings-input:focus {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 0 2px rgba(0, 240, 255, 0.1);
}

.settings-input::placeholder {
    color: var(--text-muted);
}

.settings-create-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 16px;
}

/* ── New Key Banner ────────────────────────────────────────────────── */

.settings-new-key-banner {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px 18px;
    background: rgba(0, 240, 255, 0.03);
    border: 1px solid rgba(0, 240, 255, 0.15);
    border-radius: var(--radius-md);
    margin: 16px 0;
    box-shadow: var(--glow-sm);
}

.settings-new-key-header {
    width: 100%;
}

.settings-new-key-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.settings-new-key-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--neon-cyan);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.settings-new-key-value {
    width: 100%;
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-primary);
    background: var(--bg-input);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    word-break: break-all;
    user-select: all;
    box-sizing: border-box;
}

.settings-copy-key-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(0, 240, 255, 0.08);
    border: 1px solid var(--neon-cyan);
    border-radius: var(--radius-sm);
    color: var(--neon-cyan);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.settings-copy-key-btn:hover {
    background: rgba(0, 240, 255, 0.18);
    box-shadow: 0 0 8px rgba(0, 240, 255, 0.25);
}

.settings-copy-key-btn.copied {
    color: var(--gain) !important;
    border-color: var(--gain) !important;
    background: rgba(77, 158, 110, 0.15) !important;
    box-shadow: 0 0 8px rgba(77, 158, 110, 0.25) !important;
}

.settings-new-key-warning {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.settings-new-key-warning svg {
    flex-shrink: 0;
}

/* ── Key Search ────────────────────────────────────────────────────── */

.settings-key-search {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
}

.settings-key-search svg {
    color: var(--text-muted);
    flex-shrink: 0;
}

.settings-key-search-input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 13px;
    font-family: var(--font-sans);
}

.settings-key-search-input::placeholder {
    color: var(--text-muted);
}

/* ── Keys Table ────────────────────────────────────────────────────── */

.settings-keys-list {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.settings-key-header,
.settings-key-row {
    display: grid;
    grid-template-columns: 1fr 140px 100px 100px 40px;
    align-items: center;
    padding: 10px 16px;
    gap: 8px;
}

.settings-key-header {
    background: var(--bg-hover);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
}

.settings-key-row {
    border-bottom: 1px solid var(--border);
    transition: background 0.15s, opacity 0.3s;
}

.settings-key-row:last-child { border-bottom: none; }
.settings-key-row:hover { background: var(--bg-hover); }

.settings-key-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.settings-key-prefix code {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--neon-cyan);
    background: rgba(0, 240, 255, 0.08);
    padding: 2px 8px;
    border-radius: 4px;
}

.settings-key-date {
    font-size: 12px;
    color: var(--text-muted);
}

.settings-key-revoke {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.settings-key-revoke:hover {
    color: var(--loss);
    background: rgba(239, 68, 68, 0.10);
}

.settings-keys-empty {
    padding: 40px 20px;
    text-align: center;
}

.settings-keys-empty p {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 8px;
}

/* ═══════════════════════════════════════════════════════════════════════
   Integrations Tab
   ═══════════════════════════════════════════════════════════════════════ */

.integration-platforms {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.integration-platform-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 16px 7px 10px;
    background: rgba(0, 240, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: all 0.2s;
}

.integration-platform-btn[data-platform="other"] {
    padding: 7px 16px;
}

.integration-platform-icon {
    width: 18px;
    height: 18px;
    object-fit: contain;
    flex-shrink: 0;
    filter: drop-shadow(0 0 4px rgba(0, 240, 255, 0.25));
    pointer-events: none;
}

.integration-platform-btn:hover {
    border-color: rgba(0, 240, 255, 0.2);
    color: var(--text-secondary);
}

.integration-platform-btn:hover .integration-platform-icon {
    filter: drop-shadow(0 0 7px rgba(0, 240, 255, 0.45));
}

.integration-platform-btn.active {
    background: rgba(0, 240, 255, 0.1);
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.15);
}

.integration-platform-btn.active .integration-platform-icon {
    filter: drop-shadow(0 0 8px rgba(0, 240, 255, 0.55));
}

.integration-guide {
    display: none;
}

.integration-guide.active {
    display: block;
    animation: settings-fade-in 0.2s ease;
}

.integration-steps {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px;
}

.integration-step {
    display: flex;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.integration-step:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.integration-step:first-child {
    padding-top: 0;
}

.integration-step-num {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid rgba(0, 240, 255, 0.3);
    color: var(--neon-cyan);
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    text-shadow: 0 0 8px rgba(0, 240, 255, 0.4);
}

.integration-step-content {
    flex: 1;
}

.integration-step-content strong {
    font-size: 15px;
    color: var(--text-primary);
    display: block;
    margin-bottom: 4px;
}

.integration-step-content p {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0;
}

.integration-fields-list {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.integration-field-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.integration-field-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    font-weight: 600;
}

.integration-field-row .integration-copy-block {
    margin-top: 0;
}

.integration-copy-block {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
}

.integration-copy-block code {
    flex: 1;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--neon-cyan);
    word-break: break-all;
}

.integration-copy-btn {
    padding: 6px 14px;
    background: rgba(0, 240, 255, 0.1);
    border: 1px solid rgba(0, 240, 255, 0.25);
    border-radius: var(--radius-sm);
    color: var(--neon-cyan);
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.integration-copy-btn:hover {
    background: rgba(0, 240, 255, 0.2);
}

.integration-example {
    color: rgba(0, 240, 255, 0.6) !important;
    font-style: italic;
    font-size: 14px;
}

.integration-instruction-block {
    padding: 12px 16px;
    background: rgba(0, 240, 255, 0.03);
    border: 1px dashed rgba(0, 240, 255, 0.15);
    border-left: 3px solid var(--neon-cyan);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    margin: 8px 0;
    box-shadow: var(--glow-sm);
}

/* ═══════════════════════════════════════════════════════════════════════
   Developer Playground
   ═══════════════════════════════════════════════════════════════════════ */

.playground-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 32px;
}

.playground-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid var(--border);
}

.playground-method {
    background: rgba(0, 240, 255, 0.15);
    color: var(--neon-cyan);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 800;
    font-family: var(--font-mono);
}

.playground-endpoint {
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--text-secondary);
    flex: 1;
}

.playground-run-btn {
    padding: 6px 16px;
    background: var(--neon-cyan);
    border: none;
    border-radius: var(--radius-sm);
    color: #000;
    font-size: 14px;
    font-weight: 700;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: all 0.2s;
}

.playground-run-btn:hover {
    background: #33f5ff;
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.4);
}

.playground-run-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.playground-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 200px;
}

.playground-panel {
    padding: 16px;
}

.playground-panel:first-child {
    border-right: 1px solid var(--border);
}

.playground-panel-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.playground-input-group {
    margin-bottom: 12px;
}

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

.playground-select {
    width: 100%;
    padding: 8px 10px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    font-family: var(--font-sans);
    outline: none;
}
.settings-key-search .playground-select {
    background: transparent;
}

.playground-select option {
    background: var(--bg-elevated);
    color: var(--text-primary);
    padding: 8px;
}

.playground-textarea {
    width: 100%;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    font-family: var(--font-mono);
    resize: vertical;
    outline: none;
    box-sizing: border-box;
}

.playground-textarea:focus {
    border-color: var(--neon-cyan);
}

.playground-output {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-secondary);
    overflow: auto;
    max-height: 300px;
    white-space: pre-wrap;
    word-break: break-word;
    margin: 0;
}

/* ── Developer Docs ────────────────────────────────────────────────── */

.dev-docs {
    margin-top: 8px;
}

.dev-docs-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 24px 0 8px;
}

.dev-docs-block {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
}

.dev-docs-block code {
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--neon-cyan);
    word-break: break-all;
}

.dev-docs-block pre {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
}

.dev-docs-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
}

.dev-docs-table th {
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
}

.dev-docs-table td {
    font-size: 14px;
    color: var(--text-secondary);
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

/* Neon separator line */
.dev-docs-separator {
    height: 1px;
    margin: 28px 0;
    background: linear-gradient(90deg, transparent, var(--neon-cyan), transparent);
    opacity: 0.4;
}

/* Language selector pills */
.dev-docs-lang-pills {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
}

.dev-lang-pill {
    padding: 6px 16px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-mono);
}

.dev-lang-pill:hover {
    color: var(--text-primary);
    border-color: var(--text-secondary);
}

.dev-lang-pill.active {
    background: rgba(0, 255, 200, 0.08);
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
    box-shadow: 0 0 8px rgba(0, 255, 200, 0.15);
}

/* Language panels */
.dev-lang-panel {
    display: none;
}

.dev-lang-panel.active {
    display: block;
}

/* Syntax highlighting */
.code-keyword {
    color: var(--neon-cyan);
    font-weight: 500;
}

.code-string {
    color: #7deba0;
}

/* ── Mini Usage Bar (API Keys tab) ────────────────────────────────── */
.mini-usage-bar {
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
}

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

.mini-usage-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.mini-usage-text {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

.mini-usage-track {
    height: 4px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 2px;
    overflow: hidden;
}

.mini-usage-fill {
    height: 100%;
    border-radius: 2px;
    background: var(--neon-cyan);
    box-shadow: 0 0 6px rgba(0, 255, 200, 0.3);
    transition: width 0.6s ease;
}

.mini-usage-fill--warn {
    background: #f0a040;
    box-shadow: 0 0 6px rgba(240, 160, 64, 0.3);
}

.mini-usage-fill--danger {
    background: #f04040;
    box-shadow: 0 0 6px rgba(240, 64, 64, 0.3);
}
/* ── Settings Responsive ───────────────────────────────────────────── */

@media (max-width: 768px) {
    .settings-page { padding: 20px 16px; }
    .billing-packages { grid-template-columns: 1fr; }
    .billing-usage-bars { flex-direction: column; }
    .playground-body { grid-template-columns: 1fr; }
    .playground-panel:first-child { border-right: none; border-bottom: 1px solid var(--border); }
    .settings-key-header, .settings-key-row { grid-template-columns: 1fr 100px 40px; }
    .settings-key-header span:nth-child(3), .settings-key-row span:nth-child(3),
    .settings-key-header span:nth-child(4), .settings-key-row span:nth-child(4) { display: none; }
}




/* ═══════════════════════════════════════════════════════════════════════
   HEADER ICON BUTTONS (split-view toggle, right sidebar toggle)
   ═══════════════════════════════════════════════════════════════════════ */

.header-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.header-icon-btn:hover {
    background: rgba(0, 240, 255, 0.1);
    color: var(--neon);
}

.header-icon-btn.active {
    background: rgba(0, 240, 255, 0.15);
    color: var(--neon);
    box-shadow: 0 0 8px rgba(0, 240, 255, 0.2);
}

html[data-theme="light"] .header-icon-btn {
    color: #374151;
    background: transparent;
    border: 1px solid transparent;
}
html[data-theme="light"] .header-icon-btn:hover,
html[data-theme="light"] .header-icon-btn.active {
    background: transparent;
    color: #0e7490;
    border-color: #d5dbe3;
    box-shadow: none;
}
html[data-theme="light"] #chat-open-btn {
    color: #374151;
    background: transparent;
    border: 1px solid transparent;
}
html[data-theme="light"] #chat-open-btn:hover {
    color: #0e7490;
    background: transparent;
    border-color: #d5dbe3;
}


/* ── Right Sidebar ─────────────────────────────────────────────────────
   Exact mirror of left sidebar (.app-sidebar at line 5174).
   position: fixed, top: 64px, right: 0, width: 260px.
   ───────────────────────────────────────────────────────────────────── */

.right-sidebar {
    width: 260px !important;
    min-width: 260px !important;
    height: calc(100vh - 64px) !important;
    background: var(--bg-sidebar);
    border-left: none !important;
    display: flex !important;
    flex-direction: column;
    position: fixed;
    top: 64px;
    right: 0;
    z-index: 950;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -10px 10px 30px rgba(0, 0, 0, 0.4);
    box-sizing: border-box;
    padding-top: 12px;
}

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

/* Content nav — exact copy of .sidebar-sections */
.right-sidebar-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0;
    scrollbar-width: none;
}

.right-sidebar-content::-webkit-scrollbar { display: none; }

/* Delete confirmation (✓ | ✕) */
.rs-item--confirming {
    background: rgba(255, 80, 80, 0.08) !important;
}

.rs-confirm-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
    flex-shrink: 0;
}

.rs-confirm-yes, .rs-confirm-no {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    transition: all 0.15s ease;
}

.rs-confirm-yes {
    background: rgba(255, 80, 80, 0.15);
    color: #ff5050;
}

.rs-confirm-yes:hover {
    background: rgba(255, 80, 80, 0.3);
}

.rs-confirm-divider {
    color: var(--text-muted);
    opacity: 0.3;
    font-size: 12px;
}

.rs-confirm-no {
    background: rgba(0, 240, 255, 0.08);
    color: var(--neon);
}

.rs-confirm-no:hover {
    background: rgba(0, 240, 255, 0.2);
}

/* Empty & loading states */
.rs-empty, .rs-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 13px;
    text-align: center;
}

.rs-loading { color: var(--neon); font-size: 12px; }

.rs-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid rgba(0, 240, 255, 0.15);
    border-top-color: var(--neon);
    border-radius: 50%;
    animation: rs-spin 0.8s linear infinite;
}

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

@media (max-width: 768px) {
    .right-sidebar { display: none !important; }
}


/* ═══════════════════════════════════════════════════════════════════════
   RIGHT SIDEBAR — Detail View
   ═══════════════════════════════════════════════════════════════════════ */

.rs-detail {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.rs-detail-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(0, 240, 255, 0.1);
    flex-shrink: 0;
}

.rs-detail-back {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: rgba(0, 240, 255, 0.06);
    color: var(--neon);
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.rs-detail-back:hover {
    background: rgba(0, 240, 255, 0.15);
}

.rs-detail-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary, #e0e6ed);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rs-detail-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.rs-detail-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--neon);
    opacity: 0.6;
    margin-bottom: 8px;
}

.rs-detail-symbols {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
}

.rs-detail-symbol {
    padding: 8px 12px;
    background: rgba(0, 240, 255, 0.04);
    border: 1px solid rgba(0, 240, 255, 0.08);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary, #e0e6ed);
    letter-spacing: 0.5px;
}

.rs-detail-add-row {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.rs-detail-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid rgba(0, 240, 255, 0.15);
    border-radius: 8px;
    background: rgba(0, 240, 255, 0.04);
    color: var(--text-primary, #e0e6ed);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease;
}

.rs-detail-input:focus {
    border-color: var(--neon);
    box-shadow: 0 0 0 2px rgba(0, 240, 255, 0.1);
}

.rs-detail-input::placeholder {
    color: var(--text-muted, #556677);
}

.rs-detail-add-btn {
    padding: 8px 16px;
    border: 1px solid rgba(0, 240, 255, 0.2);
    border-radius: 8px;
    background: rgba(0, 240, 255, 0.08);
    color: var(--neon);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.rs-detail-add-btn:hover {
    background: rgba(0, 240, 255, 0.18);
}

.rs-detail-holding {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 8px;
    background: rgba(0, 240, 255, 0.04);
    border: 1px solid rgba(0, 240, 255, 0.08);
    margin-bottom: 4px;
}

.rs-detail-holding-sym {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary, #e0e6ed);
    min-width: 60px;
}

.rs-detail-holding-shares {
    font-size: 13px;
    color: var(--text-secondary, #8899aa);
    flex: 1;
}

.rs-detail-holding-cost {
    font-size: 13px;
    color: var(--text-muted, #556677);
}

.rs-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(0, 240, 255, 0.06);
    font-size: 14px;
    color: var(--text-primary, #e0e6ed);
}

.rs-detail-row .rs-detail-label {
    margin-bottom: 0;
}


/* ═══════════════════════════════════════════════════════════════════════
   ALERT SYSTEM STYLES
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Alert Create Form ────────────────────────────────────────────────── */

.alert-create-view,
.alert-detail-view {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.alert-field-group {}

.alert-field-label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 8px;
}

/* Toggle button group */
.alert-toggle-group {
    display: flex;
    gap: 6px;
}

.alert-toggle-btn {
    flex: 1;
    padding: 10px 8px;
    border: 1px solid rgba(0, 240, 255, 0.12);
    border-radius: 8px;
    background: rgba(0, 240, 255, 0.03);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.alert-toggle-btn:hover {
    border-color: rgba(0, 240, 255, 0.25);
    background: rgba(0, 240, 255, 0.06);
    color: var(--text-secondary);
}

.alert-toggle-btn.active {
    border-color: rgba(0, 240, 255, 0.4);
    background: rgba(0, 240, 255, 0.08);
    color: var(--accent-primary, #00f0ff);
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.08);
}

/* Direction group */
.alert-dir-group .alert-toggle-btn {
    min-width: 0;
    flex: 1;
}

/* Ticker card (pre-filled) */
.alert-ticker-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid rgba(0, 240, 255, 0.1);
    border-radius: 10px;
    background: rgba(0, 240, 255, 0.03);
}

.alert-ticker-logo-wrap {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: rgba(0, 240, 255, 0.06);
}

.alert-ticker-logo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.alert-ticker-logo-wrap--clickable {
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.alert-ticker-logo-wrap--clickable:hover {
    transform: scale(1.08);
    box-shadow: 0 0 0 2px rgba(0, 240, 255, 0.25);
}

.alert-ticker-sym {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.alert-ticker-name {
    font-size: 11px;
    color: var(--text-muted);
}

.alert-ticker-price {
    margin-left: auto;
    font-size: 14px;
    font-weight: 700;
    color: var(--accent-primary, #00f0ff);
}

/* Value input */
.alert-value-input-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    border: 1px solid rgba(0, 240, 255, 0.12);
    border-radius: 8px;
    background: rgba(0, 240, 255, 0.03);
    transition: border-color 0.2s ease;
}

.alert-value-input-wrap:focus-within {
    border-color: rgba(0, 240, 255, 0.35);
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.06);
}

.alert-value-prefix {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    min-width: 14px;
}

.alert-value-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
}

.alert-value-input::placeholder {
    color: rgba(255, 255, 255, 0.2);
}

.alert-ref-line {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 6px;
}

/* Event type pills */
.alert-pill-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.alert-pill {
    padding: 8px 14px;
    border: 1px solid rgba(0, 240, 255, 0.12);
    border-radius: 20px;
    background: rgba(0, 240, 255, 0.03);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.alert-pill:hover {
    border-color: rgba(0, 240, 255, 0.25);
    color: var(--text-secondary);
}

.alert-pill.active {
    border-color: rgba(0, 240, 255, 0.5);
    background: rgba(0, 240, 255, 0.1);
    color: var(--accent-primary, #00f0ff);
    box-shadow: 0 0 16px rgba(0, 240, 255, 0.08);
}

/* Submit button */
.alert-create-submit {
    width: 100%;
    padding: 14px;
    border: 1px solid rgba(0, 240, 255, 0.3);
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.08), rgba(0, 200, 255, 0.04));
    color: var(--accent-primary, #00f0ff);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.alert-create-submit:hover:not(:disabled) {
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.14), rgba(0, 200, 255, 0.08));
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.1);
}

.alert-create-submit:disabled {
    opacity: 0.5;
    cursor: default;
}

html[data-theme="light"] .alert-create-view .wl-title-static {
    color: #111827 !important;
}
html[data-theme="light"] .alert-field-label {
    color: #374151;
}
html[data-theme="light"] .alert-toggle-btn {
    background: #ffffff;
    border-color: #d5dbe3;
    color: #374151;
}
html[data-theme="light"] .alert-toggle-btn:hover {
    background: #e8ecf0;
    border-color: #94a3b8;
    color: #111827;
}
html[data-theme="light"] .alert-toggle-btn.active {
    background: #e8ecf0;
    border-color: #0e7490;
    color: #111827;
    box-shadow: none;
}
html[data-theme="light"] .alert-value-input-wrap,
html[data-theme="light"] .alert-ticker-card {
    background: #ffffff;
    border-color: #d5dbe3;
}
html[data-theme="light"] .alert-value-input-wrap:focus-within {
    border-color: #0e7490;
    box-shadow: none;
}
html[data-theme="light"] .alert-value-prefix,
html[data-theme="light"] .alert-ticker-name,
html[data-theme="light"] .alert-ref-line {
    color: #4b5563;
}
html[data-theme="light"] .alert-value-input {
    color: #111827;
}
html[data-theme="light"] .alert-value-input::placeholder {
    color: #9ca3af;
}
html[data-theme="light"] .alert-ticker-price {
    color: #0e7490;
}
html[data-theme="light"] .alert-pill {
    background: #ffffff;
    border-color: #d5dbe3;
    color: #374151;
}
html[data-theme="light"] .alert-pill:hover {
    background: #e8ecf0;
    border-color: #94a3b8;
    color: #111827;
}
html[data-theme="light"] .alert-pill.active {
    background: #e8ecf0;
    border-color: #0e7490;
    color: #111827;
    box-shadow: none;
}
html[data-theme="light"] .alert-create-submit {
    background: #0e7490;
    border-color: #0e7490;
    color: #ffffff;
}
html[data-theme="light"] .alert-create-submit:hover:not(:disabled) {
    background: #0c5f75;
    box-shadow: none;
}

/* ── Sidebar Alert Items ──────────────────────────────────────────────── */

.alert-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-right: 4px;
}

.alert-sidebar-meta {
    font-size: 10px;
    color: var(--text-muted);
    opacity: 0.6;
    margin-left: auto;
    margin-right: 6px;
    white-space: nowrap;
}

.alert-notif-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #fbbf24;
    flex-shrink: 0;
    animation: alert-notif-pulse 2s ease-in-out infinite;
}

@keyframes alert-notif-pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 4px rgba(251, 191, 36, 0.4); }
    50% { opacity: 0.5; box-shadow: 0 0 8px rgba(251, 191, 36, 0.6); }
}

/* ── Notification Banner ──────────────────────────────────────────────── */

.alert-notif-banner {
    width: 100%;
    z-index: 100;
    background: linear-gradient(90deg, rgba(251, 191, 36, 0.2), rgba(0, 240, 255, 0.12));
    border-bottom: 1px solid rgba(251, 191, 36, 0.32);
    animation: alert-banner-slide 0.3s ease-out;
}

@keyframes alert-banner-slide {
    from { opacity: 0; transform: translateY(-100%); }
    to { opacity: 1; transform: translateY(0); }
}

.alert-notif-banner-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    max-width: 1400px;
    margin: 0 auto;
}

.alert-notif-banner-icon {
    color: #fbbf24;
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.alert-notif-banner-msg {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
    cursor: pointer;
}

.alert-notif-banner-msg:hover {
    text-decoration: underline;
    text-decoration-color: rgba(251, 191, 36, 0.5);
}

.alert-notif-banner-more {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
}

.alert-notif-banner-clear-all {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.alert-notif-banner-clear-all:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

html[data-theme="light"] .alert-notif-banner-clear-all:hover {
    background: rgba(0, 0, 0, 0.06);
}

.alert-notif-banner-dismiss {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.15s ease;
}

.alert-notif-banner-dismiss:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

/* ── Investing Menu Notification Dot ──────────────────────────────────── */

.investing-notif-dot {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #fbbf24;
    border: 2px solid var(--bg-primary, #050a14);
    animation: alert-notif-pulse 2s ease-in-out infinite;
}

/* ── Logged-out sidebar state and login button ──────────────────────── */

.rs-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 24px;
    text-align: center;
    color: var(--text-muted);
    gap: 16px;
}

.rs-login-btn {
    padding: 10px 24px;
    background: rgba(0, 240, 255, 0.1);
    border: 2px solid var(--neon-cyan);
    border-radius: var(--radius-md);
    color: var(--neon-cyan);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-shadow: 0 0 8px rgba(0, 240, 255, 0.3);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.1);
    margin-top: 8px;
}

.rs-login-btn:hover {
    background: rgba(0, 240, 255, 0.2);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.3);
    transform: translateY(-1px);
}

.rs-login-btn:active {
    transform: translateY(0);
}

/* ── Index Card Grid Layout for Desktop ── */
.index-card-left {
    display: grid;
    grid-template-areas:
        "name pct"
        "price delta";
    grid-template-columns: 1fr auto;
    gap: 4px;
    align-items: baseline;
    width: 100%;
}
.ic-name { grid-area: name; }
.ic-pct { grid-area: pct; }
.ic-price { grid-area: price; }
.ic-delta { grid-area: delta; }
.ic-stats { display: contents; }

/* ── Right Sidebar Mobile Header ── */
.right-sidebar-mobile-header {
    display: none;
}

/* ── Responsive Overrides (max-width: 768px) ── */
@media (max-width: 768px) {
    /* 1. Movers tables: keep columns, swipe the row (do not squeeze) */
    .movers-table {
        min-width: 0 !important;
        width: 100% !important;
    }
    .mkt-scroll .movers-table,
    #section-overview .movers-table,
    #world-table-wrap .movers-table {
        width: max-content !important;
        min-width: 100% !important;
    }
    #section-overview .movers-panel,
    #section-overview [id$="-tbl"],
    #world-table-wrap {
        max-width: 100%;
        min-width: 0;
    }
    .mover-name-text--sm {
        max-width: 100px !important;
    }

    /* 2. Slim Index Cards — keep the 56px row; hide spark on half-width Overview tiles */
    #section-indexes-body .index-card .ic-spark {
        display: none !important;
    }
    #section-indexes-body .index-cards > .index-card:last-child:nth-child(odd) .ic-spark {
        display: block !important;
        width: 90px !important;
        height: 28px !important;
    }
    .index-card {
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        padding: 8px 12px !important;
        gap: 12px !important;
        height: 56px !important;
    }
    .index-card-left {
        display: flex !important;
        flex-direction: column !important;
        gap: 2px !important;
        flex: 1 !important;
        min-width: 0 !important;
    }
    .ic-stats {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 8px !important;
    }
    .ic-name {
        font-size: 15px !important;
    }
    .ic-price {
        font-size: 13px !important;
    }
    .ic-delta, .ic-pct {
        font-size: 13px !important;
    }
    .ic-spark {
        width: 90px !important;
        height: 28px !important;
        margin: 0 !important;
        flex-shrink: 0 !important;
    }

    /* 3. Fullscreen Right Sidebar & Hiding Split View Toggle */
    .right-sidebar {
        display: flex !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        transform: none !important;
        opacity: 0 !important;
        pointer-events: none !important;
        transition: opacity 0.3s ease !important;
        z-index: 10000 !important;
        background: var(--bg-primary) !important;
        padding-top: 0 !important;
    }
    .right-sidebar.open {
        opacity: 1 !important;
        pointer-events: all !important;
    }
    .right-sidebar-mobile-header {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        padding: 16px 24px !important;
        border-bottom: 1px solid var(--border) !important;
        height: 64px !important;
        width: 100% !important;
        box-sizing: border-box !important;
        flex-shrink: 0 !important;
    }
    .right-sidebar-mobile-title {
        font-size: 16px !important;
        font-weight: 600 !important;
        color: var(--text-primary) !important;
    }
    .right-sidebar-mobile-close {
        background: transparent !important;
        border: none !important;
        color: var(--text-secondary) !important;
        cursor: pointer !important;
        padding: 8px !important;
        border-radius: 8px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    .right-sidebar-mobile-close:hover {
        color: var(--loss) !important;
        background: rgba(255, 255, 255, 0.05) !important;
    }
    #split-view-toggle,
    #split-divider {
        display: none !important;
    }

    /* 4. Technicals Table Sizing */
    .ta-table {
        min-width: 0 !important;
        width: 100% !important;
        table-layout: fixed !important;
    }
    .ta-table th:first-child,
    .ta-table td:first-child {
        width: 45% !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
    .ta-table th:nth-child(2),
    .ta-table td:nth-child(2) {
        width: 25% !important;
        white-space: nowrap !important;
    }
    .ta-table th:nth-child(3),
    .ta-table td:nth-child(3) {
        width: 30% !important;
        white-space: nowrap !important;
    }

    /* 5. Relocated Technical Indicators Selector */
    .ta-chart-row {
        display: flex !important;
        flex-direction: column !important;
    }
    .ta-indicators-panel {
        order: -1 !important;
        width: 100% !important;
        box-sizing: border-box !important;
        border-left: none !important;
        border-bottom: 1px solid var(--border) !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
        padding: 10px 12px !important;
        background: rgba(0,0,0,0.2) !important;
    }
    .ta-ind-item {
        padding: 6px 12px !important;
        background: rgba(255,255,255,0.04) !important;
        border-radius: 4px !important;
        font-size: 12px !important;
    }
    .ta-ind-item.active {
        background: rgba(0, 240, 255, 0.1) !important;
    }

    /* 6. Billing Package mobile collapsing */
    .billing-pkg-features li:not(:first-child) {
        display: none !important;
    }
    .billing-pkg-card.expanded .billing-pkg-features li:not(:first-child) {
        display: flex !important;
    }
    .billing-pkg-more-toggle {
        display: block !important;
    }
    .billing-pkg-card.expanded .billing-pkg-more-toggle {
        border-bottom: 1px solid rgba(255,255,255,0.05);
        margin-bottom: 4px;
    }

    /* 7. Settings Mobile Alignment */
    .settings-page {
        padding: 20px 16px !important;
    }
    .settings-section-header {
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 12px !important;
    }
    .settings-create-key-btn {
        padding: 6px 12px !important;
        font-size: 13px !important;
        white-space: nowrap !important;
    }
}

/* Earnings Calendar Price Loading Shimmer */
.cal-price-loading-cell {
    position: relative;
    vertical-align: middle;
}
.cal-price-shimmer {
    width: 45px;
    height: 16px;
    background: linear-gradient(90deg, rgba(255,255,255,0.06) 25%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.06) 75%);
    background-size: 200% 100%;
    animation: cal-shimmer-loading 1.4s infinite;
    border-radius: 4px;
    display: inline-block;
    vertical-align: middle;
}
@keyframes cal-shimmer-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ═══════════════════════════════════════════════════════════════════════
   Technical Analysis — Redesigned AI Summary Layout (ta-vm-*)
   ═══════════════════════════════════════════════════════════════════════ */

.ta-brain-icon { display:inline-block; vertical-align:middle; margin-right:5px; margin-bottom:1px; color:#a78bfa; filter:drop-shadow(0 0 4px rgba(167,139,250,.6)); transition:color .2s; }
.ta-ai-tab-btn.active .ta-brain-icon { color:#a78bfa; filter:drop-shadow(0 0 4px rgba(167,139,250,.6)); }
/* No top padding — toolbar already has margin-bottom:16px like other section menus */
.ta-new-wrap { display:flex; flex-direction:column; gap:12px; padding:0 0 20px; }
.ta-vm-card { background:linear-gradient(180deg,var(--bg-card,#0d121b) 0%,rgba(7,10,16,.97) 100%); border:1px solid var(--border,rgba(255,255,255,.07)); border-radius:10px; }
.ta-vm-panel-h { display:flex; align-items:center; justify-content:space-between; padding:12px 16px; border-bottom:1px solid rgba(255,255,255,.05); }
.ta-vm-panel-title { font-family:var(--font-mono); font-size:13px; letter-spacing:.14em; text-transform:uppercase; color:var(--text-muted); font-weight:600; }
.ta-vm-panel-sub { font-family:var(--font-mono); font-size:13px; letter-spacing:.1em; text-transform:uppercase; color:rgba(255,255,255,.2); }

.ta-verdict { display:flex; align-items:center; gap:18px; padding:16px 20px; flex-wrap:wrap; }
.ta-verdict-logo { width:36px; height:36px; border-radius:8px; background:linear-gradient(135deg,rgba(14,42,42,.9),rgba(10,22,32,.9)); border:1px solid rgba(0,212,170,.3); display:grid; place-items:center; flex-shrink:0; overflow:hidden; }
.ta-verdict-logo img { width:34px; height:34px; object-fit:contain; border-radius:6px; }
.ta-verdict-logo-letter { font-family:var(--font-mono); font-weight:700; font-size:16px; color:var(--neon-cyan,#00d4aa); }
.ta-verdict-ticker { display:flex; flex-direction:column; gap:2px; }
.ta-verdict-sym { font-family:var(--font-mono); font-weight:700; font-size:20px; letter-spacing:.02em; color:var(--text-primary); }
.ta-verdict-price { margin-left:auto; text-align:right; }
.ta-verdict-px { font-family:var(--font-mono); font-size:24px; font-weight:700; letter-spacing:-.01em; color:var(--text-primary); }
.ta-verdict-sig { display:flex; flex-direction:column; align-items:flex-end; gap:6px; padding-left:18px; border-left:1px solid rgba(255,255,255,.07); }
.ta-verdict-pill { display:inline-flex; align-items:center; font-family:var(--font-mono); font-size:13px; font-weight:600; letter-spacing:.04em; padding:4px 10px; border-radius:6px; border:1px solid transparent; text-transform:uppercase; }
.ta-verdict-conf { font-family:var(--font-mono); font-size:13px; color:rgba(255,255,255,.3); letter-spacing:.05em; }
.ta-verdict-conf b { color:#f59e0b; }

.ta-exec-header { display:flex; align-items:center; gap:8px; padding:14px 18px 10px; }
.ta-brain-dot { width:8px; height:8px; border-radius:50%; background:#a78bfa; box-shadow:0 0 8px rgba(167,139,250,.7); flex-shrink:0; }
.ta-exec-label { font-family:var(--font-mono); font-size:13px; letter-spacing:.14em; text-transform:uppercase; color:#a78bfa; font-weight:600; }
.ta-exec-date { margin-left:auto; font-family:var(--font-mono); font-size:13px; color:rgba(255,255,255,.25); letter-spacing:.08em; }
.ta-exec-text { margin:0; padding:0 18px 16px; font-size:13px; color:var(--text-muted); line-height:1.65; }

.ta-tf-row { display:grid; grid-template-columns:repeat(3,1fr); gap:12px; }
.ta-tf-chip { padding:14px 16px; display:flex; flex-direction:column; gap:8px; position:relative; overflow:hidden; }
.ta-tf-chip::before { content:''; position:absolute; left:0; top:0; bottom:0; width:3px; }
.ta-tf-bull::before { background:var(--gain,#3ddc97); }
.ta-tf-bear::before { background:var(--loss,#f87171); }
.ta-tf-neutral::before { background:#f59e0b; }
.ta-tf-chip-top { display:flex; align-items:center; justify-content:space-between; }
.ta-tf-chip-name { font-family:var(--font-mono); font-size:13px; letter-spacing:.14em; color:var(--text-muted); }
.ta-tf-chip-dir { font-family:var(--font-mono); font-size:13px; font-weight:600; }
.ta-tf-bull .ta-tf-chip-dir { color:var(--gain,#3ddc97); }
.ta-tf-bear .ta-tf-chip-dir { color:var(--loss,#f87171); }
.ta-tf-neutral .ta-tf-chip-dir { color:#f59e0b; }
.ta-tf-chip-note { margin:0; font-size:13px; color:var(--text-muted); line-height:1.5; }

.ta-regime-panel { padding:14px 16px 16px; display:flex; flex-direction:column; gap:12px; }
.ta-regime-row { display:grid; grid-template-columns:repeat(3,1fr); gap:12px; }
.ta-regime-chip { margin:0; }
.ta-regime-meta { color:rgba(255,255,255,.45); font-size:12px; letter-spacing:.02em; }
.ta-tf-alignment {
    margin:0 2px 4px; font-size:13px; color:var(--text-muted); line-height:1.45;
    font-family:var(--font-mono);
}

.ta-pricemap-grid { display:grid; grid-template-columns:1.15fr .85fr; gap:12px; align-items:stretch; }
.ta-pricemap-grid > .ta-vm-card { display:flex; flex-direction:column; }
.ta-pricemap-right { display:flex; flex-direction:column; gap:12px; height:100%; }
.ta-pricemap-right > .ta-vm-card:last-child { flex:1; }
.ta-pricemap-body { padding:16px 18px 24px; display:flex; flex-direction:column; flex:1; }
.ta-pricemap-legend { display:flex; gap:14px; margin-bottom:16px; flex-wrap:wrap; }
.ta-pm-lg { display:flex; align-items:center; gap:6px; font-size:13px; color:var(--text-muted); font-family:var(--font-mono); }
.ta-pm-lg i { width:9px; height:9px; border-radius:2px; display:inline-block; flex-shrink:0; }

.ta-ladder { position:relative; flex:1; min-height:750px; margin-left:72px; }
.ta-ladder-axis { position:absolute; left:0; top:0; bottom:0; width:2px; background:rgba(255,255,255,.07); }
.ta-ladder-zone { position:absolute; left:-72px; right:0; z-index:0; pointer-events:none; }
.ta-zone-sup { background:linear-gradient(90deg,rgba(61,220,151,.06),transparent); }
.ta-zone-res { background:linear-gradient(90deg,rgba(248,113,113,.05),transparent); }
.ta-ladder-lvl { position:absolute; left:0; right:0; transform:translateY(-50%); display:flex; align-items:center; height:22px; z-index:2; }
.ta-ladder-line { position:absolute; left:0; right:0; height:1px; background:rgba(255,255,255,.04); z-index:1; }
.ta-ladder-dot { position:absolute; left:-5px; width:12px; height:12px; border-radius:50%; border:2px solid rgba(7,10,16,.95); z-index:3; }
.ta-ladder-px { position:absolute; right:calc(100% + 12px); width:60px; text-align:right; font-family:var(--font-mono); font-size:13px; font-weight:600; }
.ta-ladder-src { margin-left:16px; font-size:13px; color:rgba(255,255,255,.28); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:200px; }
.ta-trade-pill { margin-left:auto; flex-shrink:0; font-family:var(--font-mono); font-size:13px; font-weight:600; padding:2px 8px; border-radius:5px; letter-spacing:.04em; }
.ta-ladder-trade .ta-ladder-src { display:none; }
.ta-ladder-now { position:absolute; left:-72px; right:0; transform:translateY(-50%); z-index:4; display:flex; align-items:center; pointer-events:none; }
.ta-ladder-now-bar { position:absolute; left:0; right:0; height:2px; background:linear-gradient(90deg,var(--neon-cyan,#00d4aa),rgba(0,212,170,.12)); box-shadow:0 0 10px rgba(0,212,170,.4); }
.ta-ladder-now-lbl { position:relative; background:var(--neon-cyan,#00d4aa); color:#04201c; font-family:var(--font-mono); font-weight:700; font-size:13px; padding:2px 8px; border-radius:4px; white-space:nowrap; }
.ta-ladder-now-sub { margin-left:8px; font-size:13px; color:var(--neon-cyan,#00d4aa); font-family:var(--font-mono); letter-spacing:.1em; text-transform:uppercase; }

.ta-momentum-body { padding:14px 16px; }
.ta-rsi-track { stroke: rgba(255,255,255,.06); }
.ta-rsi-tick { fill: rgba(255,255,255,.25); }
.ta-rsi-wrap { display:flex; align-items:center; gap:14px; padding-bottom:12px; border-bottom:1px solid rgba(255,255,255,.05); margin-bottom:2px; }
.ta-rsi-read { display:flex; flex-direction:row; align-items:center; gap:14px; flex:1; min-width:0; }
.ta-rsi-text { display:flex; flex-direction:column; gap:3px; flex:1; min-width:0; }
.ta-rsi-val { font-family:var(--font-mono); font-size:26px; font-weight:700; line-height:1; color:var(--text-primary); flex-shrink:0; }
.ta-rsi-key { font-size:13px; color:rgba(255,255,255,.28); font-family:var(--font-mono); letter-spacing:.1em; }
.ta-rsi-desc { font-size:13px; color:var(--text-muted); line-height:1.4; }
.ta-mom-row { display:flex; align-items:flex-start; gap:10px; padding:10px 0; border-bottom:1px solid rgba(255,255,255,.04); }
.ta-mom-row:last-child { border-bottom:0; padding-bottom:0; }
.ta-mom-key { font-family:var(--font-mono); font-size:13px; letter-spacing:.1em; color:rgba(255,255,255,.28); width:44px; flex-shrink:0; padding-top:1px; text-transform:uppercase; }
.ta-mom-val { font-size:13px; color:var(--text-muted); flex:1; line-height:1.4; }
.ta-mom-val-wrap { flex:1; display:flex; flex-direction:column; gap:5px; }
.ta-adx-bar { height:4px; border-radius:2px; background:rgba(255,255,255,.06); overflow:hidden; }
.ta-adx-fill { height:100%; border-radius:2px; background:#f59e0b; }
.ta-italic { font-style:italic; }

.ta-ma-body { padding:4px 16px 22px; }
.ta-ma-ref { display:flex; justify-content:space-between; align-items:baseline; padding:10px 0 6px; font-family:var(--font-mono); font-size:13px; letter-spacing:.1em; color:rgba(255,255,255,.25); text-transform:uppercase; }
.ta-ma-ref-px { color:var(--neon-cyan,#00d4aa); font-weight:600; font-size:13px; }
.ta-ma-line { display:grid; grid-template-columns:58px 1fr 46px; align-items:center; gap:12px; padding:10px 0; border-bottom:1px solid rgba(255,255,255,.04); }
.ta-ma-line:last-of-type { border-bottom:0; }
.ta-ma-label { font-family:var(--font-mono); font-size:13px; letter-spacing:.08em; color:var(--text-muted); }
.ta-dbar { position:relative; height:7px; border-radius:4px; background:rgba(255,255,255,.05); overflow:hidden; }
.ta-dbar-ctr { position:absolute; left:50%; top:0; bottom:0; width:1px; background:rgba(255,255,255,.18); z-index:2; }
.ta-dbar-fill { position:absolute; top:0; bottom:0; z-index:1; border-radius:4px; }
.ta-dbar-up { left:50%; background:linear-gradient(90deg,rgba(61,220,151,.3),var(--gain,#3ddc97)); }
.ta-dbar-dn { right:50%; background:linear-gradient(270deg,rgba(248,113,113,.3),var(--loss,#f87171)); }
.ta-ma-pct { font-family:var(--font-mono); font-size:13px; font-weight:600; text-align:right; }
.ta-pct-up { color:var(--gain,#3ddc97); }
.ta-pct-dn { color:var(--loss,#f87171); }
.ta-ma-footer { padding:10px 0 2px; font-size:13px; color:var(--text-muted); line-height:1.5; }
.ta-ma-footer b { color:var(--text-primary); }

.ta-trade-body { padding:16px 18px; min-width:0; max-width:100%; box-sizing:border-box; }
.ta-trade-flow { display:flex; align-items:stretch; gap:0; flex-wrap:wrap; }
.ta-trade-step { flex:1; min-width:110px; padding:0 16px; position:relative; }
.ta-trade-step:not(:last-child)::after { content:''; position:absolute; right:0; top:6px; bottom:6px; width:1px; background:rgba(255,255,255,.07); }
.ta-step-key { font-family:var(--font-mono); font-size:13px; letter-spacing:.12em; color:rgba(255,255,255,.28); text-transform:uppercase; margin-bottom:6px; }
.ta-step-val { font-family:var(--font-mono); font-size:16px; font-weight:700; letter-spacing:-.01em; word-break:break-word; color:var(--text-primary); }
.ta-trade-foot { display:flex; align-items:flex-start; gap:8px; margin-top:14px; padding-top:12px; border-top:1px solid rgba(255,255,255,.05); font-size:13px; color:#f59e0b; line-height:1.5; }
@media (max-width:760px) {
  .ta-trade-flow {
    flex-wrap:nowrap;
    overflow-x:auto;
    overscroll-behavior-x:contain;
    -webkit-overflow-scrolling:touch;
    scrollbar-width:none;
    width:100%;
    max-width:100%;
    min-width:0;
    padding:0 0 2px;
  }
  .ta-trade-flow::-webkit-scrollbar { display:none; }
  .ta-trade-step {
    flex:0 0 auto;
    width:148px;
    min-width:148px;
    max-width:148px;
    padding:0 12px;
    box-sizing:border-box;
  }
  .ta-step-key { font-size:11px; letter-spacing:.08em; margin-bottom:4px; }
  .ta-step-val { font-size:14px; }
  .ta-step-sub { font-size:11px; max-width:none; }
}

.ta-botgrid { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.ta-vol-body { padding:14px 16px; }
.ta-vol-stats { display:flex; gap:20px; margin-bottom:12px; }
.ta-vstat-k { font-family:var(--font-mono); font-size:13px; color:rgba(255,255,255,.28); letter-spacing:.1em; text-transform:uppercase; }
.ta-vstat-v { font-family:var(--font-mono); font-size:13px; font-weight:600; margin-top:3px; }
.ta-vol-note { font-size:13px; color:var(--text-muted); line-height:1.55; }
.ta-vol-spike { display:flex; gap:8px; margin-top:10px; padding:10px 12px; border-radius:8px; background:rgba(251,191,36,.06); border:1px solid rgba(251,191,36,.18); font-size:13px; color:#e3c48a; line-height:1.5; }
.ta-risk-body { padding:14px 16px; display:flex; flex-direction:column; gap:12px; }
.ta-rr { display:flex; align-items:baseline; gap:10px; }
.ta-rr-val { font-family:var(--font-mono); font-size:20px; font-weight:700; color:var(--text-primary); }
.ta-rr-k { font-size:13px; color:var(--text-muted); }
.ta-flags { display:flex; flex-wrap:wrap; gap:7px; }
.ta-flag { display:inline-flex; align-items:center; gap:5px; font-size:13px; color:#e0a9a9; background:rgba(248,113,113,.06); border:1px solid rgba(248,113,113,.18); padding:5px 9px; border-radius:7px; font-family:var(--font-mono); }

@media (max-width:840px) {
    .ta-pricemap-grid { grid-template-columns:1fr; }
    .ta-tf-row { grid-template-columns:1fr; }
    .ta-regime-row { grid-template-columns:1fr; }
    .ta-botgrid { grid-template-columns:1fr; }
    .ta-verdict-price { margin-left:0; width:100%; }
    .ta-verdict-sig { align-items:flex-start; padding-left:0; border-left:0; }
    .ta-ladder { height:650px; min-height:650px; }
}

/* ── Compact metric strip (replaces verdict bar) ──────────────────────── */
.ta-metric-strip {
    display: flex; align-items: center; gap: 0;
    padding: 0; overflow: hidden;
}
.ta-metric-item {
    display: flex; flex-direction: column; gap: 4px;
    padding: 14px 28px; flex: 1;
}
.ta-metric-item:first-child { padding-left: 20px; }
.ta-metric-sep {
    width: 1px; align-self: stretch; background: rgba(255,255,255,.07); flex-shrink: 0;
}
.ta-metric-label {
    font-family: var(--font-mono); font-size: 13px;
    letter-spacing: .12em; text-transform: uppercase;
    color: rgba(255,255,255,.3); font-weight: 600;
}
.ta-metric-val {
    font-family: var(--font-mono); font-size: 20px; font-weight: 700;
    color: var(--text-primary); letter-spacing: -.01em;
}
.ta-metric-item .ta-verdict-pill {
    font-size: 13px; padding: 4px 10px; align-self: flex-start;
}
@media (max-width: 640px) {
    .ta-metric-strip {
        flex-wrap: nowrap;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }
    .ta-metric-strip::-webkit-scrollbar { display: none; }
    .ta-metric-sep { display: block; }
    .ta-metric-item {
        flex: 1 1 0;
        min-width: 96px;
        padding: 12px 14px;
        border-bottom: 0;
    }
    .ta-metric-item:first-child { padding-left: 14px; }
    .ta-metric-label { font-size: 11px; letter-spacing: .08em; }
    .ta-metric-val { font-size: 16px; }
    .ta-metric-item .ta-verdict-pill { font-size: 11px; padding: 3px 8px; }
}

/* Trade plan cell subtitle */
.ta-step-sub {
    font-size: 13px; color: var(--text-muted);
    margin-top: 4px; line-height: 1.3;
    max-width: 150px; word-break: break-word;
}

/* Bump up all 13px (including previous 10px/11px/12px elements bumped to 13px) to 14px */
.ta-vm-panel-title,
.ta-vm-panel-sub,
.ta-verdict-pill,
.ta-verdict-conf,
.ta-exec-label,
.ta-exec-date,
.ta-exec-text,
.ta-tf-chip-name,
.ta-tf-chip-dir,
.ta-tf-chip-note,
.ta-pm-lg,
.ta-ladder-px,
.ta-ladder-src,
.ta-trade-pill,
.ta-ladder-now-lbl,
.ta-ladder-now-sub,
.ta-rsi-key,
.ta-rsi-desc,
.ta-mom-key,
.ta-mom-val,
.ta-ma-ref,
.ta-ma-ref-px,
.ta-ma-label,
.ta-ma-pct,
.ta-ma-footer,
.ta-step-key,
.ta-trade-foot,
.ta-vstat-k,
.ta-vstat-v,
.ta-vol-note,
.ta-vol-spike,
.ta-rr-k,
.ta-flag,
.ta-metric-label,
.ta-metric-item .ta-verdict-pill,
.ta-step-sub {
    font-size: 14px !important;
}

/* -- Portfolio Weekly Recap panel ─────────────────────────────────── */
.pf-recap-panel {
    padding: 0 14px 28px;
    overflow-x: hidden;
    overflow-y: auto;
    max-height: calc(100vh - 180px);
    min-width: 0;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
}
.pf-detail,
.pf-detail .wl-header {
    min-width: 0;
    max-width: 100%;
}
.pf-recap-panel::-webkit-scrollbar { width: 6px; }
.pf-recap-panel::-webkit-scrollbar-thumb { background: rgba(148,163,184,.25); border-radius: 3px; }
@media (max-width: 760px) {
    .pf-recap-panel { padding: 0 12px 32px; }
}

/* legacy pf-recap helpers (panel shell only — layout lives in pf-recap.js) */
/* -- Large Moves (stock Overview) ───────────────────────────────── */
.mt-root { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 18px 20px; }
.mt-list { display: flex; flex-direction: column; gap: 0; position: relative; padding-left: 20px; }
.mt-list::before { content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px; background: var(--border); }
.mt-card { position: relative; padding: 0 0 18px 16px; }
.mt-dot { position: absolute; left: -17px; top: 6px; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--bg-card); }
.mt-dot.mt-up { background: var(--gain, #4ade80); }
.mt-dot.mt-down { background: var(--loss, #f87171); }
.mt-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 8px; }
.mt-date { display: flex; flex-direction: column; align-items: center; min-width: 42px; line-height: 1.1; }
.mt-mon { font-size: 9px; letter-spacing: .08em; color: var(--text-muted); }
.mt-day { font-size: 18px; font-weight: 800; }
.mt-yr { font-size: 9px; color: var(--text-muted); }
.mt-price { font-size: 13px; color: var(--text-secondary); }
.mt-lbl { font-size: 9px; letter-spacing: .1em; color: var(--text-muted); margin-right: 4px; }
.mt-pct { font-size: 15px; font-weight: 700; margin-left: auto; }
.mt-pct.mt-up { color: var(--gain, #4ade80); }
.mt-pct.mt-down { color: var(--loss, #f87171); }
.mt-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.mt-tag { font-size: 9px; font-weight: 700; letter-spacing: .06em; padding: 3px 7px; border-radius: 4px; background: rgba(124,58,237,.12); color: #a78bfa; border: 1px solid rgba(124,58,237,.25); }
.mt-summary { font-size: 14px; line-height: 1.55; color: var(--text-secondary); }
.mt-expand-btn { margin-top: 8px; background: none; border: 1px solid var(--border); color: var(--text-muted); font-size: 11px; padding: 4px 10px; border-radius: 6px; cursor: pointer; }
.mt-expand-btn:hover { color: var(--text-primary); border-color: var(--accent, #7c3aed); }
.mt-detail { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); display: none; }
.mt-card.mt-expanded .mt-detail { display: block; }
.mt-block { margin-bottom: 12px; font-size: 13px; color: var(--text-secondary); }
.mt-block ul { margin: 6px 0 0; padding-left: 18px; }
.mt-block li { margin-bottom: 4px; line-height: 1.5; }

/* ═══════════════════════════════════════════════════════════════════════
   Benchmark — AI Competitive Landscape (company_competitors) — cc-*
   ═══════════════════════════════════════════════════════════════════════ */

/* Match Thesis (.sr-root) top rhythm: no extra section title, tight gap under tab menu */
.cc-root,
.fc-root,
.va-root,
.mq-root { padding: 0 0 20px; }
.cc-meta { font-size: 12px; color: var(--text-muted); margin: 0 2px 8px; text-align: right; line-height: 1; display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.cc-meta-date { line-height: 1; }
.dd-section-dl {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; padding: 0; margin: 0;
  border: none; border-radius: 5px; background: transparent;
  color: var(--text-muted); cursor: pointer; flex-shrink: 0;
}
.dd-section-dl:hover { color: #2dd4bf; background: rgba(45, 212, 191, 0.12); }
.dd-section-dl:disabled, .dd-section-dl.is-busy { opacity: 1; cursor: wait; color: #2dd4bf; }
.cc-stale { color: #f59e0b; }
.cc-divider { height: 1px; background: var(--border); margin: 22px 0; }

/* Verdict badges */
.cc-verdict { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.cc-vb { flex: 1 1 160px; min-width: 140px; border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; background: var(--bg-card); border-left: 3px solid var(--text-muted); overflow: hidden; }
.cc-vb-k { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-vb-v { font-size: 22px; font-weight: 700; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.cc-vb.good { border-left-color: var(--gain); }
.cc-vb.good .cc-vb-v { color: var(--gain); }
.cc-vb.cy { border-left-color: var(--neon-cyan); }
.cc-vb.cy .cc-vb-v { color: var(--neon-cyan); }
.cc-vb.amb { border-left-color: #f59e0b; }
.cc-vb.amb .cc-vb-v { color: #f59e0b; }
.cc-vb.bad { border-left-color: #f87171; }
.cc-vb.bad .cc-vb-v { color: #f87171; }

/* Headline KPI strip */
.cc-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-bottom: 4px; }
.cc-kpi { background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }
.cc-kpi-k { font-size: 13px; letter-spacing: .06em; color: var(--text-muted); margin-bottom: 5px; }
.cc-kpi-v { font-size: 18px; font-weight: 800; font-family: var(--font-mono); color: var(--text-primary); }
.cc-kpi-v.positive { color: var(--gain); }
.cc-kpi-v.negative { color: var(--loss); }
.cc-kpi-c { font-size: 12px; margin-top: 3px; color: var(--text-muted); }
.cc-kpi-c.positive { color: var(--gain); }
.cc-kpi-c.negative { color: var(--loss); }

/* Mobile: one-line sideways scroll (Financials / Forecast / Valuation / Competition / People) */
@media (max-width: 760px) {
  .cc-root, .fc-root, .mq-root { overflow-x: clip; max-width: 100%; }
  .cc-verdict {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 10px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 0 0 2px;
    margin: 0 0 18px;
  }
  .cc-verdict::-webkit-scrollbar { display: none; }
  .cc-verdict > .cc-vb {
    flex: 0 0 auto;
    width: 168px;
    min-width: 168px;
    max-width: 168px;
    box-sizing: border-box;
    padding: 9px 11px;
  }
  /* Shared mobile type for all metric / verdict cards */
  .cc-verdict > .cc-vb .cc-vb-k,
  .cc-kpis > .cc-kpi .cc-kpi-k,
  .mq-root .cc-vb-k,
  .mq-strip .cc-kpi-k,
  .fc-tiles > .tile .k,
  .va-tiles > .va-tile .k,
  .va-tiles-3 > .va-tile .k {
    font-size: 11px;
    letter-spacing: .05em;
  }
  .cc-verdict > .cc-vb .cc-vb-v,
  .cc-kpis > .cc-kpi .cc-kpi-v,
  .mq-root .cc-vb-v,
  .mq-strip .cc-kpi-v,
  .fc-tiles > .tile .v,
  .va-tiles > .va-tile .v,
  .va-tiles-3 > .va-tile .v {
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .cc-kpis > .cc-kpi .cc-kpi-c,
  .fc-tiles > .tile .c,
  .va-tiles > .va-tile .c,
  .va-tiles-3 > .va-tile .c {
    font-size: 11px;
  }
  .cc-kpis {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 10px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 0 0 2px;
    margin: 0 0 4px;
  }
  .cc-kpis::-webkit-scrollbar { display: none; }
  .cc-kpis > .cc-kpi {
    flex: 0 0 auto;
    width: 148px;
    min-width: 148px;
    max-width: 148px;
    box-sizing: border-box;
    overflow: hidden;
    padding: 9px 11px;
  }
}

/* Section slabs (title bar) */
.cc-slab { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.cc-slab-l { font-size: 13px; font-weight: 700; color: var(--text-primary); letter-spacing: .01em; }
.cc-slab-l.cc-purple { color: #a78bfa; }
.cc-slab-r { font-size: 12px; color: var(--text-muted); }
.cc-clabel { font-size: 13px; letter-spacing: .07em; text-transform: uppercase; color: var(--text-muted); margin: 14px 0 8px; }
.cc-brief { font-size: 14px; line-height: 1.6; color: var(--text-secondary); margin: 0; }
.cc-brief-sm { font-size: 14px; }

/* DeepDive narrative clamp — paragraphs only (lists stay fully visible) */
.dd-clamped {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
    overflow: hidden;
}
.dd-more-btn {
    display: inline-block;
    margin: 6px 0 0;
    padding: 0;
    border: none;
    background: none;
    color: var(--neon-cyan);
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    line-height: 1.2;
}
.dd-more-btn:hover { text-decoration: underline; color: #67e8f9; }

/* Moat source chips */
.cc-moat-src { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 14px; }
.cc-ms { font-size: 13px; font-weight: 600; padding: 5px 10px; border-radius: 20px; background: rgba(124, 58, 237, .10); color: #c4b5fd; border: 1px solid rgba(124, 58, 237, .22); }

/* Two-column layout */
.cc-grid2 { display: grid; grid-template-columns: 1.1fr 1fr; gap: 22px; }
@media (max-width: 900px) { .cc-grid2 { grid-template-columns: 1fr; } }
.cc-lft, .cc-rgt { min-width: 0; }

/* Attribute key/value rows */
.cc-attrs { display: flex; flex-direction: column; gap: 7px; }
.cc-attr { display: flex; align-items: center; justify-content: space-between; font-size: 14px; padding: 6px 0; border-bottom: 1px dashed var(--border); }
.cc-attr:last-child { border-bottom: none; }
.cc-attr-k { color: var(--text-muted); }
.cc-attr-v { font-weight: 700; }
.cc-attr-v.cc-g { color: var(--gain); }
.cc-attr-v.cc-a { color: #f59e0b; }
.cc-attr-v.cc-r { color: #f87171; }
.cc-attr-v.cc-c { color: var(--neon-cyan); }
.cc-attr-v.cc-n { color: var(--text-secondary); }

/* Metric tiles */
.cc-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.cc-tiles-2 { grid-template-columns: repeat(2, 1fr); }
.cc-tile { background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; }
.cc-tile-k { font-size: 13px; letter-spacing: .05em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 4px; }
.cc-tile-v { font-size: 15px; font-weight: 700; font-family: var(--font-mono); color: var(--text-primary); }
.cc-tile-v.cc-green { color: var(--gain); }
.cc-tile-v.cc-amber { color: #f59e0b; }
.cc-tile-v.cc-red { color: #f87171; }
.cc-tile-c { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.cc-tile.cc-null { opacity: .55; }
.cc-tile.cc-null .cc-tile-v { color: var(--text-muted); font-style: italic; }

/* Callouts */
.cc-callout { display: flex; align-items: flex-start; gap: 9px; font-size: 14px; line-height: 1.55; padding: 11px 14px; border-radius: 8px; margin-top: 14px; color: var(--text-secondary); }
.cc-callout.cc-cy { background: rgba(0, 240, 255, .06); border: 1px solid rgba(0, 240, 255, .18); }
.cc-callout.cc-amb { background: rgba(245, 158, 11, .08); border: 1px solid rgba(245, 158, 11, .2); }
.cc-callout.cc-neutral { background: var(--bg-card); border: 1px solid var(--border); }
.cc-callout b { color: var(--text-primary); }

/* Reinforcement / threats two-column lists */
.cc-er { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 900px) { .cc-er { grid-template-columns: 1fr; } }
.cc-mlab { font-size: 13px; letter-spacing: .06em; text-transform: uppercase; font-weight: 700; margin-bottom: 7px; }
.cc-mlab.cc-green { color: var(--gain); }
.cc-mlab.cc-red { color: #f87171; }
.cc-mlist { margin: 0; padding-left: 16px; font-size: 14px; line-height: 1.55; color: var(--text-secondary); }
.cc-mlist li { margin-bottom: 6px; }
.cc-mlist.cc-g li::marker { color: var(--gain); }
.cc-mlist.cc-r li::marker { color: #f87171; }

/* Industry "arena" cards */
.cc-arena { background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; margin-bottom: 12px; }
.cc-ahead { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.cc-aname { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.cc-tier { font-size: 13px; font-weight: 700; padding: 3px 9px; border-radius: 20px; border: 1px solid var(--border); color: var(--text-secondary); }
.cc-tier.leader { color: var(--gain); border-color: rgba(77, 158, 110, .35); background: rgba(77, 158, 110, .08); }
.cc-tier.challenger { color: var(--neon-cyan); border-color: rgba(0, 240, 255, .3); background: rgba(0, 240, 255, .06); }
.cc-tier.niche { color: #f59e0b; border-color: rgba(245, 158, 11, .3); background: rgba(245, 158, 11, .06); }
.cc-afacts { display: flex; gap: 16px; margin-left: auto; flex-wrap: wrap; }
.cc-fact { display: flex; flex-direction: column; font-size: 12px; }
.cc-fk { color: var(--text-muted); font-size: 12px; letter-spacing: .05em; text-transform: uppercase; }
.cc-fv { color: var(--text-primary); font-weight: 600; }
.cc-apos { font-size: 14px; color: var(--text-secondary); line-height: 1.55; margin-bottom: 4px; }

/* Competitor rows (also reused by Suppliers) */
.cc-comps { display: flex; flex-direction: column; gap: 6px; }
.cc-comp { display: flex; align-items: stretch; gap: 10px; background: rgba(255, 255, 255, .015); border: 1px solid var(--border); border-radius: 8px; padding: 9px 12px; }
.cc-strength { width: 3px; border-radius: 2px; flex-shrink: 0; background: var(--text-muted); }
.cc-comp.cc-stronger .cc-strength { background: #f87171; }
.cc-comp.cc-comparable .cc-strength { background: #f59e0b; }
.cc-comp.cc-weaker .cc-strength { background: var(--gain); }
.cc-cbody { flex: 1; min-width: 0; }
.cc-ctop { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cc-cn { font-size: 14px; font-weight: 700; color: var(--text-primary); }
a.cc-cn { color: var(--text-primary); }
.cc-ctk { font-size: 13px; font-family: var(--font-mono); color: var(--neon-cyan); background: rgba(0, 240, 255, .08); padding: 1px 6px; border-radius: 4px; }
a.cc-ctk { color: var(--neon-cyan); }
.cc-ctk.cc-na { color: var(--text-muted); background: rgba(255, 255, 255, .05); }
a.cc-clink { cursor: pointer; }
a.cc-clink:hover { text-decoration: underline; }
.cc-ctype { font-size: 12px; color: var(--text-muted); text-transform: capitalize; }
.cc-sbadge { font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 2px 7px; border-radius: 10px; margin-left: auto; }
.cc-sbadge.cc-stronger { color: #f87171; background: rgba(248, 113, 113, .1); }
.cc-sbadge.cc-comparable { color: #f59e0b; background: rgba(245, 158, 11, .1); }
.cc-sbadge.cc-weaker { color: var(--gain); background: rgba(77, 158, 110, .1); }
.cc-cdiff { font-size: 12px; color: var(--text-muted); margin-top: 4px; line-height: 1.5; }

/* Suppliers empty-state box */
.cc-empty-state { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-muted); background: var(--bg-card); border: 1px dashed var(--border); border-radius: 8px; padding: 12px 14px; font-style: italic; }

/* "More" accordion — open by default */
.cc-more { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.cc-more-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; cursor: pointer; background: var(--bg-card); font-size: 14px; font-weight: 600; color: var(--text-primary); user-select: none; }
.cc-more-header:hover { background: rgba(255, 255, 255, .03); }
.cc-more-toggle-icon { font-size: 12px; color: var(--text-muted); }
.cc-more-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 14px; }
.cc-mlab2 { font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 5px; }
.cc-more-body p { margin: 0; font-size: 14px; line-height: 1.6; color: var(--text-secondary); }

/* Sources strip */
.cc-srcs { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.cc-srcs a, .cc-srcs span { font-size: 12px; color: var(--text-muted); text-decoration: none; }
.cc-srcs a:hover { color: var(--neon-cyan); }
.cc-srcs .cc-n { color: var(--text-muted); margin-right: 3px; font-family: var(--font-mono); }

/* Fine print under every Deep Dive Sources accordion */
.dd-ai-disclaimer {
  margin: 10px 2px 0;
  padding: 0;
  font-size: 11px;
  line-height: 1.4;
  color: var(--text-muted);
  opacity: 0.9;
  font-weight: 400;
}
.dd-powered {
  margin: 4px 2px 0;
  padding: 0;
  font-size: 11px;
  line-height: 1.4;
  color: var(--text-muted);
  opacity: 0.9;
  font-weight: 400;
}
.dd-powered a {
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.dd-powered a:hover { color: var(--neon-cyan); }

/* Benchmark | Peers icon toggle — sits top-right of the chart header, next to the beta badge */
.bm-mode-toggle { display: flex; gap: 2px; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 2px; flex-shrink: 0; }
.bm-mode-btn { display: flex; align-items: center; justify-content: center; width: 26px; height: 22px; background: none; border: none; border-radius: 4px; color: var(--text-muted); cursor: pointer; transition: var(--transition); }
.bm-mode-btn:hover { background: var(--bg-hover); color: var(--text-secondary); }
.bm-mode-btn.active { background: rgba(0, 240, 255, .1); color: var(--neon-cyan); }

/* ═══════════════════════════════════════════════════════════════════════
   Financials — AI Financial & Forensic Analysis (financial_analysis) — fa-*
   Shares cc-root/cc-meta/cc-verdict/cc-kpis/cc-slab/cc-brief/cc-grid2/cc-er/
   cc-mlist/cc-tiles/cc-more/cc-srcs/cc-empty-state — new classes below cover
   only the chart primitives specific to this surface (bars, donut, gauges,
   waterfall) that company_competitors didn't need.
   ═══════════════════════════════════════════════════════════════════════ */

/* Section icon + heading row (icon chip left of the cc-slab-style title) */
.fa-sechead { display: flex; align-items: center; gap: 10px; margin-bottom: 13px; flex-wrap: wrap; }
.fa-sechead .fa-ico { width: 26px; height: 26px; border-radius: 7px; background: var(--bg-card); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--neon-cyan); }
.fai-note .fa-sechead { flex-wrap: nowrap; }
.fai-note .fa-sechead h3 { min-width: 0; }
.fai-note .fa-sechead .fa-ico { width: auto; height: auto; background: transparent; border: none; border-radius: 0; }
.fai-note .fai-marks { margin-left: auto; display: inline-flex; gap: 1px; flex-shrink: 0; line-height: 1; }
.fai-note .fai-marks span { font-size: 12px; color: var(--text-muted); opacity: .28; }
.fai-note .fai-marks span.on { color: #c8960c; opacity: 1; }
.fai-note .cc-brief + .fa-chart-lab { margin-top: 22px; }
.fai-rev { margin-top: 8px; }
.fai-rev-svg { width: 100%; height: auto; display: block; overflow: visible; }
.fai-rev-area { fill: rgba(0, 240, 255, .16); }
.fai-rev-line { fill: none; stroke: var(--neon-cyan); stroke-width: 2; }
.fai-rev-dot { fill: var(--neon-cyan); }
.fai-rev-grid { stroke: var(--border); stroke-width: 1; }
.fai-rev-spine { stroke: var(--text-muted); stroke-width: 1; }
.fai-rev-axis { fill: var(--text-secondary); font-size: 10px; font-family: var(--font-mono); }
.fai-rev-unit { font-size: 12px; color: var(--text-muted); margin-top: 6px; text-align: center; padding-left: 9%; padding-right: 2%; }
.fai-seg-scroll { margin-top: 18px; width: 100%; max-width: 100%; min-width: 0; overflow-x: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
.fai-seg { width: 100%; border-collapse: collapse; margin-top: 0; }
.fai-seg th { font-size: 12px; font-weight: 600; color: var(--text-muted); text-align: right; padding: 8px 10px 10px; border-bottom: 1px solid var(--border); }
.fai-seg th:first-child { text-align: left; }
.fai-seg td { font-size: 14px; padding: 11px 10px; border-bottom: 1px solid var(--border); color: var(--text-primary); }
.fai-seg td.num { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
@media (max-width: 760px) {
  .fai-seg-scroll { touch-action: pan-x pan-y; }
  .fai-seg { width: max-content; min-width: 520px; }
  .fai-seg th, .fai-seg td { white-space: nowrap; }
}
.fai-note .dd-sources { margin-top: 32px; }
.fai-follows { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 15px; }
.fai-note .fa-sechead .fa-key,
.fai-note .fa-sechead .fa-badge { display: none; }
.fa-sechead h3 { margin: 0; font-size: 13px; font-weight: 700; color: var(--text-primary); letter-spacing: .01em; }
.fa-sechead .fa-key { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); background: var(--bg-card); border: 1px solid var(--border); padding: 2px 7px; border-radius: 5px; }
.fa-sechead .fa-badge { margin-left: auto; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 3px 9px; border-radius: 6px; flex-shrink: 0; }
.fa-badge.good { color: var(--gain); background: rgba(77, 158, 110, .1); border: 1px solid rgba(77, 158, 110, .28); }
.fa-badge.amb { color: #f59e0b; background: rgba(245, 158, 11, .1); border: 1px solid rgba(245, 158, 11, .28); }
.fa-badge.bad { color: #f87171; background: rgba(248, 113, 113, .1); border: 1px solid rgba(248, 113, 113, .28); }

/* Slab sub-header used above each chart primitive (e.g. "Q1 FY2027 vs Q1 FY2026") */
.fa-netcash { margin: 0 0 14px; display: grid; gap: 6px; max-width: 420px; }
.fa-netcash-row { display: flex; justify-content: space-between; gap: 16px; font-size: 13px; }
.fa-netcash-row .n { color: var(--text-muted); }
.fa-netcash-row .v { font-family: var(--font-mono); color: var(--text-primary); font-weight: 600; }
.fa-netcash-row:last-child .n,
.fa-netcash-row:last-child .v { color: var(--text-primary); font-weight: 700; }
.fa-chart-lab { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.fa-chart-lab .l { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }
.fa-chart-lab .r { font-size: 12px; color: var(--text-muted); }

/* Diverging growth bars (quarter_comparison, segment/geo growth) */
.fa-divbars { display: flex; flex-direction: column; gap: 2px; margin-bottom: 14px; }
.fa-divrow { display: grid; grid-template-columns: 128px 1fr 64px; align-items: center; gap: 12px; padding: 5px 0; }
.fa-divrow .n { font-size: 13px; color: var(--text-secondary); }
.fa-divbar { position: relative; height: 16px; background: var(--bg-card); border-radius: 4px; overflow: hidden; }
.fa-divbar .zero { position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--border); }
.fa-divbar .f { position: absolute; top: 2px; bottom: 2px; border-radius: 3px; }
.fa-divbar .f.up { left: 50%; background: linear-gradient(90deg, rgba(77, 158, 110, .45), var(--gain)); }
.fa-divbar .f.dn { right: 50%; background: linear-gradient(270deg, rgba(248, 113, 113, .45), #f87171); }
.fa-divrow .p { font-family: var(--font-mono); font-size: 13px; font-weight: 700; text-align: right; }
.fa-divrow .p.up { color: var(--gain); }
.fa-divrow .p.dn { color: #f87171; }
.fa-divrow .p.nd { color: var(--text-muted); font-size: 11px; font-style: italic; font-weight: 400; }

/* Horizontal single-direction bars (ROIC vs WACC, cash-flow waterfall) */
.fa-hbars { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.fa-hbrow { display: grid; grid-template-columns: 90px 1fr 70px; align-items: center; gap: 10px; }
.fa-hbrow .n { font-size: 12px; color: var(--text-muted); text-align: right; }
.fa-hbar { position: relative; height: 14px; background: var(--bg-card); border-radius: 7px; overflow: hidden; }
.fa-hbar .f { position: absolute; top: 0; bottom: 0; left: 0; border-radius: 7px; background: linear-gradient(90deg, rgba(0, 240, 255, .35), var(--neon-cyan)); }
.fa-hbar .f.alt { background: rgba(0, 240, 255, .35); }
.fa-hbar .band { position: absolute; top: 0; bottom: 0; background: rgba(255, 255, 255, .12); border-radius: 7px; }
.fa-hbar .thr { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--text-primary); opacity: .65; }
.fa-hbrow .v { font-family: var(--font-mono); font-size: 13px; font-weight: 700; color: var(--neon-cyan); }
.fa-hnote { font-size: 12px; color: var(--text-muted); margin-top: -2px; }

/* Comparison bars (quarter_comparison: current fill + prior marker line) */
.fa-cmprow { display: grid; grid-template-columns: 100px 1fr 64px; align-items: center; gap: 10px; margin-bottom: 10px; }
.fa-cmprow .n { font-size: 12px; color: var(--text-muted); text-align: right; }
.fa-cmprow .v { font-family: var(--font-mono); font-size: 13px; font-weight: 700; text-align: right; }
.fa-cmpnote { font-size: 11px; color: var(--text-muted); margin: -6px 0 12px 110px; }

/* Cash-flow waterfall */
.fa-waterfall { margin-bottom: 14px; }
.fa-wf-ocf { height: 22px; border-radius: 6px; background: linear-gradient(90deg, var(--neon-cyan), #0d7a82); display: flex; align-items: center; padding: 0 10px; font-family: var(--font-mono); font-size: 12px; font-weight: 700; color: #04211d; margin-bottom: 6px; white-space: nowrap; overflow: hidden; }
.fa-wf-uses { display: flex; height: 20px; border-radius: 5px; overflow: hidden; gap: 2px; }
.fa-wf-seg { display: flex; align-items: center; justify-content: center; font-family: var(--font-mono); font-size: 11px; font-weight: 700; white-space: nowrap; overflow: hidden; color: #0a0f17; }
.fa-wf-seg.retained { background: var(--bg-card); color: var(--text-muted); }
.fa-wf-foot { font-size: 12px; color: var(--text-muted); margin-top: 8px; }

/* Donut (segment revenue mix) */
.fa-donut-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.fa-donut { position: relative; width: 140px; height: 140px; flex-shrink: 0; }
.fa-donut .ctr { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.fa-donut .ctr .big { font-family: var(--font-mono); font-size: 19px; font-weight: 700; color: var(--neon-cyan); }
.fa-donut .ctr .sm { font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--text-muted); margin-top: 2px; text-align: center; max-width: 100px; }
.fa-seclist { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 7px; }
.fa-secrow { display: grid; grid-template-columns: 10px 1fr auto auto; align-items: center; gap: 8px; }
.fa-secrow .sd { width: 9px; height: 9px; border-radius: 3px; }
.fa-secrow .sn { font-size: 13px; color: var(--text-secondary); }
.fa-secrow .sv { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); }
.fa-secrow .sp { font-family: var(--font-mono); font-size: 13px; font-weight: 700; text-align: right; min-width: 42px; }

/* Geography bars */
.fa-geo { display: flex; flex-direction: column; gap: 11px; }
.fa-georow .gt { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 4px; }
.fa-georow .gt b { font-family: var(--font-mono); font-weight: 700; font-size: 12px; color: var(--text-primary); }
.fa-georow .gt .gv { font-family: var(--font-mono); color: var(--text-muted); font-size: 11px; }
.fa-gbar { height: 7px; border-radius: 4px; background: var(--bg-card); overflow: hidden; }
.fa-gbar span { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, rgba(0, 240, 255, .35), var(--neon-cyan)); }

/* Forensic gauges (Beneish / Altman) */
.fa-gauges { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; margin-bottom: 16px; }
@media (max-width: 700px) { .fa-gauges, .fa-flags { grid-template-columns: 1fr; } }
.fa-gauge-lab { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; letter-spacing: .05em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 7px; }
.fa-gauge-lab b { font-family: var(--font-mono); font-size: 13px; color: var(--text-primary); letter-spacing: 0; text-transform: none; }
.fa-gauge { position: relative; height: 10px; border-radius: 5px; }
.fa-gauge.beneish { background: linear-gradient(90deg, #4d9e6e 0%, var(--gain) 40%, #f59e0b 62%, #f87171 100%); }
.fa-gauge.altman { background: linear-gradient(90deg, #f87171 0%, #f59e0b 30%, var(--gain) 52%, #4d9e6e 100%); }
.fa-gauge .thr { position: absolute; top: -5px; bottom: -5px; width: 2px; background: var(--text-primary); border-radius: 1px; opacity: .8; }
.fa-gauge .mkr { position: absolute; top: 50%; transform: translate(-50%, -50%); width: 15px; height: 15px; border-radius: 50%; border: 3px solid #0a0f17; }
.fa-gauge .mkr.ok { background: var(--gain); box-shadow: 0 0 0 1px var(--gain); }
.fa-gauge .mkr.bad { background: #f87171; box-shadow: 0 0 0 1px #f87171; }
.fa-gauge .mkr.unk { background: var(--text-muted); box-shadow: 0 0 0 1px var(--text-muted); }
.fa-gauge-notes { display: flex; justify-content: space-between; margin-top: 8px; font-size: 12px; }
.fa-gauge-notes .a { font-weight: 700; font-family: var(--font-mono); }
.fa-gauge-notes .a.ok { color: var(--gain); }
.fa-gauge-notes .a.bad { color: #f87171; }
.fa-gauge-notes .t { color: var(--text-muted); }
.fa-zones { display: flex; justify-content: space-between; margin-top: 5px; font-family: var(--font-mono); font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--text-muted); }

/* Flag / clean-check cards */
.fa-flags { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 4px; }
.fa-flags > .fa-fcard:only-child { grid-column: 1 / -1; }
.fa-fcard { border-radius: 9px; padding: 11px 13px; }
.fa-fcard.elevated, .fa-fcard.severe { background: rgba(248, 113, 113, .05); border: 1px solid rgba(248, 113, 113, .24); }
.fa-fcard.monitor { background: rgba(245, 158, 11, .045); border: 1px solid rgba(245, 158, 11, .2); }
.fa-fcard.ok { background: rgba(77, 158, 110, .045); border: 1px solid rgba(77, 158, 110, .18); }
.fa-fcard .top { display: flex; align-items: center; gap: 7px; margin-bottom: 6px; }
.fa-fcard.elevated .top svg, .fa-fcard.severe .top svg { color: #f87171; }
.fa-fcard.monitor .top svg { color: #f59e0b; }
.fa-fcard.ok .top svg { color: var(--gain); }
.fa-fcard .top b { font-size: 13px; color: var(--text-primary); }
.fa-fcard .sev { margin-left: auto; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 2px 6px; border-radius: 4px; flex-shrink: 0; }
.fa-fcard.elevated .sev, .fa-fcard.severe .sev { color: #f87171; border: 1px solid rgba(248, 113, 113, .3); }
.fa-fcard.monitor .sev { color: #f59e0b; border: 1px solid rgba(245, 158, 11, .3); }
.fa-fcard .val { font-family: var(--font-mono); font-size: 14px; font-weight: 700; }
.fa-fcard.elevated .val, .fa-fcard.severe .val { color: #f87171; }
.fa-fcard.monitor .val { color: #f59e0b; }
.fa-fcard.ok .val { color: var(--gain); }
.fa-fcard .val small { color: var(--text-muted); font-weight: 400; font-size: 11px; }
.fa-fcard .note { font-size: 12px; color: var(--text-muted); margin-top: 4px; line-height: 1.5; }

/* ── Forecast tab — AI Growth & Future Prospects (forecast) — fc-* ── */
.fc-strip .cc-kpi-v.amb { color: #fbbf24; }
.fc-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.fc-chip { font-size: 11px; font-weight: 600; padding: 4px 9px; border-radius: 20px; border: 1px solid var(--border); color: var(--text-muted); background: var(--bg-card); }
.fc-chip.good { color: var(--gain); border-color: rgba(77, 158, 110, .28); background: rgba(77, 158, 110, .08); }
.fc-chip.amb { color: #fbbf24; border-color: rgba(251, 191, 36, .28); background: rgba(251, 191, 36, .08); }
.fc-chip.bad { color: #f87171; border-color: rgba(248, 113, 113, .28); background: rgba(248, 113, 113, .08); }
.fc-legend { display: flex; gap: 16px; align-items: center; margin-bottom: 6px; flex-wrap: wrap; }
.fc-legend .lg2 { display: flex; align-items: center; gap: 7px; font-family: var(--font-mono); font-size: 11px; color: var(--text-secondary); }
.fc-legend .bx { width: 12px; height: 10px; border-radius: 2px; background: linear-gradient(180deg, #3ddc97, #1c6e64); display: inline-block; }
.fc-legend .ln { width: 14px; height: 3px; border-radius: 2px; display: inline-block; }
.fc-legend .ln.gm { background: #fbbf24; }
.fc-legend .ln.om { background: #2dd4bf; }
.fc-legend .faint { color: var(--text-muted); }
.fc-legend .conf { margin-left: auto; font-family: var(--font-mono); font-size: 10px; color: #fbbf24; }
.fc-chart { display: block; margin: 4px 0 8px; }
.fc-svg-g, .fc-svg-g-lab { fill: #3ddc97; font-size: 9px; font-family: var(--font-mono), monospace; }
.fc-svg-g-lab { font-size: 8px; opacity: .85; }
.fc-svg-m, .fc-svg-m-lab { fill: #8a97a9; font-size: 9px; font-family: var(--font-mono), monospace; }
.fc-svg-m-lab { font-size: 8px; opacity: .9; }
.fc-svg-gm { fill: #fbbf24; font-size: 9px; font-family: var(--font-mono), monospace; }
.fc-svg-om { fill: #2dd4bf; font-size: 9px; font-family: var(--font-mono), monospace; }
.fc-svg-x { fill: #8a97a9; font-size: 10px; font-family: var(--font-mono), monospace; }
@media (max-width: 760px) {
  .fc-legend .lg2 { font-size: 12px; }
  .fc-legend .conf { font-size: 12px; }
  .fc-chart.fc-chart-mobile .fc-svg-g,
  .fc-chart.fc-chart-mobile .fc-svg-m { font-size: 16px; }
  .fc-chart.fc-chart-mobile .fc-svg-g-lab,
  .fc-chart.fc-chart-mobile .fc-svg-m-lab { font-size: 13px; }
  .fc-chart.fc-chart-mobile .fc-svg-gm,
  .fc-chart.fc-chart-mobile .fc-svg-om { font-size: 15px; }
  .fc-chart.fc-chart-mobile .fc-svg-x { font-size: 15px; }
}
.fc-grid { stroke: #1c2532; stroke-width: 1; }
.fc-grid-soft { stroke: #141b27; stroke-width: 1; stroke-dasharray: 3 4; }
.fc-basis-note { font-size: 12px !important; margin-top: 8px !important; }
.fc-ftable-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  margin-top: 14px;
  box-sizing: border-box;
}
.fc-ftable-wrap::-webkit-scrollbar { display: none; }
.fc-ftable { width: 100%; border-collapse: collapse; margin-top: 0; }
.fc-ftable th { font-family: var(--font-mono); font-size: 9px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); font-weight: 600; text-align: right; padding: 8px 6px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.fc-ftable th:first-child { text-align: left; }
.fc-ftable td { font-family: var(--font-mono); font-size: 12px; padding: 9px 6px; border-bottom: 1px solid var(--border); text-align: right; color: var(--text-primary); white-space: nowrap; }
.fc-ftable td:first-child { text-align: left; font-weight: 700; }
.fc-ftable tr:last-child td { border-bottom: 0; }
.fc-ftable tr.fc-path-note td:first-child { color: #fbbf24; }
.fc-swatch { width: 12px; height: 10px; border-radius: 2px; display: inline-block; background: #243044; flex-shrink: 0; }
.fc-swatch-fcf { background: #1F8A65; }
.fc-swatch-net { background: #70B0D8; }
.fc-swatch-op { background: #5A6CC0; }
.fc-swatch-gross { background: #F0A040; }
.fc-swatch-cost { background: #C06028; }
.fc-head-note { margin-left: auto; font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); letter-spacing: .02em; white-space: nowrap; }
.cai-note .cai-head .fc-head-note + .cai-marks { margin-left: 12px; }
.fc-root.cai-note .fc-chips { margin: 6px 0 14px; }
.fc-root.cai-note .fc-legend { margin: 26px 0 10px; }
.fc-root.cai-note .fc-stack { margin-top: 0; }
.fc-stack { display: flex; gap: 12px; align-items: flex-end; margin: 8px 0 4px; min-height: 180px; }
.fc-stack-col { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: stretch; }
.fc-stack-rev { font-family: var(--font-mono); font-size: 11px; color: var(--text-secondary); text-align: center; margin-bottom: 6px; }
.fc-stack-bar { height: 140px; display: flex; flex-direction: column-reverse; border-radius: 4px; overflow: hidden; background: var(--bg-card); }
.fc-stack-seg { min-height: 0; }
.fc-stack-fy { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); text-align: center; margin-top: 6px; }
.fc-ftable td.positive { color: var(--gain); }
.fc-ftable td.negative { color: #f87171; }
@media (max-width: 760px) {
  .fc-ftable { width: max-content; min-width: 100%; }
}
.fc-share { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.fc-share .big { font-family: var(--font-mono); font-size: 38px; font-weight: 700; color: var(--neon-cyan); line-height: 1; }
.fc-share .lbl { font-size: 12px; color: var(--text-muted); line-height: 1.4; }
.fc-share .lbl b { color: var(--text-primary); }
.fc-badges { display: flex; flex-direction: column; gap: 8px; }
.fc-badges .mb { display: flex; align-items: flex-start; gap: 9px; font-size: 12px; color: var(--text-muted); background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; padding: 9px 11px; line-height: 1.45; }
.fc-badges .mb .ico { color: var(--neon-cyan); flex-shrink: 0; }
.fc-badges .mb b { color: var(--text-primary); }
.fc-mcmp { display: flex; flex-direction: column; gap: 13px; }
.fc-mc .top { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; margin-bottom: 5px; }
.fc-mc .top .nm { color: var(--text-primary); }
.fc-mc .top b { font-family: var(--font-mono); font-weight: 700; }
.fc-mc .top b.pos { color: var(--gain); }
.fc-mc .top b.amb { color: #fbbf24; }
.fc-mc .top.avg-row { margin-top: 3px; justify-content: flex-end; }
.fc-mc .avg { font-family: var(--font-mono); font-size: 10px; color: var(--text-muted); }
.fc-mc .track { position: relative; height: 9px; border-radius: 5px; background: var(--bg-card); }
.fc-mc .track .fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 5px; background: linear-gradient(90deg, #1c6e64, #3ddc97); }
.fc-mc .track .fill.warn { background: linear-gradient(90deg, #7a5a12, #fbbf24); }
.fc-mc .track .avgmk { position: absolute; top: -3px; width: 2px; height: 15px; background: var(--text-muted); border-radius: 1px; }
.fc-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
@media (max-width: 760px) {
  .fc-tiles {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 10px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 0 0 2px;
    margin: 16px 0 0;
  }
  .fc-tiles::-webkit-scrollbar { display: none; }
  .fc-tiles > .tile {
    flex: 0 0 auto;
    width: 160px;
    min-width: 160px;
    max-width: 160px;
    box-sizing: border-box;
    overflow: hidden;
  }
  .fc-tiles > .tile .v {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}
.fc-tiles .tile { background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }
.fc-tiles .tile .k { font-size: 13px; letter-spacing: .06em; color: var(--text-muted); margin-bottom: 5px; text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fc-tiles .tile .v { font-family: var(--font-mono); font-size: 18px; font-weight: 800; margin-top: 2px; color: var(--text-primary); }
.fc-tiles .tile .v.good { color: var(--gain); }
.fc-tiles .tile .v.amb { color: #fbbf24; }
.fc-tiles .tile .v.bad { color: #f87171; }
.fc-tiles .tile .c { font-size: 12px; color: var(--text-muted); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* DeepDive brain tab on Forecast (Analysis) submenu */
#analysis-deepdive-btn.ta-ai-tab-btn { display: inline-flex; align-items: center; gap: 5px; }
#analysis-deepdive-btn .ta-brain-icon { flex-shrink: 0; }

/* ── People tab — AI Management Quality (management_quality) — mq-* ── */
/* Body copy defaults to 14px; captions / notes stay at 12px. */
.mq-root { font-size: 14px; color: var(--text-secondary); }
.mq-strip { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.mq-strip .cc-kpi-k { font-size: 12px; }
.mq-strip .cc-kpi-v { font-size: 20px; }
.mq-strip .cc-kpi-c { font-size: 12px; }
.mq-strip .cc-kpi-v.amb { color: #fbbf24; }
.mq-root .cc-vb-k { font-size: 12px; }
.mq-root .cc-vb-v { font-size: 22px; }
.mq-root .cc-slab-l { font-size: 14px; }
.mq-root .cc-slab-r { font-size: 12px; }
.mq-root .cc-brief { font-size: 14px; }
.mq-root .cc-mlist { font-size: 14px; }
.mq-root .cc-mlab { font-size: 12px; }
.mq-root .cc-mlab2 { font-size: 12px; }
.mq-root .cc-ms { font-size: 12px; }
.mq-root .cc-more-header { font-size: 14px; }
.mq-roster { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 680px) { .mq-roster { grid-template-columns: 1fr; } }
.mq-pcard { border: 1px solid var(--border); border-radius: 11px; background: var(--bg-card); padding: 14px; }
.mq-pcard.feat { grid-column: 1 / -1; border-color: rgba(45, 212, 191, .28); }
.mq-phdr { display: flex; align-items: center; gap: 12px; }
.mq-av { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-mono); font-weight: 700; font-size: 14px; flex-shrink: 0; }
.mq-pcard.feat .mq-av { width: 56px; height: 56px; font-size: 16px; }
.mq-av.a1 { background: linear-gradient(135deg, #8b5cf6, #a78bfa); color: #12081f; }
.mq-av.a2 { background: linear-gradient(135deg, #2dd4bf, #3ddc97); color: #07110f; }
.mq-av.a3 { background: linear-gradient(135deg, #a78bfa, #7c6bd6); color: #0e0a1a; }
.mq-av.a4 { background: linear-gradient(135deg, #fbbf24, #e0980f); color: #1a1205; }
.mq-av.a5 { background: linear-gradient(135deg, #5fb8d4, #3a8fb0); color: #04121a; }
.mq-pinfo { flex: 1; min-width: 0; }
.mq-nm { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.mq-pcard.feat .mq-nm { font-size: 17px; }
.mq-role { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.mq-rbadge { display: inline-flex; align-items: center; gap: 4px; font-family: var(--font-mono); font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: 3px 8px; border-radius: 6px; flex-shrink: 0; align-self: flex-start; }
.mq-rbadge.exc { color: var(--neon-cyan); background: rgba(45, 212, 191, .1); border: 1px solid rgba(45, 212, 191, .3); }
.mq-rbadge.str { color: var(--gain); background: rgba(61, 220, 151, .08); border: 1px solid rgba(61, 220, 151, .28); }
.mq-rbadge.avg { color: #fbbf24; background: rgba(251, 191, 36, .08); border: 1px solid rgba(251, 191, 36, .28); }
.mq-ptrack { font-size: 14px; color: var(--text-secondary); line-height: 1.55; margin: 11px 0 0; }
.mq-pmeta { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 11px; }
.mq-chip { font-family: var(--font-mono); font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 6px; background: var(--bg-card); border: 1px solid var(--border); color: var(--text-muted); display: inline-flex; align-items: center; gap: 5px; }
.mq-chip.own { color: var(--neon-cyan); border-color: rgba(45, 212, 191, .25); }
.mq-chip.null { color: var(--text-muted); font-style: italic; border-style: dashed; }
.mq-pstr { margin-top: 11px; padding-top: 11px; border-top: 1px solid var(--border); }
.mq-lbl { font-family: var(--font-mono); font-size: 12px; letter-spacing: .09em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 6px; }
.mq-slist { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.mq-slist li { font-size: 14px; color: var(--text-secondary); line-height: 1.5; padding-left: 14px; position: relative; }
.mq-slist li::before { content: ""; position: absolute; left: 2px; top: 8px; width: 4px; height: 4px; border-radius: 50%; background: var(--gain); }
.mq-pconcern { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; color: #e3c48a; background: rgba(251, 191, 36, .06); border: 1px solid rgba(251, 191, 36, .18); border-radius: 8px; padding: 9px 11px; margin-top: 11px; line-height: 1.5; }
.mq-pconcern .mq-ico { color: #fbbf24; flex-shrink: 0; }
.mq-trow { display: grid; grid-template-columns: 190px 1fr 70px; gap: 12px; align-items: center; padding: 6px 0; }
@media (max-width: 680px) { .mq-trow { grid-template-columns: 140px 1fr 60px; } }
.mq-trow .nm { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.mq-trow .nm small { display: block; color: var(--text-muted); font-size: 12px; font-weight: 400; }
.mq-trow .tbar { height: 9px; border-radius: 5px; background: var(--bg-card); }
.mq-trow .tbar span { display: block; height: 100%; border-radius: 5px; background: linear-gradient(90deg, #1c6e64, #2dd4bf); }
.mq-trow .tbar.unk { background: repeating-linear-gradient(45deg, #121926, #121926 4px, #171f2c 4px, #171f2c 8px); }
.mq-trow .tyr { font-family: var(--font-mono); font-size: 14px; font-weight: 700; text-align: right; color: var(--text-primary); }
.mq-trow .tyr.unk { color: var(--text-muted); font-size: 12px; font-style: italic; }
.mq-owns { display: flex; flex-direction: column; gap: 9px; }
.mq-ownrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; }
.mq-ownrow .l2 { font-size: 14px; color: var(--text-primary); }
.mq-ownrow .l2 small { display: block; color: var(--text-muted); font-size: 12px; }
.mq-ownrow .p2 { font-family: var(--font-mono); font-size: 14px; font-weight: 700; color: var(--neon-cyan); text-align: right; flex-shrink: 0; }
.mq-ownrow .p2 small { display: block; font-size: 12px; color: var(--text-muted); font-weight: 500; letter-spacing: .06em; text-transform: uppercase; }
.mq-ownrow.miss { opacity: .55; }
.mq-ownrow.miss .p2 { color: var(--text-muted); font-style: italic; font-size: 12px; }
.mq-sr-callout { display: flex; gap: 12px; align-items: flex-start; background: rgba(251, 191, 36, .06); border: 1px solid rgba(251, 191, 36, .28); border-radius: 10px; padding: 13px 15px; margin-bottom: 16px; }
.mq-sr-callout .mq-ico { color: #fbbf24; font-size: 18px; flex-shrink: 0; }
.mq-sr-callout .k { font-family: var(--font-mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); }
.mq-sr-callout .t { font-size: 14px; color: var(--text-secondary); line-height: 1.5; margin-top: 3px; }
.mq-sr-pill { margin-left: auto; font-family: var(--font-mono); font-size: 12px; font-weight: 700; text-transform: uppercase; color: #fbbf24; flex-shrink: 0; }
#people-deepdive-btn.ta-ai-tab-btn { display: inline-flex; align-items: center; gap: 5px; }

/* ── Valuation tab — AI Valuation Analysis (valuation) — va-* ── */
.va-strip .cc-kpi-v.amb { color: #fbbf24; }
.va-chart { display: block; margin: 4px 0 10px; }
.va-peers { width: 100%; border-collapse: collapse; margin: 8px 0 4px; font-size: 13px; }
.va-peers th, .va-peers td { text-align: right; padding: 6px 8px; border-bottom: 1px solid var(--border); }
.va-peers th:first-child, .va-peers td:first-child { text-align: left; }
.va-peers th { color: var(--text-muted); font-weight: 600; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }
.va-assumptions-toggle { margin-left: auto; background: none; border: 0; padding: 0; color: var(--text-muted); font-size: 12px; cursor: pointer; }
.va-assumptions-toggle:hover { color: var(--text-primary); }
.va-assumption-input { width: 88px; text-align: right; background: transparent; color: inherit; border: 1px solid var(--border); border-radius: 4px; padding: 2px 6px; font: inherit; }
.va-assumptions-note { color: var(--text-muted); font-size: 12px; }
.va-grid { stroke: #141b27; stroke-width: 1; }
.va-axis { fill: #5c6878; font-size: 9px; font-family: var(--font-mono), monospace; }
.va-price-line { stroke: #f87171; stroke-width: 1.5; stroke-dasharray: 4 3; }
.va-price-lab { fill: #f87171; font-size: 9.5px; font-family: var(--font-mono), monospace; font-weight: 700; }
.va-row-lab { font-size: 10px; font-family: var(--font-mono), monospace; font-weight: 700; }
.va-end { fill: #8a97a9; font-size: 9px; font-family: var(--font-mono), monospace; }
.va-mid-tick { stroke: #e8eef5; stroke-width: 2; }
.va-mid-lab { fill: #e8eef5; font-size: 9.5px; font-family: var(--font-mono), monospace; font-weight: 700; }
@media (max-width: 760px) {
  .va-chart.va-chart-mobile .va-axis { font-size: 13px; }
  .va-chart.va-chart-mobile .va-end { font-size: 12px; }
  .va-chart.va-chart-mobile .va-mid-lab { font-size: 14px; }
  .va-chart.va-chart-mobile .va-row-lab { font-size: 13px; }
  .va-chart.va-chart-mobile .va-price-lab { font-size: 13px; }
  .va-chart.va-chart-mobile .va-mid-tick { stroke-width: 3; }
  .va-chart.va-chart-mobile .va-price-line { stroke-width: 2.25; }
}
.va-acc { display: flex; flex-direction: column; gap: 9px; margin-top: 12px; }
.va-ac { border: 1px solid var(--border); border-radius: 10px; background: var(--bg-card); overflow: hidden; }
.va-ac[open] { border-color: var(--border-light, var(--border)); }
.va-ac.blend[open] { border-color: rgba(61, 220, 151, .3); }
.va-ac summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.va-ac summary::-webkit-details-marker { display: none; }
.va-ac summary .caret { font-family: var(--font-mono); font-size: 10px; color: var(--text-muted); transition: transform .15s; flex-shrink: 0; }
.va-ac[open] summary .caret { transform: rotate(90deg); }
.va-ac .swatch { width: 9px; height: 9px; border-radius: 3px; flex-shrink: 0; }
.va-ac .mname { font-family: var(--font-mono); font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-primary); }
.va-ac .mrange { margin-left: auto; display: flex; align-items: baseline; gap: 9px; font-family: var(--font-mono); flex-shrink: 0; }
.va-ac .mrange .lo, .va-ac .mrange .hi { font-size: 10.5px; color: var(--text-muted); }
.va-ac .mrange .base { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.va-ac .body { padding: 0 15px 15px; border-top: 1px solid var(--border); margin-top: 2px; padding-top: 13px; }
.va-caselist { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-bottom: 12px; }
@media (max-width: 680px) {
  .va-ac .mrange .lo, .va-ac .mrange .hi { display: none; }
  .va-caselist {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 10px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    margin: 0 0 12px;
    padding: 0 0 2px;
  }
  .va-caselist::-webkit-scrollbar { display: none; }
  .va-caselist > .va-case {
    flex: 0 0 auto;
    width: 148px;
    min-width: 148px;
    max-width: 148px;
    box-sizing: border-box;
  }
}
.va-case { background: var(--bg-secondary, var(--bg-card)); border: 1px solid var(--border); border-radius: 8px; padding: 9px 11px; }
.va-case .cl { font-family: var(--font-mono); font-size: 8.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); }
.va-case .cv { font-family: var(--font-mono); font-size: 14px; font-weight: 700; margin-top: 3px; color: var(--text-primary); }
.va-case .cd { font-family: var(--font-mono); font-size: 9px; color: var(--text-muted); margin-top: 3px; line-height: 1.45; }
.va-subhead { font-family: var(--font-mono); font-size: 9px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); margin: 13px 0 7px; }
.va-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.va-grid2 .lft { padding-right: 30px; border-right: 1px solid var(--border); }
.va-grid2 .rgt { padding-left: 30px; }
@media (max-width: 680px) {
  .va-grid2 { grid-template-columns: 1fr; min-width: 0; max-width: 100%; }
  .va-grid2 .lft,
  .va-grid2 .rgt { min-width: 0; max-width: 100%; }
  .va-grid2 .lft { padding-right: 0; border-right: 0; border-bottom: 1px solid var(--border); padding-bottom: 16px; margin-bottom: 16px; }
  .va-grid2 .rgt { padding-left: 0; }
  .va-root { overflow-x: clip; max-width: 100%; }
}
.va-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.va-tiles-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 680px) {
  /* Scroll stays inside the row — page width must not grow */
  .va-tiles, .va-tiles-3 {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 10px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 0 0 2px;
    margin: 0;
  }
  .va-tiles::-webkit-scrollbar, .va-tiles-3::-webkit-scrollbar { display: none; }
  .va-tiles > .va-tile, .va-tiles-3 > .va-tile {
    flex: 0 0 auto;
    width: 148px;
    min-width: 148px;
    max-width: 148px;
    box-sizing: border-box;
    overflow: hidden;
  }
  .va-tiles > .va-tile .v, .va-tiles-3 > .va-tile .v {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}
.va-tile { background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; overflow: hidden; }
.va-tile .k { font-family: var(--font-mono); font-size: 13px; letter-spacing: .06em; color: var(--text-muted); text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.va-tile .v { font-family: var(--font-mono); font-size: 18px; font-weight: 700; margin-top: 3px; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.va-tile .v.positive { color: var(--gain); }
.va-tile .v.negative { color: #f87171; }
.va-tile .v.faint { color: var(--text-muted); }
.va-tile .c { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); margin-top: 3px; }

/* Mobile: keep all metric/verdict cards on the same type scale as top cc-vb */
@media (max-width: 760px) {
  .cc-vb .cc-vb-k,
  .cc-kpi .cc-kpi-k,
  .mq-root .cc-vb-k,
  .mq-strip .cc-kpi-k,
  .fc-tiles .tile .k,
  .va-tile .k {
    font-size: 11px !important;
    letter-spacing: .05em;
  }
  .cc-vb .cc-vb-v,
  .cc-kpi .cc-kpi-v,
  .mq-root .cc-vb-v,
  .mq-strip .cc-kpi-v,
  .fc-tiles .tile .v,
  .va-tile .v {
    font-size: 15px !important;
  }
  .cc-kpi .cc-kpi-c,
  .fc-tiles .tile .c,
  .va-tile .c {
    font-size: 11px !important;
  }
  .cc-vb,
  .cc-kpi,
  .fc-tiles .tile,
  .va-tile {
    padding: 9px 11px;
  }
}

.va-pctrow { display: grid; grid-template-columns: 82px 1fr 74px; gap: 11px; align-items: center; padding: 7px 0; }
.va-pctrow .m { font-family: var(--font-mono); font-size: 11px; font-weight: 600; color: var(--text-primary); }
.va-pctrow .m small { display: block; color: var(--text-muted); font-weight: 400; font-size: 9.5px; }
.va-pctrow .track { position: relative; height: 8px; border-radius: 4px; background: var(--bg-card); border: 1px solid var(--border); }
.va-pctrow .track .fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; }
.va-pctrow .track .mk { position: absolute; top: -4px; width: 2px; height: 15px; background: var(--text-primary); border-radius: 1px; }
.va-pctrow .pv { font-family: var(--font-mono); font-size: 11px; font-weight: 700; text-align: right; color: var(--text-primary); }
.va-pctrow .pv.positive { color: var(--gain); }
.va-pctrow .pv.amb { color: #fbbf24; }
.va-pctrow .pv.negative { color: #f87171; }
.va-callout { display: flex; gap: 9px; align-items: flex-start; font-size: 14px; line-height: 1.6; border-radius: 8px; padding: 10px 12px; margin-top: 12px; color: var(--text-secondary); background: var(--bg-card); border: 1px solid var(--border); }
.va-callout b { color: var(--text-primary); font-weight: 600; }
.va-tenx { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.va-tenx .big { font-family: var(--font-mono); font-size: 30px; font-weight: 700; color: var(--neon-cyan); line-height: 1; }
.va-tenx .bl { font-size: 11px; color: var(--text-muted); line-height: 1.45; }
.va-tenx .bl b { color: var(--text-primary); }
.va-tenx-metrics { margin-bottom: 14px; }
.va-plbadge { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; font-family: var(--font-mono); font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #fbbf24; background: rgba(251, 191, 36, .08); border: 1px solid rgba(251, 191, 36, .28); padding: 5px 10px; border-radius: 7px; }
.va-plbadge.good { color: var(--gain); border-color: rgba(61, 220, 151, .28); background: rgba(61, 220, 151, .08); }
.va-plbadge.bad { color: #f87171; border-color: rgba(248, 113, 113, .28); background: rgba(248, 113, 113, .08); }
.va-plbadge.cy { color: var(--neon-cyan); border-color: rgba(45, 212, 191, .28); background: rgba(45, 212, 191, .08); }
.va-gapbar { display: flex; align-items: center; gap: 12px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 9px; padding: 11px 13px; margin-bottom: 14px; flex-wrap: wrap; }
.va-gapbar .seg { display: flex; flex-direction: column; gap: 2px; }
.va-gapbar .seg .k { font-family: var(--font-mono); font-size: 8.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }
.va-gapbar .seg .v { font-family: var(--font-mono); font-size: 14px; font-weight: 700; color: var(--text-primary); }
.va-gapbar .seg .v.cy { color: var(--neon-cyan); }
.va-gapbar .seg .v.amb { color: #fbbf24; }
.va-gapbar .arrow { color: var(--text-muted); font-size: 16px; }
.va-srcs { display: flex; flex-direction: column; gap: 5px; margin-top: 4px; }
.va-srcs a, .va-srcs span { font-size: 10.5px; color: var(--text-muted); line-height: 1.45; text-decoration: none; }
.va-srcs a:hover { color: var(--neon-cyan); }
#val-mode-toggle .ta-ai-tab-btn { display: inline-flex; align-items: center; gap: 5px; }

/* ── Journal (calendar + daily entry) ─────────────────────────────────────── */
.journal-root{
  --j-bg:#070a10;--j-surface:#0d121b;--j-surface-2:#121926;--j-border:#1c2532;--j-border-soft:#151d28;
  --j-text:#e8eef5;--j-muted:#8a97a9;--j-faint:#5c6878;
  --j-cyan:#2dd4bf;--j-green:#3ddc97;--j-red:#f87171;--j-amber:#fbbf24;--j-purple:#a78bfa;
  --j-mono:var(--font-mono, ui-monospace, monospace);
  --j-sans:var(--font-sans, Inter,system-ui,sans-serif);
  width:100%;max-width:none;margin:0;padding:20px 22px 36px;color:var(--j-text);font-family:var(--j-sans);line-height:1.45;
  background:radial-gradient(900px 500px at 80% -10%,#0c1a22 0%,transparent 60%),transparent;
  box-sizing:border-box;
}
.journal-root *,.journal-root *::before,.journal-root *::after{box-sizing:border-box}
.journal-loading,.journal-empty{padding:48px 16px;text-align:center;color:var(--j-faint);font-size:13px}
.journal-back{display:inline-flex;align-items:center;gap:6px;margin-bottom:14px;background:none;border:none;color:var(--j-cyan);font-family:var(--j-mono);font-size:11px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;cursor:pointer;padding:0}
.journal-back:hover{filter:brightness(1.15)}
.journal-root .divider{height:1px;background:var(--j-border-soft);margin:22px 0;border:0}
.journal-root .slab{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px}
.journal-root .slab .l{font-family:var(--j-mono);font-size:11px;letter-spacing:.16em;text-transform:uppercase;color:var(--j-faint);font-weight:600;display:flex;align-items:center;gap:8px}
.journal-root .slab .l i{font-size:14px;color:var(--j-cyan)}
.journal-root .slab .r{font-family:var(--j-mono);font-size:10px;letter-spacing:.12em;text-transform:uppercase;color:var(--j-faint)}
.journal-root .jhead{display:flex;align-items:flex-end;gap:16px;flex-wrap:wrap;margin-bottom:18px}
.journal-root .datebox{display:flex;flex-direction:column;line-height:1}
.journal-root .datebox .dow{font-family:var(--j-mono);font-size:10px;letter-spacing:.16em;text-transform:uppercase;color:var(--j-cyan);margin-bottom:6px}
.journal-root .datebox .d{font-size:28px;font-weight:700;letter-spacing:-.02em}
.journal-root .datebox .d span{color:var(--j-muted);font-weight:500}
.journal-root .nav{margin-left:auto;display:flex;align-items:center;gap:6px}
.journal-root .nav button{width:30px;height:30px;display:grid;place-items:center;border-radius:8px;cursor:pointer;background:var(--j-surface-2);border:1px solid var(--j-border-soft);color:var(--j-muted);font-size:15px;transition:.15s}
.journal-root .nav button:hover:not(:disabled){color:var(--j-cyan);border-color:rgba(45,212,191,.32);background:rgba(45,212,191,.06)}
.journal-root .nav button:disabled{opacity:.3;cursor:default}
.journal-root .nav .today{width:auto;padding:0 11px;font-family:var(--j-mono);font-size:9.5px;font-weight:700;letter-spacing:.08em;text-transform:uppercase}
.journal-root .jhead .lbl{margin-left:auto;display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.journal-root .strip{display:grid;grid-template-columns:repeat(5,1fr);gap:14px;width:100%}
.journal-root .st .k{font-family:var(--j-mono);font-size:8.5px;letter-spacing:.09em;color:var(--j-faint);text-transform:uppercase;line-height:1.3;min-height:22px;display:flex;align-items:flex-start}
.journal-root .st .v{font-family:var(--j-mono);font-size:18px;font-weight:700;margin-top:3px;line-height:1}
.journal-root .st .x{font-family:var(--j-mono);font-size:9px;margin-top:4px;color:var(--j-faint);line-height:1.4}
.journal-root .st .v.cy{color:var(--j-cyan)} .journal-root .st .v.gr{color:var(--j-green)}
.journal-root .calwrap{display:grid;grid-template-columns:minmax(0,1fr) 280px;gap:18px;align-items:start;width:100%}
.journal-root .calwrap > div:first-child{min-width:0;width:100%}
.journal-root .dows{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:6px;margin-bottom:6px;width:100%}
.journal-root .dows span{font-family:var(--j-mono);font-size:8.5px;letter-spacing:.12em;text-transform:uppercase;color:var(--j-faint);text-align:center}
.journal-root .cal{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:6px;width:100%}
.journal-day{position:relative;display:flex;flex-direction:column;gap:5px;min-height:88px;width:100%;padding:7px 7px 6px;background:var(--j-surface);border:1px solid var(--j-border-soft);border-radius:9px;font-family:var(--j-sans);text-align:left;cursor:pointer;transition:.15s;overflow:hidden;color:inherit}
.journal-day.pad{background:transparent;border-color:transparent;cursor:default;pointer-events:none;min-height:88px}
.journal-day.empty{background:var(--j-surface);border-style:dashed;border-color:var(--j-border);cursor:default;opacity:.55;min-height:88px}
.journal-day.empty .dnum{color:var(--j-faint);font-weight:500}
.journal-day:hover:not(.pad):not(.empty){border-color:rgba(45,212,191,.38);transform:translateY(-1px)}
.journal-day.sel{border-color:var(--j-cyan);background:rgba(45,212,191,.07)}
.journal-day.today .dnum{color:var(--j-cyan)}
.journal-day.today::after{content:"";position:absolute;left:7px;bottom:5px;width:12px;height:2px;border-radius:2px;background:var(--j-cyan)}
.journal-day.lvl1{background:rgba(45,212,191,.035)}
.journal-day.lvl2{background:rgba(45,212,191,.07)}
.journal-day.lvl3{background:rgba(45,212,191,.12);border-color:rgba(45,212,191,.22)}
.journal-day .dnum{font-family:var(--j-mono);font-size:12px;font-weight:700;color:var(--j-text);line-height:1}
.journal-day .dtrade{position:absolute;top:7px;right:7px;width:6px;height:6px;border-radius:50%;background:var(--j-green);box-shadow:0 0 0 2px rgba(61,220,151,.18)}
.journal-day .dtks{display:flex;flex-wrap:wrap;gap:3px;margin-top:auto}
.journal-day .dtks b{font-family:var(--j-mono);font-size:8.5px;font-weight:700;letter-spacing:.02em;color:var(--j-muted);background:var(--j-surface-2);border:1px solid var(--j-border-soft);border-radius:4px;padding:1px 4px}
.journal-day .dtks b.more{color:var(--j-faint);background:transparent;border-color:transparent;padding:1px 2px}
.journal-day .dbar{display:flex;gap:2px}
.journal-day .dbar i{height:2px;flex:1;border-radius:2px;background:var(--j-border)}
.journal-day .dbar i.on{background:var(--j-cyan)}
.journal-root .rail{background:var(--j-surface);border:1px solid var(--j-border-soft);border-radius:10px;padding:14px 15px;position:sticky;top:18px}
.journal-root .rail .rdate{font-family:var(--j-mono);font-size:9px;letter-spacing:.14em;text-transform:uppercase;color:var(--j-faint)}
.journal-root .rail h4{margin:5px 0 0;font-size:17px;font-weight:700;letter-spacing:-.01em}
.journal-root .chip{display:inline-flex;align-items:center;gap:6px;font-family:var(--j-mono);font-size:9.5px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;padding:5px 10px;border-radius:7px;border:1px solid;margin-top:10px}
.journal-root .chip.act{color:var(--j-amber);background:rgba(251,191,36,.08);border-color:rgba(251,191,36,.28)}
.journal-root .chip.cur{color:var(--j-green);background:rgba(61,220,151,.07);border-color:rgba(61,220,151,.26)}
.journal-root .chip.qt{color:var(--j-muted);background:var(--j-bg);border-color:var(--j-border-soft)}
.journal-root .chip i{font-size:11px}
.journal-root .rail .lede{font-size:12px;color:var(--j-muted);line-height:1.65;margin:12px 0 0}
.journal-root .rrow{display:flex;justify-content:space-between;align-items:center;font-family:var(--j-mono);font-size:10px;color:var(--j-faint);padding:7px 0;border-top:1px solid var(--j-border-soft)}
.journal-root .rrow:first-of-type{margin-top:13px}
.journal-root .rrow b{color:var(--j-text);font-size:11px}
.journal-root .rtks{display:flex;flex-wrap:wrap;gap:5px;margin-top:12px}
.journal-root .sent{font-family:var(--j-mono);font-size:9px;font-weight:700;letter-spacing:.06em;padding:3px 7px;border-radius:5px;display:inline-flex;align-items:center;gap:4px;text-transform:uppercase}
.journal-root .sent.bullish{color:var(--j-green);background:rgba(61,220,151,.09);border:1px solid rgba(61,220,151,.25)}
.journal-root .sent.bearish{color:var(--j-red);background:rgba(248,113,113,.09);border:1px solid rgba(248,113,113,.25)}
.journal-root .sent.neutral{color:var(--j-muted);background:var(--j-bg);border:1px solid var(--j-border-soft)}
.journal-root .sent.none{color:var(--j-faint);background:var(--j-bg);border:1px dashed var(--j-border)}
.journal-root .sent i{font-size:10px}
.journal-root .open{display:flex;align-items:center;justify-content:center;gap:7px;width:100%;margin-top:14px;padding:9px;border-radius:8px;cursor:pointer;font-family:var(--j-mono);font-size:10px;font-weight:700;letter-spacing:.1em;text-transform:uppercase;color:#052620;background:var(--j-cyan);border:1px solid var(--j-cyan);transition:.15s}
.journal-root .open:hover{filter:brightness(1.1)}
.journal-root .rempty{font-size:12px;color:var(--j-faint);line-height:1.65;margin:12px 0 0}
.journal-root .legend{display:flex;gap:16px;flex-wrap:wrap;align-items:center;font-family:var(--j-mono);font-size:9px;letter-spacing:.06em;text-transform:uppercase;color:var(--j-faint);margin-top:14px}
.journal-root .legend span{display:inline-flex;align-items:center;gap:6px}
.journal-root .sw{width:11px;height:11px;border-radius:3px;border:1px solid var(--j-border-soft);display:inline-block}
.journal-root .sw.l0{background:transparent;border-style:dashed;border-color:var(--j-border)}
.journal-root .sw.l1{background:rgba(45,212,191,.035)} .journal-root .sw.l2{background:rgba(45,212,191,.07)} .journal-root .sw.l3{background:rgba(45,212,191,.12);border-color:rgba(45,212,191,.22)}
.journal-root .sw.tr{border-radius:50%;width:7px;height:7px;background:var(--j-green);border:none}
.journal-root .meta{display:flex;gap:18px;flex-wrap:wrap;font-family:var(--j-mono);font-size:9.5px;color:var(--j-faint);padding-top:16px;border-top:1px solid var(--j-border-soft);margin-top:22px}
.journal-root .meta span b{color:var(--j-muted);font-weight:600}
.journal-root .prose{font-size:13px;color:var(--j-muted);line-height:1.8;margin:0 0 12px}
.journal-root .rsum{display:flex;gap:11px;align-items:flex-start;background:var(--j-surface-2);border:1px solid var(--j-border-soft);border-radius:10px;padding:13px 15px;margin-top:16px}
.journal-root .rsum i{color:var(--j-purple);font-size:16px;flex-shrink:0;margin-top:1px}
.journal-root .rsum .t{font-family:var(--j-mono);font-size:9px;letter-spacing:.1em;text-transform:uppercase;color:var(--j-faint);margin-bottom:5px}
.journal-root .rsum p{margin:0;font-size:12px;color:var(--j-muted);line-height:1.65}
.journal-root .tks{display:grid;grid-template-columns:repeat(4,1fr);gap:10px}
.journal-root .tkcard{background:var(--j-surface-2);border:1px solid var(--j-border-soft);border-radius:10px;padding:12px;position:relative;overflow:hidden;cursor:pointer;transition:border-color .15s,background .15s,transform .12s}
.journal-root .tkcard:hover{border-color:rgba(45,212,191,.35);background:var(--j-surface);transform:translateY(-1px)}
.journal-root .tkcard:focus-visible{outline:2px solid rgba(45,212,191,.45);outline-offset:2px}
.journal-root .dtick[data-symbol]{cursor:pointer}
.journal-root .dtick[data-symbol]:hover{color:var(--j-cyan,#2dd4bf)}
.journal-root .tkcard::before{content:"";position:absolute;left:0;top:0;bottom:0;width:3px}
.journal-root .tkcard.bullish::before{background:var(--j-green)}
.journal-root .tkcard.bearish::before{background:var(--j-red)}
.journal-root .tkcard.neutral::before{background:var(--j-faint)}
.journal-root .tkcard.none::before{background:transparent}
.journal-root .tkcard .row{display:flex;align-items:center;gap:9px;margin-bottom:8px}
.journal-root .lg{width:26px;height:26px;border-radius:6px;background:#fff;overflow:hidden;position:relative;flex-shrink:0;display:grid;place-items:center}
.journal-root .lg::before{content:attr(data-i);font-family:var(--j-mono);font-size:8.5px;font-weight:700;color:#475569}
.journal-root .lg img{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;padding:2px;background:#fff}
.journal-root .tkcard b{font-family:var(--j-mono);font-size:13px;font-weight:700}
.journal-root .tl{position:relative;padding-left:28px}
.journal-root .tl::before{content:"";position:absolute;left:8px;top:10px;bottom:10px;width:2px;background:var(--j-border)}
.journal-root .ti-item{position:relative;margin-bottom:11px}
.journal-root .ti-item:last-child{margin-bottom:0}
.journal-root .ti-item::before{content:"";position:absolute;left:-25px;top:14px;width:11px;height:11px;border-radius:50%;border:3px solid var(--j-bg);box-shadow:0 0 0 1px var(--j-border);background:var(--j-cyan)}
.journal-root .ti-item.trade::before{background:var(--j-green);box-shadow:0 0 0 1px var(--j-green)}
.journal-root .dcard{background:var(--j-surface);border:1px solid var(--j-border-soft);border-radius:10px;padding:12px 14px}
.journal-root .dcard.trade{border-color:rgba(61,220,151,.3);background:rgba(61,220,151,.06)}
.journal-root .dcard .dtop{display:flex;align-items:center;gap:9px;flex-wrap:wrap;margin-bottom:6px}
.journal-root .dcard .dtop i{font-size:15px;color:var(--j-cyan)}
.journal-root .dcard.trade .dtop i{color:var(--j-green)}
.journal-root .atype{font-family:var(--j-mono);font-size:9px;font-weight:700;letter-spacing:.07em;text-transform:uppercase;color:var(--j-cyan);background:rgba(45,212,191,.08);border:1px solid rgba(45,212,191,.25);padding:2px 8px;border-radius:5px}
.journal-root .dcard.trade .atype{color:var(--j-green);background:rgba(61,220,151,.09);border-color:rgba(61,220,151,.28)}
.journal-root .dtick{font-family:var(--j-mono);font-size:12px;font-weight:700;color:var(--j-text)}
.journal-root .dtick.na{color:var(--j-faint);font-weight:500;font-style:italic;font-size:10.5px}
.journal-root .dcard .det{font-size:12px;color:var(--j-muted);line-height:1.55}
.journal-root .dcard .det a.jlib-link{color:var(--j-cyan);text-decoration:underline;text-underline-offset:2px;cursor:pointer}
.journal-root .dcard .det a.jlib-link:hover{color:var(--j-text)}
.journal-root .dcard .qty{margin-left:auto;font-family:var(--j-mono);font-size:12px;font-weight:700;color:var(--j-green);flex-shrink:0}
.journal-root .oq{display:flex;flex-direction:column;gap:10px}
.journal-root .oqi{display:flex;gap:11px;align-items:flex-start;background:rgba(251,191,36,.05);border:1px solid rgba(251,191,36,.22);border-radius:10px;padding:12px 14px}
.journal-root .oqi i{color:var(--j-amber);font-size:15px;flex-shrink:0;margin-top:1px}
.journal-root .oqi p{margin:0;font-size:12px;color:var(--j-text);line-height:1.6}
.journal-root.compact .calwrap{grid-template-columns:1fr}
.journal-root.compact .rail{display:none}
@media (max-width:760px){
  .journal-root .calwrap{grid-template-columns:1fr}
  .journal-root .rail{display:none}
  /* Strip metrics on one horizontal scroller (Sessions / Messages / Tickers / …). */
  .journal-root .strip{
    display:flex; flex-wrap:nowrap; gap:12px; width:100%;
    overflow-x:auto; -webkit-overflow-scrolling:touch;
    scrollbar-width:none; padding-bottom:2px;
  }
  .journal-root .strip::-webkit-scrollbar{display:none}
  .journal-root .strip .st{flex:0 0 auto; min-width:118px}
  .journal-day{min-height:56px}
  .journal-day .dtks{display:none}
  .journal-root .tks{grid-template-columns:1fr 1fr}
}

/* ── Light theme: islands that own their own tokens ───────────────── */
html[data-theme="light"] .settings-seg {
  background: var(--bg-input);
  border-color: var(--border);
}
html[data-theme="light"] .settings-seg-btn:hover {
  border-color: var(--border);
  background: var(--bg-hover);
}
html[data-theme="light"] .settings-seg-btn.active {
  box-shadow: none;
}

html[data-theme="light"] .ei-root {
  --ei-bg: #f4f6f8;
  --ei-sf: #ffffff;
  --ei-sf2: #eef1f4;
  --ei-bd: #d5dbe3;
  --ei-bds: #e4e8ee;
  --ei-text: #111827;
  --ei-muted: #374151;
  --ei-faint: #6b7280;
  --ei-cyan: var(--neon-cyan);
  background: var(--ei-bg);
  color: var(--ei-text);
}
html[data-theme="light"] .ei-card {
  background: var(--ei-sf);
}
html[data-theme="light"] .ei-hdr,
html[data-theme="light"] .ei-theme,
html[data-theme="light"] .ei-gcard,
html[data-theme="light"] .ei-kstat {
  background: var(--ei-sf2);
}

html[data-theme="light"] .journal-root {
  --j-bg: #f4f6f8;
  --j-surface: var(--bg-sidebar);
  --j-surface-2: #eef1f4;
  --j-border: #d5dbe3;
  --j-border-soft: #e5e7eb;
  --j-text: #111827;
  --j-muted: #374151;
  --j-faint: #4b5563;
  --j-cyan: #0e7490;
  --j-green: #047857;
  --j-red: #b91c1c;
  --j-amber: #b45309;
  --j-purple: #6d28d9;
  background: transparent;
  color: var(--j-text);
}
html[data-theme="light"] .journal-root .rail,
html[data-theme="light"] .journal-root .dcard,
html[data-theme="light"] .journal-root .tkcard,
html[data-theme="light"] .journal-root .rsum {
  background: var(--j-surface);
  border-color: var(--j-border);
}
html[data-theme="light"] .journal-root .dcard.trade {
  background: rgba(4, 120, 87, 0.06);
}
html[data-theme="light"] .journal-root .open {
  color: #ffffff;
}
html[data-theme="light"] .journal-day.lvl1 {
  background: rgba(14, 116, 144, 0.06);
}
html[data-theme="light"] .journal-day.lvl2 {
  background: rgba(14, 116, 144, 0.10);
}
html[data-theme="light"] .journal-day.lvl3 {
  background: rgba(14, 116, 144, 0.16);
  border-color: rgba(14, 116, 144, 0.28);
}
html[data-theme="light"] .journal-root .sw.l1 {
  background: rgba(14, 116, 144, 0.14);
  border-color: #d5dbe3;
}
html[data-theme="light"] .journal-root .sw.l2 {
  background: rgba(14, 116, 144, 0.28);
  border-color: rgba(14, 116, 144, 0.28);
}
html[data-theme="light"] .journal-root .sw.l3 {
  background: rgba(14, 116, 144, 0.42);
  border-color: rgba(14, 116, 144, 0.40);
}
html[data-theme="light"] .journal-root .sw.l0 {
  border-color: #94a3b8;
}
html[data-theme="light"] .journal-root .dtick {
  color: var(--j-text);
}
html[data-theme="light"] .journal-root .dtick.na {
  color: var(--j-faint);
}

html[data-theme="light"] .search-dropdown,
html[data-theme="light"] .wl-search-dropdown,
html[data-theme="light"] .pf-benchmark-dropdown {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--border);
  box-shadow: var(--glow-md);
}
html[data-theme="light"] .search-result:hover,
html[data-theme="light"] .wl-dd-item:hover,
html[data-theme="light"] .pf-bm-item:hover {
  background: var(--bg-hover);
}
html[data-theme="light"] .search-result-name,
html[data-theme="light"] .wl-dd-name,
html[data-theme="light"] .pf-bm-name {
  color: var(--text-muted);
}
html[data-theme="light"] .search-result-symbol,
html[data-theme="light"] .wl-dd-sym {
  color: var(--text-primary);
}
html[data-theme="light"] .pf-bm-sym {
  color: var(--neon-cyan);
}

html[data-theme="light"] .wl-mt {
  --mt-bg: #f4f6f8;
  --mt-surface: var(--bg-sidebar);
  --mt-surface2: #eef1f4;
  --mt-border: #d5dbe3;
  --mt-bs: #e5e7eb;
  --mt-text: #111827;
  --mt-muted: #4b5563;
  --mt-faint: #6b7280;
  --mt-cyan: #0e7490;
  --mt-amber: #b45309;
  --mt-purple: #6d28d9;
  --mt-flat: #cbd5e1;
  color: var(--mt-text);
}
html[data-theme="light"] .wl-brief-ticker-badge {
  background: #e8ecf0;
  color: var(--text-primary);
}
html[data-theme="light"] .wl-brief-header,
html[data-theme="light"] .wl-brief-divider,
html[data-theme="light"] .wl-brief-footer {
  border-color: var(--border);
}
html[data-theme="light"] .wl-brief-summary {
  background: var(--bg-hover);
  color: var(--text-secondary);
}

html[data-theme="light"] .pf-recap-root {
  --pf-surface: #ffffff;
  --pf-surface2: #eef1f4;
  --pf-border: #d5dbe3;
  --pf-bs: #e5e7eb;
  --pf-text: #111827;
  --pf-muted: #374151;
  --pf-faint: #4b5563;
  --pf-cyan: #0e7490;
  --pf-green: #047857;
  --pf-red: #b91c1c;
  --pf-amber: #b45309;
  --pf-purple: #6d28d9;
  color: var(--pf-text);
}
html[data-theme="light"] .pf-kpi,
html[data-theme="light"] .pf-chart-box,
html[data-theme="light"] .pf-risk-card {
  background: var(--bg-sidebar);
  border-color: var(--pf-border);
}

html[data-theme="light"] .bb-side,
html[data-theme="light"] .bb-thesis,
html[data-theme="light"] .bb-pitem {
  color: #1f2937;
}
html[data-theme="light"] .bb-eyebrow,
html[data-theme="light"] .bb-metric-lab,
html[data-theme="light"] .bb-sublabel,
html[data-theme="light"] .bb-foot {
  color: #4b5563;
}
html[data-theme="light"] .bb-metric-val,
html[data-theme="light"] .bb-ax-lab {
  color: #111827;
}
html[data-theme="light"] .bb-verdict,
html[data-theme="light"] .bb-axes,
html[data-theme="light"] .bb-col {
  background: var(--bg-card);
  border-color: var(--border);
}

html[data-theme="light"] .cc-brief,
html[data-theme="light"] .cc-mlist,
html[data-theme="light"] .cc-callout {
  color: #1f2937;
}
html[data-theme="light"] .cc-vb,
html[data-theme="light"] .cc-kpi,
html[data-theme="light"] .cc-tile {
  background: var(--bg-card);
  border-color: var(--border);
}
html[data-theme="light"] .cc-vb.good { border-left-color: var(--gain); }
html[data-theme="light"] .cc-vb.good .cc-vb-v { color: var(--gain); }
html[data-theme="light"] .cc-vb.amb { border-left-color: #d97706; }
html[data-theme="light"] .cc-vb.amb .cc-vb-v { color: #d97706; }
html[data-theme="light"] .cc-vb.bad { border-left-color: #dc2626; }
html[data-theme="light"] .cc-vb.bad .cc-vb-v { color: #dc2626; }

html[data-theme="light"] .va-axis,
html[data-theme="light"] .va-end {
  fill: #4b5563;
}
html[data-theme="light"] .va-mid-lab {
  fill: #111827;
}
html[data-theme="light"] .va-grid {
  stroke: rgba(15, 23, 42, 0.08);
}

html[data-theme="light"] .kf-tooltip {
  background: #ffffff;
  border-color: var(--border);
  box-shadow: var(--glow-md);
  color: var(--text-primary);
}
html[data-theme="light"] .kf-tip-formula,
html[data-theme="light"] .kf-tip-source,
html[data-theme="light"] .kf-tip-filing {
  border-color: var(--border);
}
html[data-theme="light"] .kf-tip-result {
  border-color: #d5dbe3;
}
html[data-theme="light"] .kf-tip-section {
  color: var(--text-muted);
}
html[data-theme="light"] .kf-badge {
  background: #e8ecf0;
  color: var(--text-primary);
  border-color: var(--border);
}
html[data-theme="light"] .kf-badge:hover {
  background: #dbe3ea;
  color: var(--text-primary);
  border-color: var(--border-active);
}
html[data-theme="light"] .kf-src-icon {
  color: #4b5563;
  border-color: #94a3b8;
  background: #ffffff;
}
html[data-theme="light"] td:hover .kf-src-icon {
  color: #0e7490;
  border-color: #0e7490;
  text-shadow: none;
}
html[data-theme="light"] .kf-src-icon:hover {
  color: #0e7490 !important;
  border-color: #0e7490 !important;
  background: rgba(14, 116, 144, 0.10);
  text-shadow: none !important;
}
html[data-theme="light"] .kf-cell-hover {
  outline-color: rgba(14, 116, 144, 0.35);
  background: rgba(14, 116, 144, 0.06) !important;
}
html[data-theme="light"] .kf-cell-input {
  background: rgba(14, 116, 144, 0.10) !important;
  outline-color: rgba(14, 116, 144, 0.35);
}
html[data-theme="light"] .kf-separator td {
  border-top-color: var(--border);
}
html[data-theme="light"] .kf-estimate,
html[data-theme="light"] .kf-estimate-col {
  color: var(--text-muted) !important;
}
html[data-theme="light"] .kf-section-pill {
  background: var(--bg-hover);
  color: var(--text-secondary);
}
html[data-theme="light"] .kf-section-pill:hover {
  background: #dbe3ea;
  color: var(--text-primary);
  border-color: var(--border-active);
}
html[data-theme="light"] .kf-section-pill.active {
  color: #0e7490;
  border-color: rgba(14, 116, 144, 0.45);
  background: rgba(14, 116, 144, 0.08);
  box-shadow: none;
}
html[data-theme="light"] .chart-popover {
  background: #ffffff;
  border-color: var(--border);
  box-shadow: var(--glow-md);
}
html[data-theme="light"] .eh-chart-well {
  background:
    radial-gradient(120% 90% at 8% 0%, rgba(14, 116, 144, 0.10), transparent 52%),
    linear-gradient(180deg, #e8f1f4 0%, #f4f7f9 48%, #f8fafc 100%);
  box-shadow: inset 0 1px 0 rgba(14, 116, 144, 0.10);
}
html[data-theme="light"] .eh-transcript {
  background: none;
  border-radius: 0;
  padding: 4px 0 16px;
}
html[data-theme="light"] .earnings-dual-grid {
  background: #ffffff;
}
html[data-theme="light"] .quarter-chip:hover {
  border-color: var(--border-active);
}
html[data-theme="light"] .quarter-chip.active {
  background: rgba(14, 116, 144, 0.08);
  border-color: rgba(14, 116, 144, 0.35);
  color: var(--text-primary);
}
html[data-theme="light"] .listen-btn:hover {
  background: var(--bg-hover);
}
html[data-theme="light"] .ac-bar-neutral {
  background: #94a3b8;
}
html[data-theme="light"] .ac-pt-track,
html[data-theme="light"] .price-target-line {
  background: linear-gradient(90deg, #b05252 0%, #94a3b8 28%, #94a3b8 72%, #3d8b5c 100%);
  box-shadow: inset 0 0 0 1px rgba(17, 24, 39, 0.10);
}
html[data-theme="light"] .ac-marker-current,
html[data-theme="light"] .price-target-dot.dot-current {
  border-color: #111827;
  background: #ffffff;
}
html[data-theme="light"] .ac-pt-ring-current {
  border-color: #111827;
}
html[data-theme="light"] .fmp-rating-pill {
  background: #ffffff;
  border-color: var(--border);
}
html[data-theme="light"] .fmp-rating-overall {
  border-right-color: var(--border);
}
html[data-theme="light"] .popover-btn.active {
  background: rgba(14, 116, 144, 0.08);
  box-shadow: none;
}

html[data-theme="light"] .ta-new-wrap .ta-vm-card {
  background: #ffffff;
  border-color: var(--border);
  box-shadow: var(--glow-sm);
}
html[data-theme="light"] .ta-vm-panel-h,
html[data-theme="light"] .ta-rsi-wrap,
html[data-theme="light"] .ta-mom-row,
html[data-theme="light"] .ta-ma-line,
html[data-theme="light"] .ta-trade-foot {
  border-color: var(--border);
}
html[data-theme="light"] .ta-metric-sep {
  background: var(--border);
}
html[data-theme="light"] .ta-verdict-sig {
  border-left-color: var(--border);
}
html[data-theme="light"] .ta-trade-step:not(:last-child)::after {
  background: var(--border);
}
html[data-theme="light"] .ta-vm-panel-sub,
html[data-theme="light"] .ta-exec-date,
html[data-theme="light"] .ta-verdict-conf,
html[data-theme="light"] .ta-regime-meta,
html[data-theme="light"] .ta-ladder-src,
html[data-theme="light"] .ta-rsi-key,
html[data-theme="light"] .ta-mom-key,
html[data-theme="light"] .ta-ma-ref,
html[data-theme="light"] .ta-step-key,
html[data-theme="light"] .ta-vstat-k,
html[data-theme="light"] .ta-metric-label {
  color: #4b5563;
}
html[data-theme="light"] .ta-exec-text,
html[data-theme="light"] .ta-tf-chip-note,
html[data-theme="light"] .ta-tf-alignment,
html[data-theme="light"] .ta-rsi-desc,
html[data-theme="light"] .ta-mom-val,
html[data-theme="light"] .ta-vol-note,
html[data-theme="light"] .ta-ma-footer,
html[data-theme="light"] .ta-step-sub {
  color: #374151;
}
html[data-theme="light"] .ta-exec-label {
  color: #6d28d9;
}
html[data-theme="light"] .ta-brain-icon,
html[data-theme="light"] .ta-ai-tab-btn.active .ta-brain-icon {
  color: #6d28d9;
  filter: none;
}
html[data-theme="light"] .ta-verdict-logo {
  background: #eef6f7;
  border-color: rgba(14, 116, 144, 0.35);
}
html[data-theme="light"] .ta-ladder-axis,
html[data-theme="light"] .ta-ladder-line {
  background: rgba(17, 24, 39, 0.16);
}
html[data-theme="light"] .ta-ladder-dot {
  border-color: #ffffff;
}
html[data-theme="light"] .ta-zone-sup {
  background: linear-gradient(90deg, rgba(61, 139, 92, 0.10), transparent);
}
html[data-theme="light"] .ta-zone-res {
  background: linear-gradient(90deg, rgba(176, 82, 82, 0.10), transparent);
}
html[data-theme="light"] .ta-adx-bar,
html[data-theme="light"] .ta-dbar {
  background: #e5e7eb;
}
html[data-theme="light"] .ta-dbar-ctr {
  background: #94a3b8;
}
html[data-theme="light"] .ta-rsi-track {
  stroke: rgba(17, 24, 39, 0.12);
}
html[data-theme="light"] .ta-rsi-tick {
  fill: #6b7280;
}
html[data-theme="light"] .ta-vol-spike {
  color: #92400e;
  background: rgba(245, 158, 11, 0.10);
}
html[data-theme="light"] .ta-flag {
  color: #991b1b;
}
html[data-theme="light"] .ta-indicators-panel {
  background: transparent;
  border-left-color: var(--border);
}
html[data-theme="light"] .ta-ind-item {
  color: #6b7280;
}
html[data-theme="light"] .ta-ind-item:hover {
  color: #111827;
}
html[data-theme="light"] .ta-panel-label {
  color: #4b5563;
}
html[data-theme="light"] #etf-stats-content .card,
html[data-theme="light"] .etf-stats-grid .card {
  background: #ffffff;
  border-color: var(--border);
}
html[data-theme="light"] .etf-stats-grid .card:hover {
  background: var(--bg-hover);
  border-color: var(--border-active);
}
html[data-theme="light"] .etf-stat-lab {
  color: #4b5563;
}
html[data-theme="light"] .etf-exp-track {
  background: #e5e7eb;
}

.cai-note .cai-head { display: flex; align-items: center; gap: 8px; margin: 18px 0 8px; }
.cai-note .cai-head .cai-pos { margin-left: auto; }
.cai-note .cai-head h3 { margin: 0; }
.cai-ico { display: inline-flex; align-items: center; flex-shrink: 0; color: var(--neon-cyan); }
.cai-ico svg { width: 15px; height: 15px; }
.cai-note .dd-sources { margin-top: 40px; }
.cai-note .cai-marks { margin-left: auto; display: inline-flex; gap: 1px; flex-shrink: 0; line-height: 1; }
.cc-vb .cai-marks { margin: 8px 0 0; }
.cai-note .cai-marks span { font-size: 12px; color: var(--text-muted); opacity: .28; }
.cai-note .cai-marks span.on { color: #c8960c; opacity: 1; }
.cai-note td .cai-marks { margin: 6px 0 0; }
.pai-seat { display: block; color: var(--text-muted); font-size: 12px; margin-top: 2px; }
.cai-table-scroll {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.cai-table-scroll::-webkit-scrollbar { display: none; }
@media (max-width: 760px) {
  .cai-table-scroll .cai-table { width: 680px; min-width: 680px; }
}
.pai-sub { display: block; color: var(--text-secondary); margin-top: 6px; }
.cai-arena-h { display: flex; align-items: center; gap: 8px; margin: 16px 0 6px; font-size: 14px; }
.cai-no { color: var(--text-muted); font-variant-numeric: tabular-nums; margin-right: 2px; }
.cai-pos { flex-shrink: 0; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 2px 8px; border-radius: 6px; }
.cai-pos.leader { color: var(--gain); background: rgba(77, 158, 110, .1); border: 1px solid rgba(77, 158, 110, .28); }
.cai-pos.challenger { color: #f59e0b; background: rgba(245, 158, 11, .1); border: 1px solid rgba(245, 158, 11, .28); }
.cai-pos.present { color: var(--text-muted); background: rgba(255, 255, 255, .06); border: 1px solid var(--border); }
.cai-pos.augmented { color: var(--gain); background: rgba(77, 158, 110, .1); border: 1px solid rgba(77, 158, 110, .28); }
.cai-pos.immune { color: var(--text-muted); background: rgba(255, 255, 255, .06); border: 1px solid var(--border); }
.cai-pos.risk { color: #f87171; background: rgba(248, 113, 113, .1); border: 1px solid rgba(248, 113, 113, .28); }
html[data-theme="light"] .cai-pos.risk { color: #dc2626; background: rgba(220, 38, 38, .08); border-color: rgba(220, 38, 38, .28); }
.cai-cash { margin: 12px 0 16px; }
.cai-cash-top { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; color: var(--text-secondary); margin-bottom: 6px; }
.cai-cash-bar { display: flex; height: 14px; width: 100%; background: var(--border); }
.cai-cash-seg { height: 14px; }
.cai-cash-seg.issue, .cai-cash-swatch.issue { background: var(--text-muted); }
.cai-cash-seg.div, .cai-cash-swatch.div { background: var(--neon-cyan); }
.cai-cash-seg.buy, .cai-cash-swatch.buy { background: var(--gain); }
.cai-cash-seg.kept, .cai-cash-swatch.kept { background: var(--border); }
.cai-cash-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 8px; font-size: 12px; color: var(--text-secondary); }
.cai-cash-swatch { display: inline-block; width: 8px; height: 8px; margin-right: 6px; vertical-align: baseline; }
.cai-table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 8px 0 16px; }
.cai-table th { text-align: left; color: var(--text-muted); font-weight: 600; padding: 8px 8px 8px 0; }
.cai-table td { padding: 8px 8px 8px 0; border-top: 1px solid var(--border); vertical-align: top; }
.cai-note tr.ea-pos td:first-child { color: var(--gain); }
.cai-note tr.ea-neg td:first-child { color: var(--loss); }
.ea-quote p:first-child { margin: 0 0 8px; }
.cai-table tr.cai-good td:nth-child(2) { color: var(--gain); }
.cai-table tr.cai-warn td:nth-child(2) { color: #f59e0b; }
.cai-arena { margin: 16px 0; }
.cai-stance { margin: 0 0 8px; color: var(--text-secondary); }
.cai-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.cai-card { border: 1px solid var(--border); border-radius: 8px; padding: 12px; }
.cai-card-h { display: flex; align-items: center; gap: 8px; font-weight: 650; margin-bottom: 6px; }
.cai-co { display: inline-flex; align-items: center; gap: 8px; color: inherit; text-decoration: none; }
.cai-co:hover span { text-decoration: underline; }
.cai-co img { width: 20px; height: 20px; border-radius: 4px; object-fit: contain; flex-shrink: 0; }
.cai-card p, .cai-named p { margin: 0 0 8px; }
.cai-src { color: var(--text-muted); }
.cai-follows { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.cai-pair { margin: 8px 0 0; }

.tai-h { margin: 18px 0 8px; font-size: 16px; }
.tai-sma { display: inline-flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.tai-rel { color: var(--text-muted); font-size: 11px; }
.tai-avg .cai-table { width: 100%; table-layout: fixed; }
.tai-avg th, .tai-avg td { white-space: nowrap; vertical-align: middle; }
.tai-caption { color: var(--text-muted); font-size: 12px; margin: 8px 0 0; }
.tai-legend { display: flex; flex-wrap: wrap; gap: 14px; margin: 8px 0 12px; color: var(--text-muted); font-size: 12px; }
.tai-legend span { display: inline-flex; align-items: center; gap: 6px; }
.tai-dot { width: 8px; height: 8px; display: inline-block; flex-shrink: 0; }
.tai-dot.support { background: var(--gain); }
.tai-dot.resistance { background: #f87171; }
.tai-dot.spot { background: var(--neon-cyan); }
.tai-dot.trade { background: #f59e0b; }
.tai-map-row { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; }
.tai-map-plot { min-width: 0; }
.tai-map-trade .tai-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 0 0 16px; }
.tai-stat-col { display: flex; flex-direction: column; gap: 14px; }
.tai-map-trade .cc-brief { margin: 0; }
.tai-ladder { position: relative; width: 100%; margin: 8px 0 4px 0; }
.tai-axis { position: absolute; left: 88px; top: 0; bottom: 0; width: 1px; background: var(--border); }
.tai-band { position: absolute; left: 88px; right: 0; width: auto; background: rgba(245, 158, 11, .16); border-left: 2px solid #f59e0b; }
.tai-spotline { position: absolute; left: 88px; right: 0; width: auto; height: 0; border-top: 1px dashed var(--neon-cyan); z-index: 2; }
.tai-spotpx { position: absolute; left: -88px; top: -9px; width: 80px; text-align: right; color: var(--neon-cyan); font-size: 13px; font-weight: 650; font-variant-numeric: tabular-nums; }
.tai-mark { position: absolute; left: 0; right: 0; display: flex; align-items: center; gap: 8px; transform: translateY(-50%); }
.tai-px { width: 72px; text-align: right; font-variant-numeric: tabular-nums; font-size: 13px; flex: 0 0 72px; }
.tai-rule { flex: 1 1 auto; width: auto; min-width: 48px; height: 1px; background: var(--border); }
.tai-src { color: var(--text-secondary); font-size: 13px; }
.tai-pill { font-size: 11px; font-weight: 650; letter-spacing: .03em; padding: 1px 6px; border: 1px solid var(--border); border-radius: 999px; color: var(--text-secondary); }
.tai-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; margin: 12px 0; }
@media (max-width: 760px) {
  .tai-map-row { grid-template-columns: 1fr; }
}
.tai-k { color: var(--text-muted); font-size: 12px; }
.tai-v { font-weight: 650; font-variant-numeric: tabular-nums; }

/* Light theme: stock chapter boxes sit on the page color. Scoped to the
   stock page so the download hosts keep their own paper fills. */
html[data-theme="light"] #ticker-section .mt-root,
html[data-theme="light"] #ticker-section .cc-vb,
html[data-theme="light"] #ticker-section .cc-kpi,
html[data-theme="light"] #ticker-section .cc-tile,
html[data-theme="light"] #ticker-section .cc-callout.cc-neutral,
html[data-theme="light"] #ticker-section .cc-arena,
html[data-theme="light"] #ticker-section .cc-more-header,
html[data-theme="light"] #ticker-section .fc-badges .mb,
html[data-theme="light"] #ticker-section .fc-tiles .tile,
html[data-theme="light"] #ticker-section .mq-pcard,
html[data-theme="light"] #ticker-section .mq-ownrow,
html[data-theme="light"] #ticker-section .va-ac,
html[data-theme="light"] #ticker-section .va-tile,
html[data-theme="light"] #ticker-section .va-callout,
html[data-theme="light"] #ticker-section .va-gapbar,
html[data-theme="light"] #ticker-section .earnings-dual-grid,
html[data-theme="light"] #ticker-section .fmp-rating-pill {
    background: transparent;
}
html[data-theme="light"] #ticker-section .cc-more-header:hover {
    background: var(--bg-hover);
}

/* Light theme: white panels on left-menu sections use the menu grey, not the page grey. */
html[data-theme="light"] .market-tab-content .cal-day-card:not(.today):not(.active),
html[data-theme="light"] .market-tab-content .cal-day-card:not(.today):not(.active):hover,
html[data-theme="light"] .market-tab-content .index-card,
html[data-theme="light"] .market-tab-content .index-card:hover,
html[data-theme="light"] .market-tab-content .movers-panel,
html[data-theme="light"] .market-tab-content .world-region,
html[data-theme="light"] .market-tab-content .ts-card,
html[data-theme="light"] .market-tab-content .ts-tile,
html[data-theme="light"] .market-tab-content .pm-card,
html[data-theme="light"] .market-tab-content .pm-card:hover,
html[data-theme="light"] .market-tab-content .fx-matrix-scroll,
html[data-theme="light"] .market-tab-content .fx-matrix-corner,
html[data-theme="light"] .market-tab-content .fx-matrix-header-cell,
html[data-theme="light"] .market-tab-content .fx-matrix-row-header,
html[data-theme="light"] .market-tab-content .cali-card,
html[data-theme="light"] .market-tab-content .cali-day,
html[data-theme="light"] .market-tab-content .ovi-card,
html[data-theme="light"] .market-tab-content .fli-stat,
html[data-theme="light"] .market-tab-content .fli-card,
html[data-theme="light"] .market-tab-content .pri-card,
html[data-theme="light"] .market-tab-content .nwi-card {
    background: var(--bg-sidebar);
}
