:root {
    --tv-bg: #131722;
    --tv-pane: #1e222d;
    --tv-border: #2a2e39;
    --tv-text: #d1d4dc;
    --tv-blue: #2962ff;
    --tv-green: #22d3ee;
    --tv-red: #a855f7;
    --nav-height: 72px;
    --chat-width: 380px;
    --console-status-height: 24px;
    --panel-min-width: 340px;
    --panel-gap: 0.65rem;
    --panel-padding: 0.65rem;
    --panel-row-min-height: 280px;
    --chart-panel-min-height: 430px;
    /* Console unified theme */
    --console-bg: #05060a;
    --console-surface: rgba(255,255,255,0.045);
    --console-border: rgba(255,255,255,0.12);
    --console-accent: #06B6D4;
    --console-accent-2: #9333EA;
    --console-positive: #10B981;
    --console-negative: #EF4444;
    --panel-bg: rgba(255,255,255,0.045);
    --panel-blur: blur(20px);
    --panel-border: rgba(255,255,255,0.12);
    --panel-radius: var(--tg-radius-card, 8px);
}

/* Full-screen console layout (same intent as chat page) */
body > footer,
main + footer,
footer,
#siteFooter {
    display: none !important;
}

.ai-chat-fab {
    display: none !important;
}

html,
body {
    height: 100vh !important;
    height: 100dvh !important;
    max-height: 100vh !important;
    max-height: 100dvh !important;
    overflow: hidden !important;
}

main {
    min-height: calc(100vh - var(--nav-height)) !important;
    min-height: calc(100dvh - var(--nav-height) - env(safe-area-inset-bottom, 0px)) !important;
    height: calc(100vh - var(--nav-height)) !important;
    height: calc(100dvh - var(--nav-height) - env(safe-area-inset-bottom, 0px)) !important;
    max-height: calc(100vh - var(--nav-height)) !important;
    max-height: calc(100dvh - var(--nav-height) - env(safe-area-inset-bottom, 0px)) !important;
    overflow: hidden !important;
    padding: 0 !important;
}

body.console-header-hidden {
    --nav-height: 0px;
}

body.console-header-hidden #luxuryNav {
    display: none !important;
    transform: translateY(-100%) !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

body.console-header-hidden main {
    min-height: 100vh !important;
    min-height: calc(100dvh - env(safe-area-inset-bottom, 0px)) !important;
    height: 100vh !important;
    height: calc(100dvh - env(safe-area-inset-bottom, 0px)) !important;
    max-height: 100vh !important;
    max-height: calc(100dvh - env(safe-area-inset-bottom, 0px)) !important;
}

.console-viewport {
    height: calc(100vh - var(--nav-height) - var(--console-status-height));
    height: calc(100dvh - var(--nav-height) - var(--console-status-height) - env(safe-area-inset-bottom, 0px));
    display: flex;
    flex-direction: row;
    background: var(--tv-bg);
    overflow: hidden;
}

body.console-header-hidden .console-viewport {
    height: calc(100vh - var(--console-status-height));
    height: calc(100dvh - var(--console-status-height) - env(safe-area-inset-bottom, 0px));
}

body.console-terminal-fullscreen {
    --nav-height: 0px;
}

body.console-terminal-fullscreen #luxuryNav,
body.console-terminal-fullscreen > footer,
body.console-terminal-fullscreen main + footer,
body.console-terminal-fullscreen footer,
body.console-terminal-fullscreen #siteFooter,
body.console-terminal-fullscreen .ai-chat-fab {
    display: none !important;
}

body.console-terminal-fullscreen main {
    position: fixed !important;
    inset: 0 !important;
    z-index: 10000 !important;
    width: 100vw !important;
    min-height: 100vh !important;
    min-height: 100dvh !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-height: 100vh !important;
    max-height: 100dvh !important;
    overflow: hidden !important;
    background: var(--console-bg, #05060a) !important;
}

body.console-terminal-fullscreen .console-viewport {
    width: 100vw;
    height: calc(100vh - var(--console-status-height));
    height: calc(100dvh - var(--console-status-height));
}

body.console-terminal-fullscreen .console-status-bar {
    z-index: 10030;
}

body.console-terminal-fullscreen .console-panel.panel-maximized {
    inset: 12px 12px calc(var(--console-status-height) + 12px) 12px;
}

body.console-density-compact {
    --chat-width: 340px;
    --panel-min-width: 320px;
    --panel-gap: 0.45rem;
    --panel-padding: 0.45rem;
    --panel-row-min-height: 250px;
    --chart-panel-min-height: 380px;
}

body.console-density-comfort {
    --chat-width: 400px;
    --panel-min-width: 360px;
    --panel-gap: 0.75rem;
    --panel-padding: 0.75rem;
    --panel-row-min-height: 300px;
    --chart-panel-min-height: 450px;
}

/* Left: chart + metrics */
.console-left {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Right: chat sidebar */
.console-chat {
    width: var(--chat-width);
    min-width: var(--chat-width);
    max-width: var(--chat-width);
    display: flex;
    flex-direction: column;
    background: var(--tv-pane);
}

.console-chat-resizer {
    width: 9px;
    min-width: 9px;
    cursor: col-resize;
    display: flex;
    align-items: center;
    justify-content: center;
    border-left: 1px solid var(--tv-border);
    border-right: 1px solid rgba(255,255,255,0.04);
    background: linear-gradient(90deg, rgba(255,255,255,0.015), rgba(255,255,255,0.035));
    transition: background 0.15s ease, border-color 0.15s ease;
}
.console-chat-resizer::before {
    content: "";
    width: 2px;
    height: 38px;
    border-radius: var(--tg-radius-pill, 999px);
    background: rgba(148,163,184,0.38);
}
.console-chat-resizer:hover,
body.console-chat-resizing .console-chat-resizer {
    background: rgba(6,182,212,0.08);
    border-left-color: rgba(6,182,212,0.35);
}
.console-chat-resizer:hover::before,
body.console-chat-resizing .console-chat-resizer::before {
    background: rgba(6,182,212,0.8);
}
.console-chat-resizer.hidden { display: none !important; }
body.console-chat-resizing,
body.console-chat-resizing * {
    cursor: col-resize !important;
    user-select: none !important;
}

.mobile-chat-back { display: none; }

/* Toolbar */
.console-toolbar {
    background: var(--tv-pane);
    border-bottom: 1px solid var(--tv-border);
    padding: 0.4rem 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: nowrap;
    position: relative;
    z-index: 100000;
    min-height: 44px;
}
.console-toolbar select,
.console-toolbar input {
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--tv-border);
    color: var(--tv-text);
    padding: 0.3rem 0.5rem;
    border-radius: 6px;
    font-size: 0.8rem;
    outline: none;
}
.console-toolbar select:focus,
.console-toolbar input:focus {
    border-color: var(--tv-blue);
}
.console-toolbar input::placeholder {
    color: rgba(209,212,220,0.4);
}

#symbolInput {
    width: 140px;
}

.live-price-badge {
    font-size: 1rem;
    font-weight: 700;
    padding: 0.25rem 0.7rem;
    border-radius: 6px;
    transition: all 0.3s;
    letter-spacing: 0.02em;
}
.live-price-badge.up {
    color: #22d3ee;
    background: rgba(34,211,238,0.14);
    text-shadow: 0 0 8px rgba(34,211,238,0.35);
}
.live-price-badge.down {
    color: #c084fc;
    background: rgba(168,85,247,0.14);
    text-shadow: 0 0 8px rgba(168,85,247,0.35);
}
.live-price-badge.flat {
    color: #ffffff;
    background: rgba(255,255,255,0.08);
}

.toolbar-btn {
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--tv-border);
    color: var(--tv-text);
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}
.toolbar-btn:hover {
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.2);
}
.toolbar-btn.active {
    background: rgba(41,98,255,0.2);
    border-color: var(--tv-blue);
    color: #93bbff;
}
.toolbar-btn.icon-only {
    width: 30px;
    height: 30px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.toolbar-spacer { flex: 1; }

.console-context-menu {
    position: fixed;
    min-width: 230px;
    max-width: min(340px, calc(100vw - 16px));
    max-height: calc(100dvh - 16px);
    overflow-y: auto;
    scrollbar-width: thin;
    padding: 0.35rem;
    border: 1px solid rgba(96,165,250,0.22);
    border-radius: 8px;
    background: rgba(7, 11, 19, 0.98);
    box-shadow: 0 18px 44px rgba(0,0,0,0.48);
    z-index: 100060;
    color: var(--tv-text);
    user-select: none;
}
.console-context-menu.hidden {
    display: none !important;
}
.console-context-menu-title {
    padding: 0.3rem 0.45rem 0.4rem;
    color: rgba(209,212,220,0.45);
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.console-context-menu button {
    width: 100%;
    min-height: 30px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.45rem;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: rgba(226,232,240,0.86);
    font-size: 0.7rem;
    text-align: left;
    cursor: pointer;
}
.console-context-menu button:hover {
    background: rgba(96,165,250,0.12);
    color: #f8fafc;
}
.console-context-menu button.danger:hover {
    background: rgba(239,68,68,0.14);
    color: #fecaca;
}
.console-context-menu button i {
    width: 16px;
    color: rgba(96,165,250,0.78);
    text-align: center;
}
.console-context-menu button.danger i {
    color: rgba(248,113,113,0.82);
}
.console-context-layout-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.25rem;
    padding: 0 0.1rem;
}
.console-context-menu button.context-layout-btn,
.console-context-menu button.context-panel-btn {
    min-height: 28px;
}
.console-context-menu button.context-layout-btn small,
.console-context-menu button.context-panel-btn small {
    margin-left: auto;
    color: rgba(209,212,220,0.38);
    font-size: 0.56rem;
    font-weight: 700;
    text-transform: uppercase;
}
.console-context-menu button.context-layout-btn.locked small,
.console-context-menu button.context-panel-btn.locked small {
    color: rgba(250,204,21,0.68);
}
.console-context-menu button.context-panel-btn.active {
    background: rgba(34,211,238,0.08);
    color: #f8fafc;
}
.console-context-menu button.context-panel-btn.active i {
    color: #22d3ee;
}
.console-context-category-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.22rem;
    padding: 0 0.1rem 0.2rem;
}
.console-context-menu button.context-category-btn {
    min-height: 26px;
    justify-content: center;
    gap: 0.3rem;
    padding: 0.3rem 0.35rem;
    background: rgba(255,255,255,0.035);
    color: rgba(226,232,240,0.7);
}
.console-context-menu button.context-category-btn.active {
    background: rgba(96,165,250,0.14);
    color: #f8fafc;
}
.console-context-menu button.context-category-btn i {
    width: auto;
    font-size: 0.62rem;
}
.console-context-menu button.context-category-btn span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.console-context-panel-list {
    display: none;
    grid-template-columns: 1fr;
    gap: 0.18rem;
    padding: 0.12rem 0 0.22rem 0.55rem;
}
.console-context-panel-list[data-context-panel-group] {
    padding: 0 0.05rem 0.1rem;
}
.console-context-panel-list.open {
    display: grid;
}
.console-panel.panel-context-focus {
    outline: 1px solid rgba(34,211,238,0.75);
    box-shadow: 0 0 0 3px rgba(34,211,238,0.16), 0 18px 44px rgba(0,0,0,0.36);
}
.console-context-menu-sep {
    height: 1px;
    margin: 0.28rem 0.2rem;
    background: rgba(255,255,255,0.08);
}

/* ===== Tab bar (focused symbol/index mode) ===== */
.console-tab-bar {
    display: flex; align-items: center; gap: 2px;
    padding: 0 0.5rem; overflow-x: auto; scrollbar-width: none;
}
.console-tab-bar::-webkit-scrollbar { display: none; }
.console-tab {
    display: inline-flex; align-items: center; gap: 0.35rem;
    padding: 0.45rem 0.85rem; border: none; background: transparent;
    color: rgba(209,212,220,0.5); font-size: 0.78rem; font-weight: 600;
    cursor: pointer; white-space: nowrap;
    border-bottom: 2px solid transparent; transition: all 0.15s;
}
.console-tab:hover { color: rgba(209,212,220,0.8); background: rgba(255,255,255,0.04); }
.console-tab.active { color: var(--console-accent, #06b6d4); border-bottom-color: var(--console-accent, #06b6d4); }
.console-tab i { font-size: 0.7rem; }
.console-full-terminal-btn { margin-left: auto; font-size: 0.68rem; opacity: 0.6; }
.console-full-terminal-btn:hover { opacity: 1; }
.console-guest-nudge {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 14px; gap: 10px; grid-column: 1 / -1;
    background: linear-gradient(135deg, rgba(6,182,212,0.08), rgba(139,92,246,0.08));
    border: 1px solid rgba(6,182,212,0.15); border-radius: 8px; margin-bottom: 6px;
}
.console-guest-nudge span { color: rgba(209,212,220,0.7); font-size: 0.7rem; }
.console-guest-nudge a {
    padding: 5px 12px; background: linear-gradient(135deg,#0891b2,#7c3aed);
    border-radius: 6px; color: #fff; font-size: 0.6rem; font-weight: 600;
    text-decoration: none; white-space: nowrap; flex-shrink: 0;
}
.console-guest-nudge button {
    background: none; border: none; color: rgba(209,212,220,0.3);
    cursor: pointer; padding: 2px; font-size: 10px; flex-shrink: 0;
}
/* Country chip bar (index mode - full width below toolbar) */
.country-chip-bar {
    display: flex; align-items: center; gap: 6px;
    padding: 0.3rem 0.75rem; overflow-x: auto; scrollbar-width: none;
    background: rgba(255,255,255,0.015); border-bottom: 1px solid rgba(255,255,255,0.04);
    flex-shrink: 0;
}
.country-chip-bar::-webkit-scrollbar { display: none; }
.country-chip {
    display: inline-flex; align-items: center; gap: 0.25rem;
    padding: 0.25rem 0.55rem; border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.03); border-radius: var(--tg-radius-card, 8px);
    color: rgba(209,212,220,0.6); font-size: 0.65rem; font-weight: 500;
    cursor: pointer; white-space: nowrap; transition: all 0.15s;
}
.country-chip:hover { border-color: rgba(255,255,255,0.15); background: rgba(255,255,255,0.06); color: rgba(209,212,220,0.85); }
.country-chip.primary { border-color: rgba(6,182,212,0.3); background: rgba(6,182,212,0.08); color: var(--console-accent, #06b6d4); }
.country-chip.primary .country-star { color: #eab308; font-size: 7px; }
.country-chip .country-remove { opacity: 0.3; font-size: 8px; margin-left: 2px; cursor: pointer; }
.country-chip .country-remove:hover { opacity: 0.8; color: #ef4444; }
.country-chip .country-flag { font-size: 0.75rem; }
.country-add-btn {
    display: inline-flex; align-items: center; gap: 0.2rem;
    padding: 0.25rem 0.5rem; border: 1px dashed rgba(255,255,255,0.1);
    background: none; border-radius: var(--tg-radius-card, 8px); color: rgba(209,212,220,0.35);
    font-size: 0.6rem; cursor: pointer; white-space: nowrap; transition: all 0.15s;
}
.country-add-btn:hover { border-color: rgba(255,255,255,0.2); color: rgba(209,212,220,0.6); }
.country-dropdown {
    position: absolute; top: 100%; right: 0; z-index: 100;
    background: var(--console-bg, #0f1117); border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px; padding: 6px; min-width: 200px; max-height: 280px;
    overflow-y: auto; box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    display: grid; grid-template-columns: 1fr 1fr; gap: 2px;
}
.country-dropdown-item {
    display: flex; align-items: center; gap: 0.3rem;
    padding: 0.3rem 0.5rem; border-radius: 5px; border: none;
    background: none; color: rgba(209,212,220,0.6); font-size: 0.62rem;
    cursor: pointer; white-space: nowrap; text-align: left; width: 100%;
}
.country-dropdown-item:hover { background: rgba(255,255,255,0.06); color: rgba(209,212,220,0.9); }
.country-dropdown-item.selected { opacity: 0.4; pointer-events: none; }

@media (max-width: 768px) {
    .console-full-terminal-btn .panel-chip-label { display: none; }
    .console-tab span { display: none; }
    .console-tab { padding: 0.4rem 0.6rem; }
    .console-guest-nudge { flex-wrap: wrap; }
    .country-chip-bar { padding: 0.2rem 0.5rem; }
    .country-chip-bar .country-chip span:not(.country-flag):not(.country-star):not(.country-remove) { display: none; }
    .country-chip-bar .country-add-btn span { display: none; }
}

.empty-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    border-radius: 7px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.04);
    color: var(--tv-text);
    font-size: 0.66rem;
    font-weight: 600;
    line-height: 1;
    padding: 0.35rem 0.6rem;
    white-space: nowrap;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.empty-action-btn:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.18);
}
.empty-action-btn i {
    color: #67e8f9;
}

/* Indicator legend tags */
.indicator-legend {
    position: absolute;
    top: 60px;
    left: 20px;
    z-index: 18;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 0.45rem 0.5rem;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.06);
    background: rgba(30,34,45,0.80);
    backdrop-filter: blur(4px);
    max-width: min(320px, calc(100% - 40px));
    overflow-y: auto;
    max-height: 150px;
    pointer-events: none;
}
.ind-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    border: 1px solid rgba(245,158,11,0.4);
    background: rgba(255,255,255,0.04);
    color: var(--tv-text);
    font-size: 0.68rem;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity 0.15s;
    pointer-events: auto;
}
.ind-tag.off { opacity: 0.35; }
.ind-tag.sel { box-shadow: 0 0 0 1px rgba(147,197,253,0.45) inset; }
.ind-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}
.ind-x {
    background: none;
    border: none;
    color: rgba(209,212,220,0.5);
    font-size: 0.8rem;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
    pointer-events: auto;
}
.ind-x:hover { color: #ef5350; }
.ind-move {
    background: none;
    border: none;
    color: rgba(148,163,184,0.85);
    font-size: 0.72rem;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
    pointer-events: auto;
}
.ind-move:hover { color: #93c5fd; }

/* Indicator add dropdown */
.ind-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 220px;
    max-height: 300px;
    overflow-y: auto;
    background: #1e222d;
    border: 1px solid var(--tv-border);
    border-radius: 8px;
    z-index: 100;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    padding: 0.3rem 0;
}
.ind-dropdown.hidden { display: none; }
.ind-dropdown .ind-option {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.7rem;
    cursor: pointer;
    font-size: 0.78rem;
    color: var(--tv-text);
    transition: background 0.1s;
}
.ind-dropdown .ind-option:hover { background: rgba(41,98,255,0.15); }
.ind-dropdown .ind-option .ind-opt-dot {
    width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}

/* Symbol suggestions dropdown */
.symbol-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    width: 280px;
    max-height: 260px;
    overflow-y: auto;
    background: #1e222d;
    border: 1px solid var(--tv-border);
    border-radius: 8px;
    z-index: 100;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}
.symbol-suggestions .sug-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    font-size: 0.8rem;
    color: var(--tv-text);
    transition: background 0.1s;
}
.symbol-suggestions .sug-item:hover,
.symbol-suggestions .sug-item.active {
    background: rgba(41,98,255,0.15);
}
.sug-item .sug-symbol { font-weight: 600; min-width: 60px; }
.sug-item .sug-name { color: rgba(209,212,220,0.6); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sug-item .sug-exchange { margin-left: auto; color: rgba(209,212,220,0.35); font-size: 0.7rem; }

/* Chart container */
.console-chart-wrap {
    flex: 1;
    min-height: 200px;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0;
    contain: layout paint;
}
.console-main-chart {
    position: relative;
    flex: 1 1 auto;
    min-height: 220px;
}
.console-pane1 {
    position: relative;
    flex: 0 0 30%;
    min-height: 130px;
    border-top: 1px solid #2a2e39;
    background: #131722;
}
.console-pane1.hidden { display: none; }
.console-pane2 {
    position: relative;
    flex: 0 0 24%;
    min-height: 110px;
    border-top: 1px solid #2a2e39;
    background: #131722;
}
.console-pane2.hidden { display: none; }
.console-panel-resizer {
    flex: 0 0 10px;
    height: 10px;
    position: relative;
    background: transparent;
    cursor: row-resize;
    z-index: 22;
}
.console-panel-resizer::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 28px;
    height: 4px;
    border-radius: var(--tg-radius-pill, 999px);
    transform: translate(-50%, -50%);
    background: rgba(148,163,184,0.75);
    box-shadow: 0 0 0 1px rgba(0,0,0,0.35);
}
.console-panel-resizer.hidden { display: none; }
body.tv-panel-resizing { cursor: row-resize; }

