/* ─── Display font ──────────────────────────────────────── */
.site-brand,
.ticker-symbol {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 800;
    letter-spacing: 0.5px;
}

/* ─── Base ─────────────────────────────────────────────── */
:root {
    --accent: #00d4aa;
    --accent-dim: rgba(0, 212, 170, 0.15);
    --card-bg: #141a23;
    --card-border: #1e2d3d;
    --border: #1e2d3d;
    --surface: #0d1117;
    --text-primary: #e6edf3;
    --text-secondary: #c9d1d9;
    --text-muted: #8b949e;
    --signal-short: #3b82f6;
    --signal-long: #22c55e;
    --signal-both: #f59e0b;
    --signal-hold: #6b7280;
    --positive: #22c55e;
    --negative: #ef4444;
}

html { font-size: 16px; min-height: 100%; }

body {
    background-color: var(--surface);
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ─── Market Mood Bar ───────────────────────────────────── */
@keyframes ticker-scroll {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.market-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    padding: 0;
    font-size: 0.75rem;
    border-bottom: 1px solid var(--card-border);
    background: #0d1117;
    font-family: inherit;
}

.market-bar-row {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 0;
    overflow: hidden;
}

.market-bar-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.62rem;
    letter-spacing: 0.06em;
    white-space: nowrap;
    padding: 0.45rem 1rem 0.45rem 0;
    border-right: 1px solid var(--card-border);
    margin-right: 0;
    flex-shrink: 0;
}

.market-ticker-wrap {
    flex: 1;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 4%, black 96%, transparent 100%);
    mask-image: linear-gradient(to right, transparent 0%, black 4%, black 96%, transparent 100%);
}

.market-ticker-track {
    display: flex;
    align-items: center;
    width: max-content;
    animation: ticker-scroll 18s linear infinite;
}

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

.market-ticker-item {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 1.25rem;
    white-space: nowrap;
}

.market-ticker-sep {
    color: var(--card-border);
    padding: 0 0.25rem;
    flex-shrink: 0;
}

.market-bar-ticker {
    color: var(--text-secondary);
    font-weight: 700;
}

.market-bar-price {
    color: var(--text-primary);
    font-weight: 600;
}

.market-bar-change {
    font-weight: 700;
}

.market-bar-mood {
    font-size: 1rem;
    line-height: 1;
}

.market-bar-add-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0 1rem;
    font-size: 0.8rem;
    line-height: 1;
    flex-shrink: 0;
    border-left: 1px solid var(--card-border);
    height: 100%;
    display: flex;
    align-items: center;
    transition: color 0.15s;
}
.market-bar-add-btn:hover { color: var(--text-primary); }

/* Home button in the header (market bar) — top-left, like a site logo/home */
.market-bar-home-btn {
    background: none;
    color: var(--text-muted);
    padding: 0 0.9rem;
    font-size: 0.95rem;
    line-height: 1;
    flex-shrink: 0;
    border-right: 1px solid var(--card-border);
    align-self: stretch;
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: color 0.15s;
}
.market-bar-home-btn:hover { color: var(--accent, #00c896); }

/* Fixed home button for bare pages (HideChrome) that don't render the market bar */
.global-home-btn {
    position: fixed;
    top: 10px;
    left: 14px;
    z-index: 200;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    color: var(--text-muted);
    background: rgba(13,17,23,0.85);
    border: 1px solid var(--card-border);
    text-decoration: none;
    font-size: 1rem;
    transition: color 0.15s, border-color 0.15s;
}
.global-home-btn:hover { color: var(--accent, #00c896); border-color: var(--accent, #00c896); }

.market-ticker-watch { position: relative; }

.market-watch-remove {
    background: none;
    border: none;
    color: #e05555;
    cursor: pointer;
    font-size: 0.75rem;
    padding: 0 0.1rem;
    line-height: 1;
    opacity: 0;
    transition: opacity 0.15s;
}
.market-ticker-watch:hover .market-watch-remove { opacity: 1; }

.market-bar-add-form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 1rem;
    border-top: 1px solid var(--card-border);
}

.market-bar-add-form input[type="text"] {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    width: 160px;
}
.market-bar-add-form input[type="text"]:focus { outline: none; border-color: var(--accent); }

.market-bar-add-error {
    color: #e05555;
    font-size: 0.7rem;
}

/* ─── Header / Nav ──────────────────────────────────────── */
.site-header {
    background: #0d1117;
    border-bottom: 1px solid var(--card-border);
    padding: 0.6rem 0;
}

.site-brand {
    color: var(--accent) !important;
    font-weight: 800;
    font-size: clamp(1.45rem, 3.5vw, 1.9rem);
    letter-spacing: 0;
}

@media (max-width: 480px) {
    .site-header { padding: 0.45rem 0; }
}

/* ─── Main container ────────────────────────────────────── */
.main-container {
    padding-top: 0.75rem;
    padding-bottom: 1.5rem;
    flex: 1;
}
.main-container-bare {
    /* leave a top gutter so the fixed top-left home button clears the page title */
    padding-top: 3.25rem;
}

/* ─── Disclaimer banner ─────────────────────────────────── */
.disclaimer-banner {
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 8px;
    padding: 0.5rem 0.85rem;
    margin-top: 0.75rem;
    color: #fbbf24;
    font-size: 0.78rem;
    line-height: 1.5;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.disclaimer-banner i { flex-shrink: 0; }

.btn-dismiss {
    background: none;
    border: none;
    color: #fbbf24;
    cursor: pointer;
    margin-left: auto;
    padding: 0.25rem;
    opacity: 0.7;
    flex-shrink: 0;
    line-height: 1;
}

.btn-dismiss:hover { opacity: 1; }

/* ─── Picks section ─────────────────────────────────────── */
.picks-section { margin-top: 0; }

.site-logo-block {
    display: block;
    text-decoration: none;
    margin-bottom: 0.75rem;
    transition: opacity 0.15s ease;
}
.site-logo-block:hover { opacity: 0.8; }
.site-logo-text {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 800;
    font-size: clamp(1.6rem, 4vw, 2.2rem);
    color: #4ade80;
    letter-spacing: -0.5px;
    line-height: 1;
    display: flex;
    align-items: center;
    gap: 0.45em;
    text-shadow: 0 0 18px rgba(74,222,128,0.45), 0 0 40px rgba(74,222,128,0.18);
}
.site-logo-icon {
    font-size: 0.85em;
    opacity: 0.9;
}
.site-logo-sub {
    display: block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.62rem;
    font-weight: 400;
    color: var(--text-muted);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-top: 0.3rem;
}

.page-section-label {
    font-size: 0.63rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent);
    margin: 0.75rem 0 0.4rem;
    padding-bottom: 0.25rem;
    padding-left: 0.5rem;
    border-left: 2px solid var(--accent);
    border-bottom: 1px solid rgba(0, 212, 170, 0.15);
}

/* ─── Main two-column grid ──────────────────────────────── */
.main-grid {
    display: grid;
    grid-template-columns: 410px minmax(0, 1fr);
    gap: 1.25rem;
    align-items: start;
}

.main-grid > * {
    min-width: 0;
}

.main-grid-left .stock-cards-wrap {
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

.main-grid-left .page-section-label,
.main-grid-right .page-section-label:first-child {
    margin-top: 0;
}

@media (max-width: 880px) {
    .main-grid { grid-template-columns: 1fr; }
    .site-logo-block { text-align: center; }
    .site-logo-text { justify-content: center; }
}


/* ─── Refresh animation ─────────────────────────────────── */
@keyframes spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* ─── Ticker + company name ─────────────────────────────── */
.ticker-info-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.company-name {
    font-size: 0.68rem;
    color: var(--text-muted);
    font-weight: 400;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ─── Info panel ─────────────────────────────────────────── */
.card-info-panel {
    background: rgba(0, 212, 170, 0.05);
    border: 1px solid rgba(0, 212, 170, 0.15);
    border-radius: 8px;
    padding: 0.65rem 0.85rem;
    margin-bottom: 0.25rem;
}

.info-sector {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.35rem;
}

.info-description {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.5;
}

/* ─── Per-card refresh button ───────────────────────────── */
.card-header-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-card-refresh {
    position: relative;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.2rem 0.3rem;
    line-height: 1;
    border-radius: 4px;
    font-size: 0.95rem;
    transition: color 0.15s;
    flex-shrink: 0;
}

.btn-card-info {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.2rem 0.3rem;
    line-height: 1;
    border-radius: 4px;
    font-size: 0.95rem;
    transition: color 0.15s;
    flex-shrink: 0;
}

.btn-card-info:hover { color: var(--accent); }
.btn-card-info.active { color: var(--accent); }

.btn-card-refresh:hover { color: var(--accent); }

.btn-card-refresh.htmx-request { cursor: default; }

/* Fade the portfolio container during any swap instead of hard flash */
#portfolio-card-container {
    transition: opacity 0.1s ease;
}
#portfolio-card-container.htmx-swapping {
    opacity: 0.4;
}

.btn-card-refresh.htmx-request .bi,
.btn-card-refresh:hover .bi {
    display: inline-block;
    animation: spin 0.7s linear infinite;
}

/* ─── Loading indicator ─────────────────────────────────── */
.loading-indicator {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 3rem 0;
    color: var(--text-muted);
}

.htmx-indicator { display: none; }
.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator { display: flex !important; }

.text-accent { color: var(--accent) !important; }
.loading-text { font-size: 0.9rem; color: var(--text-muted); }

/* ─── Recommendations grid ──────────────────────────────── */
.recommendations-grid {
    display: block;
}

.stock-cards-wrap {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
    align-items: stretch;
    min-width: 0;
}

/* Gov Trades / portfolio — full-width rows below */
.congress-card-row {
    margin-top: 0.5rem;
}

@media (max-width: 760px) {
    .stock-cards-wrap { grid-template-columns: 1fr; gap: 1rem; }
}

@media (max-width: 540px) {
    .stock-card { padding: 0.75rem; border-radius: 10px; gap: 0.45rem; }
    .ticker-symbol { font-size: 1.05rem; }
    .company-name { font-size: 0.64rem; }
    .current-price { font-size: 1.35rem; }
    .card-reason { font-size: 0.78rem; }
    .card-sell-tip { font-size: 0.74rem; padding: 0.4rem 0.6rem; }
    .signal-badge { font-size: 0.75rem; min-height: 32px; }
}

/* ─── Stock card ────────────────────────────────────────── */
.stock-card {
    background: linear-gradient(160deg, rgba(0,212,170,0.03) 0%, var(--card-bg) 40%);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 0.85rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.stock-card:hover {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent-dim);
}

.stock-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.ticker-symbol {
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: var(--text-primary);
    white-space: nowrap;
}

.price-change {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    white-space: nowrap;
}

.positive { color: var(--positive); }
.negative { color: var(--negative); }
.text-success { color: var(--positive); }
.text-warning { color: #f0b429; }
.text-danger  { color: var(--negative); }
.price-change.positive { background: rgba(34, 197, 94, 0.12); }
.price-change.negative { background: rgba(239, 68, 68, 0.12); }

.current-price {
    font-size: 1.55rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.freshness-line {
    color: var(--text-muted);
    font-size: 0.68rem;
    line-height: 1.4;
    margin-top: -0.45rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.freshness-separator {
    opacity: 0.65;
}

/* ─── Signal badge ──────────────────────────────────────── */
.stock-card .signal-badge { margin-top: auto; }

.signal-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.4rem 0.75rem;
    border-radius: 7px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-align: center;
    min-height: 34px;
}

.badge-signal-short  { background: rgba(59, 130, 246, 0.15); color: var(--signal-short);  border: 1px solid rgba(59,130,246,0.4); }
.badge-signal-long   { background: rgba(34, 197, 94, 0.15);  color: var(--signal-long);   border: 1px solid rgba(34,197,94,0.4); }
.badge-signal-both   { background: rgba(245,158,11, 0.15);   color: var(--signal-both);   border: 1px solid rgba(245,158,11,0.4); }
.badge-signal-hold   { background: rgba(107,114,128,0.15);   color: var(--signal-hold);   border: 1px solid rgba(107,114,128,0.4); }

/* ─── Card reason + sell tip ────────────────────────────── */
.card-reason {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.6;
}

.card-sell-tip {
    font-size: 0.78rem;
    font-weight: 600;
    color: #fbbf24;
    background: rgba(245, 158, 11, 0.07);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: 7px;
    padding: 0.5rem 0.75rem;
    line-height: 1.5;
}

/* ─── Placeholder cards ─────────────────────────────────── */
.stock-card-placeholder {
    min-height: 180px;
    border-color: var(--card-border);
}

.placeholder-pulse {
    width: 100%;
    height: 100%;
    min-height: 160px;
    border-radius: 8px;
    background: linear-gradient(90deg, var(--card-border) 25%, rgba(255,255,255,0.05) 50%, var(--card-border) 75%);
    background-size: 200% 100%;
    animation: pulse 1.5s ease-in-out infinite;
}

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

/* ─── Swap fade ─────────────────────────────────────────── */
#recommendations-container {
    min-height: 320px;
}

.refresh-toast {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    background: var(--card-bg);
    border: 1px solid var(--accent);
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    z-index: 9999;
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    animation: toastSlide 2.2s ease forwards;
}

@keyframes toastSlide {
    0%   { opacity: 0; transform: translateY(8px); }
    12%  { opacity: 1; transform: translateY(0); }
    75%  { opacity: 1; }
    100% { opacity: 0; transform: translateY(4px); }
}

.btn-card-refresh:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.btn-card-refresh:disabled:hover::after {
    content: 'refreshes are available every 30s';
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    background: var(--card-bg);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.72rem;
    padding: 0.3rem 0.65rem;
    border-radius: 6px;
    white-space: nowrap;
    z-index: 9999;
    pointer-events: none;
}

/* ─── Performance tracker ───────────────────────────────── */
.portfolio-tracker-section {
    padding-bottom: 0.4rem;
    margin-bottom: 0.2rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.portfolio-bot-grid {
    display: grid;
    /* Auto-fit: 2 cols when there's room for two ≥330px cards, else 1 — no overflow.
       min(100%, 330px) prevents overflow on containers narrower than 330px. */
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 330px), 1fr));
    gap: 0.75rem;
    margin-bottom: 0;
}
/* Let cards shrink below their content's intrinsic width so titles ellipsis-truncate
   instead of pushing the grid wider than its container. */
.portfolio-bot-grid > *,
.portfolio-bot-grid .portfolio-name-row,
.portfolio-bot-grid .ticker-info-wrap { min-width: 0; }

/* Tighter, uniform cards inside the 3-col bot row */
.portfolio-bot-grid .stock-card { padding: 0.65rem 0.85rem; display: flex; flex-direction: column; }
.portfolio-bot-grid .stock-card-header { flex-shrink: 0; }
.portfolio-bot-grid .portfolio-chart-wrap { flex-shrink: 0; }
.portfolio-bot-grid .portfolio-name-row { gap: 0.25rem; flex-wrap: nowrap; }
.portfolio-bot-grid .congress-ticker { font-size: 0.72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.portfolio-bot-grid .portfolio-live-badge { font-size: 0.55rem; padding: 1px 5px; flex-shrink: 0; }
.portfolio-bot-grid .portfolio-bot-badge { font-size: 0.7rem; flex-shrink: 0; }
.portfolio-bot-grid .portfolio-total-value { display: none; }
.hourly-balance {
    margin-left: auto;
    flex-shrink: 0;
    padding-left: 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.portfolio-bot-grid .portfolio-pct-hero { font-size: 1.3rem; }
.portfolio-bot-grid .portfolio-pct-sub { font-size: 0.6rem; }

.portfolio-tracker-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

/* .portfolio-bot-grid now uses auto-fit (see base rule) — it reflows 2↔1 column
   on its own with no overflow, so it needs no width breakpoints. */
@media (max-width: 1175px) {
    .portfolio-tracker-grid { grid-template-columns: 1fr; }
}

/* ─── Portfolio card ─────────────────────────────────────── */
.portfolio-all-wrap {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

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

.portfolio-cards-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.portfolio-create-form {
    padding: 0.75rem 0;
}

.portfolio-create-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.portfolio-create-row input {
    flex: 1;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.85rem;
    padding: 0.45rem 0.75rem;
    outline: none;
}
.portfolio-create-row input:focus { border-color: var(--accent); }

.btn-portfolio-delete-card {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.2rem 0.3rem;
    font-size: 0.8rem;
    opacity: 0.4;
    transition: opacity 0.15s, color 0.15s;
}
.btn-portfolio-delete-card:hover { opacity: 1; color: #e05555; }

.portfolio-card {}

/* ─── Trump portfolio card ──────────────────────────────────── */
.portfolio-card-trump {
    border-color: rgba(220, 38, 38, 0.55) !important;
    box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.2), 0 0 24px rgba(59, 130, 246, 0.08);
    background: linear-gradient(160deg, rgba(220, 38, 38, 0.05) 0%, rgba(59, 130, 246, 0.03) 100%, var(--card-bg) 100%);
}

.portfolio-voo-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #60a5fa;
    background: rgba(96,165,250,0.1);
    border: 1px solid rgba(96,165,250,0.25);
    border-radius: 4px;
    padding: 0.1rem 0.35rem;
    white-space: nowrap;
}

.portfolio-trump-badge {
    display: inline-flex;
    align-items: center;
    font-size: 1rem;
    line-height: 1;
}


/* ─── Bot portfolio card ────────────────────────────────────── */
:root { --bot: #8b5cf6; --bot-dim: rgba(139, 92, 246, 0.15); }

.portfolio-card-bot {
    border-color: rgba(139, 92, 246, 0.55) !important;
    box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.2), 0 0 24px rgba(139, 92, 246, 0.08);
    background: linear-gradient(160deg, rgba(139, 92, 246, 0.05) 0%, var(--card-bg) 40%);
}

/* FJ (friend's) cards — orange glow instead of purple */
.portfolio-card-bot-fj {
    border-color: rgba(249, 115, 22, 0.55) !important;
    box-shadow: 0 0 0 1px rgba(249, 115, 22, 0.2), 0 0 24px rgba(249, 115, 22, 0.1) !important;
    background: linear-gradient(160deg, rgba(249, 115, 22, 0.05) 0%, var(--card-bg) 40%) !important;
}

.badge-new {
    display: inline-flex;
    align-items: center;
    font-size: 0.55rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #0d1117;
    background: #4ade80;
    border-radius: 4px;
    padding: 0.1rem 0.4rem;
    line-height: 1.4;
    box-shadow: 0 0 10px rgba(74, 222, 128, 0.5);
}

.badge-paper {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.55rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #fbbf24;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.35);
    border-radius: 4px;
    padding: 0.1rem 0.4rem;
    line-height: 1.4;
    white-space: nowrap;
}

.portfolio-bot-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #a78bfa;
    background: rgba(139, 92, 246, 0.12);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 4px;
    padding: 0.1rem 0.4rem;
    line-height: 1.4;
}

.portfolio-live-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 4px;
    padding: 0.1rem 0.4rem;
    line-height: 1.4;
    animation: livePulse 2.5s ease-in-out infinite;
}

@keyframes livePulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.55; }
}