/* Chart as panel */
.console-panel.panel-chart { grid-column: 1 / -1; min-height: var(--chart-panel-min-height); }
.panel-chart .panel-body { display: flex; flex-direction: column; position: relative; overflow: hidden; }
.panel-chart .chart-panel-main { position: relative; flex: 1 1 auto; min-height: 220px; }
#panel-chart { order: -1; }
.chart-panel-controls {
    display: flex; align-items: center; gap: 6px; margin-left: auto;
}
.chart-panel-controls input[type="text"] {
    background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12);
    color: #d1d4dc; padding: 2px 8px; border-radius: 6px; font-size: 0.78rem;
    width: 90px; outline: none;
}
.chart-panel-controls input[type="text"]:focus { border-color: rgba(6,182,212,0.5); }
.chart-panel-controls select {
    background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12);
    color: #d1d4dc; padding: 2px 6px; border-radius: 6px; font-size: 0.78rem;
    outline: none; cursor: pointer;
}
.chart-panel-controls .live-price-badge {
    font-size: 0.75rem; font-weight: 600; padding: 2px 8px; border-radius: 6px;
    background: rgba(255,255,255,0.06); white-space: nowrap;
}

/* Panel grid row resizer */
.grid-row-resizer {
    position: absolute;
    left: 0.5rem;
    right: 0.5rem;
    height: 10px;
    cursor: row-resize;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
}
.grid-row-resizer::before {
    content: "";
    width: 28px;
    height: 3px;
    border-radius: var(--tg-radius-pill, 999px);
    background: transparent;
    transition: background 0.15s;
}
.grid-row-resizer:hover::before { background: rgba(6,182,212,0.5); }
body.grid-row-resizing,
body.grid-row-resizing * { cursor: row-resize !important; user-select: none !important; }

.console-chart-wrap canvas { touch-action: none; }

/* Chart loading overlay */
.chart-loading-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(19,23,34,0.8);
    z-index: 5;
    transition: opacity 0.2s;
}
.chart-loading-overlay.hide {
    opacity: 0;
    pointer-events: none;
    display: none;
}
.chart-loading-overlay .spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255,255,255,0.1);
    border-top-color: var(--tv-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Metrics panel */
.metrics-panel {
    border-top: 1px solid var(--tv-border);
    background: var(--tv-pane);
    transition: max-height 0.3s ease, padding 0.3s ease;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 1fr);
    align-items: start;
}
.metrics-panel.collapsed {
    max-height: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    border-top-color: transparent;
}
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.5rem;
    padding: 0.6rem 0.75rem;
}
.metric-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 8px;
    padding: 0.5rem 0.65rem;
}
.metric-card .metric-label {
    font-size: 0.65rem;
    color: rgba(209,212,220,0.5);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.15rem;
}
.metric-card .metric-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--tv-text);
}
.metric-card .metric-value.bullish { color: var(--tv-green); }
.metric-card .metric-value.bearish { color: var(--tv-red); }
.metric-card .metric-value.na { color: rgba(209,212,220,0.3); }

.metrics-news {
    border-left: 1px solid rgba(255,255,255,0.06);
    padding: 0.45rem 0.65rem 0.5rem;
    min-width: 0;
    max-height: 185px;
    display: flex;
    flex-direction: column;
}
.metrics-news-title {
    font-size: 0.62rem;
    color: rgba(209,212,220,0.55);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 0.35rem;
}
.metrics-news-list {
    display: flex;
    flex-direction: column;
    gap: 0.28rem;
    overflow-y: auto;
    max-height: 148px;
    padding-right: 0.15rem;
}
.metrics-news-item {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.4rem;
    align-items: flex-start;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 8px;
    padding: 0.34rem 0.42rem;
}
.metrics-news-item.news-link {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.metrics-news-item.news-link:hover {
    border-color: rgba(34,211,238,0.35);
    background: rgba(255,255,255,0.06);
}
.metrics-news-item .news-score {
    font-size: 0.64rem;
    font-weight: 700;
    line-height: 1;
    border-radius: var(--tg-radius-pill, 999px);
    padding: 0.22rem 0.42rem;
    border: 1px solid rgba(255,255,255,0.16);
    color: rgba(209,212,220,0.92);
    background: rgba(255,255,255,0.04);
}
.metrics-news-item .news-score.critical {
    color: #67e8f9;
    border-color: rgba(103,232,249,0.55);
    background: rgba(34,211,238,0.14);
}
.metrics-news-item .news-score.high {
    color: #a5f3fc;
    border-color: rgba(165,243,252,0.4);
    background: rgba(34,211,238,0.1);
}
.metrics-news-item .news-score.medium {
    color: #c4b5fd;
    border-color: rgba(196,181,253,0.4);
    background: rgba(139,92,246,0.12);
}
.metrics-news-item .news-score.low {
    color: rgba(209,212,220,0.75);
}
.metrics-news-item .news-main {
    min-width: 0;
}
.metrics-news-item .news-headline {
    font-size: 0.69rem;
    line-height: 1.18;
    color: var(--tv-text);
    font-weight: 600;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.metrics-news-item .news-meta {
    margin-top: 0.12rem;
    font-size: 0.58rem;
    color: rgba(209,212,220,0.48);
}
.metrics-news-empty {
    font-size: 0.71rem;
    color: rgba(209,212,220,0.5);
    padding: 0.2rem 0.05rem;
}

/* Order Book panel */
.orderbook-panel {
    border-top: 1px solid var(--tv-border);
    background: var(--tv-pane);
    transition: max-height 0.3s ease, padding 0.3s ease;
    overflow: hidden;
    overflow-y: auto;
    max-height: 300px;
}
.orderbook-panel.collapsed {
    max-height: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    border-top-color: transparent;
}
.orderbook-content {
    display: flex;
    gap: 0;
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
    font-size: 0.72rem;
    line-height: 1;
    padding: 0.4rem 0.5rem;
}
.ob-side {
    flex: 1;
    min-width: 0;
}
.ob-header {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.2rem;
    padding: 0.2rem 0.4rem;
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(209,212,220,0.45);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    margin-bottom: 0.2rem;
}
.ob-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.2rem;
    padding: 0.15rem 0.4rem;
    position: relative;
    z-index: 1;
}
.ob-row .ob-bar {
    position: absolute;
    top: 0; bottom: 0;
    z-index: -1;
    border-radius: 2px;
}
.ob-asks .ob-bar {
    right: 0;
    background: rgba(168,85,247,0.12);
}
.ob-bids .ob-bar {
    left: 0;
    background: rgba(34,211,238,0.12);
}
.ob-price { font-weight: 600; }
.ob-asks .ob-price { color: #c084fc; }
.ob-bids .ob-price { color: #67e8f9; }
.ob-qty, .ob-total { color: rgba(209,212,220,0.7); text-align: right; }
.ob-spread-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.35rem 0;
    font-size: 0.68rem;
    color: rgba(209,212,220,0.55);
    border-top: 1px solid rgba(255,255,255,0.04);
    border-bottom: 1px solid rgba(255,255,255,0.04);
    margin: 0.15rem 0;
}
.ob-spread-val { color: #fbbf24; font-weight: 600; }
.ob-badge {
    display: inline-block;
    font-size: 0.55rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    padding: 0.12rem 0.4rem;
    border-radius: 4px;
    margin-left: 0.4rem;
    vertical-align: middle;
}
.ob-badge.live {
    color: #34d399;
    background: rgba(52,211,153,0.12);
    border: 1px solid rgba(52,211,153,0.3);
}
.ob-badge.simulated {
    color: #fbbf24;
    background: rgba(251,191,36,0.12);
    border: 1px solid rgba(251,191,36,0.3);
}
.ob-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: rgba(209,212,220,0.4);
    font-size: 0.78rem;
}

/* Quote panel (stocks/forex - real data) */
.ob-quote-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 0.4rem;
    padding: 0.2rem 0.4rem 0.4rem;
}
.ob-quote-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 8px;
    padding: 0.4rem 0.55rem;
}
.ob-quote-card.ob-quote-price {
    grid-column: span 2;
    background: rgba(255,255,255,0.04);
    border-color: rgba(255,255,255,0.1);
}
.ob-quote-label {
    font-size: 0.6rem;
    color: rgba(209,212,220,0.45);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.12rem;
}
.ob-quote-value {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--tv-text);
    font-family: 'SF Mono','Fira Code','Cascadia Code',monospace;
}
.ob-quote-sub {
    font-size: 0.62rem;
    color: rgba(209,212,220,0.5);
    margin-top: 0.1rem;
}
.ob-bid-color { color: #67e8f9; }
.ob-ask-color { color: #c084fc; }
.ob-spread-color { color: #fbbf24; }
.ob-vol-bar-bg {
    margin-top: 0.25rem;
    height: 3px;
    background: rgba(255,255,255,0.06);
    border-radius: 2px;
    overflow: hidden;
}
.ob-vol-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #22d3ee, #2962ff);
    border-radius: 2px;
}
.ob-range-section {
    padding: 0.25rem 0.4rem;
}
.ob-range-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.2rem;
}
.ob-range-label {
    font-size: 0.6rem;
    color: rgba(209,212,220,0.45);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.ob-range-vals {
    font-size: 0.65rem;
    color: rgba(209,212,220,0.65);
    font-family: 'SF Mono','Fira Code','Cascadia Code',monospace;
}
.ob-range-bar-bg {
    height: 4px;
    background: rgba(255,255,255,0.06);
    border-radius: 2px;
    position: relative;
    overflow: hidden;
}
.ob-range-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #22d3ee, #67e8f9);
    border-radius: 2px;
    position: relative;
}
.ob-range-bar-fill::after {
    content: '';
    position: absolute;
    right: -1px;
    top: -3px;
    width: 3px;
    height: 10px;
    background: #fff;
    border-radius: 1px;
}
.ob-range-52w {
    background: linear-gradient(90deg, #a855f7, #c084fc);
}

/* Intelligence panel */
.intel-panel {
    border-top: 1px solid var(--tv-border);
    background: var(--console-bg);
    transition: max-height 0.3s ease, padding 0.3s ease;
    overflow: hidden;
    overflow-y: auto;
    max-height: 520px;
}
.intel-panel.collapsed {
    max-height: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    border-top-color: transparent;
}
/* Ticker strip */
.intel-ticker-strip {
    display: flex;
    align-items: center;
    gap: 0;
    background: rgba(255,255,255,0.02);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    overflow-x: auto;
    scrollbar-width: none;
    font-family: 'SF Mono','Fira Code','Cascadia Code',monospace;
    font-size: 0.68rem;
    min-height: 28px;
}
.intel-ticker-strip::-webkit-scrollbar { display: none; }
.intel-ticker-item {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.65rem;
    border-right: 1px solid rgba(255,255,255,0.05);
    white-space: nowrap;
    flex-shrink: 0;
}
.intel-ticker-name { color: var(--console-accent); font-weight: 600; font-size: 0.6rem; letter-spacing: 0.04em; }
.intel-ticker-val { color: #e0e3ea; font-weight: 500; }
.intel-ticker-change { font-size: 0.6rem; font-weight: 600; }
.intel-ticker-change.pos { color: var(--console-positive); }
.intel-ticker-change.neg { color: var(--console-negative); }
.intel-ticker-timestamp {
    display: flex; align-items: center; gap: 0.25rem;
    padding: 0.25rem 0.65rem; border-right: 1px solid rgba(255,255,255,0.08);
    white-space: nowrap; flex-shrink: 0;
    color: rgba(255,255,255,0.35); font-size: 0.55rem; font-weight: 500;
    letter-spacing: 0.03em;
}
.intel-ticker-timestamp .ts-dot { width: 5px; height: 5px; border-radius: 50%; background: rgba(6,182,212,0.5); flex-shrink: 0; }
.intel-ticker-timestamp.live .ts-dot { background: var(--console-positive); animation: ts-pulse 2s ease-in-out infinite; }
@keyframes ts-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }
.intel-ticker-live-badge {
    display: inline-flex; align-items: center; gap: 0.2rem;
    color: var(--console-positive); font-size: 0.5rem; font-weight: 700;
    letter-spacing: 0.06em; text-transform: uppercase;
}
/* ===== MOBILE TICKER FULLSCREEN ===== */
.mobile-ticker-fullscreen {
    display: none;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 0.5rem;
    background: var(--console-bg, #0a0e17);
    -webkit-overflow-scrolling: touch;
}
.mobile-ticker-fullscreen.active { display: flex; }
.mtf-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.25rem 0.15rem 0.5rem;
}
.mtf-title {
    font-size: 0.75rem; font-weight: 700; color: #e0e3ea;
    letter-spacing: 0.04em;
}
.mtf-updated {
    font-size: 0.55rem; color: rgba(255,255,255,0.35);
    display: flex; align-items: center; gap: 0.25rem;
}
.mtf-updated .ts-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--console-positive); animation: ts-pulse 2s ease-in-out infinite; }
.mtf-section-header {
    font-size: 0.55rem; font-weight: 700; color: rgba(6,182,212,0.5);
    letter-spacing: 0.08em; text-transform: uppercase;
    padding: 0.5rem 0.15rem 0.2rem; margin-top: 0.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.mtf-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 0.35rem;
    padding: 0.25rem 0;
}
.mtf-card {
    display: flex; flex-direction: column; gap: 0.15rem;
    padding: 0.5rem 0.55rem;
    background: rgba(255,255,255,0.025);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 6px;
    backdrop-filter: blur(8px);
    position: relative;
}
.mtf-card-name {
    font-size: 0.55rem; font-weight: 600; color: rgba(6,182,212,0.7);
    letter-spacing: 0.04em;
}
.mtf-card-value {
    font-size: 0.85rem; font-weight: 600; color: #e0e3ea;
    font-family: 'SF Mono','Fira Code','Cascadia Code',monospace;
}
.mtf-card-change {
    font-size: 0.6rem; font-weight: 600;
    font-family: 'SF Mono','Fira Code','Cascadia Code',monospace;
}
.mtf-card-change.pos { color: var(--console-positive); }
.mtf-card-change.neg { color: var(--console-negative); }
.mtf-card .live-dot {
    position: absolute; top: 0.35rem; right: 0.35rem;
    width: 4px; height: 4px; border-radius: 50%;
    background: var(--console-positive); animation: ts-pulse 2s ease-in-out infinite;
}
.mtf-rates-list {
    display: flex; flex-direction: column; gap: 0.2rem;
    padding: 0.25rem 0;
}
.mtf-rate-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.3rem 0.4rem;
    background: rgba(255,255,255,0.02);
    border-radius: 4px;
    font-family: 'SF Mono','Fira Code','Cascadia Code',monospace;
    font-size: 0.65rem;
}
.mtf-rate-code { color: rgba(6,182,212,0.6); font-weight: 700; width: 32px; }
.mtf-rate-val { color: #e0e3ea; font-weight: 600; }
.mtf-rate-chg { font-weight: 600; }
.mtf-rate-chg.pos { color: var(--console-positive); }
.mtf-rate-chg.neg { color: var(--console-negative); }
/* Main layout */
.intel-content {
    display: flex;
    flex-direction: column;
    font-size: 0.75rem;
    line-height: 1.35;
}
.intel-main {
    display: flex;
    min-height: 280px;
}
.intel-map-wrap {
    flex: 1 1 auto;
    min-height: 280px;
    position: relative;
}
.intel-map-wrap .leaflet-container { background: var(--console-bg) !important; }
.intel-detail-wrap {
    flex: 1;
    overflow-y: auto;
    max-height: 440px;
    border-left: 1px solid rgba(255,255,255,0.06);
    display: flex;
    flex-direction: column;
}
/* Sub-tab bar */
.intel-subtab-bar {
    display: flex;
    gap: 0;
    background: rgba(255,255,255,0.02);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
}
.intel-subtab {
    padding: 0.4rem 0.7rem;
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(209,212,220,0.4);
    cursor: pointer;
    transition: all 0.15s;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
}
.intel-subtab:hover { color: rgba(209,212,220,0.7); background: rgba(255,255,255,0.03); }
.intel-subtab.active {
    color: var(--console-accent);
    border-bottom-color: var(--console-accent);
    background: rgba(6,182,212,0.06);
}
.intel-subtab i { margin-right: 0.25rem; font-size: 0.58rem; }
.intel-tab-content {
    flex: 1;
    overflow-y: auto;
    padding: 0.35rem 0.5rem;
}
/* Section headers */
.intel-section-header {
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--console-accent);
    padding: 0.4rem 0.1rem 0.2rem;
    border-bottom: 1px solid rgba(6,182,212,0.15);
    margin-bottom: 0.3rem;
}
/* Filter chips (macro tab) */
.intel-filter-bar {
    display: flex;
    gap: 0.25rem;
    padding: 0.3rem 0;
    flex-wrap: wrap;
}
.intel-chip {
    font-size: 0.58rem;
    padding: 0.14rem 0.45rem;
    border-radius: 3px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.03);
    color: rgba(209,212,220,0.55);
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.intel-chip:hover { background: rgba(255,255,255,0.06); color: rgba(209,212,220,0.8); }
.intel-chip.active {
    background: rgba(6,182,212,0.12);
    border-color: rgba(6,182,212,0.4);
    color: var(--console-accent);
}
/* Country cards */
.intel-country-card {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 4px;
    padding: 0.4rem 0.5rem;
    margin-bottom: 0.3rem;
    cursor: pointer;
    transition: all 0.15s;
}
.intel-country-card:hover { border-color: rgba(255,255,255,0.15); background: rgba(255,255,255,0.04); }
.intel-country-card.active-card { border-color: var(--console-accent); background: rgba(6,182,212,0.05); }
.intel-country-name {
    font-weight: 700;
    font-size: 0.72rem;
    color: var(--tv-text);
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin-bottom: 0.2rem;
    font-family: 'SF Mono','Fira Code','Cascadia Code',monospace;
}
.intel-health-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}
.intel-health-dot.growing { background: var(--console-positive); box-shadow: 0 0 6px rgba(16,185,129,0.5); }
.intel-health-dot.stable { background: var(--console-accent); box-shadow: 0 0 6px rgba(6,182,212,0.4); }
.intel-health-dot.contracting { background: var(--console-negative); box-shadow: 0 0 6px rgba(239,68,68,0.5); }
.intel-ind-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.15rem 0.5rem;
}
.intel-ind-label {
    font-size: 0.55rem;
    color: rgba(6,182,212,0.6);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}