.portfolio-perf-emoji {
    font-size: 1rem;
    line-height: 1;
    cursor: default;
}

/* ─── Bot dashboard ─────────────────────────────────────────── */
.bot-dashboard-title {
    font-size: 1.3rem;
    font-weight: 800;
    color: #a78bfa;
}

.bot-stat-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 1rem 1.25rem;
}

.bot-stat-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
}

.bot-stat-value {
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1;
    color: var(--text-primary);
}

.bot-stat-sub {
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.bot-trade-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
}

.bot-trade-table th {
    color: var(--text-muted);
    font-size: 0.63rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.3rem 0.5rem 0.5rem;
    border-bottom: 1px solid var(--card-border);
    text-align: left;
    white-space: nowrap;
}

.bot-trade-table td {
    padding: 0.4rem 0.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    vertical-align: middle;
    color: var(--text-primary);
}

.bot-status-badge {
    display: inline-block;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
}

.bot-status-proposed { background: rgba(245,158,11,0.12); color: #fbbf24; border: 1px solid rgba(245,158,11,0.3); }
.bot-status-open      { background: rgba(34,197,94,0.12);  color: #4ade80; border: 1px solid rgba(34,197,94,0.3); }
.bot-status-closed    { background: rgba(139,92,246,0.12); color: #a78bfa; border: 1px solid rgba(139,92,246,0.3); }
.bot-status-rejected  { background: rgba(239,68,68,0.12);  color: #f87171; border: 1px solid rgba(239,68,68,0.3); }
.bot-status-running   { background: rgba(59,130,246,0.12); color: #60a5fa; border: 1px solid rgba(59,130,246,0.3); }
.bot-status-done      { background: rgba(34,197,94,0.12);  color: #4ade80; border: 1px solid rgba(34,197,94,0.3); }
.bot-status-error     { background: rgba(239,68,68,0.12);  color: #f87171; border: 1px solid rgba(239,68,68,0.3); }

.bot-run-row {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

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

.portfolio-card-system {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 1px rgba(0, 212, 170, 0.2), 0 0 24px rgba(0, 212, 170, 0.08);
    background: linear-gradient(160deg, rgba(0, 212, 170, 0.04) 0%, var(--card-bg) 40%);
}

.uncle-sidebar-wrap .portfolio-card-system {
    border-color: var(--card-border) !important;
    box-shadow: none;
    background: var(--card-bg);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.uncle-sidebar-wrap .portfolio-card-system:hover {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 1px var(--accent-dim);
}

.portfolio-system-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    background: rgba(0, 212, 170, 0.1);
    border: 1px solid rgba(0, 212, 170, 0.25);
    border-radius: 4px;
    padding: 0.1rem 0.35rem;
    line-height: 1.4;
}

.portfolio-card-best {
    border-color: rgba(255, 200, 0, 0.7) !important;
    box-shadow: 0 0 0 1px rgba(255, 200, 0, 0.3), 0 0 24px rgba(255, 200, 0, 0.12);
}

.portfolio-crown {
    font-size: 1.3rem;
    line-height: 1;
    filter: drop-shadow(0 0 6px rgba(255, 200, 0, 1));
}

.portfolio-rank-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: rgba(255,255,255,0.06);
    border-radius: 6px;
    padding: 0.1rem 0.45rem 0.1rem 0.35rem;
}
.portfolio-rank-badge.rank-1 { filter: drop-shadow(0 0 6px rgba(255, 200, 0, 0.8)); }
.portfolio-rank-badge.rank-2 { filter: drop-shadow(0 0 5px rgba(180, 180, 210, 0.6)); }
.portfolio-rank-badge.rank-3 { filter: drop-shadow(0 0 4px rgba(200, 120, 60, 0.5)); }

.rank-number {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.3px;
}

.portfolio-name-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-portfolio-rename {
    opacity: 0;
    transition: opacity 0.15s, color 0.15s;
}
.portfolio-name-row:hover .btn-portfolio-rename { opacity: 0.55; }
.btn-portfolio-rename:hover { opacity: 1 !important; color: var(--accent); }

.portfolio-rename-form {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.portfolio-rename-input {
    background: var(--input-bg, #0d1b2a);
    border: 1px solid var(--accent);
    border-radius: 5px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    padding: 0.15rem 0.4rem;
    width: 10rem;
    outline: none;
}

.portfolio-total-value {
    margin-left: 0.25rem;
}

.portfolio-pct-hero {
    display: block;
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1.1;
    margin-top: 0.1rem;
}

.portfolio-pct-sub {
    display: block;
    font-size: 0.7rem;
    font-weight: 400;
    opacity: 0.7;
    margin-top: 0.1rem;
}
.portfolio-spy-cmp {
    font-size: 0.55em;
    opacity: 0.55;
    font-weight: 500;
    font-style: normal;
    vertical-align: middle;
}

@media (max-width: 540px) {
    .portfolio-pct-hero { font-size: 1.15rem; }
    .portfolio-spy-cmp {
        display: block;
        font-size: 0.7rem;
        margin-top: 0.1rem;
        vertical-align: unset;
    }
}

.portfolio-chart-wrap {
    position: relative;
    width: 100%;
    height: 110px;
    margin: 0.35rem 0 0.5rem;
    overflow: hidden;
}

.portfolio-chart-wrap canvas {
    width: 100% !important;
}

.portfolio-positions-wrap { container-type: inline-size; }
.portfolio-positions-hidden { display: none !important; }

.btn-portfolio-toggle {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem 0.4rem;
    font-size: 0.9rem;
    opacity: 0.5;
    border-radius: 6px;
    transition: opacity 0.15s, color 0.15s, background 0.15s;
    line-height: 1;
}
.btn-portfolio-toggle:hover { opacity: 1; background: rgba(255,255,255,0.06); }
.btn-portfolio-toggle.active { color: var(--accent); opacity: 1; }

.portfolio-positions {
    display: flex;
    flex-direction: column;
    gap: 0;
    font-size: 0.75rem;
}

.portfolio-header-row,
.portfolio-row,
.portfolio-total-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1.2fr 1.4fr 0.7fr;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0;
}

.portfolio-header-row {
    color: var(--text-muted);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
}

.portfolio-row {
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.portfolio-sold-section {
    margin-top: 0.75rem;
    border-top: 1px solid var(--border);
    padding-top: 0.5rem;
    opacity: 0.6;
}
.portfolio-sold-header {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
    font-weight: 500;
}
.portfolio-sold-grid .portfolio-header-row,
.portfolio-sold-row {
    grid-template-columns: 2fr 1fr 1fr 1fr 1.2fr 1fr 0.5fr;
}

.portfolio-total-row {
    border-top: 1px solid var(--border);
    padding-top: 0.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.portfolio-total-label {
    color: var(--text-muted);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.portfolio-ticker-cell {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.portfolio-cell {
    color: var(--text-primary);
    line-height: 1.3;
}

.portfolio-cell small {
    color: var(--text-muted);
    font-size: 0.65rem;
}

.portfolio-edit-row { background: rgba(255,255,255,0.03); border-radius: 6px; }

.portfolio-edit-input {
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--border);
    border-radius: 5px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.75rem;
    padding: 0.25rem 0.4rem;
    width: 100%;
    outline: none;
}
.portfolio-edit-input:focus { border-color: var(--accent); }

.portfolio-edit-actions { display: flex; gap: 0.25rem; }

.btn-portfolio-edit-icon {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.15rem 0.3rem;
    font-size: 0.78rem;
    opacity: 0.55;
    transition: opacity 0.15s, color 0.15s;
}
.btn-portfolio-edit-icon:hover { opacity: 1; color: var(--accent); }

.btn-portfolio-sell {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.15rem 0.3rem;
    font-size: 0.78rem;
    opacity: 0.45;
    transition: opacity 0.15s, color 0.15s;
}
.btn-portfolio-sell:hover { opacity: 1; color: #22c55e; }

.btn-portfolio-sell-confirm {
    background: none;
    border: none;
    color: #22c55e;
    cursor: pointer;
    padding: 0.15rem 0.3rem;
    font-size: 0.9rem;
    transition: opacity 0.15s;
}
.btn-portfolio-sell-confirm:hover { opacity: 0.75; }

.portfolio-sell-label { color: #22c55e; }

.btn-portfolio-edit-save {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    padding: 0.1rem 0.25rem;
    font-size: 0.82rem;
    transition: opacity 0.15s;
}
.btn-portfolio-edit-save:hover { opacity: 0.75; }

.btn-portfolio-add {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.2rem 0.45rem;
    border-radius: 5px;
    font-size: 0.85rem;
    line-height: 1;
    transition: color 0.15s, border-color 0.15s;
}
.btn-portfolio-add:hover { color: var(--accent); border-color: var(--accent); }

.portfolio-sort-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1rem;
    margin: 0.5rem 0 0.25rem;
    align-items: center;
}
.sort-group {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.sort-group-label {
    font-size: 0.67rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-right: 0.2rem;
    font-weight: 500;
}
.btn-sort {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-muted);
    border-radius: 4px;
    padding: 0.18rem 0.5rem;
    font-size: 0.7rem;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.btn-sort:hover { color: var(--text-primary); border-color: rgba(255,255,255,0.25); }
.btn-sort-active {
    color: var(--accent);
    border-color: var(--accent);
    background: rgba(99,102,241,0.1);
}
.sort-description {
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    font-style: italic;
}

.btn-portfolio-delete {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.15rem 0.3rem;
    font-size: 0.78rem;
    opacity: 0.45;
    transition: opacity 0.15s, color 0.15s;
}
.btn-portfolio-delete:hover { opacity: 1; color: #e05555; }

.portfolio-add-form {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

.portfolio-form-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.65rem;
    margin-bottom: 0.65rem;
}

.portfolio-form-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.portfolio-form-field label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.portfolio-form-field input {
    background: var(--input-bg, rgba(255,255,255,0.05));
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.8rem;
    padding: 0.4rem 0.6rem;
    width: 100%;
    outline: none;
    transition: border-color 0.15s;
}
.portfolio-form-field input:focus { border-color: var(--accent); }

.portfolio-form-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-portfolio-submit {
    background: var(--accent);
    border: none;
    border-radius: 6px;
    color: #000;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.45rem 1rem;
    transition: opacity 0.15s;
}
.btn-portfolio-submit:hover { opacity: 0.85; }

.btn-portfolio-cancel {
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-muted);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.8rem;
    padding: 0.45rem 0.85rem;
    transition: color 0.15s;
}
.btn-portfolio-cancel:hover { color: var(--text-primary); }

.portfolio-form-error {
    color: #e05555;
    font-size: 0.75rem;
    margin-bottom: 0.5rem;
}

@container (max-width: 700px) {
    .portfolio-form-row { grid-template-columns: 1fr 1fr; }
    .portfolio-header-row,
    .portfolio-row,
    .portfolio-edit-row,
    .portfolio-total-row { grid-template-columns: 2fr 1fr 1.2fr 1.4fr 0.4fr; }
    .portfolio-header-row :nth-child(2),
    .portfolio-row :nth-child(2),
    .portfolio-edit-row :nth-child(2),
    .portfolio-total-row :nth-child(2) { display: none; }
    .portfolio-header-row :nth-child(3),
    .portfolio-row :nth-child(3),
    .portfolio-edit-row :nth-child(3),
    .portfolio-total-row :nth-child(3) { display: none; }
}

/* ─── Congress / Gov Trades (minimal) ───────────────────── */
.gov-trades-wrap {
    display: flex;
    flex-direction: column;
}

.gov-trade-row {
    display: grid;
    grid-template-columns: 46px auto 1fr auto;
    align-items: center;
    gap: 0.4rem;
    padding: 0.32rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.gov-trade-row:last-of-type { border-bottom: none; }

.gov-trade-ticker {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.04em;
}

.gov-trade-txn {
    font-size: 0.57rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    line-height: 1.5;
    white-space: nowrap;
}

.gov-trade-person {
    font-size: 0.7rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gov-trade-date {
    font-size: 0.63rem;
    color: var(--text-muted);
    opacity: 0.6;
    white-space: nowrap;
}

.gov-trade-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: 0.45rem;
    font-size: 0.6rem;
    color: var(--text-muted);
    opacity: 0.5;
}

.btn-gov-refresh {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.1rem 0.2rem;
    font-size: 0.8rem;
    line-height: 1;
    opacity: 0.6;
    flex-shrink: 0;
}
.btn-gov-refresh:hover { opacity: 1; color: var(--accent); }
.btn-gov-refresh.htmx-request .bi { display: inline-block; animation: spin 0.7s linear infinite; }

/* ─── Congress / Gov Trades (legacy card styles) ─────────── */
.congress-trades-list {
    display: flex;
    flex-direction: column;
}

.congress-trade-card {
    display: grid;
    grid-template-columns: 1.6fr 1.6fr auto;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0;
    border: none !important;
    border-bottom: 1px solid rgba(255,255,255,0.05) !important;
    border-radius: 0 !important;
    background: none !important;
    box-shadow: none !important;
    gap: 0.75rem;
}
.congress-trade-card:last-child { border-bottom: none !important; }
.congress-trade-card:hover { border-color: rgba(255,255,255,0.05) !important; }

.congress-ticker-wrap {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.congress-ticker {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.04em;
}

.congress-txn {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    line-height: 1.5;
}
.congress-txn-buy  { background: rgba(34,197,94,0.12);  color: #4ade80; border: 1px solid rgba(34,197,94,0.25); }
.congress-txn-sell { background: rgba(239,68,68,0.12);  color: #f87171; border: 1px solid rgba(239,68,68,0.25); }

.congress-col-left {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.congress-company {
    font-size: 0.68rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.congress-col-mid {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.congress-person {
    font-size: 0.78rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.congress-vip { color: #fbbf24; margin-left: 0.1rem; }

.congress-filed {
    font-size: 0.68rem;
    color: var(--text-muted);
}

.congress-col-right {
    text-align: right;
    flex-shrink: 0;
}

.congress-price {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.congress-note {
    font-size: 0.72rem;
    margin-top: 0.25rem;
}

@media (max-width: 540px) {
    .congress-trade-card { grid-template-columns: 1fr auto; }
    .congress-col-mid { display: none; }
}

/* ─── Bot KPI bar ────────────────────────────────────────── */
.bot-kpi-bar {
    display: flex;
    align-items: stretch;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.bot-kpi {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0.7rem 1rem;
    gap: 0.1rem;
    min-width: 0;
}

.bot-kpi-narrow { flex: 0 0 90px; }

.bot-kpi-sep {
    width: 1px;
    background: var(--card-border);
    flex-shrink: 0;
    margin: 0.5rem 0;
}

.bot-kpi-label {
    font-size: 0.57rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.bot-kpi-value {
    font-size: 1.3rem;
    font-weight: 800;
    line-height: 1.1;
    color: var(--text-primary);
    white-space: nowrap;
}

.bot-kpi-sub {
    font-size: 0.6rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bot-w2-line {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.65rem;
    margin-top: 0.55rem;
    flex-wrap: wrap;
}
.bot-w2-role {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 4px;
    padding: 1px 7px;
    color: #c9d1d9;
    font-style: normal;
    white-space: nowrap;
}
.bot-w2-pace {
    color: var(--text-muted);
    font-style: italic;
}
.bot-w2-salary {
    color: #4ade80;
    font-weight: 600;
    font-style: normal;
    letter-spacing: 0.01em;
}
.bot-w2-meta {
    color: var(--text-muted);
    opacity: 0.55;
    font-style: italic;
}

/* ─── Bot body: chart + feed grid ───────────────────────── */
.bot-body-grid {
    display: block;
}
.bot-chart-canvas-wrap {
    height: 120px;
    position: relative;
}

/* ─── Collapsible toggle cards (details/summary) ──────── */
.hbot-toggle > summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: .7rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: .06em;
    user-select: none;
}
.hbot-toggle > summary::-webkit-details-marker { display: none; }
.hbot-toggle > summary::after {
    content: '›';
    font-size: .9rem;
    color: #6c757d;
    transform: rotate(90deg);
    display: inline-block;
    transition: transform .2s;
}
.hbot-toggle[open] > summary::after { transform: rotate(270deg); }
.hbot-toggle > summary:hover { color: #9ca3af; }

/* ─── Hourly bot page ──────────────────────────────────── */
/* Height is set dynamically by JS (sizeHud) so it fills exactly to the bottom */
#hourly-hud {
    min-height: 280px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.08) transparent;
}
#hourly-hud::-webkit-scrollbar { width: 4px; }
#hourly-hud::-webkit-scrollbar-track { background: transparent; }
#hourly-hud::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }
#hourly-hud::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.22); }

@media (max-width: 760px) {
    .hbot-kpi-grid {
        grid-template-columns: 1fr 1fr !important;
        row-gap: 12px;
    }
    /* even cells lose the divider, odd cells keep a center divider */
    .hbot-kpi-grid > div:nth-child(odd)  { border-right: 1px solid #1e1e1e; padding-left: 0; padding-right: 12px; }
    .hbot-kpi-grid > div:nth-child(even) { border-right: none; padding-left: 12px; padding-right: 0; }
    /* drop the small descriptive subtext to declutter */
    .hbot-kpi-desc { display: none; }
    /* hide the strike-ladder subtitle in the hero (badge already says version) */
    .hbot-subtitle { display: none; }
    /* feed uses most of the screen; page scrolls to reach the cards below */
    #hourly-hud { height: 68vh; min-height: 300px; }
}

/* iPad landscape and wider: chart left, feed right */
@media (orientation: landscape) and (min-width: 768px) {
    .bot-body-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
        align-items: start;
    }
    .bot-body-chart .stock-card {
        margin-bottom: 0;
        height: 100%;
        box-sizing: border-box;
    }
    .bot-chart-canvas-wrap {
        height: 200px;
    }
    .bot-hud {
        height: 260px;
    }
}

/* ─── Bot live HUD ───────────────────────────────────────── */
.bot-hud-wrap {
    background: #050a0e;
    border: 1px solid var(--card-border);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.bot-hud {
    height: 280px;
    overflow-y: auto;
    padding: 0.6rem 0.75rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.68rem;
    line-height: 1.5;
    display: flex;
    flex-direction: column;
    gap: 0.05rem;
    scroll-behavior: smooth;
}

.hud-entry {
    display: grid;
    grid-template-columns: 76px 1fr;
    gap: 0.6rem;
    padding: 0.15rem 0.35rem;
    border-radius: 3px;
    align-items: baseline;
}

.hud-time {
    color: var(--text-muted);
    opacity: 0.4;
    white-space: nowrap;
    font-size: 0.6rem;
    user-select: none;
}

.hud-msg { color: var(--text-muted); word-break: break-word; }

.hud-win    { background: rgba(34,197,94,0.07); }
.hud-win    .hud-msg { color: #4ade80; font-weight: 700; }
.hud-loss   { background: rgba(239,68,68,0.07); }
.hud-loss   .hud-msg { color: #f87171; font-weight: 700; }

@keyframes hud-buy-flash {
    0%   { background: rgba(0,212,170,0.35); }
    100% { background: transparent; }
}
@keyframes hud-win-flash {
    0%   { background: rgba(74,222,128,0.55); transform: scaleX(1.01); }
    80%  { background: rgba(74,222,128,0.15); transform: scaleX(1); }
    100% { background: rgba(34,197,94,0.07); }
}
@keyframes hud-loss-flash {
    0%   { background: rgba(239,68,68,0.55); transform: scaleX(1.01); }
    80%  { background: rgba(239,68,68,0.15); transform: scaleX(1); }
    100% { background: rgba(239,68,68,0.07); }
}
.hud-anim-buy  { animation: hud-buy-flash  1.4s ease-out forwards; }
.hud-anim-win  { animation: hud-win-flash  1.8s ease-out forwards; }
.hud-anim-loss { animation: hud-loss-flash 1.8s ease-out forwards; }

@keyframes win-overlay-fade {
    0%   { opacity: 0.28; }
    30%  { opacity: 0.18; }
    100% { opacity: 0; }
}
#win-overlay {
    position: fixed; inset: 0; z-index: 9999;
    background: radial-gradient(ellipse at center, rgba(74,222,128,0.45) 0%, rgba(0,0,0,0) 70%);
    pointer-events: none;
    animation: win-overlay-fade 1.8s ease-out forwards;
}
@keyframes loss-overlay-fade {
    0%   { opacity: 0.22; }
    30%  { opacity: 0.14; }
    100% { opacity: 0; }
}
#loss-overlay {
    position: fixed; inset: 0; z-index: 9999;
    background: radial-gradient(ellipse at center, rgba(239,68,68,0.40) 0%, rgba(0,0,0,0) 70%);
    pointer-events: none;
    animation: loss-overlay-fade 1.5s ease-out forwards;
}
.hud-seeded { opacity: 0.55; }
.hud-filter-btn {
    background: none;
    border: 1px solid #2a2a2a;
    border-radius: 4px;
    color: #6c757d;
    font-family: 'JetBrains Mono', monospace;
    font-size: .65rem;
    letter-spacing: .05em;
    padding: 2px 8px;
    cursor: pointer;
    text-transform: uppercase;
}
.hud-filter-btn:hover { border-color: #444; color: #aaa; }
.hud-filter-active { border-color: #4ade80 !important; color: #4ade80 !important; }
.wl-range-btn {
    background: none;
    border: 1px solid #2a2a2a;
    border-radius: 4px;
    color: #6c757d;
    font-family: 'JetBrains Mono', monospace;
    font-size: .62rem;
    letter-spacing: .04em;
    padding: 2px 9px;
    cursor: pointer;
    text-transform: uppercase;
}
.wl-range-btn:hover { border-color: #444; color: #aaa; }
.wl-range-active { border-color: #a78bfa !important; color: #a78bfa !important; background: rgba(167,139,250,0.1) !important; }
.hud-scan-idle .hud-msg { color: #4a5a4a; }
.hud-scan-idle .hud-time { color: #556655; }
.hud-placed .hud-msg { color: #60a5fa; }
.hud-filled .hud-msg { color: var(--accent); }
.hud-warn   { background: rgba(245,158,11,0.07); }
.hud-warn   .hud-msg { color: #fbbf24; }
.hud-edge   .hud-msg { color: var(--text-secondary); }
.hud-scan   .hud-msg { opacity: 0.35; }
.hud-error  .hud-msg { color: #f87171; font-weight: 700; }
.hud-high       { background: rgba(167,139,250,0.10); }
.hud-high       .hud-msg { color: #a78bfa; font-weight: 700; }
.hud-candidate  { background: rgba(167,139,250,0.05); }
.hud-candidate  .hud-msg { color: #c4b5fd; }

@media (max-width: 700px) {
    .bot-kpi-bar { flex-wrap: wrap; }
    .bot-kpi-sep { display: none; }
    .bot-kpi { flex: 1 1 40%; border-bottom: 1px solid var(--card-border); }
    .bot-kpi-narrow { flex: 1 1 40%; }
}

/* ─── VEGA Bot Dashboard ────────────────────────────────── */
.vega-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.vega-hero-left { display: flex; flex-direction: column; gap: 0.2rem; }

.vega-name-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.vega-name {
    font-family: 'JetBrains Mono', monospace;
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: var(--accent);
    line-height: 1;
    text-shadow: 0 0 24px rgba(0,212,170,0.35);
}

.vega-version {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    background: rgba(255,255,255,0.07);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.15rem 0.4rem;
    align-self: flex-end;
    margin-bottom: 0.2rem;
}

.vega-status {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.2rem 0.55rem;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    align-self: center;
}
.vega-status-active { background: rgba(34,197,94,0.12); color: #4ade80; border: 1px solid rgba(34,197,94,0.3); }
.vega-status-kill   { background: rgba(239,68,68,0.12);  color: #f87171; border: 1px solid rgba(239,68,68,0.3); }

.vega-subtitle {
    font-size: 0.72rem;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}

.vega-intel-card {
    background: linear-gradient(135deg, rgba(0,212,170,0.06) 0%, rgba(0,212,170,0.02) 100%);
    border: 1px solid rgba(0,212,170,0.2);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}

.vega-intel-label {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.vega-intel-text {
    font-size: 0.85rem;
    color: var(--text-primary);
    line-height: 1.6;
}

.vega-intel-idle { color: var(--text-muted); font-style: italic; }

.vega-intel-meta {
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-top: 0.6rem;
}

.vega-stats-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.vega-stat {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 0.85rem 1rem;
}

.vega-stat-label {
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
}

.vega-stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1;
    color: var(--text-primary);
}

.vega-stat-sub {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.vega-section-label {
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin: 0 0 0.65rem;
}

.vega-trade-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.vega-trade-row:last-child { border-bottom: none; }

.vega-trade-left { flex: 1; min-width: 0; }

.vega-trade-top {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
    margin-bottom: 0.3rem;
}

.vega-trade-pnl {
    font-size: 0.8rem;
    font-weight: 700;
}

.vega-tag {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.1rem 0.4rem;
}

.vega-trade-thesis {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ─── Performance tracker: tablet / iPad landscape fixes ──── */
@media (max-width: 1400px) {
    .portfolio-live-badge { display: none; }
}

.vega-reject-reason { color: #f87171; }

.vega-trade-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.2rem;
    flex-shrink: 0;
}

.vega-trade-price {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.vega-trade-date {
    font-size: 0.68rem;
    color: var(--text-muted);
}

@media (max-width: 600px) {
    .vega-stats-grid { grid-template-columns: 1fr 1fr; }
    .vega-name { font-size: 1.5rem; }
}

/* ─── Day Trader: return hero + "what & why" position cards ─── */
.dt-return-hero {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    flex-wrap: wrap;
    border-radius: 14px; padding: 1rem 1.3rem; margin-bottom: 0.85rem;
    background:
        radial-gradient(120% 140% at 0% 0%, rgba(74,222,128,0.10), transparent 60%),
        linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.015));
    border: 1px solid rgba(74,222,128,0.28);
}
.dt-return-hero.is-down {
    background:
        radial-gradient(120% 140% at 0% 0%, rgba(248,113,113,0.10), transparent 60%),
        linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.015));
    border-color: rgba(248,113,113,0.28);
}
.dt-return-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); display: flex; align-items: center; gap: 0.5rem; }
.dt-base-chip { font-size: 0.62rem; letter-spacing: 0.03em; padding: 1px 7px; border-radius: 999px; background: rgba(255,255,255,0.07); color: #c9d1d9; border: 1px solid rgba(255,255,255,0.12); }
.dt-return-value { font-size: 2.6rem; font-weight: 800; line-height: 1.05; margin: 0.1rem 0; }
.dt-return-hero.is-up   .dt-return-value { color: #4ade80; }
.dt-return-hero.is-down .dt-return-value { color: #f87171; }
.dt-return-sub { font-size: 0.78rem; color: var(--text-muted); }
.dt-return-split { display: flex; gap: 1.4rem; }
.dt-split-item { display: flex; flex-direction: column; align-items: flex-end; }
.dt-split-num { font-size: 1.05rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.dt-split-cap { font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-muted); }

.dt-pos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 0.85rem; }
.dt-pos-card {
    border-radius: 12px; padding: 0.85rem 0.95rem;
    background: linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.01));
    border: 1px solid rgba(255,255,255,0.08);
    border-left: 3px solid #a78bfa;
    transition: transform 0.12s ease, border-color 0.12s ease;
}
.dt-pos-card:hover { transform: translateY(-2px); }
.dt-pos-card.is-intraday { border-left-color: #38bdf8; }
.dt-pos-card.is-swing    { border-left-color: #a78bfa; }
.dt-pos-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.5rem; }
.dt-pos-id { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.dt-pos-ticker { font-size: 1.25rem; font-weight: 800; letter-spacing: 0.02em; }
.dt-strat-badge { font-size: 0.56rem; font-weight: 800; letter-spacing: 0.06em; padding: 2px 7px; border-radius: 5px; }
.dt-strat-badge.b-intraday { background: rgba(56,189,248,0.14); color: #38bdf8; border: 1px solid rgba(56,189,248,0.3); }
.dt-strat-badge.b-swing    { background: rgba(167,139,250,0.14); color: #a78bfa; border: 1px solid rgba(167,139,250,0.3); }
.dt-pos-pnl { text-align: right; font-size: 1.15rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.dt-pos-pnl-usd { display: block; font-size: 0.66rem; font-weight: 600; opacity: 0.75; }
.dt-pos-prices { display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; margin: 0.55rem 0 0.5rem; font-size: 0.74rem; color: var(--text-muted); }
.dt-pos-prices strong { color: #e6edf3; font-weight: 700; }
.dt-rail { position: relative; height: 6px; border-radius: 999px; background: rgba(255,255,255,0.08); overflow: visible; margin-top: 0.2rem; }
.dt-rail-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; background: linear-gradient(90deg, rgba(248,113,113,0.5), #4ade80); }
.dt-rail-dot { position: absolute; top: 50%; width: 11px; height: 11px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 2px #0d1117, 0 0 6px rgba(255,255,255,0.6); transform: translate(-50%, -50%); }
.dt-rail-entry { position: absolute; top: -2px; bottom: -2px; width: 2px; background: rgba(255,255,255,0.5); transform: translateX(-50%); }
.dt-rail-ends { display: flex; justify-content: space-between; font-size: 0.58rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin-top: 0.3rem; }
.dt-pos-why { font-size: 0.78rem; line-height: 1.5; color: #c9d1d9; margin: 0.6rem 0 0.45rem; display: flex; gap: 0.45rem; }
.dt-why-tag { flex-shrink: 0; font-size: 0.55rem; font-weight: 800; letter-spacing: 0.08em; color: #fbbf24; background: rgba(251,191,36,0.12); border: 1px solid rgba(251,191,36,0.3); border-radius: 4px; padding: 1px 5px; height: fit-content; margin-top: 1px; }
.dt-pos-meta { font-size: 0.66rem; color: var(--text-muted); }

/* Minimized Uncle's Stock Picks card in the Portfolios area — chart hidden, just the header + expandable positions */
.portfolio-card-mini .portfolio-chart-wrap { display: none; }
.portfolio-card-mini .portfolio-card { opacity: 0.92; }
.portfolio-card-mini .portfolio-card:hover { opacity: 1; }

/* Day trader: trade-history pager */
.dt-pager { display: flex; align-items: center; justify-content: center; gap: 0.9rem; }
.dt-pager-btn {
    background: rgba(255,255,255,0.05); color: #c9d1d9; border: 1px solid rgba(255,255,255,0.12);
    border-radius: 6px; padding: 3px 12px; font-size: 0.78rem; cursor: pointer;
}
.dt-pager-btn:hover:not(:disabled) { background: rgba(255,255,255,0.1); }
.dt-pager-btn:disabled { opacity: 0.35; cursor: default; }
.dt-pager-info { font-size: 0.72rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }

/* Day trader: collapsed "How it works" at the bottom */
.dt-howitworks {
    margin: 0.5rem 0 1.5rem; border: 1px solid rgba(255,255,255,0.08); border-radius: 10px;
    background: rgba(255,255,255,0.02); padding: 0.7rem 1rem;
}
.dt-howitworks > summary {
    cursor: pointer; list-style: none; font-size: 0.78rem; font-weight: 600; color: #c9d1d9;
    display: flex; align-items: center;
}
.dt-howitworks > summary::-webkit-details-marker { display: none; }
.dt-howitworks > summary::after { content: '▸'; margin-left: auto; opacity: 0.5; transition: transform 0.15s; }
.dt-howitworks[open] > summary::after { transform: rotate(90deg); }

/* Recent-sells strip under the bot card's gains chart */
.dt-sells-strip { display: flex; align-items: center; flex-wrap: wrap; gap: 0.35rem; padding: 0.4rem 0.1rem 0.1rem; }
.dt-sells-label { font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin-right: 0.15rem; }
.dt-sell-chip { font-size: 0.66rem; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); white-space: nowrap; }
.dt-sell-chip.positive { color: #4ade80; border-color: rgba(74,222,128,0.3); }
.dt-sell-chip.negative { color: #f87171; border-color: rgba(248,113,113,0.3); }
.dt-sell-chip strong { font-weight: 800; }

/* "Trading now" strategy-split badges on the homepage bot card */
.dt-now-badge { font-size: 0.58rem; font-weight: 700; letter-spacing: 0.03em; padding: 1px 7px; border-radius: 999px; white-space: nowrap; }
.dt-now-intraday { background: rgba(56,189,248,0.14); color: #38bdf8; border: 1px solid rgba(56,189,248,0.3); }
.dt-now-swing    { background: rgba(167,139,250,0.14); color: #a78bfa; border: 1px solid rgba(167,139,250,0.3); }

/* ─── Mission Control ────────────────────────────────── */
.mc-outer {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    flex-direction: column;
    background: #0d1117;
}
.mc-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0 1rem;
    height: 36px;
    background: #0d1117;
    border-bottom: 1px solid #1e2d3d;
    flex-shrink: 0;
}
.mc-title {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #8b949e;
}
.mc-dot {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 5px;
}
.mc-live-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    animation: mc-pulse 2s ease-in-out infinite;
}
@keyframes mc-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.3; }
}
.mc-grid {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr;
    gap: 1px;
    background: #1e2d3d;
    overflow: hidden;
}
.mc-panel {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: #0d1117;
    padding: 10px 14px;
    overflow: hidden;
}
.mc-panel-name {
    font-size: 0.82rem;
    font-weight: 700;
}
.mc-stats {
    display: flex;
    gap: 14px;
    align-items: center;
    flex-wrap: wrap;
    padding: 6px 10px;
    background: #111;
    border: 1px solid #1e2d3d;
    border-radius: 5px;
}
.mc-kpi { display: flex; flex-direction: column; gap: 1px; }
.mc-kpi-label {
    font-size: 0.55rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.mc-kpi-value {
    font-size: 0.85rem;
    font-weight: 700;
    color: #e0e0e0;
}
.mc-feed-label {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent);
    border-left: 2px solid var(--accent);
    padding-left: 5px;
}
.mc-hud {
    flex: 1;
    overflow-y: auto;
    scroll-behavior: auto;   /* override bot-hud smooth so JS scrollTop is instant */
    scrollbar-width: thin;
    scrollbar-color: #2a2a2a transparent;
}

/* ─── Mission Control — mobile (stacked, scrollable) ───── */
@media (max-width: 760px) {
    .mc-outer {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    .mc-header {
        height: auto;
        min-height: 40px;
        flex-wrap: wrap;
        row-gap: 4px;
        column-gap: 0.6rem;
        padding: 7px 32px 7px 12px;
        position: sticky;
        top: 0;
        z-index: 10;
    }
    .mc-title { font-size: 0.62rem; }
    .mc-header > div:first-of-type { /* dot group */
        gap: 0.6rem !important;
        flex-wrap: wrap;
    }
    .mc-dot { font-size: 0.62rem; }
    /* Balance block: full width on its own line, left-aligned */
    .mc-header > div:nth-of-type(2) {
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100%;
        justify-content: flex-start;
        border-top: 1px solid #1e2d3d;
        padding-top: 5px;
    }
    .mc-header > a { position: absolute; top: 7px; right: 12px; }

    .mc-grid {
        display: flex;
        flex-direction: column;
        flex: none;
        gap: 0;
        overflow: visible;
    }
    .mc-panel {
        height: 82vh;
        min-height: 460px;
        border-bottom: 3px solid #1e2d3d;
        padding: 12px 14px;
    }
    .mc-panel-name { font-size: 0.95rem; }
    .mc-stats { gap: 12px 18px; padding: 8px 12px; }
    .mc-kpi-label { font-size: 0.6rem; }
    .mc-kpi-value { font-size: 0.95rem; }
    .mc-feed-label { font-size: 0.65rem; }
    .mc-hud { font-size: 0.72rem; }
    .bot-hud .hud-entry { padding: 2px 0; }
}