.intel-ind-val {
    font-size: 0.74rem;
    font-weight: 600;
    color: #e0e3ea;
    font-family: 'SF Mono','Fira Code','Cascadia Code',monospace;
}
.intel-ind-change { font-size: 0.58rem; margin-left: 0.15rem; font-weight: 700; }
.intel-ind-change.pos { color: var(--console-positive); }
.intel-ind-change.neg { color: var(--console-negative); }
/* Indicator cards (energy/rates tabs) */
.intel-data-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.3rem;
    margin-bottom: 0.4rem;
}
.intel-indicator-card {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 4px;
    padding: 0.35rem 0.45rem;
}
.intel-indicator-card:hover { border-color: rgba(255,255,255,0.12); }
/* Event rows */
.intel-event-row {
    display: grid;
    grid-template-columns: 50px 32px 1fr 48px 48px 48px;
    gap: 0.3rem;
    padding: 0.22rem 0.15rem;
    font-family: 'SF Mono','Fira Code','Cascadia Code',monospace;
    font-size: 0.64rem;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    align-items: center;
}
.intel-event-row:hover { background: rgba(255,255,255,0.03); }
.intel-event-time { color: rgba(209,212,220,0.45); font-size: 0.58rem; }
.intel-event-currency { color: var(--console-accent); font-weight: 700; font-size: 0.6rem; }
.intel-event-name { color: var(--tv-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.intel-event-actual { color: var(--console-positive); font-weight: 600; text-align: right; }
.intel-event-forecast { color: rgba(209,212,220,0.5); text-align: right; }
.intel-event-previous { color: rgba(209,212,220,0.35); text-align: right; }
.intel-event-header {
    display: grid;
    grid-template-columns: 50px 32px 1fr 48px 48px 48px;
    gap: 0.3rem;
    padding: 0.2rem 0.15rem;
    font-size: 0.52rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(6,182,212,0.5);
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
/* News rows */
.intel-news-row {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
    padding: 0.3rem 0.15rem;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    font-size: 0.66rem;
}
.intel-news-row:hover { background: rgba(255,255,255,0.03); }
.intel-news-score {
    flex-shrink: 0;
    width: 28px; height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.58rem;
    font-weight: 700;
    border-radius: 3px;
    font-family: 'SF Mono','Fira Code','Cascadia Code',monospace;
}
.intel-news-score.critical { background: rgba(239,68,68,0.15); color: var(--console-negative); border: 1px solid rgba(239,68,68,0.3); }
.intel-news-score.high { background: rgba(255,165,0,0.12); color: #ffa500; border: 1px solid rgba(255,165,0,0.3); }
.intel-news-headline { color: var(--tv-text); line-height: 1.3; }
.intel-news-time { font-size: 0.55rem; color: rgba(209,212,220,0.35); margin-top: 0.1rem; }
/* Country news side panel */
.country-news-panel {
    position: absolute; right: 0; top: 0; bottom: 0; width: 320px; max-width: 50%;
    background: rgba(13,17,28,0.96); border-left: 1px solid rgba(6,182,212,0.15);
    z-index: 1100; display: flex; flex-direction: column;
    transform: translateX(100%); transition: transform 0.25s ease;
    backdrop-filter: blur(12px);
}
.country-news-panel.open { transform: translateX(0); }
.country-news-panel-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.5rem 0.6rem; border-bottom: 1px solid rgba(6,182,212,0.12);
    font-size: 0.72rem; font-weight: 700; color: var(--tv-text);
    background: rgba(6,182,212,0.04);
}
.country-news-panel-close {
    cursor: pointer; color: rgba(209,212,220,0.5); font-size: 0.9rem;
    background: none; border: none; padding: 0 4px; line-height: 1;
}
.country-news-panel-close:hover { color: var(--console-negative); }
.country-news-panel-body { flex: 1; overflow-y: auto; padding: 0.3rem 0.4rem; }
.country-news-panel-body .intel-news-row { cursor: pointer; }
.country-news-panel-body .intel-news-row:hover { background: rgba(6,182,212,0.06); }
.country-news-score.medium { background: rgba(251,191,36,0.12); color: #fbbf24; border: 1px solid rgba(251,191,36,0.3); }
.country-news-score.low { background: rgba(107,114,128,0.12); color: #9ca3af; border: 1px solid rgba(107,114,128,0.3); }
/* Sparklines */
.intel-sparkline {
    display: inline-flex;
    align-items: flex-end;
    gap: 1px;
    height: 12px;
    margin-left: 0.2rem;
    vertical-align: middle;
}
.intel-sparkline .spark-bar {
    width: 2px;
    background: rgba(6,182,212,0.45);
    border-radius: 1px;
    min-height: 1px;
}
.intel-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: rgba(209,212,220,0.3);
    font-size: 0.72rem;
    width: 100%;
    font-family: 'SF Mono','Fira Code','Cascadia Code',monospace;
}
/* Skeleton loader shimmer */
@keyframes console-shimmer { 0%{background-position:-200% 0} 100%{background-position:200% 0} }
.console-skeleton { padding: 0.8rem; display: flex; flex-direction: column; gap: 0.55rem; }
.console-skeleton-row {
    height: 10px; border-radius: 3px;
    background: linear-gradient(90deg, rgba(255,255,255,0.03) 25%, rgba(255,255,255,0.07) 50%, rgba(255,255,255,0.03) 75%);
    background-size: 200% 100%;
    animation: console-shimmer 1.8s ease-in-out infinite;
}
.console-skeleton-row.wide { width: 90%; }
.console-skeleton-row.medium { width: 65%; }
.console-skeleton-row.short { width: 40%; }
/* Error state + retry */
.console-error-state {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 1.5rem 1rem; gap: 0.6rem; text-align: center; width: 100%;
}
.console-error-state .error-icon { font-size: 1.2rem; color: rgba(239,68,68,0.6); }
.console-error-state .error-msg { color: rgba(209,212,220,0.5); font-size: 0.65rem; line-height: 1.4; max-width: 220px; }
.console-retry-btn {
    display: inline-flex; align-items: center; gap: 0.35rem;
    padding: 0.3rem 0.8rem; border-radius: 5px; border: 1px solid rgba(6,182,212,0.3);
    background: rgba(6,182,212,0.08); color: #06b6d4; font-size: 0.6rem; font-weight: 600;
    cursor: pointer; transition: background 0.2s, border-color 0.2s;
}
.console-retry-btn:hover { background: rgba(6,182,212,0.18); border-color: rgba(6,182,212,0.5); }
/* Fundamental & News panels */
.fund-metric-row { display:flex; justify-content:space-between; padding:4px 6px; border-bottom:1px solid rgba(255,255,255,0.03); }
.fund-metric-label { font-size:0.44rem; color:rgba(209,212,220,0.5); }
.fund-metric-value { font-size:0.46rem; font-weight:700; color:#e0e3ea; font-family:'JetBrains Mono',monospace; }
.fund-snowflake-row { display:flex; align-items:center; gap:6px; padding:2px 6px; }
.fund-snowflake-label { font-size:0.40rem; color:rgba(209,212,220,0.45); min-width:50px; }
.fund-snowflake-bar { flex:1; height:5px; background:rgba(255,255,255,0.06); border-radius:3px; overflow:hidden; }
.fund-snowflake-fill { height:100%; border-radius:3px; transition:width 0.4s ease; }
.news-panel-item { display:block; padding:6px 8px; border-bottom:1px solid rgba(255,255,255,0.04); text-decoration:none; color:inherit; transition:background 0.12s; }
.news-panel-item:hover { background:rgba(255,255,255,0.03); }
.news-score-badge { display:inline-block; padding:1px 6px; border-radius:3px; font-size:0.40rem; font-weight:700; font-family:'JetBrains Mono',monospace; }
.news-headline { font-size:0.46rem; font-weight:600; color:#e0e3ea; line-height:1.35; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.news-summary { font-size:0.40rem; color:rgba(209,212,220,0.45); line-height:1.3; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; margin-top:2px; }
.news-meta { font-size:0.38rem; color:rgba(209,212,220,0.3); margin-top:3px; display:flex; align-items:center; gap:6px; }
/* Panel search inputs */
.panel-search-wrap { position:relative; padding:4px 6px; }
.panel-search-input { width:100%; padding:4px 8px; background:rgba(255,255,255,0.04); border:1px solid rgba(255,255,255,0.08); border-radius:4px; color:#e0e3ea; font-size:0.46rem; font-family:'JetBrains Mono',monospace; outline:none; box-sizing:border-box; }
.panel-search-input:focus { border-color:rgba(6,182,212,0.4); background:rgba(6,182,212,0.04); }
.panel-search-input::placeholder { color:rgba(209,212,220,0.3); }
.panel-search-suggestions { position:absolute; top:100%; left:6px; right:6px; max-height:200px; overflow-y:auto; background:#1e222d; border:1px solid var(--tv-border); border-radius:6px; z-index:100; box-shadow:0 6px 20px rgba(0,0,0,0.5); display:none; }
.panel-search-suggestions.visible { display:block; }
.panel-filters-bar { display:flex; flex-wrap:wrap; gap:3px; padding:2px 6px 4px; align-items:center; }
.panel-filter-group { display:flex; gap:2px; align-items:center; margin-right:4px; }
.panel-filter-label { font-size:0.34rem; color:rgba(209,212,220,0.25); font-weight:700; text-transform:uppercase; letter-spacing:0.05em; margin-right:1px; white-space:nowrap; }
.panel-filter-pill { padding:1px 6px; border:1px solid rgba(255,255,255,0.06); background:transparent; color:rgba(209,212,220,0.35); border-radius:3px; font-size:0.36rem; cursor:pointer; font-family:'JetBrains Mono',monospace; white-space:nowrap; }
.panel-filter-pill:hover { border-color:rgba(6,182,212,0.3); color:rgba(209,212,220,0.5); }
.panel-filter-pill.active { border-color:rgba(6,182,212,0.5); background:rgba(6,182,212,0.08); color:#06b6d4; }
.panel-quick-row { display:flex; flex-wrap:wrap; gap:3px; padding:2px 6px 4px; align-items:center; }
.panel-quick-sym { padding:1px 6px; background:rgba(6,182,212,0.03); border:1px solid rgba(6,182,212,0.08); border-radius:3px; font-size:0.36rem; color:rgba(6,182,212,0.5); cursor:pointer; font-family:'JetBrains Mono',monospace; }
.panel-quick-sym:hover { background:rgba(6,182,212,0.08); border-color:rgba(6,182,212,0.25); color:#06b6d4; }
/* Symbol link badge in panel headers */
.panel-sym-badge { display:inline-flex; align-items:center; gap:3px; margin-left:0.3rem; padding:1px 6px; background:rgba(6,182,212,0.08); border:1px solid rgba(6,182,212,0.2); border-radius:4px; font-size:0.5rem; font-weight:600; color:#06b6d4; font-family:'JetBrains Mono',monospace; letter-spacing:0.04em; cursor:pointer; transition:all 0.15s; white-space:nowrap; text-transform:uppercase; line-height:1.4; }
.panel-sym-badge:hover { background:rgba(6,182,212,0.15); border-color:rgba(6,182,212,0.4); }
.panel-sym-badge.unlinked { background:rgba(251,191,36,0.08); border-color:rgba(251,191,36,0.25); color:#fbbf24; }
.panel-sym-badge.unlinked:hover { background:rgba(251,191,36,0.15); border-color:rgba(251,191,36,0.4); }
.panel-sym-badge .link-icon { font-size:0.4rem; opacity:0.5; transition:opacity 0.15s; }
.panel-sym-badge:hover .link-icon { opacity:1; }
.panel-sym-search-inline { position:absolute; top:calc(100% + 2px); left:0; min-width:220px; z-index:120; background:#1e222d; border:1px solid rgba(6,182,212,0.3); border-radius:6px; box-shadow:0 6px 20px rgba(0,0,0,0.5); padding:4px; }
.panel-sym-search-inline .panel-search-wrap { padding:0; }
.panel-sym-search-inline .panel-search-input { font-size:0.5rem; padding:5px 8px; }
.panel-sym-search-inline .panel-search-suggestions { left:0; right:0; }
@media (max-width:768px) {
    .panel-sym-badge { font-size:0.6rem; padding:3px 10px; min-height:32px; min-width:44px; justify-content:center; }
    .panel-sym-search-inline { position:fixed; left:8px; right:8px; top:auto; bottom:auto; min-width:unset; max-width:calc(100vw - 16px); z-index:200; }
    .panel-sym-search-inline .panel-search-input { font-size:0.65rem; padding:8px 10px; }
    .panel-sym-search-inline .panel-search-suggestions { max-height:40vh; }
}
/* Yield curve mini chart */
.intel-yield-curve {
    display: flex;
    align-items: flex-end;
    gap: 0;
    height: 50px;
    padding: 0.3rem 0.2rem;
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 4px;
    background: rgba(255,255,255,0.01);
    margin: 0.3rem 0;
}
.intel-yield-bar {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
}
.intel-yield-fill {
    width: 16px;
    background: linear-gradient(180deg, var(--console-accent), rgba(6,182,212,0.3));
    border-radius: 2px 2px 0 0;
    min-height: 2px;
}
.intel-yield-label { font-size: 0.5rem; color: rgba(209,212,220,0.4); font-weight: 600; }
.intel-yield-val { font-size: 0.55rem; color: #e0e3ea; font-weight: 600; font-family: 'SF Mono','Fira Code','Cascadia Code',monospace; }
/* Leaflet popup override */
.intel-popup .leaflet-popup-content-wrapper {
    background: var(--console-bg);
    color: #d1d4dc;
    border: 1px solid rgba(6,182,212,0.25);
    border-radius: 4px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.6);
    font-family: 'SF Mono','Fira Code','Cascadia Code',monospace;
}
.intel-popup .leaflet-popup-tip { background: var(--console-bg); }
.intel-popup .leaflet-popup-content { margin: 8px 12px; font-size: 0.68rem; line-height: 1.5; }
.intel-tooltip { background: rgba(5,6,10,0.92) !important; border: 1px solid rgba(6,182,212,0.3) !important; color: #d1d4dc !important; padding: 4px 8px !important; border-radius: 4px !important; box-shadow: 0 2px 8px rgba(0,0,0,0.5) !important; }
.intel-tooltip::before { border-top-color: rgba(6,182,212,0.3) !important; }
.intel-popup .leaflet-popup-content strong { color: var(--console-accent); }
/* Pulsing marker */
@keyframes intel-pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.8); opacity: 0.3; }
    100% { transform: scale(1); opacity: 1; }
}
.intel-marker-inner {
    width: 8px; height: 8px;
    border-radius: 50%;
    border: 1.5px solid rgba(255,255,255,0.5);
    position: relative;
}
.intel-marker-inner::after {
    content: '';
    position: absolute;
    top: -5px; left: -5px;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: inherit;
    opacity: 0.25;
    animation: intel-pulse 2.5s infinite;
}
.intel-marker-inner.growing { background: var(--console-positive); }
.intel-marker-inner.stable { background: var(--console-accent); }
.intel-marker-inner.contracting { background: var(--console-negative); }
.intel-marker-inner.contracting::after { animation: intel-pulse-fast 1.5s infinite !important; }
@keyframes intel-pulse-fast {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(2.2); opacity: 0.15; }
    100% { transform: scale(1); opacity: 1; }
}
.intel-hud {
    background: rgba(5,6,10,0.88);
    border: 1px solid rgba(6,182,212,0.2);
    border-radius: 4px;
    padding: 0.35rem 0.5rem;
    font-family: 'SF Mono','Fira Code','Cascadia Code',monospace;
    font-size: 0.56rem;
    color: rgba(209,212,220,0.7);
    backdrop-filter: blur(8px);
    min-width: 140px;
}
.intel-hud-title {
    font-size: 0.46rem;
    font-weight: 700;
    color: rgba(6,182,212,0.6);
    letter-spacing: 0.08em;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    padding-bottom: 3px;
    margin-bottom: 4px;
}
.intel-hud-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2px 0;
    gap: 6px;
}
.intel-hud-label {
    color: rgba(209,212,220,0.4);
    font-weight: 600;
    font-size: 0.48rem;
    min-width: 32px;
}
.intel-hud-val {
    font-weight: 700;
    font-size: 0.58rem;
}
.intel-flag-label {
    font-size: 0.6rem;
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
    pointer-events: none;
}
/* Port markers */
.intel-port-dot {
    border-radius: 50%;
    border: 1.5px solid rgba(255,255,255,0.5);
    box-shadow: 0 0 6px rgba(34,211,238,0.5);
    position: relative;
}
.intel-port-dot.container { background: #06b6d4; }
.intel-port-dot.oil { background: #f59e0b; box-shadow: 0 0 6px rgba(245,158,11,0.5); }
.intel-port-dot.mixed { background: #a78bfa; box-shadow: 0 0 6px rgba(167,139,250,0.5); }
.intel-port-label {
    font-family: 'SF Mono','Fira Code',monospace;
    font-size: 8px;
    font-weight: 700;
    color: rgba(209,212,220,0.65);
    white-space: nowrap;
    text-shadow: 1px 1px 3px #000, -1px -1px 3px #000;
    letter-spacing: 0.03em;
    pointer-events: none;
}
/* Oil hub markers */
.intel-oil-marker {
    width: 10px; height: 10px;
    border: 1.5px solid rgba(245,158,11,0.8);
    background: rgba(245,158,11,0.3);
    transform: rotate(45deg);
    box-shadow: 0 0 8px rgba(245,158,11,0.4);
}
.intel-oil-marker.storage { border-color: #f59e0b; background: rgba(245,158,11,0.25); }
.intel-oil-marker.terminal { border-color: #ef4444; background: rgba(239,68,68,0.25); box-shadow: 0 0 8px rgba(239,68,68,0.4); }
.intel-oil-marker.refinery { border-color: #8b5cf6; background: rgba(139,92,246,0.25); box-shadow: 0 0 8px rgba(139,92,246,0.4); }
/* Shipping route animation */
@keyframes route-flow {
    from { stroke-dashoffset: 0; }
    to { stroke-dashoffset: -24; }
}
@keyframes route-flow-slow {
    from { stroke-dashoffset: 0; }
    to { stroke-dashoffset: -32; }
}
.route-animated { animation: route-flow 3s linear infinite; }
.route-animated-slow { animation: route-flow-slow 5s linear infinite; }
/* Layer control */
.intel-layer-control {
    background: rgba(5,6,10,0.92);
    border: 1px solid rgba(6,182,212,0.2);
    border-radius: 4px;
    padding: 0.35rem 0.5rem;
    font-family: 'SF Mono','Fira Code',monospace;
    font-size: 0.58rem;
    color: var(--tv-text);
    backdrop-filter: blur(8px);
    min-width: 110px;
}
.intel-layer-title {
    font-size: 0.52rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--console-accent);
    margin-bottom: 0.25rem;
    border-bottom: 1px solid rgba(6,182,212,0.15);
    padding-bottom: 0.2rem;
}
.intel-layer-row {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.15rem 0;
    cursor: pointer;
    color: rgba(209,212,220,0.6);
    transition: color 0.15s;
}
.intel-layer-row:hover { color: var(--tv-text); }
.intel-layer-row.active { color: var(--tv-text); }
.intel-layer-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
    opacity: 0.3;
    transition: opacity 0.15s;
}
.intel-layer-row.active .intel-layer-dot { opacity: 1; }
/* Map legend */
.intel-legend {
    background: rgba(5,6,10,0.85);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 4px;
    padding: 0.3rem 0.45rem;
    font-family: 'SF Mono','Fira Code',monospace;
    font-size: 0.52rem;
    color: rgba(209,212,220,0.5);
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}
.intel-legend-item {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    white-space: nowrap;
}
.intel-legend-line {
    width: 14px; height: 2px;
    border-radius: 1px;
    flex-shrink: 0;
}
.intel-legend-sq {
    width: 6px; height: 6px;
    flex-shrink: 0;
}
/* Storage fill gauges */
.intel-fill-gauge {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 4px;
    padding: 0.4rem 0.5rem;
    margin-bottom: 0.35rem;
}
.intel-fill-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.2rem;
}
.intel-fill-name {
    font-size: 0.58rem;
    color: rgba(6,182,212,0.7);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.intel-fill-pct {
    font-size: 0.82rem;
    font-weight: 700;
    font-family: 'SF Mono','Fira Code','Cascadia Code',monospace;
}
.intel-fill-track {
    height: 10px;
    background: rgba(255,255,255,0.06);
    border-radius: 5px;
    overflow: hidden;
    position: relative;
}
.intel-fill-level {
    height: 100%;
    border-radius: 5px;
    transition: width 0.6s ease;
    position: relative;
}
.intel-fill-level::after {
    content: '';
    position: absolute;
    top: 0; right: 0; bottom: 0;
    width: 6px;
    background: rgba(255,255,255,0.3);
    border-radius: 0 5px 5px 0;
}
.intel-fill-sub {
    display: flex;
    justify-content: space-between;
    font-size: 0.52rem;
    color: rgba(209,212,220,0.35);
    margin-top: 0.15rem;
    font-family: 'SF Mono','Fira Code','Cascadia Code',monospace;
}
/* Mini fill bar (popups) */
.intel-mini-fill {
    margin-top: 4px;
    height: 5px;
    background: rgba(255,255,255,0.08);
    border-radius: 3px;
    overflow: hidden;
}
.intel-mini-fill-level {
    height: 100%;
    border-radius: 3px;
}
/* Region quick-zoom control */
.intel-region-control {
    background: rgba(5,6,10,0.88);
    border: 1px solid rgba(6,182,212,0.15);
    border-radius: 4px;
    padding: 3px;
    font-family: 'SF Mono','Fira Code',monospace;
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.intel-region-btn {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 3px;
    color: rgba(209,212,220,0.5);
    font-family: inherit;
    font-size: 0.46rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    padding: 3px 6px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s;
}
.intel-region-btn:hover { color: rgba(6,182,212,0.8); border-color: rgba(6,182,212,0.3); }
.intel-region-btn.active { color: #06b6d4; background: rgba(6,182,212,0.1); border-color: rgba(6,182,212,0.4); }
/* Country search control */
.intel-search-control {
    background: rgba(5,6,10,0.88);
    border: 1px solid rgba(6,182,212,0.15);
    border-radius: 4px;
    padding: 4px;
    font-family: 'SF Mono','Fira Code',monospace;
    backdrop-filter: blur(8px);
    min-width: 140px;
    position: relative;
}
.intel-search-input {
    width: 100%;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 3px;
    color: #e0e3ea;
    font-family: inherit;
    font-size: 0.52rem;
    padding: 3px 6px;
    outline: none;
    box-sizing: border-box;
}
.intel-search-input::placeholder { color: rgba(209,212,220,0.3); }
.intel-search-input:focus { border-color: rgba(6,182,212,0.4); }
.intel-search-results {
    position: absolute;
    left: 4px; right: 4px; top: 100%;
    background: rgba(5,6,10,0.95);
    border: 1px solid rgba(6,182,212,0.2);
    border-radius: 0 0 3px 3px;
    max-height: 160px;
    overflow-y: auto;
    z-index: 9999;
    display: none;
}
.intel-search-results.open { display: block; }
.intel-search-result {
    padding: 3px 6px;
    font-size: 0.52rem;
    color: rgba(209,212,220,0.7);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}
.intel-search-result:hover { background: rgba(6,182,212,0.1); color: #e0e3ea; }
/* Dim markers for non-FRED countries */
.intel-marker-dim {
    width: 4px; height: 4px;
    border-radius: 50%;
    background: rgba(209,212,220,0.25);
    border: 0.5px solid rgba(255,255,255,0.15);
}
.intel-flag-label-dim {
    font-size: 0.45rem;
    opacity: 0.4;
    pointer-events: none;
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}
/* Chokepoint markers */
.intel-chokepoint-marker {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: rgba(34,211,238,0.3);
    border: 1.5px solid rgba(34,211,238,0.6);
    box-shadow: 0 0 6px rgba(34,211,238,0.3);
    animation: intel-pulse 3s infinite;
}
.intel-chokepoint-marker.elevated {
    background: rgba(245,158,11,0.35);
    border-color: rgba(245,158,11,0.7);
    box-shadow: 0 0 8px rgba(245,158,11,0.4);
    animation: intel-pulse 2s infinite;
}
.intel-chokepoint-marker.high {
    background: rgba(239,68,68,0.4);
    border-color: rgba(239,68,68,0.8);
    box-shadow: 0 0 10px rgba(239,68,68,0.5);
    animation: intel-pulse-fast 1.5s infinite;
}
/* Regime border glow on map container */
.intel-map-bullish { box-shadow: inset 0 0 30px rgba(34,197,94,0.12), 0 0 15px rgba(34,197,94,0.08); border-color: rgba(34,197,94,0.25) !important; }
.intel-map-bearish { box-shadow: inset 0 0 30px rgba(239,68,68,0.12), 0 0 15px rgba(239,68,68,0.08); border-color: rgba(239,68,68,0.25) !important; }
.intel-map-neutral { box-shadow: inset 0 0 20px rgba(6,182,212,0.08), 0 0 10px rgba(6,182,212,0.05); border-color: rgba(6,182,212,0.15) !important; }
.intel-map-crisis {
    border-color: rgba(239,68,68,0.4) !important;
    animation: intel-crisis-pulse 2s ease-in-out infinite;
}
@keyframes intel-crisis-pulse {
    0%, 100% { box-shadow: inset 0 0 30px rgba(239,68,68,0.1), 0 0 15px rgba(239,68,68,0.06); }
    50% { box-shadow: inset 0 0 50px rgba(239,68,68,0.2), 0 0 25px rgba(239,68,68,0.12); }
}
/* Calendar event map icon */
.intel-event-map-icon {
    width: 16px; height: 16px;
    border-radius: 50%;
    background: #ef4444;
    color: #fff;
    font-size: 0.42rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid rgba(255,255,255,0.4);
    box-shadow: 0 0 6px rgba(239,68,68,0.5);
    font-family: 'SF Mono','Fira Code',monospace;
}
/* Fullscreen toggle */
.intel-fullscreen-btn {
    background: rgba(5,6,10,0.88);
    border: 1px solid rgba(6,182,212,0.15);
    border-radius: 4px;
    width: 26px; height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: rgba(209,212,220,0.5);
    font-size: 0.65rem;
    backdrop-filter: blur(8px);
    transition: all 0.15s;
}
.intel-fullscreen-btn:hover { color: #06b6d4; border-color: rgba(6,182,212,0.4); }
.intel-panel-fullscreen {
    position: fixed !important;
    top: 0 !important; left: 0 !important;
    width: 100vw !important; height: 100vh !important;
    z-index: 99998 !important;
    border-radius: 0 !important;
    max-height: none !important;
}
.intel-panel-fullscreen .intel-map-wrap { min-height: calc(100vh - 80px) !important; }
/* Dense data table (macro) */
.intel-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'SF Mono','Fira Code','Cascadia Code',monospace;
    font-size: 0.62rem;
}
.intel-table th {
    text-align: left;
    font-size: 0.5rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(6,182,212,0.5);
    padding: 0.25rem 0.35rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    position: sticky;
    top: 0;
    background: var(--console-bg);
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
}
.intel-table th:hover { color: var(--console-accent); }
.intel-table td {
    padding: 0.22rem 0.35rem;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    white-space: nowrap;
    color: #e0e3ea;
}
.intel-table tr:hover td { background: rgba(255,255,255,0.03); }
.intel-table tr.active-row td { background: rgba(6,182,212,0.06); border-color: rgba(6,182,212,0.15); }
.intel-table .td-country {
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}
.intel-table .td-val { text-align: right; }
.intel-table .td-change { text-align: right; font-weight: 700; font-size: 0.58rem; }
.intel-table .td-health {
    text-align: center;
    font-size: 0.5rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
/* Markets grid */
.intel-market-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.3rem;
    margin-bottom: 0.3rem;
}
.intel-market-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem 0.4rem;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.04);
    border-radius: 3px;
    font-family: 'SF Mono','Fira Code','Cascadia Code',monospace;
    font-size: 0.64rem;
}
.intel-market-row:hover { border-color: rgba(255,255,255,0.12); background: rgba(255,255,255,0.04); }
.intel-market-name { color: rgba(6,182,212,0.7); font-weight: 600; font-size: 0.58rem; }
.intel-market-val { color: #e0e3ea; font-weight: 600; }
.intel-market-chg { font-size: 0.56rem; font-weight: 700; margin-left: 0.3rem; }
/* Heatmap circles (GDP size) */
.intel-heat-circle {
    border-radius: 50%;
    opacity: 0.12;
    pointer-events: none;
}
/* Global summary bar */
.intel-summary-bar {
    display: flex;
    align-items: stretch;
    gap: 0;
    background: rgba(255,255,255,0.02);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    font-family: 'SF Mono','Fira Code','Cascadia Code',monospace;
    font-size: 0.6rem;
    min-height: 22px;
    overflow-x: auto;
    scrollbar-width: none;
}
.intel-summary-bar::-webkit-scrollbar { display: none; }
.intel-summary-item {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.15rem 0.5rem;
    border-right: 1px solid rgba(255,255,255,0.04);
    white-space: nowrap;
    flex-shrink: 0;
}
.intel-summary-label { color: rgba(6,182,212,0.45); font-size: 0.5rem; font-weight: 700; letter-spacing: 0.06em; }
.intel-summary-val { color: #e0e3ea; font-weight: 600; }
/* Auto-scroll ticker animation */
@keyframes ticker-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}
.intel-ticker-strip.auto-scroll .intel-ticker-inner,
.console-ticker-strip.auto-scroll .intel-ticker-inner {
    display: flex;
    animation: ticker-scroll 60s linear infinite;
    width: max-content;
}
.intel-ticker-strip.auto-scroll .intel-ticker-inner:hover,
.console-ticker-strip.auto-scroll .intel-ticker-inner:hover { animation-play-state: paused; }
/* Rate comparison bar chart */
.intel-rate-chart {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    margin: 0.3rem 0;
    padding: 0.3rem 0.3rem;
    border: 1px solid rgba(255,255,255,0.04);
    border-radius: 4px;
    background: rgba(255,255,255,0.01);
}
.intel-rate-row {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-family: 'SF Mono','Fira Code','Cascadia Code',monospace;
    font-size: 0.58rem;
    height: 16px;
}
.intel-rate-label {
    width: 28px;
    color: rgba(209,212,220,0.5);
    font-weight: 700;
    text-align: right;
    flex-shrink: 0;
}
.intel-rate-bar-wrap {
    flex: 1;
    height: 10px;
    background: rgba(255,255,255,0.03);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}
.intel-rate-bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.6s ease;
    min-width: 2px;
}
.intel-rate-val {
    width: 42px;
    text-align: right;
    color: #e0e3ea;
    font-weight: 600;
    flex-shrink: 0;
}
/* Country flag emoji */
.intel-flag { font-size: 0.72rem; margin-right: 0.1rem; }
/* Inflation heat color coding */
.intel-heat-low { color: var(--console-positive) !important; }
.intel-heat-mid { color: #f59e0b !important; }
.intel-heat-high { color: var(--console-negative) !important; }
.intel-heat-extreme { color: #ff1a1a !important; text-shadow: 0 0 4px rgba(255,26,26,0.4); }
/* Currency strength meter */
.intel-strength-meter {
    display: flex;
    gap: 0.15rem;
    margin: 0.3rem 0;
}
.intel-strength-bar {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1rem;
    padding: 0.25rem 0.2rem;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.04);
    border-radius: 3px;
    font-family: 'SF Mono','Fira Code','Cascadia Code',monospace;
    font-size: 0.52rem;
    cursor: pointer;
    transition: all 0.15s;
}
.intel-strength-bar:hover { border-color: rgba(255,255,255,0.15); background: rgba(255,255,255,0.04); }
.intel-strength-name { color: rgba(6,182,212,0.6); font-weight: 700; }
.intel-strength-val { font-weight: 700; font-size: 0.62rem; }
.intel-strength-chg { font-size: 0.48rem; font-weight: 600; }
/* Sortable column indicator */
.intel-table th.sorted-asc::after { content: ' \u25B2'; font-size: 0.42rem; }
.intel-table th.sorted-desc::after { content: ' \u25BC'; font-size: 0.42rem; }
/* GDP rank badge */
.intel-gdp-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px; height: 14px;
    border-radius: 2px;
    font-size: 0.44rem;
    font-weight: 700;
    background: rgba(6,182,212,0.12);
    color: var(--console-accent);
    margin-right: 0.15rem;
    flex-shrink: 0;
}
/* Correlation matrix cell */
.intel-corr-cell {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.48rem; font-weight: 700;
    font-family: 'SF Mono','Fira Code','Cascadia Code',monospace;
    border-radius: 2px;
}
/* Map country label */
.intel-country-label {
    font-family: 'SF Mono','Fira Code',monospace;
    font-size: 7px;
    font-weight: 700;
    color: rgba(209,212,220,0.4);
    white-space: nowrap;
    text-shadow: 1px 1px 3px #000, -1px -1px 3px #000;
    pointer-events: none;
}
/* Pulse badge for live data */
@keyframes live-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}
.intel-live-dot {
    width: 5px; height: 5px;
    border-radius: 50%;
    background: var(--console-positive);
    display: inline-block;
    animation: live-pulse 2s ease infinite;
    margin-right: 0.2rem;
}
/* Status bar at top */
.intel-status-bar {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.12rem 0.5rem;
    background: rgba(255,255,255,0.02);
    border-bottom: 1px solid rgba(255,255,255,0.04);
    font-family: 'SF Mono','Fira Code','Cascadia Code',monospace;
    font-size: 0.5rem;
    color: rgba(209,212,220,0.35);
}

/* Chat sidebar */
.chat-header {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--tv-border);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--tv-text);
}
.chat-header .chat-dot {
    width: 8px; height: 8px;
    background: var(--tv-green);
    border-radius: 50%;
}
.chat-history-panel {
    border-bottom: 1px solid var(--tv-border);
    background: rgba(0,0,0,0.2);
}
.chat-history-item {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    transition: background 0.15s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.chat-history-item:hover { background: rgba(255,255,255,0.05); }
.chat-history-item.active { background: rgba(6,182,212,0.1); border-left: 2px solid var(--tv-cyan); }
.chat-history-item .hist-title { font-size: 0.72rem; color: var(--tv-text); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-history-item .hist-meta { font-size: 0.6rem; color: rgba(209,212,220,0.4); white-space: nowrap; }
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}
.chat-bubble {
    max-width: 95%;
    padding: 0.55rem 0.75rem;
    border-radius: var(--tg-radius-card, 8px);
    font-size: 0.82rem;
    line-height: 1.45;
    word-wrap: break-word;
    overflow-wrap: break-word;
}
.chat-bubble.user {
    align-self: flex-end;
    background: rgba(41,98,255,0.2);
    border: 1px solid rgba(41,98,255,0.3);
    color: #c4d6ff;
    border-bottom-right-radius: 4px;
}
.chat-bubble.ai {
    align-self: flex-start;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    color: var(--tv-text);
    border-bottom-left-radius: 4px;
}
.chat-bubble.ai h1, .chat-bubble.ai h2, .chat-bubble.ai h3, .chat-bubble.ai h4 {
    font-size: 0.9rem;
    font-weight: 700;
    margin: 0.5rem 0 0.25rem 0;
    color: #e2e5ea;
}
.chat-bubble.ai h1:first-child, .chat-bubble.ai h2:first-child, .chat-bubble.ai h3:first-child {
    margin-top: 0;
}
.chat-bubble.ai ul, .chat-bubble.ai ol {
    padding-left: 1.2rem;
    margin: 0.3rem 0;
}
.chat-bubble.ai li { margin-bottom: 0.15rem; }
.chat-bubble.ai code {
    background: rgba(255,255,255,0.08);
    padding: 0.1rem 0.3rem;
    border-radius: 4px;
    font-size: 0.78rem;
}
.chat-bubble.ai pre {
    background: rgba(0,0,0,0.3);
    padding: 0.5rem;
    border-radius: 6px;
    overflow-x: auto;
    margin: 0.4rem 0;
}
.chat-bubble.ai pre code {
    background: none;
    padding: 0;
}
.chat-bubble.ai strong { color: #eee; }
.chat-bubble.ai table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.4rem 0;
    font-size: 0.78rem;
}
.chat-bubble.ai th, .chat-bubble.ai td {
    border: 1px solid rgba(255,255,255,0.1);
    padding: 0.25rem 0.4rem;
    text-align: left;
}
.chat-bubble.ai th {
    background: rgba(255,255,255,0.05);
    font-weight: 600;
}
/* Typing indicator (bouncing dots) */
.typing-indicator { display:inline-flex; align-items:center; gap:4px; padding:2px 0; }
.typing-indicator span {
    width:6px; height:6px; border-radius:50%;
    background:rgba(209,212,220,0.5);
    animation: typingBounce 1.2s ease-in-out infinite;
}
.typing-indicator span:nth-child(2) { animation-delay:0.15s; }
.typing-indicator span:nth-child(3) { animation-delay:0.3s; }
@keyframes typingBounce {
    0%,60%,100% { transform:translateY(0); opacity:0.4; }
    30% { transform:translateY(-5px); opacity:1; }
}

.chat-quick-actions {
    display: flex;
    gap: 0.35rem;
    padding: 0.5rem 0.75rem;
    flex-wrap: wrap;
    border-top: 1px solid var(--tv-border);
}
.quick-btn {
    padding: 0.35rem 0.7rem;
    border-radius: 8px;
    border: 1px solid rgba(6,182,212,0.15);
    background: rgba(6,182,212,0.06);
    color: rgba(209,212,220,0.8);
    font-size: 0.7rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}
.quick-btn:hover {
    background: rgba(6,182,212,0.15);
    border-color: rgba(6,182,212,0.35);
    color: #22d3ee;
}

.chat-input-area {
    display: flex;
    gap: 0.4rem;
    padding: 0.5rem 0.75rem;
    border-top: 1px solid var(--tv-border);
    position: relative;
}
.chat-input-area textarea {
    flex: 1;
    resize: none;
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--tv-border);
    color: var(--tv-text);
    padding: 0.45rem 0.6rem;
    border-radius: 8px;
    font-size: 0.82rem;
    font-family: inherit;
    outline: none;
    min-height: 38px;
    max-height: 120px;
}
.chat-input-area textarea:focus {
    border-color: var(--tv-blue);
}
.chat-input-area textarea::placeholder {
    color: rgba(209,212,220,0.35);
}
.chat-send-btn {
    background: var(--tv-blue);
    border: none;
    color: #fff;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s;
    flex-shrink: 0;
}
.chat-send-btn:hover { opacity: 0.85; }
.chat-send-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.chat-send-btn svg { width: 18px; height: 18px; }

.chat-context-bar {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 6px 8px;
    border-top: 1px solid rgba(255,255,255,0.06);
    background: rgba(15,18,28,0.55);
}
.ctx-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.58rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(209,212,220,0.45);
}
.ctx-cost {
    font-size: 0.6rem;
    font-weight: 700;
    color: rgba(168,85,247,0.9);
    background: rgba(168,85,247,0.12);
    border-radius: 8px;
    padding: 1px 6px;
}
.ctx-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    max-height: 54px;
    overflow-y: auto;
}
.ctx-chip {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 7px;
    border-radius: var(--tg-radius-card, 8px);
    font-size: 0.6rem;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    user-select: none;
    line-height: 1.4;
}
.ctx-chip.active {
    background: rgba(168,85,247,0.18);
    border: 1px solid rgba(168,85,247,0.45);
    color: rgba(220,200,255,0.95);
}
.ctx-chip.inactive {
    background: transparent;
    border: 1px dashed rgba(255,255,255,0.12);
    color: rgba(209,212,220,0.35);
}
.ctx-chip:hover {
    filter: brightness(1.25);
}
.ctx-chip .ctx-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    flex-shrink: 0;
}
.ctx-chip.active .ctx-dot {
    background: rgba(168,85,247,0.9);
}
.ctx-chip.inactive .ctx-dot {
    border: 1px solid rgba(255,255,255,0.2);
}

/* ===== Mobile Context Dropdown ===== */
.ctx-mobile-trigger {
    display: none;
    align-items: center;
    gap: 5px;
    width: 100%;
    padding: 5px 8px;
    background: rgba(168,85,247,0.08);
    border: 1px solid rgba(168,85,247,0.2);
    border-radius: 8px;
    color: rgba(220,200,255,0.85);
    font-size: 0.62rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}
.ctx-mobile-trigger:active { background: rgba(168,85,247,0.15); }
.ctx-mobile-trigger .ctx-trigger-count {
    background: rgba(168,85,247,0.3);
    color: rgba(220,200,255,0.95);
    border-radius: 6px;
    padding: 0 5px;
    font-size: 0.58rem;
    min-width: 16px;
    text-align: center;
    line-height: 1.5;
}
.ctx-mobile-trigger .ctx-trigger-chevron {
    margin-left: auto;
    font-size: 0.5rem;
    opacity: 0.5;
    transition: transform 0.2s ease;
}
.ctx-mobile-trigger.open .ctx-trigger-chevron { transform: rotate(180deg); }

.ctx-mobile-dropdown {
    display: none;
    flex-direction: column;
    gap: 2px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
}
.ctx-mobile-dropdown.open {
    display: flex;
    max-height: 320px;
    overflow-y: auto;
}
.ctx-mobile-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    border-radius: 6px;
    font-size: 0.62rem;
    cursor: pointer;
    transition: all 0.12s ease;
    user-select: none;
}
.ctx-mobile-item.active {
    background: rgba(168,85,247,0.12);
    color: rgba(220,200,255,0.95);
}
.ctx-mobile-item.inactive {
    background: transparent;
    color: rgba(209,212,220,0.35);
}
.ctx-mobile-item:active { background: rgba(168,85,247,0.2); }
.ctx-mobile-item .ctx-m-icon {
    width: 18px;
    text-align: center;
    font-size: 0.58rem;
    flex-shrink: 0;
}
.ctx-mobile-item .ctx-m-label { flex: 1; }
.ctx-mobile-item .ctx-m-check {
    font-size: 0.55rem;
    opacity: 0;
    color: rgba(168,85,247,0.9);
    transition: opacity 0.12s ease;
}
.ctx-mobile-item.active .ctx-m-check { opacity: 1; }

@media (max-width: 768px) {
    .ctx-mobile-trigger { display: flex; }
    .ctx-chips { display: none !important; }
}

.chat-limit-banner {
    padding: 0.5rem 0.75rem;
    background: rgba(168,85,247,0.12);
    border-top: 1px solid rgba(168,85,247,0.25);
    color: rgba(196,140,255,0.95);
    font-size: 0.75rem;
    text-align: center;
}

/* Drawing active cursor */
body.drawing-active .panel-chart { cursor: crosshair; }

/* Overlay canvas */
.tv-native-overlay { position: absolute; inset: 0; z-index: 6; pointer-events: none; cursor: crosshair; }

.ohlc-overlay {
    position: absolute;
    top: 8px;
    right: 10px;
    z-index: 4;
    font-size: 0.72rem;
    color: rgba(209,212,220,0.65);
    pointer-events: none;
    display: flex;
    gap: 0.6rem;
}
.ohlc-overlay span { white-space: nowrap; }
.ohlc-overlay .up { color: var(--tv-green); }
.ohlc-overlay .down { color: var(--tv-red); }

/* ===== PANEL TOGGLE BAR ===== */
.panel-toggle-wrap {
    display: flex;
    align-items: center;
    flex-shrink: 1;
    min-width: 0;
    max-width: 100%;
    gap: 0;
}
.panel-toggle-bar {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    overflow-x: auto;
    scrollbar-width: none;
    flex-shrink: 1;
    min-width: 0;
    padding: 0 0.15rem;
    scroll-behavior: smooth;
}
.panel-toggle-bar::-webkit-scrollbar { display: none; }
.panel-toggle-arrow {
    -webkit-appearance: none;
    appearance: none;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(6,182,212,0.1);
    color: #06b6d4;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    user-select: none;
    border: 1px solid rgba(6,182,212,0.25);
    border-radius: 4px;
    outline: none;
    padding: 0;
    margin: 0;
    transition: background 0.15s, color 0.15s, opacity 0.2s;
}
.panel-toggle-arrow:hover { background: rgba(6,182,212,0.25); color: #06b6d4; }
.panel-toggle-arrow:active { background: rgba(6,182,212,0.4); color: #fff; }
.panel-toggle-arrow.hidden { opacity: 0; pointer-events: none; }
.panel-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.22rem 0.55rem;
    border-radius: var(--tg-radius-pill, 999px);
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.04);
    color: rgba(209,212,220,0.6);
    font-size: 0.68rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
    letter-spacing: 0.02em;
}
.panel-chip:hover {
    background: rgba(6,182,212,0.08);
    border-color: rgba(6,182,212,0.25);
    color: rgba(209,212,220,0.85);
}
.panel-chip.active {
    background: rgba(6,182,212,0.15);
    border-color: rgba(6,182,212,0.5);
    color: #06b6d4;
    box-shadow: 0 0 12px rgba(6,182,212,0.15);
}
.panel-chip i { font-size: 0.6rem; }
.panel-cat-divider {
    font-size: 0.55rem;
    font-weight: 700;
    color: rgba(209,212,220,0.3);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.15rem 0.25rem 0.15rem 0.5rem;
    white-space: nowrap;
    flex-shrink: 0;
    user-select: none;
    border-left: 2px solid rgba(6,182,212,0.2);
}
.panel-cat-divider:first-child { border-left: none; padding-left: 0; }
.mobile-only-chip { display: none; }
.mobile-panel-trigger { display: none; }
.mobile-panel-dropdown { display: none; }
.mobile-panel-dropdown.hidden { display: none !important; }
.console-mobile-tabbar { display: none; }

/* Chat toggle button */
.chat-toggle-btn {
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--tv-border);
    color: var(--tv-text);
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
    flex-shrink: 0;
}
.chat-toggle-btn:hover {
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.2);
}
.chat-toggle-btn.active {
    background: rgba(6,182,212,0.15);
    border-color: rgba(6,182,212,0.4);
    color: #06b6d4;
}

/* ===== GLOBAL TICKER STRIP ===== */
.console-ticker-strip {
    display: flex;
    align-items: center;
    gap: 0;
    background: rgba(255,255,255,0.02);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    overflow-x: auto;
    scrollbar-width: none;
    font-family: 'SF Mono','Fira Code','Cascadia Code',monospace;
    font-size: 0.68rem;
    min-height: 28px;
}
.console-ticker-strip::-webkit-scrollbar { display: none; }
.console-ticker-strip.hidden { display: none; }

/* ===== PANEL GRID ===== */
.panel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--panel-min-width)), 1fr));
    gap: var(--panel-gap);
    padding: var(--panel-padding);
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
    align-content: start;
    grid-auto-rows: minmax(var(--panel-row-min-height), auto);
    position: relative;
}
.panel-grid.panel-grid-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.2rem;
}

.console-empty-state {
    width: min(760px, 100%);
}
.console-empty-state.hidden { display: none !important; }
.empty-state-card {
    padding: 1.4rem;
    border-radius: var(--tg-radius-card, 8px);
    border: 1px solid rgba(255,255,255,0.08);
    background:
        radial-gradient(circle at top left, rgba(6,182,212,0.12), transparent 40%),
        radial-gradient(circle at top right, rgba(168,85,247,0.12), transparent 35%),
        rgba(255,255,255,0.035);
    box-shadow: 0 18px 50px rgba(0,0,0,0.22);
}
.empty-state-eyebrow {
    font-size: 0.62rem;
    color: rgba(103,232,249,0.8);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    font-weight: 700;
    margin-bottom: 0.5rem;
}
.empty-state-title {
    font-size: 1.55rem;
    line-height: 1.1;
    color: #f8fafc;
    font-weight: 700;
    margin-bottom: 0.45rem;
}
.empty-state-copy {
    max-width: 560px;
    color: rgba(209,212,220,0.68);
    font-size: 0.8rem;
    line-height: 1.6;
}
.empty-action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-top: 1rem;
}
.empty-action-btn.primary {
    background: linear-gradient(135deg, rgba(6,182,212,0.22), rgba(168,85,247,0.16));
    border-color: rgba(6,182,212,0.28);
    color: #ecfeff;
}
.empty-state-tip {
    margin-top: 0.85rem;
    font-size: 0.7rem;
    color: rgba(209,212,220,0.46);
}

/* ===== CONSOLE PANEL (glass card) ===== */
.console-panel {
    background: var(--panel-bg);
    backdrop-filter: var(--panel-blur);
    -webkit-backdrop-filter: var(--panel-blur);
    border: 1px solid var(--panel-border);
    border-radius: var(--panel-radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: panelSlideIn 0.25s ease-out;
    /* GPU layer promotion for smooth drag/scroll */
    will-change: transform;
}
.console-panel:not(.panel-chart):not(.panel-minimized):not(.panel-floating):not(.panel-maximized) {
    min-height: var(--panel-row-min-height);
}
/* Skip rendering for off-screen / scrolled-away panels */
.console-panel:not(.panel-floating):not(.panel-maximized):not(.panel-chart) {
    content-visibility: auto;
    contain-intrinsic-size: auto 300px;
}
@keyframes panelSlideIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.console-panel.panel-wide {
    grid-column: span 2;
}
.panel-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.65rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    background: rgba(255,255,255,0.02);
    flex-shrink: 0;
}
.panel-header-title {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--console-accent);
    letter-spacing: 0.02em;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}
.panel-header-title i { font-size: 0.6rem; }
.panel-controls { margin-left: auto; display: flex; gap: 3px; }
.panel-ctrl-btn {
    background: none;
    border: 1px solid rgba(255,255,255,0.08);
    color: rgba(209,212,220,0.5);
    width: 22px; height: 22px;
    border-radius: 6px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.5rem; transition: all 0.15s;
}
.panel-ctrl-btn:hover {
    background: rgba(6,182,212,0.15);
    border-color: rgba(6,182,212,0.3);
    color: var(--console-accent);
}
.panel-close-btn {
    background: none;
    border: 1px solid rgba(255,255,255,0.08);
    color: rgba(209,212,220,0.5);
    width: 22px;
    height: 22px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    transition: all 0.15s;
}
.panel-close-btn:hover {
    background: rgba(239,68,68,0.15);
    border-color: rgba(239,68,68,0.3);
    color: #EF4444;
}

/* Panel minimize */
.console-panel.panel-minimized .panel-body { display: none; }
.console-panel.panel-minimized { max-height: none; min-height: 0; }

/* Panel maximize — panel is moved to body, so position:fixed works cleanly */
.console-panel.panel-maximized {
    position: fixed !important;
    inset: 65px 12px 12px 12px;
    z-index: 1001;
    max-height: none !important;
    width: auto !important; height: auto !important;
}

body.console-header-hidden .console-panel.panel-maximized {
    inset: 12px 12px 12px 12px;
}
.panel-maximize-backdrop {
    position: fixed; inset: 0; z-index: 1000;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* Panel floating (drag/resize) — panel is moved to body */
.console-panel.panel-floating {
    position: fixed !important;
    z-index: 1001;
    max-height: none !important;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    transition: none;
}
.panel-header.draggable { cursor: grab; }
.panel-header.dragging { cursor: grabbing; }

/* Resize handles — 8 edges/corners, Windows-style */
.panel-resize-handle {
    position: absolute; z-index: 2;
}
.panel-resize-handle.rh-n  { top: -3px; left: 6px; right: 6px; height: 6px; cursor: n-resize; }
.panel-resize-handle.rh-s  { bottom: -3px; left: 6px; right: 6px; height: 6px; cursor: s-resize; }
.panel-resize-handle.rh-e  { right: -3px; top: 6px; bottom: 6px; width: 6px; cursor: e-resize; }
.panel-resize-handle.rh-w  { left: -3px; top: 6px; bottom: 6px; width: 6px; cursor: w-resize; }
.panel-resize-handle.rh-nw { top: -4px; left: -4px; width: 10px; height: 10px; cursor: nw-resize; }
.panel-resize-handle.rh-ne { top: -4px; right: -4px; width: 10px; height: 10px; cursor: ne-resize; }
.panel-resize-handle.rh-sw { bottom: -4px; left: -4px; width: 10px; height: 10px; cursor: sw-resize; }
.panel-resize-handle.rh-se { bottom: -4px; right: -4px; width: 10px; height: 10px; cursor: se-resize; }
/* Only show resize handles on floating/maximized panels (except chart panel) */
.console-panel:not(.panel-floating):not(.panel-maximized):not(.panel-chart) .panel-resize-handle { display: none; }
/* Chart panel in grid: show s, se, sw handles for height resize */
.panel-chart:not(.panel-floating):not(.panel-maximized) .panel-resize-handle.rh-n,
.panel-chart:not(.panel-floating):not(.panel-maximized) .panel-resize-handle.rh-e,
.panel-chart:not(.panel-floating):not(.panel-maximized) .panel-resize-handle.rh-w,
.panel-chart:not(.panel-floating):not(.panel-maximized) .panel-resize-handle.rh-nw,
.panel-chart:not(.panel-floating):not(.panel-maximized) .panel-resize-handle.rh-ne { display: none; }
.panel-chart:not(.panel-floating):not(.panel-maximized) .panel-resize-handle.rh-s  { display: block; height: 8px; bottom: -4px; cursor: s-resize; }
.panel-chart:not(.panel-floating):not(.panel-maximized) .panel-resize-handle.rh-se { display: block; width: 14px; height: 14px; bottom: -4px; right: -4px; cursor: se-resize; }
.panel-chart:not(.panel-floating):not(.panel-maximized) .panel-resize-handle.rh-sw { display: block; width: 14px; height: 14px; bottom: -4px; left: -4px; cursor: sw-resize; }
.panel-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    min-height: 0;
}

/* Chat sidebar hidden */
.console-chat.chat-hidden {
    display: none !important;
}

/* Mobile chat toggle */
.mobile-chat-toggle {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--tv-blue);
    color: #fff;
    border: none;
    z-index: 50;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0,0,0,0.4);
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

/* Mobile responsive */
@media (max-width: 768px) {
    :root {
        --nav-height: 56px;
        --console-status-height: 0px;
        --panel-gap: 0;
        --panel-padding: 0;
    }
    .grid-row-resizer { display: none; }
    .console-status-bar { display: none; }
    .console-chat-resizer { display: none !important; }

    .console-viewport {
        flex-direction: column;
        position: relative;
        height: calc(100vh - var(--nav-height));
        height: calc(100dvh - var(--nav-height) - env(safe-area-inset-bottom, 0px));
        min-height: calc(100vh - var(--nav-height));
        min-height: calc(100dvh - var(--nav-height) - env(safe-area-inset-bottom, 0px));
    }
    .console-left {
        min-height: 0;
        flex: 1;
    }
    .console-chart-wrap {
        flex: 1;
        min-height: 0;
    }
    .console-panel.panel-chart { min-height: 0; flex: 1; }
    .chart-panel-controls input[type="text"] { width: 72px; font-size: 0.72rem; }
    .chart-panel-controls select { font-size: 0.72rem; }
    .console-pane1 {
        min-height: 96px;
        flex-basis: 35%;
    }
    .console-pane2 {
        min-height: 88px;
        flex-basis: 28%;
    }
    .console-panel-resizer {
        flex-basis: 12px;
        height: 12px;
    }
    .console-chat {
        width: 100%;
        min-width: 100%;
        max-width: 100%;
        border-left: none;
        border-top: none;
        position: absolute;
        inset: 0;
        z-index: 50;
        height: 100%;
        max-height: none;
        min-height: 0;
        display: none;
    }
    .console-chat.mobile-open {
        display: flex;
        padding-top: 0;
        padding-bottom: 70px; /* Space for mobile bottom nav bar */
        box-sizing: border-box;
        overflow: hidden;
    }
    .console-chat.mobile-open .chat-header,
    .console-chat.mobile-open .chat-quick-actions,
    .console-chat.mobile-open .chat-input-area {
        flex-shrink: 0;
    }
    .console-chat.mobile-open .chat-header {
        min-height: 44px;
    }
    .console-chat.mobile-open .chat-messages {
        min-height: 0;
    }
    .console-chat.mobile-open .chat-quick-actions {
        max-height: 112px;
        overflow-y: auto;
    }
    /* Back button overlaid on chat in mobile */
    .mobile-chat-back {
        display: flex !important;
        position: absolute;
        top: 0; left: 0; right: 0;
        z-index: 60;
        height: 36px;
        align-items: center;
        padding: 0 0.5rem;
        background: rgba(19,23,34,0.97);
        border-bottom: 1px solid rgba(6,182,212,0.15);
        gap: 0.4rem;
    }
    .mobile-chat-back button {
        display: flex; align-items: center; gap: 0.3rem;
        background: rgba(6,182,212,0.1); border: 1px solid rgba(6,182,212,0.3);
        color: #06b6d4; border-radius: 6px; padding: 0.2rem 0.6rem;
        font-size: 0.68rem; font-weight: 600; cursor: pointer;
        font-family: 'SF Mono','Fira Code',monospace;
    }
    .mobile-chat-back button:active { background: rgba(6,182,212,0.25); }
    .metrics-panel {
        max-height: none;
        grid-template-columns: 1fr;
    }
    .metrics-panel.collapsed {
        max-height: 0 !important;
    }
    .metrics-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
    .metrics-news {
        border-left: none;
        border-top: 1px solid rgba(255,255,255,0.06);
        max-height: 170px;
        padding: 0.42rem 0.6rem 0.45rem;
    }
    .metrics-news-list {
        max-height: 132px;
    }
    .indicator-legend {
        top: 50px;
        left: 10px;
        max-width: min(178px, calc(100% - 20px));
        max-height: 76px;
        overflow: auto;
        opacity: 0.92;
        padding: 0.28rem 0.32rem;
        border-radius: 8px;
    }
    .ind-tag {
        font-size: 0.64rem;
        padding: 0.1rem 0.38rem;
    }
    .orderbook-panel { max-height: none; }
    .orderbook-panel.collapsed { max-height: 0 !important; }
    .orderbook-content { font-size: 0.65rem; }
    .intel-panel { max-height: none; }
    .intel-panel.collapsed { max-height: 0 !important; }
    .intel-main { flex-direction: column; }
    .intel-map-wrap { flex: none; min-height: 160px; width: 100%; }
    .intel-detail-wrap { border-left: none; border-top: 1px solid rgba(255,255,255,0.06); max-height: none; }
    .intel-ticker-strip { display: none !important; }
    .intel-data-grid { grid-template-columns: 1fr; }
    .intel-event-row { grid-template-columns: 40px 28px 1fr 40px 40px; }
    .intel-event-previous { display: none; }
    #symbolInput { width: 100px; }
    .mobile-chat-toggle { display: none; }
    .tv-side-toolbar { display: flex; }
    .tv-draw-toolbar { display: none; }
    /* Panel grid mobile — tab mode (flex, not grid — only one panel visible at a time) */
    .panel-grid {
        display: flex;
        flex-direction: column;
        max-height: none;
        flex: 1;
        min-height: 0;
        overflow: hidden;
        padding: 0;
        gap: 0;
    }
    .console-panel { max-height: none; flex: 1; min-height: 0; }
    .console-panel .panel-header { padding: 0.15rem 0.5rem; }
    .console-panel .panel-body {
        flex: 1;
        min-height: 0;
        overflow: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }
    .console-panel.panel-chart .panel-body { overflow: hidden; }
    .console-chart-wrap { min-height: 0; }
    .console-main-chart { min-height: 0; }
    .console-panel .panel-controls { display: none; }
    .console-panel .panel-header.draggable { cursor: default; }
    .console-panel.panel-wide { grid-column: span 1; }
    .console-toolbar {
        position: relative;
        flex-wrap: wrap;
        gap: 0.3rem;
        padding: 0.3rem 0.5rem;
        flex-shrink: 0;
        min-height: 38px;
    }
    .console-empty-state {
        width: 100%;
    }
    .empty-state-card {
        padding: 1rem;
        border-radius: var(--tg-radius-card, 8px);
    }
    .empty-state-title {
        font-size: 1.2rem;
    }
    .empty-state-copy {
        font-size: 0.74rem;
    }
    .toolbar-spacer { display: none; }
    #intervalSelect { display: none; }
    .workspace-selector { display: none; }
    .desktop-only-control { display: none !important; }
    .live-price-badge {
        font-size: 0.78rem;
        padding: 0.15rem 0.45rem;
        flex-shrink: 1;
        min-width: 0;
    }
    .credit-badge {
        font-size: 0.6rem !important;
        padding: 0.12rem 0.35rem !important;
        flex-shrink: 1;
        min-width: 0;
    }
    .panel-toggle-wrap { display: none !important; }
    /* Hide chip bar and scroll arrows on mobile — use dropdown instead */
    .panel-toggle-bar,
    .panel-toggle-arrow { display: none !important; }
    /* Mobile panel trigger button */
    .mobile-panel-trigger {
        display: none !important;
        align-items: center; gap: 0.3rem;
        padding: 0.25rem 0.45rem; border-radius: 8px;
        border: 1px solid rgba(6,182,212,0.3);
        background: rgba(6,182,212,0.1); color: #06b6d4;
        font-size: 0.68rem; font-weight: 600; cursor: pointer;
        white-space: nowrap; transition: all 0.2s;
    }
    .mobile-panel-trigger[aria-expanded="true"] {
        background: rgba(6,182,212,0.2); border-color: rgba(6,182,212,0.5);
    }
    .mobile-panel-chevron {
        font-size: 0.55rem; transition: transform 0.2s; opacity: 0.7;
    }
    .mobile-panel-trigger[aria-expanded="true"] .mobile-panel-chevron {
        transform: rotate(180deg);
    }
    /* Dropdown panel */
    .mobile-panel-dropdown {
        display: block; position: fixed;
        top: auto; left: 0; right: 0; bottom: calc(60px + env(safe-area-inset-bottom, 0px)); z-index: 10000;
        background: rgba(19,23,34,0.96);
        border: 1px solid rgba(255,255,255,0.1);
        border-bottom: none;
        border-radius: var(--tg-radius-card, 8px) var(--tg-radius-card, 8px) 0 0;
        box-shadow: 0 -16px 42px rgba(0,0,0,0.55);
        backdrop-filter: blur(12px);
        padding: 0.65rem;
        max-height: 58vh;
        overflow-y: auto; overscroll-behavior: contain;
        animation: mobileDropdownSlideIn 0.18s ease-out;
        -webkit-mask-image: linear-gradient(to bottom, #000 85%, transparent 100%);
        mask-image: linear-gradient(to bottom, #000 85%, transparent 100%);
    }
    @keyframes mobileDropdownSlideIn {
        from { opacity: 0; transform: translateY(12px); }
        to   { opacity: 1; transform: translateY(0); }
    }
    .mobile-panel-dropdown-grid {
        display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.4rem;
    }
    .mobile-panel-dropdown-item {
        display: flex; flex-direction: column;
        align-items: center; justify-content: center;
        gap: 0.25rem; padding: 0.5rem 0.25rem;
        border-radius: 8px; border: 1px solid transparent;
        background: rgba(255,255,255,0.03);
        color: rgba(209,212,220,0.65);
        font-size: 0.62rem; font-weight: 600;
        cursor: pointer; min-height: 54px;
        transition: all 0.15s; text-align: center;
        line-height: 1.15;
    }
    .mobile-panel-dropdown-item i { font-size: 0.85rem; }
    .mobile-panel-dropdown-item:active {
        background: rgba(6,182,212,0.15);
    }
    .mobile-panel-dropdown-item.active {
        background: rgba(6,182,212,0.12);
        border-color: rgba(6,182,212,0.4);
        color: #06b6d4;
    }
    .chat-toggle-btn { display: none; }
    /* ===== Mobile Bottom Tab Bar ===== */
    .console-mobile-tabbar {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 9999;
        background: rgba(17,24,39,0.95);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border-top: 1px solid rgba(255,255,255,0.08);
        padding: 0.25rem 0;
        padding-bottom: env(safe-area-inset-bottom, 0);
    }
    .mobile-tab,
    .mobile-tab-btn {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2px;
        padding: 0.5rem 0;
        color: #9ca3af;
        font-size: 0.6rem;
        border: none;
        background: none;
        cursor: pointer;
        transition: color 0.15s;
        -webkit-tap-highlight-color: transparent;
    }
    .mobile-tab i,
    .mobile-tab-btn i { font-size: 1rem; }
    .mobile-tab.active,
    .mobile-tab-btn.active { color: #a78bfa; }
    .mobile-tab:active,
    .mobile-tab-btn:active { transform: scale(0.95); }
    /* Add bottom padding to panel grid so content isn't hidden behind tabbar */
    .panel-grid { padding-bottom: 70px !important; }
}

/* ===== Console Credits — Blur Overlay + Upgrade CTA ===== */
.credits-blur-overlay {
    position: absolute; inset: 0; z-index: 1200;
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    background: rgba(13,17,28,0.72);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 1rem; border-radius: inherit; pointer-events: auto;
}
.credits-lock-fixed {
    position: fixed !important;
    top: var(--nav-height, 72px) !important;
    left: 0 !important; right: 0 !important; bottom: 0 !important;
    z-index: 99999 !important;
    border-radius: 0 !important;
}
.credits-blur-overlay .credits-lock-icon {
    font-size: 2rem; color: rgba(168,85,247,0.7);
}
.credits-blur-overlay .credits-msg {
    color: rgba(209,212,220,0.85); font-size: 0.85rem; text-align: center; max-width: 260px; line-height: 1.4;
}
.credits-upgrade-btn {
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.55rem 1.4rem; border-radius: 8px; border: none; cursor: pointer;
    font-size: 0.82rem; font-weight: 700; letter-spacing: 0.03em;
    background: linear-gradient(135deg, #a855f7, #6366f1);
    color: #fff; transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 0 20px rgba(168,85,247,0.35);
}
.credits-upgrade-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 30px rgba(168,85,247,0.55);
}
/* Credit low-warning banner */
.credit-warning-banner {
    display: flex; align-items: center; gap: 0.5rem; padding: 0.35rem 0.8rem;
    background: rgba(245,158,11,0.08); border: 1px solid rgba(245,158,11,0.2);
    border-radius: 6px; font-size: 0.68rem; color: #f59e0b;
    position: relative; z-index: 100;
}
.credit-warning-banner .cw-dismiss {
    margin-left: auto; background: none; border: none; color: rgba(245,158,11,0.5);
    cursor: pointer; font-size: 0.75rem; padding: 0 0.2rem;
}
.credit-warning-banner .cw-dismiss:hover { color: #f59e0b; }
.credit-warning-banner a { color: #a855f7; font-weight: 700; text-decoration: none; }
.credit-warning-banner a:hover { text-decoration: underline; }
/* Per-panel credit lock overlay */
.panel-credit-lock {
    position: absolute; inset: 0; z-index: 50;
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    background: rgba(13,17,28,0.65);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 0.5rem; border-radius: inherit; pointer-events: auto;
}
.panel-credit-lock .pcl-icon { font-size: 1.1rem; color: rgba(168,85,247,0.6); }
.panel-credit-lock .pcl-msg { color: rgba(209,212,220,0.7); font-size: 0.62rem; text-align: center; max-width: 200px; line-height: 1.35; }
.panel-credit-lock .pcl-btn {
    display: inline-flex; align-items: center; gap: 0.3rem;
    padding: 0.3rem 0.9rem; border-radius: 6px; border: none; cursor: pointer;
    font-size: 0.62rem; font-weight: 700;
    background: linear-gradient(135deg, #a855f7, #6366f1); color: #fff;
    box-shadow: 0 0 12px rgba(168,85,247,0.25); transition: transform 0.15s;
}
.panel-credit-lock .pcl-btn:hover { transform: translateY(-1px); }
/* Credit badge in toolbar */
.credit-badge {
    display: inline-flex; align-items: center; gap: 0.35rem;
    font-size: 0.72rem; font-weight: 600; padding: 0.2rem 0.6rem;
    border-radius: 6px; background: rgba(255,255,255,0.06);
    border: 1px solid var(--tv-border); color: var(--tv-text);
    cursor: pointer; transition: all 0.2s; white-space: nowrap;
}
.credit-badge:hover { border-color: rgba(168,85,247,0.5); }
.credit-badge.credit-green { color: #06b6d4; border-color: rgba(34,211,238,0.3); }
.credit-badge.credit-yellow { color: #fbbf24; border-color: rgba(251,191,36,0.3); }
.credit-badge.credit-red { color: #f87171; border-color: rgba(248,113,113,0.3); }
.credit-badge .credit-upgrade-link {
    color: #a855f7; font-weight: 700; text-decoration: none; margin-left: 0.2rem;
}
.credit-badge .credit-upgrade-link:hover { text-decoration: underline; }

/* ===== STATUS BAR ===== */
.console-status-bar {
    position: fixed; bottom: 0; left: 0; right: 0; height: 24px; z-index: 999;
    background: #05060a; border-top: 1px solid rgba(34,211,238,0.15);
    display: flex; align-items: center; gap: 1rem; padding: 0 0.75rem;
    font-family: 'JetBrains Mono', 'Fira Code', monospace; font-size: 0.68rem; color: rgba(209,212,220,0.6);
}
.status-bar-item { display: flex; align-items: center; gap: 0.3rem; white-space: nowrap; }
.status-bar-item i { font-size: 0.6rem; }
#sbTime { color: #06b6d4; }
#sbMarket.mkt-open { color: #22c55e; font-weight: 600; }
#sbMarket.mkt-closed { color: #ef4444; }
#sbCredits { cursor: pointer; }
#sbCredits:hover { color: #a855f7; }
.status-bar-connection {
    width: 6px; height: 6px; border-radius: 50%; background: #22c55e; margin-left: 0.4rem;
    animation: sbPulse 2s infinite;
}
@keyframes sbPulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }

@media (max-width: 768px) {
    .console-status-bar { display: none !important; }
}

/* ===== WORKSPACE SELECTOR ===== */
.workspace-selector { position: relative; display: flex; align-items: center; }
.workspace-btn {
    display: flex; align-items: center; gap: 0.35rem; padding: 0.2rem 0.55rem;
    background: rgba(255,255,255,0.04); border: 1px solid var(--tv-border); border-radius: 6px;
    color: var(--tv-text); font-family: 'JetBrains Mono', monospace; font-size: 0.7rem;
    cursor: pointer; transition: all 0.2s; white-space: nowrap;
}
.workspace-btn:hover { border-color: rgba(34,211,238,0.4); background: rgba(34,211,238,0.06); }
.workspace-btn i { color: #06b6d4; font-size: 0.65rem; }
.workspace-dropdown {
    position: absolute; top: calc(100% + 4px); left: 0; min-width: 220px; z-index: 1001;
    background: rgba(12,14,20,0.97); border: 1px solid rgba(34,211,238,0.2); border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5); backdrop-filter: blur(16px);
    padding: 0.35rem 0; display: none;
}
.workspace-dropdown.open { display: block; }
.workspace-dropdown-label {
    font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.08em;
    color: rgba(209,212,220,0.4); padding: 0.4rem 0.7rem 0.2rem; font-weight: 600;
}
.workspace-item {
    display: flex; align-items: center; gap: 0.4rem; padding: 0.35rem 0.7rem;
    cursor: pointer; font-size: 0.72rem; color: var(--tv-text); transition: background 0.15s;
}
.workspace-item:hover { background: rgba(34,211,238,0.08); }
.workspace-item i { color: #06b6d4; font-size: 0.65rem; width: 14px; text-align: center; }
.workspace-item .ws-del {
    margin-left: auto; color: rgba(209,212,220,0.3); font-size: 0.6rem; cursor: pointer;
    opacity: 0; transition: opacity 0.15s;
}
.workspace-item:hover .ws-del { opacity: 1; }
.workspace-item .ws-del:hover { color: #ef4444; }
.workspace-save-row {
    display: flex; gap: 0.3rem; padding: 0.35rem 0.7rem; border-top: 1px solid rgba(255,255,255,0.06); margin-top: 0.2rem;
}
.workspace-save-input {
    flex: 1; background: rgba(255,255,255,0.05); border: 1px solid var(--tv-border); border-radius: 4px;
    color: var(--tv-text); font-size: 0.68rem; padding: 0.2rem 0.4rem;
    font-family: 'JetBrains Mono', monospace;
}
.workspace-save-input:focus { outline: none; border-color: rgba(34,211,238,0.4); }
.workspace-save-btn {
    background: rgba(34,211,238,0.15); border: 1px solid rgba(34,211,238,0.3); border-radius: 4px;
    color: #06b6d4; font-size: 0.65rem; padding: 0.2rem 0.5rem; cursor: pointer; white-space: nowrap;
}
.workspace-save-btn:hover { background: rgba(34,211,238,0.25); }

/* ===== COMMAND BAR ===== */
.command-bar-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
    z-index: 10000; display: none; align-items: flex-start; justify-content: center; padding-top: 18vh;
}
.command-bar-overlay.open { display: flex; }
.command-bar-container {
    width: 90%; max-width: 560px; background: rgba(12,14,20,0.98); border: 1px solid rgba(34,211,238,0.25);
    border-radius: var(--tg-radius-card, 8px); box-shadow: 0 16px 64px rgba(0,0,0,0.6); overflow: hidden;
}
.command-bar-input-wrap {
    display: flex; align-items: center; gap: 0.5rem; padding: 0.7rem 0.9rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.command-bar-input-wrap i { color: #06b6d4; font-size: 0.85rem; }
.command-bar-input {
    flex: 1; background: transparent; border: none; color: var(--tv-text);
    font-family: 'JetBrains Mono', monospace; font-size: 0.85rem; outline: none;
}
.command-bar-input::placeholder { color: rgba(209,212,220,0.3); }
.command-bar-results { max-height: 340px; overflow-y: auto; padding: 0.3rem 0; }
.command-bar-category {
    font-size: 0.58rem; text-transform: uppercase; letter-spacing: 0.1em;
    color: rgba(209,212,220,0.35); padding: 0.5rem 0.9rem 0.2rem; font-weight: 600;
}
.command-bar-item {
    display: flex; align-items: center; gap: 0.5rem; padding: 0.45rem 0.9rem;
    cursor: pointer; transition: background 0.12s; font-size: 0.78rem; color: var(--tv-text);
}
.command-bar-item:hover, .command-bar-item.selected { background: rgba(34,211,238,0.1); }
.command-bar-item i { color: rgba(34,211,238,0.6); font-size: 0.7rem; width: 18px; text-align: center; }
.command-bar-item .cb-title { font-weight: 500; }
.command-bar-item .cb-desc { color: rgba(209,212,220,0.4); font-size: 0.68rem; margin-left: auto; }
.command-bar-hint {
    font-size: 0.6rem; color: rgba(209,212,220,0.25); padding: 0.4rem 0.9rem;
    border-top: 1px solid rgba(255,255,255,0.04); text-align: center;
}

/* ===== KEYBOARD HELP ===== */
.keyboard-help-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
    z-index: 10001; display: none; align-items: flex-start; justify-content: center; padding-top: 12vh;
}
.keyboard-help-overlay.open { display: flex; }
.keyboard-help-container {
    width: 90%; max-width: 480px; background: rgba(12,14,20,0.98); border: 1px solid rgba(34,211,238,0.25);
    border-radius: var(--tg-radius-card, 8px); box-shadow: 0 16px 64px rgba(0,0,0,0.6); padding: 1.2rem 1.5rem;
}
.keyboard-help-title {
    font-size: 0.9rem; font-weight: 700; color: #06b6d4; margin-bottom: 0.8rem;
    font-family: 'JetBrains Mono', monospace;
}
.keyboard-help-section {
    font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.1em;
    color: rgba(209,212,220,0.4); margin: 0.7rem 0 0.3rem; font-weight: 600;
}
.keyboard-help-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.25rem 0; font-size: 0.75rem; color: var(--tv-text);
}
.keyboard-help-item kbd {
    background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.12);
    border-radius: 4px; padding: 0.1rem 0.4rem; font-family: 'JetBrains Mono', monospace;
    font-size: 0.68rem; color: #06b6d4; min-width: 22px; text-align: center;
}

/* ===== WATCHLIST PANEL ===== */
.watchlist-header {
    display: flex; align-items: center; justify-content: space-between; padding: 0 0 0.4rem;
    border-bottom: 1px solid rgba(255,255,255,0.06); margin-bottom: 0.4rem;
}
.watchlist-header .wl-title { font-size: 0.72rem; font-weight: 600; color: var(--tv-text); }
.watchlist-header .wl-manage {
    font-size: 0.62rem; color: #a855f7; text-decoration: none; cursor: pointer;
}
.watchlist-header .wl-manage:hover { text-decoration: underline; }
.watchlist-item {
    display: grid; grid-template-columns: 20px 1fr auto; align-items: center; gap: 0.4rem;
    padding: 0.3rem 0.2rem; cursor: pointer; border-radius: 4px; transition: background 0.12s;
    font-size: 0.72rem;
}
.watchlist-item:hover { background: rgba(255,255,255,0.04); }
.watchlist-item .wl-star { color: rgba(209,212,220,0.3); cursor: pointer; font-size: 0.65rem; }
.watchlist-item .wl-star.active { color: #fbbf24; }
.watchlist-item .wl-star:hover { color: #fbbf24; }
.watchlist-item .wl-sym { font-weight: 600; color: var(--tv-text); }
.watchlist-item .wl-name { font-size: 0.6rem; color: rgba(209,212,220,0.4); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.watchlist-item-right { text-align: right; }
.watchlist-item .wl-price { font-weight: 500; color: var(--tv-text); font-size: 0.72rem; }
.watchlist-item .wl-change {
    display: inline-block; font-size: 0.6rem; padding: 0.05rem 0.35rem; border-radius: 3px; font-weight: 600;
}
.watchlist-item .wl-change.pos { background: rgba(34,197,94,0.15); color: #22c55e; }
.watchlist-item .wl-change.neg { background: rgba(239,68,68,0.15); color: #ef4444; }
.watchlist-empty {
    text-align: center; padding: 1.5rem 0.5rem; color: rgba(209,212,220,0.35); font-size: 0.72rem;
}

/* ===== ALERTS PANEL ===== */
.alerts-header {
    display: flex; align-items: center; justify-content: space-between; padding: 0 0 0.4rem;
    border-bottom: 1px solid rgba(255,255,255,0.06); margin-bottom: 0.4rem;
}
.alerts-header .al-title { font-size: 0.72rem; font-weight: 600; color: var(--tv-text); }
.alerts-header .al-manage {
    font-size: 0.62rem; color: #a855f7; text-decoration: none; cursor: pointer;
}
.alerts-header .al-manage:hover { text-decoration: underline; }
.alert-item {
    display: flex; align-items: center; gap: 0.4rem; padding: 0.35rem 0.3rem;
    border-left: 2px solid rgba(34,211,238,0.4); margin-bottom: 0.3rem;
    border-radius: 0 4px 4px 0; font-size: 0.72rem; transition: background 0.12s;
}
.alert-item:hover { background: rgba(255,255,255,0.03); }
.alert-item.triggered { border-left-color: #22c55e; }
.alert-item i { font-size: 0.6rem; color: rgba(34,211,238,0.6); width: 14px; text-align: center; }
.alert-item.triggered i { color: #22c55e; }
.alert-item .al-sym { font-weight: 600; color: var(--tv-text); }
.alert-item .al-cond { color: rgba(209,212,220,0.5); font-size: 0.65rem; }
.alert-item .al-price { margin-left: auto; font-weight: 500; color: var(--tv-text); }
.alert-quick-create {
    display: flex; align-items: center; justify-content: center; gap: 0.4rem;
    border: 1px dashed rgba(255,255,255,0.1); border-radius: 6px; padding: 0.45rem;
    cursor: pointer; font-size: 0.68rem; color: rgba(209,212,220,0.4); margin-top: 0.4rem;
    transition: all 0.15s;
}
.alert-quick-create:hover { border-color: rgba(34,211,238,0.3); color: #06b6d4; background: rgba(34,211,238,0.04); }
.alerts-empty {
    text-align: center; padding: 1rem 0.5rem; color: rgba(209,212,220,0.35); font-size: 0.72rem;
}
.alert-section-label {
    font-size: 0.58rem; text-transform: uppercase; letter-spacing: 0.08em;
    color: rgba(209,212,220,0.35); margin: 0.5rem 0 0.2rem; font-weight: 600;
}

/* ===== BACKTEST PANEL ===== */
#panel-backtest .panel-body { padding: 0 !important; }
#panel-backtest:not(.panel-floating):not(.panel-maximized) {
    min-height: min(720px, calc(100dvh - var(--nav-height) - var(--console-status-height) - 72px));
}
.bt-lab-embed {
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: #0f172a;
}
.bt-lab-toolbar {
    min-height: 38px;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.35rem 0.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    background: rgba(7, 11, 19, 0.92);
}
.bt-lab-title {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: #cffafe;
    font-size: 0.68rem;
    font-weight: 700;
    white-space: nowrap;
}
.bt-lab-toolbar-spacer {
    flex: 1;
}
.bt-lab-action {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.045);
    color: rgba(209,212,220,0.7);
    cursor: pointer;
    transition: all 0.15s ease;
}
.bt-lab-action:hover {
    border-color: rgba(6,182,212,0.35);
    background: rgba(6,182,212,0.12);
    color: #67e8f9;
}
.bt-lab-frame {
    flex: 1 1 auto;
    width: 100%;
    min-height: 0;
    border: 0;
    background: #0f172a;
}
#panel-backtest.panel-floating .bt-lab-embed,
#panel-backtest.panel-maximized .bt-lab-embed {
    min-height: 0;
}
.bt-wrap { padding: 0.5rem; display: flex; flex-direction: column; gap: 0.45rem; }
.bt-toolbar {
    display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem;
    padding: 0.35rem 0.5rem; background: rgba(255,255,255,0.03);
    border-bottom: 1px solid var(--console-border); border-radius: 8px 8px 0 0;
}
.bt-toolbar select, .bt-toolbar input {
    background: rgba(255,255,255,0.06); border: 1px solid var(--console-border);
    color: var(--tv-text); border-radius: 5px; padding: 0.22rem 0.4rem;
    font-size: 0.68rem; outline: none; min-width: 0;
}
.bt-toolbar select:focus, .bt-toolbar input:focus { border-color: var(--console-accent); }
.bt-toolbar select { cursor: pointer; }
.bt-sym-badge {
    background: rgba(168,85,247,0.15); color: #c084fc; border-radius: 4px;
    padding: 0.15rem 0.45rem; font-size: 0.68rem; font-weight: 600; letter-spacing: 0.03em;
}
.bt-run-btn {
    background: linear-gradient(135deg, #a855f7, #6d28d9); color: #fff; border: none;
    border-radius: 5px; padding: 0.25rem 0.7rem; font-size: 0.68rem; font-weight: 600;
    cursor: pointer; display: flex; align-items: center; gap: 0.3rem; transition: opacity 0.15s;
    margin-left: auto;
}
.bt-run-btn:hover { opacity: 0.85; }
.bt-run-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.bt-split {
    display: grid; grid-template-columns: 1fr 1fr; gap: 0.45rem;
}
@media (max-width: 900px) { .bt-split { grid-template-columns: 1fr; } }
.bt-section {
    background: rgba(255,255,255,0.03); border: 1px solid var(--console-border);
    border-radius: 8px; padding: 0.45rem;
}
.bt-section-title {
    font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.06em;
    color: rgba(209,212,220,0.45); margin-bottom: 0.35rem; font-weight: 600;
}
.bt-param-row {
    display: flex; align-items: center; gap: 0.35rem; margin-bottom: 0.25rem;
}
.bt-param-row label {
    font-size: 0.65rem; color: rgba(209,212,220,0.6); min-width: 70px;
}
.bt-param-row input, .bt-param-row select {
    background: rgba(255,255,255,0.06); border: 1px solid var(--console-border);
    color: var(--tv-text); border-radius: 4px; padding: 0.18rem 0.35rem;
    font-size: 0.65rem; width: 70px; outline: none;
}
.bt-param-row input:focus, .bt-param-row select:focus { border-color: var(--console-accent); }
.bt-metrics-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.3rem;
}
.bt-metric-card {
    background: rgba(255,255,255,0.04); border: 1px solid var(--console-border);
    border-radius: 6px; padding: 0.3rem 0.4rem; text-align: center;
}
.bt-metric-card .bt-mv { font-size: 0.85rem; font-weight: 700; color: var(--tv-text); }
.bt-metric-card .bt-ml { font-size: 0.55rem; text-transform: uppercase; color: rgba(209,212,220,0.4); letter-spacing: 0.04em; margin-top: 0.1rem; }
.bt-metric-pos { color: #10B981 !important; }
.bt-metric-neg { color: #EF4444 !important; }
.bt-equity-wrap {
    background: rgba(255,255,255,0.03); border: 1px solid var(--console-border);
    border-radius: 8px; overflow: hidden; height: 180px; position: relative;
}
.bt-trades-wrap {
    background: rgba(255,255,255,0.03); border: 1px solid var(--console-border);
    border-radius: 8px; max-height: 180px; overflow-y: auto;
}
.bt-trades-wrap table {
    width: 100%; border-collapse: collapse; font-size: 0.62rem;
}
.bt-trades-wrap th {
    position: sticky; top: 0; background: rgba(255,255,255,0.06);
    padding: 0.25rem 0.4rem; text-align: left; color: rgba(209,212,220,0.5);
    font-weight: 600; font-size: 0.58rem; text-transform: uppercase; letter-spacing: 0.04em;
}
.bt-trades-wrap td {
    padding: 0.2rem 0.4rem; color: var(--tv-text); border-top: 1px solid rgba(255,255,255,0.04);
}
.bt-status {
    font-size: 0.62rem; color: rgba(209,212,220,0.5); padding: 0.15rem 0;
    display: flex; align-items: center; gap: 0.3rem;
}
.bt-status .spinner { width: 12px; height: 12px; border: 2px solid rgba(168,85,247,0.3); border-top-color: #a855f7; border-radius: 50%; animation: spin 0.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.bt-warning {
    background: rgba(234,179,8,0.1); border: 1px solid rgba(234,179,8,0.25);
    color: #eab308; border-radius: 6px; padding: 0.3rem 0.5rem;
    font-size: 0.62rem; margin-top: 0.2rem;
}
.bt-code-wrap {
    position: relative; border: 1px solid var(--console-border); border-radius: 6px;
    overflow: hidden; display: flex;
}
.bt-line-numbers {
    width: 36px; min-width: 36px; background: rgba(0,0,0,0.5); color: rgba(168,85,247,0.35);
    font-family: 'JetBrains Mono', 'Fira Code', monospace; font-size: 0.65rem; line-height: 1.45;
    padding: 0.4rem 0.25rem; text-align: right; user-select: none; overflow: hidden;
    border-right: 1px solid rgba(255,255,255,0.06);
}
.bt-line-numbers .bt-line-error {
    background: rgba(239,68,68,0.25); color: #f87171; border-radius: 2px;
    display: inline-block; width: 100%; text-align: right;
}
.bt-editor-inner {
    flex: 1; position: relative; overflow: hidden;
}
.bt-highlight-overlay {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    margin: 0; padding: 0.4rem; pointer-events: none;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.65rem; line-height: 1.45; white-space: pre;
    tab-size: 4; overflow: hidden; color: #d1d4dc;
    background: transparent; border: none;
}
.bt-highlight-overlay code {
    font-family: inherit; font-size: inherit; line-height: inherit;
    background: none; padding: 0; display: block;
}
.bt-code-wrap textarea {
    position: relative; z-index: 1; width: 100%; min-height: 140px; max-height: 260px;
    background: rgba(0,0,0,0.3); color: transparent; caret-color: #e9d5ff;
    border: none; padding: 0.4rem; font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.65rem; line-height: 1.45; resize: vertical; outline: none;
    white-space: pre; tab-size: 4; overflow-x: auto; overflow-y: auto;
}
.bt-code-wrap.bt-editor-expanded textarea { max-height: 480px; min-height: 480px; }
.bt-hl-keyword { color: #c084fc; }
.bt-hl-string { color: #4ade80; }
.bt-hl-comment { color: rgba(209,212,220,0.35); font-style: italic; }
.bt-hl-number { color: #fb923c; }
.bt-hl-builtin { color: #06b6d4; }
.bt-hl-decorator { color: #fbbf24; }
.bt-editor-toolbar {
    display: flex; align-items: center; gap: 0.3rem; padding: 0.2rem 0.35rem;
    background: rgba(0,0,0,0.35); border: 1px solid var(--console-border);
    border-bottom: none; border-radius: 6px 6px 0 0; margin-bottom: -1px;
}
.bt-editor-toolbar button {
    background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.08);
    color: rgba(209,212,220,0.6); border-radius: 4px; padding: 0.12rem 0.35rem;
    font-size: 0.58rem; cursor: pointer; transition: all 0.15s; display: flex;
    align-items: center; gap: 0.2rem;
}
.bt-editor-toolbar button:hover { background: rgba(168,85,247,0.2); color: #c084fc; border-color: rgba(168,85,247,0.3); }
.bt-editor-toolbar button.active { background: rgba(168,85,247,0.25); color: #c084fc; }
.bt-toolbar-sep {
    width: 1px; height: 14px; background: rgba(255,255,255,0.08); margin: 0 0.15rem;
}
.bt-cursor-pos, .bt-char-count, .bt-shortcut-hint {
    font-size: 0.55rem; color: rgba(209,212,220,0.35);
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
}
.bt-cursor-pos { margin-left: auto; }
.bt-char-count { padding-left: 0.4rem; }
.bt-char-count.bt-char-warn { color: #fbbf24; }
.bt-char-count.bt-char-danger { color: #ef4444; }
.bt-shortcut-hint { padding-left: 0.4rem; opacity: 0.5; }
.bt-editor-toolbar + .bt-code-wrap { border-radius: 0 0 6px 6px; }
.bt-snippet-bar {
    display: flex; flex-wrap: wrap; gap: 0.25rem; padding: 0.2rem 0; margin-bottom: 0.2rem;
}
.bt-snippet-btn {
    background: rgba(168,85,247,0.15); color: #c084fc; border: 1px solid rgba(168,85,247,0.3);
    border-radius: 4px; padding: 0.12rem 0.4rem; font-size: 0.58rem; cursor: pointer;
    font-family: 'JetBrains Mono', 'Fira Code', monospace; transition: all 0.15s;
}
.bt-snippet-btn:hover { background: rgba(168,85,247,0.3); border-color: #a855f7; }
.bt-ai-bar {
    display: flex; gap: 0.3rem; align-items: center;
}
.bt-ai-bar input {
    flex: 1; background: rgba(255,255,255,0.06); border: 1px solid var(--console-border);
    color: var(--tv-text); border-radius: 5px; padding: 0.22rem 0.4rem;
    font-size: 0.65rem; outline: none;
}
.bt-ai-bar input:focus { border-color: #a855f7; }
.bt-ai-btn {
    background: linear-gradient(135deg, #a855f7, #ec4899); color: #fff; border: none;
    border-radius: 5px; padding: 0.22rem 0.55rem; font-size: 0.62rem; font-weight: 600;
    cursor: pointer; white-space: nowrap;
}
.bt-ai-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.bt-empty-state {
    text-align: center; padding: 1.5rem 0.5rem; color: rgba(209,212,220,0.3);
    font-size: 0.7rem;
}

/* ===== Aero Snap Overlay Styles ===== */
.snap-preview {
    position: fixed; z-index: 9999; pointer-events: none;
    background: rgba(6,182,212,0.08); border: 2px solid rgba(6,182,212,0.5);
    border-radius: var(--panel-radius);
    opacity: 0;
    transition: opacity 0.15s ease, left 0.12s ease, top 0.12s ease, width 0.12s ease, height 0.12s ease;
}
.snap-preview-visible { opacity: 1; }

.snap-guide-line {
    position: fixed; z-index: 9998; pointer-events: none;
    background: var(--console-accent); opacity: 0;
    transition: opacity 0.12s ease;
}
.snap-guide-visible { opacity: 0.45; }
.snap-guide-h { left: 0; width: 100vw; height: 1px; }
.snap-guide-v { top: 0; height: 100vh; width: 1px; }

.panel-snap-animate {
    transition: left 0.2s ease-out, top 0.2s ease-out, width 0.2s ease-out, height 0.2s ease-out !important;
}

.snap-edge-indicator {
    position: fixed; z-index: 9997; pointer-events: none;
    opacity: 0; transition: opacity 0.2s ease;
}
.snap-edge-active { opacity: 1; }
.snap-edge-left {
    left: 0; top: 0; width: 4px; height: 100vh;
    background: linear-gradient(to right, rgba(6,182,212,0.4), transparent);
}
.snap-edge-right {
    right: 0; top: 0; width: 4px; height: 100vh;
    background: linear-gradient(to left, rgba(6,182,212,0.4), transparent);
}
.snap-edge-top {
    left: 0; top: 0; height: 4px; width: 100vw;
    background: linear-gradient(to bottom, rgba(6,182,212,0.4), transparent);
}

/* ── Panel Access: Preview blur & Lock overlay ──────────────────── */
.panel-preview-blur {
    filter: blur(6px);
    pointer-events: none;
    transition: filter 0.6s ease-in-out;
    position: relative;
}
.panel-preview-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    background: rgba(0,0,0,0.5);
    pointer-events: auto;
}
.panel-preview-cta {
    text-align: center;
    padding: 1.5rem 2rem;
    border-radius: var(--tg-radius-card, 8px);
    background: rgba(0,0,0,0.7);
    border: 1px solid rgba(245,158,11,0.3);
    backdrop-filter: blur(12px);
}
.panel-chip-locked { opacity: 0.6; }
.panel-chip-locked:hover { opacity: 0.8; }
.panel-chip-preview { border-color: rgba(245,158,11,0.3) !important; }

/* Panel upgrade modal */
.panel-upgrade-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.15s ease-out;
}
.panel-upgrade-modal-content {
    background: #111827;
    border: 1px solid rgba(245,158,11,0.3);
    border-radius: var(--tg-radius-card, 8px);
    padding: 1.5rem;
    max-width: 380px;
    width: 90%;
    position: relative;
    animation: panelSlideIn 0.2s ease-out;
}
.panel-upgrade-modal-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    color: #9ca3af;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
}
.panel-upgrade-modal-close:hover { color: #fff; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Console first-visit welcome banner */
.console-welcome-banner {
    background: linear-gradient(135deg, rgba(139,92,246,0.1) 0%, rgba(0,0,0,0) 100%);
    border: 1px solid rgba(139,92,246,0.25);
    border-radius: var(--tg-radius-card, 8px);
    padding: 0.75rem 1rem;
    margin: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    animation: panelSlideIn 0.3s ease-out;
}

/* ===== TradingGPT unified console theme ===== */
:root {
    --tv-bg: var(--tg-bg-2, #04060a);
    --tv-pane: var(--tg-panel-strong, rgba(14, 20, 33, 0.94));
    --tv-border: rgba(var(--tg-cyan-bright-rgb, 96, 165, 250), 0.16);
    --tv-text: var(--tg-soft, #c8d2e1);
    --tv-blue: var(--tg-cyan, #2563eb);
    --tv-green: var(--tg-success, #2dd4bf);
    --tv-red: var(--tg-danger, #f87171);

    --console-bg: var(--tg-bg-2, #04060a);
    --console-surface: var(--tg-panel, rgba(10, 15, 26, 0.82));
    --console-surface-strong: var(--tg-panel-strong, rgba(14, 20, 33, 0.94));
    --console-surface-soft: rgba(var(--tg-panel-rgb, 10, 15, 26), 0.58);
    --console-border: rgba(var(--tg-cyan-bright-rgb, 96, 165, 250), 0.16);
    --console-border-strong: rgba(var(--tg-cyan-bright-rgb, 96, 165, 250), 0.28);
    --console-accent: var(--tg-cyan-bright, #60a5fa);
    --console-accent-rgb: var(--tg-cyan-bright-rgb, 96, 165, 250);
    --console-accent-2: var(--tg-violet, #7c3aed);
    --console-accent-2-rgb: var(--tg-violet-rgb, 124, 58, 237);
    --console-positive: var(--tg-success, #2dd4bf);
    --console-negative: var(--tg-danger, #f87171);
    --console-muted: var(--tg-muted, #9aa7ba);

    --panel-bg: var(--tg-card-bg, linear-gradient(180deg, rgba(15, 23, 42, 0.82), rgba(7, 11, 19, 0.92)));
    --panel-blur: none;
    --panel-border: rgba(var(--tg-cyan-bright-rgb, 96, 165, 250), 0.18);
    --panel-radius: var(--tg-radius-card, 8px);
}

.tg-console,
.console-viewport {
    position: relative;
    isolation: isolate;
    color: var(--tg-ink, #f8fafc);
    background: var(--tg-page-bg);
}

.tg-console::before,
.console-viewport::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(148, 163, 184, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, 0.04) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.72), transparent 92%);
}

.console-viewport *,
.command-bar-overlay *,
.keyboard-help-overlay *,
.panel-upgrade-modal * {
    box-sizing: border-box;
    scrollbar-color: rgba(var(--console-accent-rgb), 0.44) rgba(5, 7, 12, 0.62);
    scrollbar-width: thin;
}

.console-viewport *::-webkit-scrollbar,
.command-bar-overlay *::-webkit-scrollbar,
.keyboard-help-overlay *::-webkit-scrollbar,
.panel-upgrade-modal *::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.console-viewport *::-webkit-scrollbar-track,
.command-bar-overlay *::-webkit-scrollbar-track,
.keyboard-help-overlay *::-webkit-scrollbar-track,
.panel-upgrade-modal *::-webkit-scrollbar-track {
    background: rgba(5, 7, 12, 0.62);
}

.console-viewport *::-webkit-scrollbar-thumb,
.command-bar-overlay *::-webkit-scrollbar-thumb,
.keyboard-help-overlay *::-webkit-scrollbar-thumb,
.panel-upgrade-modal *::-webkit-scrollbar-thumb {
    border: 2px solid rgba(5, 7, 12, 0.62);
    border-radius: 8px;
    background: rgba(var(--console-accent-rgb), 0.48);
}

.console-left,
.panel-grid,
.console-chart-wrap,
.console-main-chart,
.console-pane1,
.console-pane2,
.mobile-ticker-fullscreen {
    background: transparent;
}

.console-toolbar,
.console-chat,
.chat-header,
.chat-history-panel,
.chat-quick-actions,
.chat-input-area,
.chat-context-bar,
.console-status-bar,
.console-mobile-tabbar,
.country-chip-bar,
.console-ticker-strip,
.intel-ticker-strip,
.mobile-panel-dropdown,
.workspace-dropdown,
.command-bar-container,
.keyboard-help-container {
    border-color: var(--console-border);
    background: rgba(7, 11, 19, 0.92);
    box-shadow: none;
}

.console-toolbar {
    min-height: 48px;
    border-bottom: 1px solid var(--console-border);
}

.toolbar-btn,
.chat-toggle-btn,
.empty-action-btn,
.workspace-btn,
.workspace-save-btn,
.panel-ctrl-btn,
.panel-close-btn,
.quick-btn,
.console-retry-btn,
.country-add-btn,
.country-chip,
.intel-chip,
.panel-filter-pill,
.panel-quick-sym,
.bt-snippet-btn,
.bt-editor-toolbar button,
.mobile-panel-dropdown-item,
.mobile-tab,
.mobile-tab-btn {
    border-radius: var(--tg-radius-card, 8px);
    border-color: rgba(var(--console-accent-rgb), 0.16);
    color: var(--tg-soft, #c8d2e1);
    background: rgba(var(--tg-cyan-rgb, 37, 99, 235), 0.08);
    box-shadow: none;
    transform: none;
}

.toolbar-btn:hover,
.chat-toggle-btn:hover,
.empty-action-btn:hover,
.workspace-btn:hover,
.workspace-save-btn:hover,
.panel-ctrl-btn:hover,
.quick-btn:hover,
.console-retry-btn:hover,
.country-chip:hover,
.country-add-btn:hover,
.intel-chip:hover,
.panel-filter-pill:hover,
.panel-quick-sym:hover,
.bt-snippet-btn:hover,
.bt-editor-toolbar button:hover,
.mobile-panel-dropdown-item:hover {
    border-color: var(--console-border-strong);
    color: var(--tg-ink, #f8fafc);
    background: rgba(var(--tg-cyan-rgb, 37, 99, 235), 0.13);
    transform: none;
}

.toolbar-btn.active,
.chat-toggle-btn.active,
.panel-chip.active,
.country-chip.primary,
.intel-subtab.active,
.intel-chip.active,
.panel-filter-pill.active,
.mobile-panel-dropdown-item.active,
.mobile-tab.active,
.mobile-tab-btn.active {
    border-color: rgba(var(--console-accent-rgb), 0.42);
    color: var(--console-accent);
    background: rgba(var(--tg-cyan-rgb, 37, 99, 235), 0.16);
    box-shadow: none;
}

.console-toolbar select,
.console-toolbar input,
.chart-panel-controls input[type="text"],
.chart-panel-controls select,
.chat-input-area textarea,
.workspace-save-input,
.command-bar-input,
.panel-search-input,
.bt-toolbar select,
.bt-toolbar input,
.bt-param-row input,
.bt-param-row select,
.bt-ai-bar input,
.bt-code-wrap textarea {
    border-radius: var(--tg-radius-card, 8px);
    border-color: rgba(var(--console-accent-rgb), 0.16);
    color: var(--tg-ink, #f8fafc);
    background: rgba(5, 7, 12, 0.54);
    box-shadow: none;
}

.console-toolbar select:focus,
.console-toolbar input:focus,
.chart-panel-controls input[type="text"]:focus,
.chart-panel-controls select:focus,
.chat-input-area textarea:focus,
.workspace-save-input:focus,
.panel-search-input:focus,
.bt-toolbar select:focus,
.bt-toolbar input:focus,
.bt-param-row input:focus,
.bt-param-row select:focus,
.bt-ai-bar input:focus {
    border-color: rgba(var(--console-accent-rgb), 0.5);
    background: rgba(var(--tg-cyan-rgb, 37, 99, 235), 0.08);
    outline: none;
    box-shadow: 0 0 0 2px rgba(var(--tg-cyan-rgb, 37, 99, 235), 0.14);
}

.panel-chip,
.panel-cat-divider,
.console-tab,
.intel-subtab,
.ctx-chip,
.panel-sym-badge,
.credit-badge,
.ob-badge,
.news-score-badge {
    border-radius: var(--tg-radius-card, 8px);
    letter-spacing: 0;
}

.panel-chip {
    border-color: rgba(var(--console-accent-rgb), 0.16);
    background: rgba(15, 23, 42, 0.54);
    color: var(--console-muted);
    transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.panel-chip:hover {
    border-color: rgba(var(--console-accent-rgb), 0.30);
    background: rgba(var(--tg-cyan-rgb, 37, 99, 235), 0.11);
    color: var(--tg-ink, #f8fafc);
}

.panel-cat-divider {
    border-left-color: rgba(var(--console-accent-rgb), 0.22);
    color: rgba(200, 210, 225, 0.48);
}

.console-access-icon,
.console-toolbar .text-amber-400,
.panel-toggle-bar .text-amber-400,
.mobile-panel-dropdown .text-amber-400 {
    margin-left: 0.2rem;
    color: var(--console-accent-2) !important;
    font-size: 8px;
}

.console-panel,
.tg-console-panel,
.empty-state-card,
.metric-card,
.metrics-news-item,
.ob-quote-card,
.mtf-card,
.intel-country-card,
.intel-indicator-card,
.bt-section,
.bt-metric-card,
.bt-equity-wrap,
.bt-trades-wrap {
    border-radius: var(--tg-radius-card, 8px);
    border: 1px solid var(--panel-border);
    background: var(--panel-bg);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.24), 0 16px 44px rgba(var(--tg-cyan-rgb, 37, 99, 235), 0.06);
}

.console-panel {
    animation: none;
    will-change: auto;
}

.console-panel:hover,
.console-panel:focus-within,
.metric-card:hover,
.ob-quote-card:hover,
.intel-country-card:hover,
.intel-indicator-card:hover {
    border-color: rgba(var(--console-accent-rgb), 0.26);
    transform: none;
}

.panel-header {
    border-bottom-color: rgba(var(--console-accent-rgb), 0.12);
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.50), rgba(8, 13, 24, 0.36));
}

.panel-header-title,
.intel-ticker-name,
.mtf-card-name,
.mtf-section-header,
.intel-section-header,
.intel-event-currency,
.intel-ind-label,
.workspace-btn i,
.workspace-item i,
.command-bar-input-wrap i,
.keyboard-help-title,
.keyboard-help-item kbd,
.panel-sym-badge,
#sbTime {
    color: var(--console-accent);
}

.panel-header-title i,
.panel-chip i,
.quick-btn i,
.mobile-tab i,
.mobile-tab-btn i {
    color: rgba(var(--console-accent-rgb), 0.82);
}

.live-price-badge,
.credit-badge,
.ctx-cost,
.status-bar-item {
    border-radius: var(--tg-radius-card, 8px);
    text-shadow: none;
    box-shadow: none;
}

.live-price-badge.up,
.ob-bids .ob-bar,
.ob-vol-bar-fill,
.ob-range-bar-fill,
.intel-yield-fill {
    background: rgba(var(--tg-cyan-rgb, 37, 99, 235), 0.22);
}

.live-price-badge.down,
.ob-asks .ob-bar,
.ob-range-52w {
    background: rgba(var(--console-accent-2-rgb), 0.18);
}

.console-guest-nudge,
.empty-action-btn.primary,
.credits-upgrade-btn,
.panel-credit-lock .pcl-btn,
.bt-run-btn,
.bt-ai-btn {
    border: 1px solid rgba(var(--console-accent-rgb), 0.28);
    color: #fff;
    background: rgba(var(--tg-cyan-rgb, 37, 99, 235), 0.22);
    box-shadow: none;
}

.console-guest-nudge a,
.credits-upgrade-btn:hover,
.panel-credit-lock .pcl-btn:hover,
.bt-run-btn:hover,
.bt-ai-btn:hover {
    color: #fff;
    background: rgba(var(--console-accent-2-rgb), 0.22);
    transform: none;
    box-shadow: none;
}

.empty-state-card {
    background: var(--panel-bg);
}

.empty-state-eyebrow {
    color: var(--console-accent);
}

.empty-state-copy,
.empty-state-tip,
.panel-body,
.chat-bubble.ai,
.metrics-news-empty,
.ob-qty,
.ob-total,
.intel-news-time,
.fund-metric-label,
.news-summary,
.news-meta {
    color: var(--console-muted);
}

.chat-bubble {
    border-radius: var(--tg-radius-card, 8px);
}

.chat-bubble.user {
    border-color: rgba(var(--console-accent-rgb), 0.30);
    color: #dbeafe;
    background: rgba(var(--tg-cyan-rgb, 37, 99, 235), 0.18);
}

.chat-bubble.ai,
.chat-history-item,
.workspace-item,
.command-bar-item,
.watchlist-item,
.alert-item,
.intel-news-row,
.intel-event-row {
    background: transparent;
}

.chat-history-item:hover,
.workspace-item:hover,
.command-bar-item:hover,
.command-bar-item.selected,
.watchlist-item:hover,
.alert-item:hover,
.intel-news-row:hover,
.intel-event-row:hover,
.country-news-panel-body .intel-news-row:hover {
    background: rgba(var(--tg-cyan-rgb, 37, 99, 235), 0.08);
}

.chart-loading-overlay {
    background: rgba(4, 6, 10, 0.82);
}

.chart-loading-overlay .spinner,
.bt-status .spinner {
    border-color: rgba(var(--console-accent-rgb), 0.18);
    border-top-color: var(--console-accent);
}

.console-skeleton-row {
    animation: none;
    background: rgba(var(--console-accent-rgb), 0.10);
}

.console-skeleton-row.medium {
    background: rgba(var(--tg-cyan-rgb, 37, 99, 235), 0.12);
}

.console-skeleton-row.short {
    background: rgba(var(--console-accent-2-rgb), 0.10);
}

.status-bar-connection,
.intel-live-dot,
.intel-ticker-timestamp.live .ts-dot,
.mtf-updated .ts-dot,
.mtf-card .live-dot,
.intel-marker-inner::after {
    animation: none !important;
    box-shadow: none !important;
}

.mobile-tab:active,
.mobile-tab-btn:active,
.credits-upgrade-btn:hover,
.panel-credit-lock .pcl-btn:hover,
.bt-run-btn:hover {
    transform: none;
}

.mobile-panel-dropdown,
.panel-upgrade-modal,
.panel-upgrade-modal-content,
.console-welcome-banner {
    animation: none;
}

.console-mobile-tabbar {
    border-top-color: var(--console-border);
}

.mobile-chat-toggle {
    border-radius: var(--tg-radius-card, 8px) !important;
    border: 1px solid rgba(var(--console-accent-rgb), 0.28) !important;
    background: rgba(var(--tg-cyan-rgb, 37, 99, 235), 0.22) !important;
    box-shadow: 0 16px 42px rgba(0, 0, 0, 0.32) !important;
}

.panel-upgrade-modal-content,
.panel-preview-cta,
.credits-blur-overlay,
.panel-credit-lock {
    border-radius: var(--tg-radius-card, 8px);
    border-color: rgba(var(--console-accent-rgb), 0.20);
    background: rgba(7, 11, 19, 0.92);
}

.panel-preview-plan-link,
.panel-upgrade-plan-link,
.panel-upgrade-dismiss {
    border-radius: var(--tg-radius-card, 8px);
    border: 1px solid rgba(var(--console-accent-rgb), 0.24);
    background: rgba(var(--tg-cyan-rgb, 37, 99, 235), 0.18);
    text-decoration: none;
}

.panel-preview-plan-link:hover,
.panel-upgrade-plan-link:hover {
    border-color: rgba(var(--console-accent-rgb), 0.36);
    background: rgba(var(--console-accent-2-rgb), 0.22);
}

.panel-upgrade-dismiss {
    background: rgba(15, 23, 42, 0.52);
}

.panel-upgrade-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--tg-radius-card, 8px);
    border: 1px solid rgba(var(--console-accent-rgb), 0.28);
    color: #fff;
    background: rgba(var(--tg-cyan-rgb, 37, 99, 235), 0.16);
}

.tg-console .console-premium-label,
.tg-console .text-amber-400,
.tg-console .text-amber-300,
.command-bar-overlay .text-amber-400,
.command-bar-overlay .text-amber-300,
.keyboard-help-overlay .text-amber-400,
.keyboard-help-overlay .text-amber-300,
.panel-upgrade-modal .text-amber-400,
.panel-upgrade-modal .text-amber-300 {
    color: var(--console-accent-2) !important;
}

.snap-preview,
.snap-guide-line {
    border-color: rgba(var(--console-accent-rgb), 0.45);
    background: rgba(var(--tg-cyan-rgb, 37, 99, 235), 0.10);
}

.snap-edge-left,
.snap-edge-right,
.snap-edge-top {
    background: rgba(var(--console-accent-rgb), 0.32);
}

/* ===== Console readability pass ===== */
:root {
    --console-font-xs: 0.70rem;
    --console-font-sm: 0.76rem;
    --console-font-md: 0.84rem;
    --console-font-lg: 0.98rem;
    --console-line: 1.48;
}

.console-toolbar {
    min-height: 52px;
    padding: 0.5rem 0.8rem;
}

.toolbar-btn,
.chat-toggle-btn,
.workspace-btn,
.credit-badge,
.quick-btn,
.empty-action-btn,
.country-chip,
.country-add-btn {
    min-height: 32px;
    font-size: var(--console-font-sm);
}

.panel-chip {
    min-height: 32px;
    padding: 0.34rem 0.68rem;
    font-size: var(--console-font-sm);
}

.panel-cat-divider {
    font-size: 0.66rem;
}

.console-tab {
    min-height: 34px;
    font-size: var(--console-font-sm);
}

.panel-header {
    min-height: 40px;
    padding: 0.55rem 0.72rem;
}

.panel-header-title {
    font-size: var(--console-font-md) !important;
    font-weight: 750;
    line-height: 1.25;
}

.panel-header-title i,
.panel-chip i {
    font-size: 0.78rem;
}

.panel-updated-at {
    font-size: 0.68rem !important;
}

.panel-controls {
    gap: 5px;
}

.panel-ctrl-btn,
.panel-close-btn {
    width: 26px;
    height: 26px;
    font-size: 0.68rem;
}

.panel-body {
    font-size: var(--console-font-md);
    line-height: var(--console-line);
}

.chart-panel-controls {
    gap: 8px;
}

#symbolInput,
.chart-panel-controls input[type="text"] {
    width: clamp(150px, 13vw, 190px);
    min-height: 34px;
    padding: 0.42rem 0.62rem;
    font-size: 0.92rem;
    font-weight: 750;
    letter-spacing: 0;
}

.chart-panel-controls select,
#intervalSelect {
    min-height: 34px;
    padding: 0.4rem 0.55rem;
    font-size: var(--console-font-md);
    font-weight: 700;
}

.live-price-badge,
.chart-panel-controls .live-price-badge {
    min-height: 30px;
    padding: 0.35rem 0.65rem;
    font-size: var(--console-font-md);
    font-weight: 800;
}

.symbol-suggestions,
.panel-search-suggestions,
.panel-sym-search-inline {
    font-size: var(--console-font-md);
}

.symbol-suggestions .sug-item,
.panel-search-suggestions .sug-item {
    min-height: 38px;
    padding: 0.58rem 0.76rem;
    font-size: var(--console-font-md);
}

.sug-item .sug-symbol {
    min-width: 72px;
    font-size: var(--console-font-md);
}

.sug-item .sug-name,
.sug-item .sug-exchange {
    font-size: var(--console-font-sm);
}

.panel-sym-badge {
    min-height: 26px;
    padding: 0.22rem 0.54rem;
    font-size: var(--console-font-sm) !important;
    font-weight: 750;
}

.panel-sym-badge .link-icon {
    font-size: 0.64rem;
}

.panel-search-input {
    min-height: 34px;
    padding: 0.48rem 0.65rem;
    font-size: var(--console-font-md) !important;
}

.metric-card {
    padding: 0.68rem 0.72rem;
}

.metric-card .metric-label,
.ob-quote-label,
.bt-metric-card .bt-ml {
    font-size: var(--console-font-xs);
}

.metric-card .metric-value,
.ob-quote-value,
.bt-metric-card .bt-mv {
    font-size: var(--console-font-lg);
}

.metrics-news-title,
.ob-header,
.intel-section-header,
.intel-event-header,
.bt-section-title,
.watchlist-header .wl-title,
.alerts-header .al-title {
    font-size: var(--console-font-xs);
}

.metrics-news-item .news-headline,
.news-headline,
.intel-news-headline,
.watchlist-item .wl-sym,
.alert-item .al-sym {
    font-size: var(--console-font-sm);
    line-height: 1.38;
}

.metrics-news-item .news-meta,
.news-summary,
.news-meta,
.intel-news-time,
.watchlist-item .wl-name,
.alert-item .al-cond {
    font-size: var(--console-font-xs);
    line-height: 1.42;
}

.metrics-news-item .news-score,
.news-score-badge,
.intel-news-score,
.ob-badge {
    min-width: 34px;
    min-height: 22px;
    font-size: var(--console-font-xs);
}

.fund-metric-row {
    padding: 0.34rem 0.48rem;
}

.fund-metric-label,
.fund-snowflake-label,
.panel-filter-label,
.intel-ind-label {
    font-size: var(--console-font-xs);
}

.fund-metric-value,
.fund-snowflake-row span:last-child,
.intel-ind-val,
.intel-event-name,
.intel-event-actual,
.intel-event-forecast,
.intel-event-previous {
    font-size: var(--console-font-sm) !important;
}

.fund-snowflake-row {
    padding: 0.24rem 0.48rem;
}

.fund-snowflake-bar {
    height: 7px;
}

.intel-loading,
.ob-loading,
.bt-empty-state,
.watchlist-empty,
.alerts-empty {
    font-size: var(--console-font-md);
}

.intel-ticker-strip,
.console-ticker-strip,
.intel-ticker-item,
.intel-ticker-name,
.intel-ticker-val,
.intel-ticker-change,
.intel-ticker-timestamp,
.intel-ticker-live-badge {
    font-size: var(--console-font-sm);
}

.mtf-title,
.mtf-card-value,
.mtf-rate-val,
.mtf-rate-code,
.mtf-rate-chg {
    font-size: var(--console-font-md);
}

.mtf-card-name,
.mtf-section-header,
.mtf-updated {
    font-size: var(--console-font-xs);
}

.intel-country-name,
.intel-event-row,
.intel-news-row,
.intel-table td,
.intel-market-row,
.watchlist-item,
.alert-item {
    font-size: var(--console-font-sm);
}

.intel-table th {
    font-size: var(--console-font-xs);
}

.panel-filter-pill,
.panel-quick-sym,
.bt-toolbar select,
.bt-toolbar input,
.bt-param-row label,
.bt-param-row input,
.bt-param-row select,
.bt-run-btn,
.bt-ai-bar input,
.bt-ai-btn,
.bt-snippet-btn,
.bt-editor-toolbar button,
.bt-status,
.bt-warning {
    font-size: var(--console-font-sm);
}

.bt-line-numbers,
.bt-highlight-overlay,
.bt-code-wrap textarea {
    font-size: 0.80rem;
    line-height: 1.58;
}

.bt-cursor-pos,
.bt-char-count,
.bt-shortcut-hint {
    font-size: var(--console-font-xs);
}

.chat-header {
    min-height: 48px;
    font-size: var(--console-font-md);
}

.chat-bubble {
    font-size: var(--console-font-md);
    line-height: 1.54;
}

.chat-quick-actions {
    gap: 0.45rem;
}

.chat-input-area textarea {
    min-height: 44px;
    font-size: var(--console-font-md);
}

.chat-send-btn {
    width: 42px;
    height: 42px;
}

/* Many console panels still render tiny inline font sizes from JS strings. */
.console-panel [style*="font-size:0.36rem"],
.console-panel [style*="font-size:0.38rem"],
.console-panel [style*="font-size:0.40rem"],
.console-panel [style*="font-size:0.4rem"],
.console-panel [style*="font-size:0.42rem"],
.console-panel [style*="font-size:0.44rem"],
.console-panel [style*="font-size:0.46rem"],
.console-panel [style*="font-size:0.48rem"],
.console-panel [style*="font-size:0.50rem"],
.console-panel [style*="font-size:0.5rem"] {
    font-size: var(--console-font-xs) !important;
}

.console-panel [style*="font-size:0.52rem"],
.console-panel [style*="font-size:0.55rem"],
.console-panel [style*="font-size:0.56rem"],
.console-panel [style*="font-size:0.58rem"],
.console-panel [style*="font-size:0.6rem"],
.console-panel [style*="font-size:0.60rem"],
.console-panel [style*="font-size:0.62rem"],
.console-panel [style*="font-size:0.65rem"],
.console-panel [style*="font-size:0.68rem"] {
    font-size: var(--console-font-sm) !important;
}

.console-panel [style*="line-height:1.3"],
.console-panel [style*="line-height:1.35"],
.console-panel [style*="line-height:1.4"] {
    line-height: var(--console-line) !important;
}

@media (max-width: 768px) {
    .console-toolbar {
        min-height: 46px;
        padding: 0.36rem 0.45rem;
        gap: 0.38rem;
    }

    .panel-header {
        min-height: 38px;
        padding: 0.4rem 0.52rem;
    }

    .panel-header-title {
        font-size: 0.82rem !important;
    }

    #symbolInput,
    .chart-panel-controls input[type="text"] {
        width: min(58vw, 220px);
        min-height: 32px;
        font-size: 0.90rem;
    }

    .chart-panel-controls select,
    #intervalSelect {
        min-height: 32px;
        font-size: 0.78rem;
    }

    .live-price-badge,
    .chart-panel-controls .live-price-badge {
        min-height: 30px;
        font-size: 0.80rem;
    }

    .panel-sym-badge {
        min-height: 30px;
        min-width: 58px;
        font-size: 0.78rem !important;
    }

    .empty-state-card {
        border-radius: var(--tg-radius-card, 8px);
    }

    .console-mobile-tabbar {
        background: rgba(7, 11, 19, 0.96);
    }
}
