/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   Company Profile â€” Neon Manawa Design System
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */


/* â”€â”€ CSS Variables â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
:root {
    --bg-primary:    #050a14;
    --bg-surface:    rgba(0, 240, 255, 0.02);
    --bg-card:       rgba(0, 240, 255, 0.03);
    --bg-hover:      rgba(0, 240, 255, 0.06);
    --bg-sidebar:    #050a14;
    --bg-input:      rgba(0, 240, 255, 0.05);

    --border:        rgba(0, 200, 255, 0.10);
    --border-active: rgba(0, 240, 255, 0.30);

    --text-primary:  #e8e8e8;
    --text-secondary: rgba(255, 255, 255, 0.60);
    --text-muted:    rgba(255, 255, 255, 0.40);

    --neon-cyan:     #00f0ff;
    --neon-violet:   #a855f7;
    --gain:          #4d9e6e;
    --loss:          #b05252;
    --blue:          #3b82f6;

    --glow-sm:       0 0 10px rgba(0, 240, 255, 0.06);
    --glow-md:       0 0 20px rgba(0, 240, 255, 0.10);
    --glow-lg:       0 0 40px rgba(0, 240, 255, 0.08);

    --font-sans:     ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    --font-mono:     ui-sans-serif, system-ui, sans-serif;
    --font-sherif:   ui-sans-serif, system-ui, sans-serif;

    --radius-sm:     6px;
    --radius-md:     10px;
    --radius-lg:     16px;
    --radius-full:   9999px;

    --transition:    all 0.2s ease;
}

/* â”€â”€ Reset & Base â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    background: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    /* Hide horizontal scrollbars globally â€” scroll still works */
    scrollbar-width: thin;
    scrollbar-color: rgba(0,240,255,0.15) transparent;
}

/* Hide horizontal scrollbar on all elements */
* { scrollbar-width: thin; }
*::-webkit-scrollbar { height: 4px; width: 6px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: rgba(0,240,255,0.12); border-radius: 3px; }
*::-webkit-scrollbar-thumb:hover { background: rgba(0,240,255,0.22); }
/* Fully hide horizontal scrollbars but keep functionality */
*::-webkit-scrollbar:horizontal { display: none; }

body { min-height: 100vh; }

a { color: var(--neon-cyan); text-decoration: none; }
a:hover { text-decoration: underline; }

/* â”€â”€ Layout â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
/* .app-shell: see sidebar layout section */

.app-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 24px;
    border-bottom: 1px solid var(--border);
    background: rgba(5, 10, 20, 0.97);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.app-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* ── Split View ───────────────────────────────────────────────────── */
.split-view {
    display: flex;
    flex-direction: row;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.split-pane {
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none !important;
    min-width: 0;
}

.split-pane::-webkit-scrollbar { display: none !important; }

.split-pane-left {
    flex: 2;
    min-width: 200px;
}

.split-pane-right {
    flex: 1;
    min-width: 0;
    display: none; /* hidden until split-view is active */
}

.split-view.active .split-pane-right {
    display: block;
}

.split-view.active .split-divider {
    display: flex;
}

/* Draggable Divider */
.split-divider {
    display: none;
    align-items: center;
    justify-content: center;
    width: 6px;
    min-width: 6px;
    cursor: col-resize;
    background: transparent;
    position: relative;
    flex-shrink: 0;
    z-index: 10;
    transition: background 0.15s;
}

.split-divider:hover {
    background: rgba(0, 240, 255, 0.06);
}

.split-divider:active {
    background: rgba(0, 240, 255, 0.1);
}

.split-divider-line {
    width: 2px;
    height: 100%;
    background: var(--border);
    border-radius: 1px;
    transition: background 0.15s, width 0.15s;
}

.split-divider:hover .split-divider-line {
    background: var(--neon);
    width: 3px;
    box-shadow: 0 0 8px rgba(0, 240, 255, 0.3);
}

/* Investing pane content */
.investing-content {
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 24px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

.investing-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    height: 100%;
    color: var(--text-muted);
    font-size: 14px;
    text-align: center;
    opacity: 0.5;
}

/* Full-width modes */
.split-view.full-terminal .split-pane-left { flex: 1; }
.split-view.full-terminal .split-pane-right { display: none; }
.split-view.full-terminal .split-divider { display: none; }

.split-view.full-investing .split-pane-left { display: none; }
.split-view.full-investing .split-pane-right { display: block; flex: 1; }
.split-view.full-investing .split-divider { display: none; }

/* ── Investing Pane Forms ─────────────────────────────────────────── */
.investing-create {
    max-width: 480px;
}

.investing-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 24px 0;
}

.investing-form {
    display: flex;
    flex-direction: column;
}

.investing-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.investing-input {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 14px;
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.investing-input:focus {
    border-color: var(--neon);
    box-shadow: 0 0 0 3px rgba(0, 240, 255, 0.1);
}

.investing-input::placeholder {
    color: var(--text-muted);
    opacity: 0.5;
}

.investing-form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    justify-content: flex-end;
}

.investing-btn {
    padding: 8px 20px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.15s;
}

.investing-btn--primary {
    background: var(--neon);
    color: #000;
}

.investing-btn--primary:hover {
    background: #33f5ff;
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.3);
}

.investing-btn--secondary {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.investing-btn--secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Detail view in central pane */
.rs-detail {
    max-width: 600px;
}

.rs-detail-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.rs-detail-back {
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 6px 8px;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.15s;
    display: flex;
    align-items: center;
}

.rs-detail-back:hover {
    border-color: var(--neon);
    color: var(--neon);
}

.rs-detail-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.rs-detail-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.rs-detail-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}

.rs-detail-symbols {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.rs-detail-symbol {
    background: rgba(0, 240, 255, 0.08);
    border: 1px solid rgba(0, 240, 255, 0.15);
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--neon);
    letter-spacing: 0.5px;
}

.rs-detail-add-row {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.rs-detail-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.15s;
}

.rs-detail-input:focus {
    border-color: var(--neon);
}

.rs-detail-add-btn {
    padding: 8px 16px;
    background: var(--neon);
    color: #000;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.rs-detail-add-btn:hover {
    background: #33f5ff;
    box-shadow: 0 0 8px rgba(0, 240, 255, 0.3);
}

.rs-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    color: var(--text-secondary);
}

.rs-detail-holding {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.rs-detail-holding-sym {
    font-weight: 600;
    color: var(--neon);
    min-width: 60px;
}

.rs-detail-holding-shares {
    color: var(--text-secondary);
}

.rs-detail-holding-cost {
    color: var(--text-muted);
    margin-left: auto;
}

.rs-section-empty {
    color: var(--text-muted);
    font-size: 13px;
    opacity: 0.6;
    padding: 8px 0;
}

/* ── Watchlist Detail View ────────────────────────────────────────── */
.wl-detail {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.wl-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 16px;
}

.wl-title-input {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    outline: none;
    padding: 4px 0;
    flex: 1;
    min-width: 0;
    transition: border-color 0.2s;
    font-family: var(--font-sans);
}

.wl-title-input:hover {
    border-bottom-color: var(--border);
}

.wl-title-input:focus {
    border-bottom-color: var(--neon);
}

.wl-close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: color 0.15s;
    flex-shrink: 0;
    opacity: 0.5;
}

.wl-close-btn:hover {
    color: var(--text-primary);
    opacity: 1;
}

/* Sidebar item hover delete */
.nav-tree-item { position: relative; }

.rs-hover-delete {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    background: none;
    border: none;
    color: #b05252;
    font-size: 12px;
    cursor: pointer;
    padding: 2px 5px;
    border-radius: 3px;
    transition: opacity 0.12s, background 0.12s;
    z-index: 2;
}

.nav-tree-item:hover .rs-hover-delete {
    opacity: 1;
}

.rs-hover-delete:hover {
    background: rgba(176, 82, 82, 0.15);
}

/* Confirmation row */
.rs-item--confirming {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 12px;
}

.rs-confirm-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.rs-confirm-yes {
    background: none;
    border: none;
    color: #b05252;
    font-size: 14px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 3px;
    transition: background 0.12s;
}

.rs-confirm-yes:hover {
    background: rgba(176, 82, 82, 0.15);
}

.rs-confirm-divider {
    color: var(--text-muted);
    opacity: 0.3;
    font-size: 12px;
}

.rs-confirm-no {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 3px;
    transition: background 0.12s;
}

.rs-confirm-no:hover {
    background: rgba(255, 255, 255, 0.08);
}

/* Search bar — mirrors header search */
.wl-search-wrap {
    position: relative;
    margin-bottom: 16px;
    z-index: 10;
}

.wl-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.wl-search-input {
    width: 100%;
    padding: 10px 14px 10px 42px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
}

.wl-search-input:focus {
    border-color: var(--neon);
    box-shadow: 0 0 0 3px rgba(0, 240, 255, 0.08);
}

.wl-search-input::placeholder {
    color: var(--text-muted);
    opacity: 0.5;
}

/* Table container */
.wl-table-wrap {
    flex: 1;
    overflow-y: auto;
    scrollbar-width: none;
}

.wl-table-wrap::-webkit-scrollbar { display: none; }

.wl-table { width: 100%; }

/* Row-level delete button — appears on hover */
.wl-remove-cell {
    width: 36px;
    padding: 8px 8px 8px 0;
    text-align: center;
}

.wl-remove-btn {
    opacity: 0;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    transition: opacity 0.15s, color 0.15s, background 0.15s;
}

.wl-row:hover .wl-remove-btn {
    opacity: 1;
}

.wl-remove-btn:hover {
    color: #b05252;
    background: rgba(176, 82, 82, 0.12);
}

/* Watchlist search dropdown */
.wl-search-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #1a1a2e;
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 10px 10px;
    max-height: 320px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
    scrollbar-width: none;
}

.wl-search-dropdown::-webkit-scrollbar { display: none; }

.wl-search-dropdown.active {
    display: block;
}

.wl-dd-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    cursor: pointer;
    transition: background 0.12s;
}

.wl-dd-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.wl-dd-item.wl-dd-added {
    opacity: 0.4;
    cursor: default;
}

.wl-dd-logo {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: white;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.wl-dd-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.wl-dd-init {
    font-size: 10px;
    font-weight: 700;
    color: #333;
}

.wl-dd-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.wl-dd-sym {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.wl-dd-name {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wl-dd-check {
    color: var(--neon);
    font-size: 14px;
    flex-shrink: 0;
}

/* Sort arrows */
.wl-sort-arrow {
    font-size: 10px;
    opacity: 0.6;
}

/* Watchlist skeleton shimmer rows */
@keyframes wl-shimmer {
    0% { background-position: -200px 0; }
    100% { background-position: 200px 0; }
}

.wl-skel-cell {
    border-radius: 4px;
    background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 75%);
    background-size: 400px 100%;
    animation: wl-shimmer 1.2s ease-in-out infinite;
}

.wl-skel-logo {
    width: 36px;
    height: 36px;
    border-radius: 8px;
}

.wl-skel-ticker {
    height: 18px;
    width: 60px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    line-height: 18px;
}

.wl-skel-num {
    height: 16px;
    width: 56px;
    margin-left: auto;
}

/* Row removal animation */
@keyframes wl-fade-out {
    0% { opacity: 1; transform: translateX(0); }
    100% { opacity: 0; transform: translateX(20px); height: 0; padding: 0; overflow: hidden; }
}

.wl-row-removing {
    animation: wl-fade-out 0.28s ease-out forwards;
    pointer-events: none;
}

/* Sidebar item removal animation */
.rs-item-removing {
    animation: wl-fade-out 0.28s ease-out forwards;
    pointer-events: none;
}

/* Sidebar loading skeleton items */
.rs-skel-item {
    padding: 8px 12px 8px 36px;
}

.rs-skel-bar {
    height: 14px;
    width: 80%;
    border-radius: 4px;
}

/* ── Portfolio Detail ─────────────────────────────────────────────── */
.pf-detail {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.pf-neon-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--neon, #00e5ff), transparent);
    margin-bottom: 16px;
    opacity: 0.5;
}

.pf-tab-bar {
    display: flex;
    gap: 0;
    margin-bottom: 16px;
    background: rgba(255,255,255,0.03);
    border-radius: 6px;
    padding: 2px;
}

.pf-tab-btn {
    flex: 1;
    text-align: center;
    font-size: 13px !important;
    padding: 6px 12px !important;
    border-radius: 4px !important;
    color: var(--text-muted) !important;
    background: none !important;
    border: none !important;
    cursor: pointer;
    transition: color 0.15s, background 0.15s;
    font-family: var(--font-sans);
}

.pf-tab-btn:hover {
    color: var(--text-primary) !important;
    background: rgba(255,255,255,0.05) !important;
}

.pf-tab-btn.active {
    color: var(--text-primary) !important;
    background: rgba(255,255,255,0.08) !important;
    font-weight: 600;
}

.pf-tab-content {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

/* Portfolio Transaction Form */
.pf-tx-form-row {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    padding-bottom: 4px;
}

.pf-tx-field {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 0 0 auto;
    width: 90px;
}

.pf-tx-field--symbol {
    width: 150px;
}

.pf-search-wrap {
    position: relative;
    z-index: 30;
    display: flex;
    align-items: center;
    margin-bottom: 0 !important;
}

.pf-search-wrap .wl-search-icon {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    opacity: 0.5;
    pointer-events: none;
    z-index: 1;
}

.pf-search-wrap .pf-search-input {
    width: 100%;
}

.pf-search-wrap .wl-search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 260px;
    z-index: 50;
}

.pf-tx-actions {
    min-width: auto;
    flex: 0 0 auto;
    width: auto;
}

/* Force all form inputs to the same height */
.pf-tx-form-row .investing-input {
    font-size: 12px;
    padding: 6px 8px;
    height: 34px;
    box-sizing: border-box;
}

.pf-tx-edit-btn:hover {
    color: var(--neon, #00e5ff) !important;
}

.pf-edit-input {
    font-size: 12px !important;
    padding: 4px 6px !important;
    height: 28px;
}

/* Delete button: hidden by default, show on row hover */
.pf-tx-del-btn {
    opacity: 0;
    transition: opacity 0.12s;
}

.pf-tx-row:hover .pf-tx-del-btn {
    opacity: 1;
}

/* Editable cells: subtle underline on hover */
.pf-editable {
    transition: border-bottom 0.12s;
    border-bottom: 1px solid transparent;
}

.pf-editable:hover {
    border-bottom: 1px dashed rgba(255,255,255,0.2);
}

.investing-label {
    font-size: 11px;
    color: var(--text-muted);
    font-family: var(--font-sans);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.investing-input {
    font-size: 13px;
    padding: 6px 8px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 4px;
    color: var(--text-primary);
    font-family: var(--font-sans);
    outline: none;
    transition: border-color 0.15s;
}

.investing-input:focus {
    border-color: var(--neon, #00e5ff);
}

.investing-input::placeholder {
    color: var(--text-muted);
    opacity: 0.5;
}

/* Date picker override for dark theme */
.investing-input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(0.7);
    cursor: pointer;
}

.investing-btn {
    font-family: var(--font-sans);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: opacity 0.15s, background 0.15s;
}

.investing-btn--primary {
    background: var(--neon, #00e5ff);
    color: #0a0a0f;
    font-weight: 600;
}

.investing-btn--primary:hover {
    opacity: 0.85;
}

.investing-btn--secondary {
    background: rgba(255,255,255,0.06);
    color: var(--text-muted);
}

.investing-btn--secondary:hover {
    background: rgba(255,255,255,0.1);
    color: var(--text-primary);
}

/* Portfolio Embed Button & Modal */
.pf-embed-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted, #8b949e);
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}
.pf-embed-btn:hover {
    color: #58a6ff;
    border-color: rgba(88,166,255,0.35);
    background: rgba(88,166,255,0.08);
}

.pf-embed-modal {
    position: relative;
    z-index: 20;
    margin: 0 0 16px;
}
.pf-embed-modal-inner {
    background: rgba(22, 27, 34, 0.95);
    border: 1px solid rgba(88,166,255,0.25);
    border-radius: 10px;
    padding: 18px 20px;
    backdrop-filter: blur(12px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.pf-embed-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.pf-embed-modal-title {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    font-weight: 600;
    color: #e6edf3;
}
.pf-embed-close {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-muted, #8b949e);
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    transition: color 0.15s;
}
.pf-embed-close:hover { color: #e6edf3; }

.pf-embed-desc {
    font-size: 12px;
    color: var(--text-muted, #8b949e);
    margin-bottom: 14px;
    line-height: 1.5;
}

.pf-embed-section { margin-bottom: 12px; }
.pf-embed-section-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted, #8b949e);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 6px;
}
.pf-embed-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}
.pf-embed-code {
    flex: 1;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 11px;
    color: #58a6ff;
    background: rgba(88,166,255,0.07);
    border: 1px solid rgba(88,166,255,0.18);
    border-radius: 6px;
    padding: 8px 12px;
    word-break: break-all;
    line-height: 1.5;
    user-select: all;
}
.pf-embed-copy {
    flex-shrink: 0;
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 600;
    background: rgba(88,166,255,0.12);
    border: 1px solid rgba(88,166,255,0.3);
    border-radius: 6px;
    color: #58a6ff;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}
.pf-embed-copy:hover {
    background: rgba(88,166,255,0.2);
}

.pf-embed-note {
    font-size: 11px;
    color: #e3a414;
    background: rgba(227,164,20,0.08);
    border: 1px solid rgba(227,164,20,0.2);
    border-radius: 6px;
    padding: 7px 10px;
    margin-top: 4px;
    line-height: 1.4;
}

.pf-embed-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}
.pf-embed-action-btn {
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    border: 1px solid;
}
.pf-embed-generate {
    background: rgba(0,212,170,0.1);
    border-color: rgba(0,212,170,0.3);
    color: #00d4aa;
}
.pf-embed-generate:hover {
    background: rgba(0,212,170,0.2);
}
.pf-embed-regenerate {
    background: rgba(88,166,255,0.1);
    border-color: rgba(88,166,255,0.3);
    color: #58a6ff;
}
.pf-embed-regenerate:hover {
    background: rgba(88,166,255,0.2);
}
.pf-embed-revoke {
    background: rgba(239,68,68,0.1);
    border-color: rgba(239,68,68,0.25);
    color: #ef4444;
}
.pf-embed-revoke:hover {
    background: rgba(239,68,68,0.18);
}
.pf-embed-action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Portfolio Statistics */
/* ═══ Portfolio Analytics (Statistics Tab) ═══ */
.pf-analytics-kpis {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    padding: 8px 0 16px;
}
.pf-akpi {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.pf-akpi-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.pf-akpi-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
}
.pf-akpi-sub {
    font-size: 11px;
    color: var(--text-muted);
}
.pf-analytics-section {
    margin-bottom: 20px;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 10px;
    padding: 16px;
}
.pf-analytics-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}
.pf-analytics-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.pf-chart-wrap {
    position: relative;
    height: 280px;
}
.pf-chart-medium {
    height: 220px;
}

/* Toggle buttons */
.pf-analytics-toggle {
    display: flex;
    background: rgba(255,255,255,0.04);
    border-radius: 6px;
    padding: 2px;
    gap: 2px;
}
.pf-atoggle-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
}
.pf-atoggle-btn.active {
    background: rgba(0,212,170,0.15);
    color: #00d4aa;
}

/* Range pills */
.pf-analytics-pills {
    display: flex;
    gap: 3px;
}
.pf-apill {
    background: none;
    border: 1px solid rgba(255,255,255,0.08);
    color: var(--text-muted);
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
}
.pf-apill.active, .pf-apill:hover {
    background: rgba(0,212,170,0.12);
    border-color: rgba(0,212,170,0.3);
    color: #00d4aa;
}

/* Risk cards */
.pf-risk-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}
.pf-risk-card {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 10px;
    padding: 14px;
}
.pf-risk-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 12px;
}
.pf-risk-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}
.pf-risk-desc {
    font-size: 10px;
    color: var(--text-muted);
}
.pf-risk-gauge {
    margin-bottom: 8px;
}
.pf-risk-track {
    position: relative;
    height: 8px;
    background: rgba(255,255,255,0.06);
    border-radius: 4px;
    overflow: visible;
}
.pf-risk-gradient {
    background: linear-gradient(90deg, #ef4444 0%, #eab308 35%, #22c55e 60%, #00d4aa 100%);
    opacity: 0.4;
}
.pf-risk-fill {
    height: 100%;
    background: linear-gradient(90deg, #00d4aa, #0ea5e9);
    border-radius: 4px;
}
.pf-risk-marker {
    position: absolute;
    top: -10px;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
}
.pf-risk-value {
    font-size: 12px;
    font-weight: 700;
    color: #00d4aa;
    background: var(--bg-primary, #0d1117);
    padding: 1px 5px;
    border-radius: 3px;
    white-space: nowrap;
}
.pf-risk-labels {
    display: flex;
    justify-content: space-between;
    font-size: 9px;
    color: var(--text-muted);
    margin-top: 4px;
}
.pf-risk-benchmark {
    text-align: center;
}
.pf-risk-bm-badge {
    font-size: 10px;
    color: var(--text-muted);
    background: rgba(255,255,255,0.04);
    padding: 2px 8px;
    border-radius: 4px;
}

/* Sector table */
.pf-sector-table {
    max-height: 260px;
    overflow-y: auto;
}

@media (max-width: 768px) {
    .pf-analytics-kpis { grid-template-columns: repeat(2, 1fr); }
    .pf-risk-grid { grid-template-columns: 1fr; }
}

/* Benchmark selector bar */
.pf-benchmark-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
    margin-bottom: 12px;
    gap: 12px;
}
.pf-benchmark-left {
    display: flex;
    align-items: center;
    gap: 8px;
}
.pf-benchmark-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.pf-benchmark-vs {
    font-size: 11px;
    color: var(--text-muted);
    font-style: italic;
}
.pf-benchmark-pill {
    display: inline-flex;
    align-items: center;
    background: rgba(0,212,170,0.12);
    color: #00d4aa;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 12px;
    border: 1px solid rgba(0,212,170,0.25);
    letter-spacing: 0.3px;
}
.pf-benchmark-search-wrap {
    position: relative;
    flex: 0 0 200px;
}
.pf-benchmark-input {
    width: 100%;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 6px;
    padding: 5px 10px;
    color: var(--text-primary);
    font-size: 12px;
    outline: none;
    transition: border-color 0.15s;
}
.pf-benchmark-input:focus {
    border-color: rgba(0,212,170,0.4);
}
.pf-benchmark-input::placeholder {
    color: var(--text-muted);
}
.pf-benchmark-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-secondary, #161b22);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    margin-top: 4px;
    z-index: 100;
    max-height: 280px;
    overflow-y: auto;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.pf-benchmark-dropdown.active {
    display: block;
}
.pf-bm-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    cursor: pointer;
    transition: background 0.1s;
}
.pf-bm-item:hover {
    background: rgba(0,212,170,0.08);
}
.pf-bm-sym {
    font-size: 12px;
    font-weight: 700;
    color: #00d4aa;
    min-width: 50px;
}
.pf-bm-name {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


.main-content {
    flex: 1;
    padding: 24px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* â”€â”€ Search Bar â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.search-container {
    position: relative;
    flex: 1;
    max-width: 480px;
}

.search-input {
    width: 100%;
    padding: 8px 16px 8px 40px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 14px;
    outline: none;
    transition: var(--transition);
}

.search-input:focus {
    border-color: var(--border-active);
    box-shadow: var(--glow-sm);
}

.search-input::placeholder { color: var(--text-muted); }

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 14px;
}

.search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background: #1e1f1f;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--glow-md);
    z-index: 200;
    display: none;
    max-height: 300px;
    overflow-y: auto;
}

.search-dropdown.active { display: block; }

.search-result {
    padding: 8px 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: var(--transition);
}

.search-result:hover { background: var(--bg-hover); }

.search-result-logo {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    border-radius: 50%;
    overflow: hidden;
    background: rgba(255,255,255,0.06);
}

.search-result-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.search-result-initials {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--text-muted);
    background: linear-gradient(135deg, rgba(255,255,255,0.06), rgba(255,255,255,0.03));
}

.search-result-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.search-result-symbol {
    font-weight: 600;
    color: var(--neon-cyan);
    font-family: var(--font-mono);
    font-size: 13px;
}

.search-result-name {
    color: var(--text-muted);
    font-size: 11px;
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-result-category {
    flex-shrink: 0;
    font-size: 10px;
    font-weight: 600;
    font-family: var(--font-mono);
    padding: 2px 7px;
    border-radius: 4px;
    color: var(--cat-color, #4caf50);
    background: color-mix(in srgb, var(--cat-color, #4caf50) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--cat-color, #4caf50) 25%, transparent);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* â”€â”€ Ticker Header â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.ticker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}

.ticker-logo {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #fff;
    padding: 4px;
    object-fit: contain;
}

.ticker-name {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.ticker-exchange {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* â”€â”€ Price Display (Perplexity dual-box) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.overview-card {
    border: 1px solid var(--border);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    overflow: hidden;
    margin-bottom: 24px;
    border-top: none;
}

.overview-card .price-boxes {
    border: none;
    border-radius: 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0;
}

.overview-card .chart-toolbar {
    padding: 8px 16px 0;
    margin-bottom: -42px;
    position: relative;
    z-index: 2;
}

.overview-card .chart-container {
    padding: 0;
}

.overview-card .stats-grid {
    margin-top: 0;
    border-top: 1px solid var(--border);
}

.price-boxes {
    display: flex;
    gap: 0;
    margin-bottom: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    overflow: hidden;
}

.price-box {
    padding: 14px 20px;
    flex: 1;
}

.price-box + .price-box {
    border-left: 1px solid var(--border);
}

.price-box-main {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.price-current {
    font-size: 18px;
    font-weight: 700;
    font-family: var(--font-mono);
}

.price-change {
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-mono);
}

.price-ah-value {
    font-size: 18px;
    font-weight: 700;
    font-family: var(--font-mono);
}

.price-ah-change {
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-mono);
}

.price-box-timestamp {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* â”€â”€ Digit-Flip Animation (WS live updates) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.price-digit {
    display: inline-block;
    position: relative;
    overflow: hidden;
    line-height: 1;
}

.price-digit.flip {
    animation: digitFlip 0.4s ease;
}

@keyframes digitFlip {
    0%   { transform: translateY(0);    opacity: 1; }
    40%  { transform: translateY(-80%); opacity: 0; }
    60%  { transform: translateY(80%);  opacity: 0; }
    100% { transform: translateY(0);    opacity: 1; }
}

/* Green/red flash on live price update */
.price-box.price-flash-gain {
    animation: flashGain 0.6s ease;
}
.price-box.price-flash-loss {
    animation: flashLoss 0.6s ease;
}

@keyframes flashGain {
    0%, 100% { background: transparent; }
    30%      { background: rgba(34, 197, 94, 0.08); }
}

@keyframes flashLoss {
    0%, 100% { background: transparent; }
    30%      { background: rgba(239, 68, 68, 0.08); }
}

/* WS live indicator dot */
.ws-live-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--gain);
    margin-right: 4px;
    animation: pulseDot 2s infinite;
    vertical-align: middle;
}

@keyframes pulseDot {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.3; }
}

/* â”€â”€ Alert Button â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.alert-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 14px;
    background: rgba(0, 240, 255, 0.07);
    border: 1px solid rgba(0, 240, 255, 0.25);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: var(--neon-cyan);
    transition: var(--transition);
    white-space: nowrap;
    margin-right: 10px;
}

.alert-btn svg { flex-shrink: 0; }

.alert-btn:hover {
    background: rgba(0, 240, 255, 0.14);
    border-color: rgba(0, 240, 255, 0.5);
    box-shadow: 0 0 14px rgba(0, 240, 255, 0.18);
}

/* â”€â”€ Price Alert Modal â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.alert-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.alert-modal {
    background: linear-gradient(145deg, #0e1520, #0a0f1a);
    border: 1px solid rgba(0, 240, 255, 0.2);
    border-radius: var(--radius-lg);
    width: 400px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.8), 0 0 40px rgba(0, 240, 255, 0.06);
    overflow: hidden;
}

.alert-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid rgba(0, 240, 255, 0.1);
    background: rgba(0, 240, 255, 0.03);
}

.alert-modal-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.alert-modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: var(--transition);
}
.alert-modal-close:hover { color: var(--text-primary); background: var(--bg-hover); }

.alert-modal-body { padding: 22px; }

.alert-modal-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.alert-modal-field { margin-bottom: 18px; }

/* Stock display row */
.alert-stock-display {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

/* Criteria toggle (Target Price / Movement Amount) */
.alert-criteria-toggle {
    display: flex;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 3px;
    gap: 3px;
}

.alert-criteria-btn {
    padding: 7px 14px;
    background: none;
    border: none;
    border-radius: 4px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.alert-criteria-btn.active {
    background: rgba(0, 240, 255, 0.12);
    color: var(--neon-cyan);
}

/* Above / Below toggle */
.alert-condition-toggle {
    display: flex;
    gap: 6px;
}

.alert-condition-btn {
    padding: 9px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.alert-condition-btn.active {
    background: rgba(0, 240, 255, 0.1);
    border-color: rgba(0, 240, 255, 0.4);
    color: var(--neon-cyan);
}

/* Movement direction +/- buttons */
.alert-dir-btn {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--text-muted);
    font-size: 20px;
    font-weight: 300;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.alert-dir-btn.active {
    background: rgba(0, 240, 255, 0.1);
    border-color: rgba(0, 240, 255, 0.4);
    color: var(--neon-cyan);
}

/* Price / % input */
.alert-price-input {
    width: 100%;
    padding: 10px 32px 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 15px;
    font-weight: 600;
    outline: none;
    transition: var(--transition);
}
.alert-price-input:focus {
    border-color: rgba(0, 240, 255, 0.4);
    box-shadow: 0 0 0 3px rgba(0, 240, 255, 0.08);
}

/* Notification select */
.alert-notif-select {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    font-family: var(--font-sans);
    outline: none;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.4)' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
    transition: var(--transition);
}
.alert-notif-select:focus { border-color: rgba(0, 240, 255, 0.4); }

/* Submit */
.alert-submit-btn {
    width: 100%;
    padding: 12px;
    background: var(--neon-cyan);
    border: none;
    border-radius: var(--radius-sm);
    color: #050a14;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 4px;
}
.alert-submit-btn:hover {
    background: #33f5ff;
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.35);
}

/* â”€â”€ Watchlist Button variant â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.watchlist-btn {
    background: rgba(138, 92, 246, 0.07);
    border-color: rgba(138, 92, 246, 0.25);
    color: #a78bfa;
}
.watchlist-btn:hover {
    background: rgba(138, 92, 246, 0.14);
    border-color: rgba(138, 92, 246, 0.5);
    box-shadow: 0 0 14px rgba(138, 92, 246, 0.18);
    color: #c4b5fd;
}

/* â”€â”€ Watchlist Modal â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.wl-modal {
    width: 380px;
}

.wl-modal-list {
    max-height: 280px;
    overflow-y: auto;
    padding: 8px 0;
}

.wl-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 22px;
    cursor: default;
    transition: background 0.15s;
}
.wl-item:hover {
    background: rgba(0, 240, 255, 0.04);
}

.wl-item-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.wl-item-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    text-transform: capitalize;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wl-item-add-btn {
    padding: 5px 14px;
    background: rgba(0, 240, 255, 0.08);
    border: 1px solid rgba(0, 240, 255, 0.2);
    border-radius: var(--radius-sm);
    color: var(--neon-cyan);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    flex-shrink: 0;
}
.wl-item-add-btn:hover {
    background: rgba(0, 240, 255, 0.15);
    border-color: rgba(0, 240, 255, 0.45);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.12);
}
.wl-item-add-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.wl-modal-status {
    padding: 0 22px 16px;
    font-size: 13px;
    min-height: 20px;
    text-align: center;
}

.alert-modal-subtitle {
    font-size: 13px;
    color: var(--neon-cyan);
    font-family: var(--font-mono);
    font-weight: 500;
    margin-top: 2px;
    opacity: 0.7;
}

.gain { color: var(--gain); }
.loss { color: var(--loss); }

/* â”€â”€ Tab Navigation â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.tab-nav {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
    overflow-x: auto;
    /* Hide the scrollbar but keep tab nav scrollable */
    scrollbar-width: none;
}
.tab-nav::-webkit-scrollbar { display: none; }

.tab-btn {
    padding: 10px 20px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.tab-btn:hover {
    color: var(--text-secondary);
    background: var(--bg-hover);
}

.tab-btn.active {
    color: #ffffff;
    border-bottom-color: #ffffff;
    font-weight: 600;
}

/* â”€â”€ Cards â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    backdrop-filter: blur(12px);
    transition: var(--transition);
}

.card:hover {
    border-color: var(--border-active);
    box-shadow: var(--glow-sm);
}

.card-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

/* â”€â”€ Key Stats Grid â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    margin-top: 20px;
}

.stat-cell {
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

/* Remove bottom border from the last row of 3 cells */
.stat-cell:nth-last-child(-n+3) {
    border-bottom: none;
}

.stat-cell:nth-child(3n+2) {
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
}

.stat-label {
    font-size: 14px;
    color: var(--text-muted);
}

.stat-value {
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-mono);
    color: var(--text-primary);
}

/* â”€â”€ Analyst Consensus Card (Perplexity parity) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.analyst-consensus-card {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-top: 16px;
}

.ac-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.ac-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.ac-see-all {
    font-size: 13px;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}
.ac-see-all:hover { color: var(--text-secondary); }

.ac-badge-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.ac-badge {
    padding: 4px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.ac-badge-buy    { background: rgba(77,158,110,0.12); color: #4d9e6e; }
.ac-badge-sell   { background: rgba(176,82,82,0.12); color: #b05252; }
.ac-badge-neutral{ background: rgba(255,255,255,0.08); color: var(--text-secondary); }

.ac-analyst-count {
    font-size: 13px;
    color: var(--text-muted);
}

.ac-sentiment-labels {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
}
.ac-bearish { color: #b05252; }
.ac-neutral { color: var(--text-muted); }
.ac-bullish { color: #4d9e6e; }
.ac-label-text { font-weight: 500; }

.ac-bar {
    display: flex;
    gap: 2px;
    margin-bottom: 20px;
}
.ac-bar-block {
    flex: 1;
    height: 8px;
    border-radius: 2px;
}
.ac-bar-bearish { background: #b05252; }
.ac-bar-neutral { background: rgba(255,255,255,0.2); }
.ac-bar-bullish { background: #4d9e6e; }

/* Price target section */
.ac-pt-section {
    padding-top: 4px;
}

.ac-pt-labels {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.ac-pt-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.ac-pt-item:last-child { text-align: right; }

.ac-pt-price {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.ac-pt-dot-label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--text-muted);
}

.ac-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.ac-dot-low     { background: #b05252; }
.ac-dot-current { border: 2px solid #ffffff; background: transparent; width: 6px; height: 6px; }
.ac-dot-avg     { border: 2px solid #4d9e6e; background: transparent; width: 6px; height: 6px; }
.ac-dot-high    { background: #4d9e6e; }

/* Track bar */
.ac-pt-track {
    position: relative;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(90deg, #b05252 0%, rgba(255,255,255,0.15) 30%, rgba(255,255,255,0.15) 70%, #4d9e6e 100%);
    margin-top: 4px;
}

.ac-pt-track-fill {
    position: absolute;
    inset: 0;
    border-radius: 3px;
}

.ac-pt-marker {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
}
.ac-marker-low {
    width: 10px; height: 10px;
    background: #b05252;
}
.ac-marker-current {
    width: 14px; height: 14px;
    border: 2.5px solid #ffffff;
    background: var(--bg-surface);
    z-index: 2;
}
.ac-marker-avg {
    width: 14px; height: 14px;
    border: 2.5px solid #4d9e6e;
    background: var(--bg-surface);
    z-index: 1;
}
.ac-marker-high {
    width: 10px; height: 10px;
    background: #4d9e6e;
}

/* â”€â”€ Data Tables â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    padding: 10px 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
}

.data-table td {
    padding: 10px 12px;
    font-size: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.data-table tr:hover td {
    background: var(--bg-hover);
}

/* -- Key Financials Table ------------------------------------------------- */
.kf-table { border-collapse: collapse; }
.kf-table th { font-size: 13px; font-weight: 500; text-transform: none; letter-spacing: 0; padding: 10px 16px; color: var(--text-muted); white-space: nowrap; }
.kf-label-col { min-width: 180px; width: 180px; }
.kf-table td { padding: 8px 16px; font-size: 14px; font-family: var(--font-mono); cursor: pointer; }
.kf-label { font-family: var(--font-body) !important; color: var(--text-muted); cursor: default; }
.kf-val { text-align: right !important; }
.kf-row-primary .kf-label { color: var(--text-primary); font-weight: 600; }
.kf-row-primary .kf-val { font-weight: 600; color: var(--text-primary); }
.kf-row-sub .kf-label { padding-left: 32px !important; font-size: 13px; }
.kf-row-sub .kf-val { font-size: 13px; color: var(--text-muted); }
.kf-separator td { border-top: 1px solid rgba(255, 255, 255, 0.08); }
.kf-badge { display: inline-flex; align-items: center; padding: 1px 6px; margin-left: 6px; border-radius: 4px; font-size: 10px; font-weight: 600; font-family: var(--font-mono); background: rgba(255, 255, 255, 0.08); color: var(--text-muted); text-decoration: none; border: 1px solid rgba(255, 255, 255, 0.1); transition: all 0.15s; vertical-align: middle; }
.kf-badge:hover { background: rgba(255, 255, 255, 0.15); color: var(--text-primary); border-color: rgba(255, 255, 255, 0.2); }
.kf-estimate-col { color: rgba(255, 255, 255, 0.4) !important; }
.kf-est-icon { font-size: 11px; opacity: 0.5; }
.kf-estimate { color: rgba(255, 255, 255, 0.45) !important; font-style: italic; }
.kf-tooltip { position: absolute; z-index: 100; background: rgba(15, 23, 35, 0.96); border: 1px solid rgba(255, 255, 255, 0.15); border-radius: 10px; padding: 14px 16px; min-width: 240px; max-width: 320px; box-shadow: 0 12px 32px -4px rgba(0, 0, 0, 0.5); pointer-events: auto; font-family: var(--font-body); }
.kf-tip-title { font-weight: 700; font-size: 14px; color: var(--text-primary); margin-bottom: 4px; }
.kf-tip-desc { font-size: 12px; color: var(--text-muted); margin-bottom: 10px; line-height: 1.4; }
.kf-tip-formula { border-top: 1px solid rgba(255, 255, 255, 0.08); padding-top: 8px; }
.kf-tip-line { font-size: 12px; color: var(--text-secondary); margin-bottom: 4px; line-height: 1.5; }
.kf-tip-op { display: inline-block; width: 14px; font-weight: 600; color: var(--text-muted); }
.kf-tip-fval { font-family: var(--font-mono); font-size: 12px; color: var(--text-primary); font-weight: 500; }
.kf-tip-result { font-size: 12px; color: var(--text-secondary); margin-top: 6px; padding-top: 6px; border-top: 1px dashed rgba(255, 255, 255, 0.1); line-height: 1.5; }
.kf-tip-filing { margin-top: 10px; padding-top: 8px; border-top: 1px solid rgba(255, 255, 255, 0.08); font-size: 11px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.kf-section-nav { display: flex; gap: 6px; flex-wrap: wrap; padding: 10px 0 14px; position: sticky; top: 0; z-index: 10; background: var(--bg-primary); }
.kf-section-pill { padding: 6px 14px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--border); border-radius: var(--radius-full); color: var(--text-muted); font-family: var(--font-sans); font-size: 12px; font-weight: 500; cursor: pointer; transition: var(--transition); white-space: nowrap; }
.kf-section-pill:hover { color: var(--text-secondary); border-color: rgba(255, 255, 255, 0.18); background: rgba(255, 255, 255, 0.07); }
.kf-section-pill.active { color: var(--neon-cyan); border-color: rgba(0, 240, 255, 0.3); background: rgba(0, 240, 255, 0.08); box-shadow: 0 0 8px rgba(0, 240, 255, 0.1); }
.kf-info-icon { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; margin-left: 5px; font-size: 12px; color: var(--text-muted); opacity: 0.4; cursor: default; transition: opacity 0.15s, color 0.15s; vertical-align: middle; }
.kf-info-icon:hover { opacity: 1; color: var(--neon-cyan); }

/* â”€â”€ Badges â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font-mono);
}

.badge-gain {
    background: rgba(34, 197, 94, 0.12);
    color: var(--gain);
    border: 1px solid rgba(34, 197, 94, 0.20);
}

.badge-loss {
    background: rgba(239, 68, 68, 0.12);
    color: var(--loss);
    border: 1px solid rgba(239, 68, 68, 0.20);
}

.badge-dem {
    background: rgba(59, 130, 246, 0.15);
    color: var(--blue);
    border: 1px solid rgba(59, 130, 246, 0.25);
}

.badge-rep {
    background: rgba(239, 68, 68, 0.15);
    color: var(--loss);
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.badge-violet {
    background: rgba(168, 85, 247, 0.15);
    color: var(--neon-violet);
    border: 1px solid rgba(168, 85, 247, 0.25);
}

/* â”€â”€ AI Narrative Card â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.ai-card {
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.04), rgba(168, 85, 247, 0.04));
    border: 1px solid rgba(168, 85, 247, 0.15);
    border-radius: var(--radius-md);
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.ai-card::before {
    content: 'âœ¨';
    position: absolute;
    top: 12px;
    right: 14px;
    font-size: 16px;
    opacity: 0.5;
}

.ai-card-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--neon-violet);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ai-card p {
    font-size: 14px;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.80);
}

/* â”€â”€ Chart Container â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.chart-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 4px;
}

.chart-container {
    width: 100%;
    height: 320px;
    background: transparent;
    border: none;
    margin: 0;
    position: relative;
}

.chart-type-btns {
    display: flex;
    gap: 2px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 2px;
}

.chart-type-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px 8px;
    background: none;
    border: none;
    border-radius: 4px;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}

.chart-type-btn:hover {
    background: var(--bg-hover);
    color: var(--text-secondary);
}

.chart-type-btn.active {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.chart-controls-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* â”€â”€ Chart Popover (interval selector) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.chart-popover-wrap {
    position: relative;
}

.chart-popover {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 6px;
    background: #1e2020;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    min-width: 220px;
    z-index: 100;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.7);
}

.chart-popover.active {
    display: block;
}

.popover-section-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.popover-btn-row {
    display: flex;
    gap: 4px;
}

.popover-btn {
    padding: 6px 12px;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
}

.popover-btn:hover {
    background: var(--bg-hover);
    color: var(--text-secondary);
}

.popover-btn.active {
    background: var(--bg-hover);
    border-color: var(--text-secondary);
    color: var(--text-primary);
}

/* â”€â”€ Financial Settings Select â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.fin-year-select {
    width: 100%;
    padding: 6px 10px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    appearance: auto;
}
.fin-year-select:focus {
    outline: none;
    border-color: var(--border-active);
}

.popover-btn-row {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.chart-periods {
    display: flex;
    gap: 2px;
    margin-bottom: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 2px;
    width: fit-content;
}

.chart-period-btn {
    padding: 4px 10px;
    background: none;
    border: none;
    border-radius: 4px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition);
}

.chart-period-btn:hover {
    background: var(--bg-hover);
    color: var(--text-secondary);
}

.chart-period-btn.active {
    background: var(--bg-hover);
    color: var(--text-primary);
    font-weight: 600;
}

/* â”€â”€ Sidebar Components â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.sidebar-section {
    margin-bottom: 24px;
}

.sidebar-section-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.sidebar-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 14px;
}

.sidebar-row-label { color: var(--text-muted); font-size: 14px; }
.sidebar-row-value { color: var(--text-primary); font-weight: 500; font-size: 14px; }

/* â”€â”€ Action Buttons â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-primary);
}

.btn:hover {
    border-color: var(--border-active);
    box-shadow: var(--glow-sm);
}

.btn-primary {
    background: rgba(0, 240, 255, 0.08);
    border-color: rgba(0, 240, 255, 0.25);
    color: var(--neon-cyan);
}

.btn-primary:hover {
    background: rgba(0, 240, 255, 0.15);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.12);
}

.btn-full { width: 100%; justify-content: center; }

/* â”€â”€ News Feed â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.news-item {
    display: flex;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.news-item:last-child { border-bottom: none; }

.news-item-image {
    width: 80px;
    height: 56px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    flex-shrink: 0;
}

.news-item-title {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    margin-bottom: 4px;
}

.news-item-meta {
    font-size: 11px;
    color: var(--text-muted);
}

/* â”€â”€ Loading / Empty States â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.skeleton {
    background: linear-gradient(90deg, var(--bg-surface) 25%, var(--bg-hover) 50%, var(--bg-surface) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
}

@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 32px;
    margin-bottom: 12px;
    opacity: 0.3;
}

/* â”€â”€ Scrollbar â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.20); }

/* â”€â”€ Tab Content Visibility â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.tab-content { display: none; }
.tab-content.active { display: block; }

/* â”€â”€ Period Toggle â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.period-toggle {
    display: inline-flex;
    gap: 6px;
    padding: 4px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.period-toggle-btn {
    padding: 6px 16px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--text-muted);
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    letter-spacing: 0.3px;
}

.period-toggle-btn:hover {
    color: var(--text-secondary);
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
}

.period-toggle-btn.active {
    color: var(--neon-cyan);
    border-color: var(--neon-cyan);
    background: rgba(0, 240, 255, 0.06);
    font-weight: 600;
    box-shadow: 0 0 8px rgba(0, 240, 255, 0.15);
}

/* â”€â”€ Underline variant (for financial statement type selectors) â”€â”€â”€â”€â”€ */
.period-toggle--underline {
    background: none;
    border: none;
    border-radius: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0;
    gap: 0;
}

.period-toggle--underline .period-toggle-btn {
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    padding: 8px 16px;
    font-size: 14px;
    letter-spacing: 0;
}

.period-toggle--underline .period-toggle-btn:hover {
    background: none;
    border-color: transparent;
    color: var(--text-secondary);
}

.period-toggle--underline .period-toggle-btn.active {
    color: white;
    border-color: transparent;
    border-bottom-color: white;
    background: none;
    box-shadow: none;
}

/* â”€â”€ Analyst Consensus Bar (Perplexity-style) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.consensus-bar {
    display: flex;
    height: 6px;
    border-radius: 3px;
    overflow: hidden;
    margin: 8px 0;
}

.consensus-bar-segment {
    transition: width 0.3s ease;
}

.consensus-breakdown {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    margin-top: 4px;
}

.consensus-breakdown span { font-weight: 500; }

/* â”€â”€ Price Target Range Line (Perplexity-style) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.price-target-range {
    position: relative;
    margin: 16px 0 8px;
}

.price-target-labels {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    font-family: var(--font-mono);
    margin-bottom: 6px;
}

.price-target-labels .pt-label { color: var(--text-muted); }
.price-target-labels .pt-value { font-weight: 600; color: var(--text-primary); }

.price-target-line {
    position: relative;
    height: 4px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    margin: 4px 0;
}

.price-target-dot {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    top: -3px;
    transform: translateX(-50%);
}

.price-target-dot.dot-low   { background: var(--loss); }
.price-target-dot.dot-current { background: var(--text-primary); border: 2px solid var(--bg-primary); width: 12px; height: 12px; top: -4px; }
.price-target-dot.dot-avg   { background: var(--gain); }
.price-target-dot.dot-high  { background: var(--gain); }

/* â”€â”€ Earnings Quarter Chips (horizontal scroll) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.quarter-chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 12px;
    margin-bottom: 20px;
    scrollbar-width: thin;
}

.quarter-chip {
    flex-shrink: 0;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
    background: var(--bg-surface);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
    white-space: nowrap;
}

.quarter-chip:hover { border-color: var(--border-active); }

.quarter-chip.active {
    background: rgba(0, 240, 255, 0.08);
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
}

.quarter-chip .chip-move {
    font-size: 11px;
    font-family: var(--font-mono);
    font-weight: 600;
}

/* â”€â”€ Earnings Summary Card â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.earnings-summary {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1px;
    background: var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 24px;
}

.earnings-summary-cell {
    background: var(--bg-primary);
    padding: 16px;
}

.earnings-summary-cell .es-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.earnings-summary-cell .es-values {
    display: flex;
    gap: 16px;
    align-items: baseline;
}

.earnings-summary-cell .es-est {
    font-size: 14px;
    color: var(--text-muted);
}

.earnings-summary-cell .es-actual {
    font-size: 18px;
    font-weight: 700;
    font-family: var(--font-mono);
}

/* â”€â”€ Holders Summary Stats â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.holders-summary {
    display: flex;
    gap: 16px;
    align-items: center;
    padding: 10px 0;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-muted);
}

.holders-summary .hs-stat {
    font-weight: 600;
    color: var(--text-primary);
}

/* â”€â”€ Sidebar Consensus Card (enhanced) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.sidebar-consensus-badge {
    display: inline-flex;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
}

.sidebar-consensus-badge.buy {
    background: rgba(34, 197, 94, 0.15);
    color: var(--gain);
    border: 1px solid rgba(34, 197, 94, 0.25);
}

.sidebar-consensus-badge.neutral {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.sidebar-consensus-badge.sell {
    background: rgba(239, 68, 68, 0.15);
    color: var(--loss);
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.quarter-chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 12px;
    margin-bottom: 20px;
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

.quarter-chips::-webkit-scrollbar {
    display: none; /* Chrome, Safari and Opera */
}

.quarter-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text-muted);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.quarter-chip:hover {
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--text-secondary);
}

.quarter-chip.active {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
}

.earnings-call-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.earnings-call-title { font-size: 18px; font-weight: 600; color: var(--text-primary); }
.listen-btn { display: inline-flex; align-items: center; gap: 6px; background: transparent; border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-primary); padding: 6px 12px; font-size: 13px; cursor: pointer; transition: all 0.2s; }
.listen-btn:hover { background: rgba(255,255,255,0.05); }
.earnings-date { font-size: 14px; color: var(--text-muted); margin-bottom: 24px; }

/* Earnings call summary — dual-grid card */
.earnings-dual-grid {
    display: flex;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: rgba(0, 0, 0, 0.15);
    margin-bottom: 24px;
    overflow: hidden;
}

.earnings-dual-grid-left {
    flex: 3;
    border-right: 1px solid var(--border);
}

.earnings-dual-grid-right {
    flex: 2;
}

.earnings-grid-row {
    display: grid;
    grid-template-columns: 100px 1fr 90px 120px;
    align-items: center;
    padding: 10px 20px;
    border-bottom: 1px solid var(--border);
    min-height: 44px;
}

.earnings-dual-grid-right .earnings-grid-row {
    grid-template-columns: 1fr auto;
}

.earnings-grid-row:last-child {
    border-bottom: none;
}

.eg-label {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
}

.eg-val-est {
    font-size: 14px;
    color: var(--text-muted);
    text-align: right;
}

.eg-val-act {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    text-align: right;
    font-family: var(--font-mono);
}

.eg-val-diff {
    font-size: 14px;
    font-weight: 500;
    text-align: right;
}

.hide-scrollbar { scrollbar-width: none; -ms-overflow-style: none; }
.hide-scrollbar::-webkit-scrollbar { display: none; }
.stream-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--radius-full); background: var(--neon-cyan); color: #000; font-size: 10px; font-weight: 700; }



.app-shell {
    display: flex;
    flex-direction: row;
    height: 100vh;
    overflow: hidden;
}

/* ── Full-height App Sidebar ────────────────────────────────────────── */
.app-sidebar {
    width: 200px;
    min-width: 200px;
    height: 100vh;
    background: var(--bg-sidebar);
    border-right: none;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: width 0.22s cubic-bezier(.4,0,.2,1), min-width 0.22s cubic-bezier(.4,0,.2,1);
    overflow: hidden;
    z-index: 200;
    position: relative;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.4);
}

.app-sidebar.collapsed {
    width: 56px;
    min-width: 56px;
}

/* Logo / brand toggle area */
.sidebar-logo-area {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
    height: 58px;
    min-height: 58px;
    box-sizing: border-box;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    overflow: hidden;
    transition: background 0.15s;
    user-select: none;
    position: relative;
    z-index: 10;
}

.sidebar-logo-area:hover {
    background: rgba(0, 240, 255, 0.04);
}

.sidebar-logo-img {
    width: 28px;
    height: 28px;
    object-fit: contain;
    flex-shrink: 0;
}

.sidebar-brand {
    font-size: 14px;
    font-weight: 400;
    color: var(--text-secondary);
    white-space: nowrap;
    opacity: 1;
    max-width: 200px;
    overflow: hidden;
    transition: opacity 0.18s, max-width 0.18s;
    letter-spacing: 0.02em;
}

.app-sidebar.collapsed .sidebar-brand {
    opacity: 0;
    max-width: 0;
    overflow: hidden;
    pointer-events: none;
}

.app-sidebar.collapsed .sidebar-logo-area {
    justify-content: center;
    align-items: center;
    padding: 0;
    gap: 0;
}

/* ── App Right: header + content ──────────────────────────────────── */
.app-right {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ── Sidebar Sections Nav ─────────────────────────────────────────── */
.sidebar-sections {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0;
    scrollbar-width: none;
}

.sidebar-sections::-webkit-scrollbar { display: none; }

/* Market group */
.sidebar-group {
    position: relative;
    border: none;
}

/* Main group button: icon + label */
.sidebar-group-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 11px 14px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.15s, background 0.15s;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-group-btn:hover {
    color: var(--text-secondary);
    background: var(--bg-hover);
}

.sidebar-group-btn.active {
    background: none;
}

.sidebar-group-btn.active .sidebar-group-icon {
    color: var(--neon-cyan);
}

.sidebar-group-btn.active .sidebar-group-label {
    color: var(--text-muted);
}

.sidebar-group-icon {
    width: 20px;
    min-width: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: inherit;
    flex-shrink: 0;
}

.sidebar-group-label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    opacity: 1;
    max-width: 200px;
    transition: opacity 0.18s, max-width 0.18s;
}

.app-sidebar.collapsed .sidebar-group-label {
    opacity: 0;
    max-width: 0;
    overflow: hidden;
    pointer-events: none;
}

.app-sidebar.collapsed .sidebar-group-btn {
    justify-content: center;
    align-items: center;
    padding: 11px 0;
    width: 100%;
}

/* Subsection items block */
.sidebar-group-items {
    overflow: hidden;
    background: rgba(0, 240, 255, 0.04);
    border-radius: 0 0 6px 6px;
}

/* Horizontal divider lines above/below subsections */
.sidebar-sub-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 2px 0;
}

/* Subsection links */
.sidebar-section-link {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 14px 8px 14px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 12px;
    font-weight: 400;
    transition: color 0.15s, background 0.15s;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-section-link:hover {
    color: var(--text-secondary);
    background: var(--bg-hover);
    text-decoration: none;
}

.sidebar-section-link.active {
    color: var(--neon-cyan);
    background: rgba(0, 240, 255, 0.06);
    font-weight: 500;
}

.sidebar-section-icon {
    width: 20px;
    min-width: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar-section-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    opacity: 1;
    max-width: 200px;
    transition: opacity 0.18s, max-width 0.18s;
}

/* Collapsed: hide labels, subsections still show as icon-only strip */
.app-sidebar.collapsed .sidebar-section-label {
    opacity: 0;
    max-width: 0;
    overflow: hidden;
    pointer-events: none;
}

.app-sidebar.collapsed .sidebar-section-link {
    justify-content: center;
    align-items: center;
    padding: 8px 0;
    width: 100%;
}

/* Tooltip via title attr - CSS enhancement for collapsed icons */
.app-sidebar.collapsed [title]:hover::after {
    content: attr(title);
    position: fixed;
    left: 62px;
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 9999;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

padding: 0 5px;
    border-radius: var(--radius-full);
    background: var(--neon-cyan);
    color: #000;
    font-size: 10px;
    font-weight: 700;
    font-family: var(--font-mono);
    margin-left: 6px;
    vertical-align: middle;
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(0, 240, 255, 0.4); }
    50% { box-shadow: 0 0 8px 2px rgba(0, 240, 255, 0.2); }
}

.stream-card {
    border: 1px solid var(--border);
    border-left: 3px solid var(--text-muted);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    margin-bottom: 10px;
    background: var(--bg-card);
    transition: var(--transition);
}

.stream-card:hover {
    border-color: var(--border-active);
    background: var(--bg-hover);
}

.stream-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.stream-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
}

.stream-time {
    font-size: 12px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.stream-card-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.5;
    margin-bottom: 4px;
}

.stream-card-title a {
    color: var(--text-primary);
    text-decoration: none;
}

.stream-card-title a:hover {
    color: var(--neon-cyan);
    text-decoration: underline;
}

.stream-card-source {
    font-size: 12px;
    color: var(--text-muted);
}

.stream-card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

.stream-meta-badge {
    padding: 1px 8px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    font-size: 11px;
    font-weight: 500;
    text-transform: capitalize;
}

/* Stream card body & details */
.stream-card-body {
    padding: 2px 0 0;
}

.stream-news-body {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.stream-news-img {
    width: 80px;
    height: 56px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    border: 1px solid var(--border);
}

.stream-card-snippet {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-top: 4px;
}

.stream-ticker-pill {
    display: inline-flex;
    align-items: center;
    padding: 1px 6px;
    border-radius: 4px;
    background: rgba(0, 240, 255, 0.08);
    border: 1px solid rgba(0, 240, 255, 0.15);
    color: var(--neon-cyan);
    font-size: 10px;
    font-weight: 700;
    font-family: var(--font-mono);
    letter-spacing: 0.5px;
}

.stream-ticker-pill.small {
    font-size: 9px;
    padding: 0 4px;
}

.stream-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 16px;
    margin-top: 8px;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.stream-detail-pair {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    padding: 2px 0;
}

.stream-detail-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.stream-detail-value {
    font-size: 12px;
    color: var(--text-primary);
    font-weight: 500;
    font-family: var(--font-mono);
    text-align: right;
}

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   Markets Dashboard â€” Navigation & Layout
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */

/* â”€â”€ Header Row (search + breadcrumb) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.header-row {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    justify-content: center;
}

/* Breadcrumb bar: top of markets-main, right-aligned */
.breadcrumb-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 6px 24px;
    background: transparent;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    white-space: nowrap;
    flex-shrink: 0;
}

.breadcrumb-item {
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
}

.breadcrumb-item:hover {
    color: var(--neon-cyan);
    text-decoration: none;
}

.breadcrumb-item.active {
    color: var(--text-primary);
    font-weight: 600;
    cursor: default;
}

.breadcrumb-sep {
    color: var(--text-muted);
    opacity: 0.5;
    font-size: 14px;
}

/* â”€â”€ Markets Sidebar â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.markets-sidebar {
    width: 190px;
    min-width: 190px;
    border-right: 1px solid var(--border);
    background: var(--bg-sidebar);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 53px;  /* below header */
    height: calc(100vh - 53px);
    overflow-y: auto;
    transition: width 0.25s ease, min-width 0.25s ease;
    z-index: 50;
}

.markets-sidebar.collapsed {
    width: 48px;
    min-width: 48px;
}

.markets-sidebar.collapsed .sidebar-group-label,
.markets-sidebar.collapsed .sidebar-section-label,
.markets-sidebar.collapsed .sidebar-chevron {
    display: none;
}

.markets-sidebar.collapsed .sidebar-group-items {
    display: none !important;
}

.markets-sidebar.collapsed .sidebar-group-btn {
    justify-content: center;
    padding: 10px 4px;
}

/* Sidebar Toggle Button */
.sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
}

.sidebar-toggle:hover {
    color: var(--neon-cyan);
    background: var(--bg-hover);
}

/* Sidebar Market Tabs â†’ Two-level tree menu */
.sidebar-group {
    border-bottom: 1px solid rgba(0, 240, 255, 0.04);
}

.sidebar-group-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 14px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
}

.sidebar-group-btn:hover {
    color: var(--text-secondary);
    background: var(--bg-hover);
}

.sidebar-group-btn.active {
    background: none;
}

.sidebar-group-btn.active .sidebar-group-icon {
    color: var(--neon-cyan);
}

.sidebar-group-btn.active .sidebar-group-label {
    color: var(--text-muted);
}

.sidebar-group-icon {
    width: 18px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: inherit;
}

.sidebar-group-label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-chevron {
    flex-shrink: 0;
    transition: transform 0.2s ease;
    opacity: 0.4;
}

.sidebar-group.open .sidebar-chevron {
    transform: rotate(180deg);
    opacity: 0.7;
}

.sidebar-group-items {
    padding-bottom: 4px;
    background: rgba(0, 240, 255, 0.04);
    border-radius: 0 0 6px 6px;
}

/* Sidebar Section Links (nested subsections) */
.sidebar-sections {
    flex: 1;
    overflow-y: auto;
    padding: 4px 0;
}

.sidebar-section-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px 7px 28px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 12px;
    font-weight: 400;
    transition: var(--transition);
    border-left: 2px solid transparent;
}

.sidebar-section-link:hover {
    color: var(--text-secondary);
    background: var(--bg-hover);
    text-decoration: none;
}

.sidebar-section-link.active {
    color: var(--neon-cyan);
    border-left-color: var(--neon-cyan);
    background: rgba(0, 240, 255, 0.04);
    font-weight: 500;
}

.sidebar-section-icon {
    font-size: 14px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-section-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* â”€â”€ Markets Main Content â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.markets-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    scrollbar-width: none;
}

.markets-main::-webkit-scrollbar { display: none; }

#markets-content {
    padding: 24px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* Market tab content visibility */
.market-tab-content {
    display: none;
}

.market-tab-content.active {
    display: block;
}

/* â”€â”€ Market Sections â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.market-section {
    margin-bottom: 32px;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--border);
}

.market-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.section-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-body {
    min-height: 120px;
}

.section-loading {
    padding: 20px 0;
}

/* Overview sub-blocks (grouped within a single section) */
.overview-block {
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(0, 240, 255, 0.06);
}

.overview-block:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

/* Section sub-tabs (Flow, Segments) */
.flow-sub-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    padding: 4px;
    background: rgba(0, 240, 255, 0.03);
    border-radius: var(--radius-md);
    border: 1px solid rgba(0, 240, 255, 0.06);
}

.flow-tab {
    padding: 6px 14px;
    background: none;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.flow-tab:hover {
    color: var(--text-secondary);
    background: var(--bg-hover);
}

.flow-tab.active {
    color: var(--neon-cyan);
    background: rgba(0, 240, 255, 0.08);
    font-weight: 600;
}

/* â”€â”€ Index Cards â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.index-cards {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-top: 10px;
    margin-bottom: 0;
}

.index-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 14px 10px;`n    font-family: var(--font-sans);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow: hidden;
}

.index-card:hover {
    border-color: rgba(0, 240, 255, 0.2);
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.05);
}

.index-card.active {
    border-color: rgba(0, 240, 255, 0.35);
    background: rgba(0, 240, 255, 0.04);
    box-shadow: 0 0 16px rgba(0, 240, 255, 0.08);
}

.index-card-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.index-card-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    flex-shrink: 0;
}

.index-card-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.index-card-symbol {
    font-size: 10px;
    color: var(--text-muted);
}

.index-card-change {
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
}

.index-card-change.gain { color: var(--gain); }
.index-card-change.loss { color: var(--loss); }

.index-card-periods {
    display: flex;
    gap: 6px;
    font-size: 9px;
    color: var(--text-muted);
}

/* â”€â”€ Heatmap Grid â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.heatmap-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 6px;
}

.heatmap-sector {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px;
    text-align: center;
    transition: var(--transition);
    cursor: default;
}

.heatmap-sector.gain {
    background: rgba(0, 200, 83, 0.06);
    border-color: rgba(0, 200, 83, 0.15);
}

.heatmap-sector.loss {
    background: rgba(255, 68, 68, 0.06);
    border-color: rgba(255, 68, 68, 0.15);
}

.heatmap-sector-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.heatmap-sector-pct {
    font-size: 16px;
    font-weight: 700;
}

.heatmap-sector-pct.gain { color: var(--gain); }
.heatmap-sector-pct.loss { color: var(--loss); }

.heatmap-sector-count {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* â”€â”€ Movers Table â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.movers-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
    padding: 4px;
    background: rgba(0, 240, 255, 0.03);
    border-radius: var(--radius-md);
    border: 1px solid rgba(0, 240, 255, 0.06);
}


/* Sort header cursor — pointer, no text selection */
.movers-th-sort,
.cal-th-sort {
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}

.cal-date-header {
    cursor: default;
    user-select: none;
    -webkit-user-select: none;
}

.movers-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
}

.movers-table th {
    text-align: left;
    padding: 8px 10px;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
}

.movers-table td {
    padding: 8px 10px;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(0, 240, 255, 0.03);
}

.movers-table tr:hover td {
    background: var(--bg-hover);
}

.mover-symbol {
    font-weight: 600;
    color: var(--neon-cyan) !important;
}

.world-index-table td, .world-index-table th {
    padding: 11px 12px;
    font-size: 15px;
}


.mover-name {
    color: var(--text-muted) !important;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

td.gain, .gain { color: var(--gain) !important; }
td.loss, .loss { color: var(--loss) !important; }

/* â”€â”€ News Feed â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.news-feed {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.news-item {
    display: flex;
    gap: 14px;
    padding: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: var(--transition);
}

.news-item:hover {
    border-color: rgba(0, 240, 255, 0.2);
    text-decoration: none;
}

.news-thumb {
    width: 80px;
    height: 56px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.news-body {
    flex: 1;
    min-width: 0;
}

.news-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-meta {
    display: flex;
    gap: 10px;
    font-size: 11px;
    color: var(--text-muted);
}

.news-ticker {
    color: var(--neon-cyan);
    font-weight: 600;
}

.news-desc {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.4;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-type-badge {
    display: inline-flex;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(0, 240, 255, 0.08);
    color: var(--neon-cyan);
    border: 1px solid rgba(0, 240, 255, 0.15);
}

/* â”€â”€ Calendar Components â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.cal-header {
    margin-bottom: 12px;
}

.cal-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cal-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 20px;
    font-weight: 600;
    transition: var(--transition);
}

.cal-today {
    font-size: 20px;
    padding: 4px 14px;
}

.cal-btn:hover {
    border-color: rgba(0, 240, 255, 0.3);
    color: var(--neon-cyan);
}

.cal-btn svg {
    display: block;
}

.cal-week-label {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-left: 8px;
}

/* Day cards row */
.cal-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    margin-top: 24px;
    margin-bottom: 24px;
}

.cal-day-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    cursor: pointer;
    transition: var(--transition);
}

.cal-day-card:hover {
    border-color: rgba(0, 240, 255, 0.25);
}

.cal-day-card.today {
    border-color: rgba(0, 240, 255, 0.4);
    background: rgba(0, 240, 255, 0.04);
}

.cal-day-card.active {
    border-color: var(--neon-cyan);
    background: rgba(0, 240, 255, 0.08);
}

.cal-day-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.cal-day-count {
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    line-height: 1.5;
}

.cal-day-count span {
    color: var(--neon-cyan);
    font-weight: 600;
}

.cal-day-none {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.15);
}

/* Calendar sub-tabs */
.cal-tabs {
    margin-bottom: 12px;
}

/* Date headers in table groups */
.cal-date-header {
    font-size: 18px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.95);
    padding: 8px 14px;
    background: rgba(0, 240, 255, 0.05);
    border-top: 1px solid rgba(0, 240, 255, 0.15);
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-top: 8px;
}

.cal-date-header:first-child {
    margin-top: 0;
}

/* Calendar table overrides */
/* Calendar table: match world-index-table style */
.cal-table th {
    font-size: 15px;
    padding: 11px 12px;
}

.cal-table td {
    font-size: 15px;
    padding: 11px 12px;
}

.cal-company {
    color: var(--text-secondary);
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cal-country {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
}

.cal-pending {
    color: rgba(255, 100, 100, 0.7);
    font-style: italic;
    font-size: 11px;
}

/* Tabs row with filter button */
.cal-tabs-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.cal-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 15px;
}

/* Timing column */
.cal-table {
    border-collapse: collapse;
}

.mover-row:hover td {
    background: rgba(255, 255, 255, 0.05) !important;
}

.cal-time {
    white-space: nowrap;
    font-size: 13px;
    font-family: monospace;
    color: var(--text-muted);
}

.cal-time-inner {
    display: flex;
    align-items: center;
    gap: 6px;
}

.cal-timing-icon {
    width: 16px;
    height: 16px;
}

.cal-timing-icon.sunrise {
    color: #ff9f43;
    filter: drop-shadow(0 0 5px rgba(255, 159, 67, 0.6));
}

.cal-timing-icon.moon {
    color: #54a0ff;
    filter: drop-shadow(0 0 5px rgba(84, 160, 255, 0.6));
}

/* Sortable column headers */
.cal-th-sort {
    cursor: pointer;
    user-select: none;
    position: relative;
}

.cal-th-sort:hover {
    color: var(--neon-cyan) !important;
}

.cal-th-sort::after {
    content: ' â‡…';
    opacity: 0.25;
    font-size: 9px;
}

/* Country filter modal */
.cal-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.15s ease-out;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.cal-modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    width: 420px;
    max-height: 70vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.cal-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    font-weight: 700;
    font-size: 13px;
    color: var(--text-primary);
}

.cal-modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    padding: 0 4px;
}

.cal-modal-close:hover { color: var(--text-primary); }

.cal-modal-actions {
    display: flex;
    gap: 8px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
}

.cal-modal-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    padding: 12px 16px;
    overflow-y: auto;
    max-height: 50vh;
}

.cal-country-opt {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 12px;
    color: var(--text-secondary);
    transition: var(--transition);
}

.cal-country-opt:hover {
    background: rgba(0, 240, 255, 0.04);
}

.cal-country-opt input[type="checkbox"] {
    accent-color: var(--neon-cyan);
}

.cal-modal-footer {
    padding: 10px 16px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
}

.cal-apply-filter {
    background: rgba(0, 240, 255, 0.1) !important;
    border-color: rgba(0, 240, 255, 0.3) !important;
    color: var(--neon-cyan) !important;
    padding: 6px 20px !important;
}

/* â”€â”€ World Indexes â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.world-indexes {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.world-region {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
}

.world-region-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--neon-cyan);
    margin-bottom: 10px;
}

/* â”€â”€ Responsive â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
@media (max-width: 1024px) {
    .app-body {
        grid-template-columns: 1fr;
    }
    .right-sidebar {
        border-left: none;
        border-top: 1px solid var(--border);
        max-height: none;
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Hide sidebar on narrow viewports (iframe embed or mobile) */
@media (max-width: 720px) {
    .markets-sidebar {
        display: none !important;
    }
    #markets-content {
        padding: 16px;
    }
}

@media (max-width: 640px) {
    .main-content { padding: 16px; }
    .app-header { padding: 0 !important; }
    .stats-grid { grid-template-columns: 1fr; }
    .price-current { font-size: 24px; }
    .breadcrumb { display: none; }
}


/* %% Country Filter Modal %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% */
.cal-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.cal-modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 620px;
    max-width: 95vw;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    overflow: hidden;
}

.cal-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--border);
}

.cal-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.cal-modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s;
}
.cal-modal-close:hover { color: var(--text-primary); }

.cal-day-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 8px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-height: 100px;
    justify-content: center;
}

.cal-day-card:hover {
    border-color: rgba(0, 240, 255, 0.4);
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.02);
}

.cal-day-card.today {
    border-color: rgba(0, 240, 255, 0.3);
    background: rgba(0, 240, 255, 0.04);
}

.cal-day-card.active {
    border-color: var(--neon-cyan);
    background: rgba(0, 240, 255, 0.08);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.1);
}

.cal-day-header {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.cal-day-main {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.cal-day-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
}

.cal-day-logos {
    display: flex;
    align-items: center;
}

.cal-day-logos .cal-ticker-logo-wrap {
    width: 20px;
    height: 20px;
    margin-right: 2px;
    border: none;
}

.cal-day-logos .cal-ticker-img, 
.cal-day-logos .cal-ticker-icon {
    width: 100%;
    height: 100%;
    font-size: 8px;
}

.cal-day-count-text {
    font-size: 15px;
    color: var(--text-muted);
    font-weight: 500;
    white-space: nowrap;
}

.cal-day-no-calls {
    font-size: 13px;
    color: rgba(255,255,255,0.15);
    font-weight: 600;
}

.cal-modal-search {
    padding: 16px 24px 8px;
    position: relative;
}
.cal-modal-search svg {
    position: absolute;
    left: 36px;
    top: 29px;
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    pointer-events: none;
}
.cal-modal-search input {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 10px 12px 10px 38px;
    font-size: 14px;
    color: var(--text-primary);
    outline: none;
    transition: all 0.2s;
}
.cal-modal-search input:focus {
    border-color: var(--cyan);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 0 2px rgba(0, 255, 255, 0.1);
}

.cal-modal-selected {
    padding: 12px 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: flex-start;
    min-height: 44px;
    max-height: 180px;
    overflow-y: auto;
    background: rgba(0,0,0,0.2);
    border-bottom: 1px solid var(--border);
}

.cal-filter-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cal-active-filters {
    display: flex;
    align-items: center;
    gap: 4px;
}

.filter-flag-bubble {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 50%;
    font-size: 14px;
    line-height: 1;
}

.filter-flag-more {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 600;
    margin-left: 2px;
}

.country-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(0, 255, 255, 0.1);
    border: 1px solid rgba(0, 255, 255, 0.2);
    border-radius: 20px;
    padding: 2px 8px 2px 6px;
    font-size: 11px;
    font-weight: 600;
    color: var(--cyan);
}
.country-badge .badge-code {
    opacity: 0.8;
}
.country-badge button {
    background: transparent;
    border: none;
    color: var(--cyan);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    margin-left: 2px;
    display: flex;
    align-items: center;
    opacity: 0.6;
}
.country-badge button:hover { opacity: 1; color: var(--loss); }

.cal-clear-all-bubbles {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 80, 80, 0.12);
    border: 1px solid rgba(255, 80, 80, 0.3);
    color: #ff6b6b;
    font-size: 13px;
    font-weight: 600;
    border-radius: 20px;
    padding: 3px 12px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    align-self: center;
}
.cal-clear-all-bubbles:hover {
    background: rgba(255, 80, 80, 0.22);
    border-color: rgba(255, 80, 80, 0.5);
    color: #ff4444;
}

.cal-modal-aggregations {
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}
.cal-agg-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    border-radius: var(--radius-md);
    padding: 6px 12px;
    transition: all 0.2s;
}
.cal-agg-btn:hover { 
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border-color: var(--text-muted);
}

.cal-modal-list {
    flex: 1;
    overflow-y: auto;
    padding: 16px 24px;
    min-height: 200px;
}

.cal-modal-continent {
    margin-bottom: 24px;
}
.cal-modal-continent h4 {
    margin: 0 0 12px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.cal-modal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 8px;
}

.cal-country-opt {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: background 0.2s;
    font-size: 14px;
    color: var(--text-secondary);
}
.cal-country-opt:hover {
    background: rgba(255,255,255,0.03);
    color: var(--text-primary);
}
.cal-country-opt input {
    display: none;
}
.cal-country-opt:has(input:checked) {
    background: rgba(255,255,255,0.08);
    color: var(--text-primary);
}

.cal-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    background: rgba(0,0,0,0.2);
}

.cal-modal-footer .cal-btn {
    padding: 8px 20px;
}
.cal-modal-footer .cal-apply-filter {
    background: #fff;
    color: #000;
    border-color: #fff;
    font-weight: 600;
}
.cal-modal-footer .cal-apply-filter:hover {
    background: #e5e5e5;
}

.cal-filter-badge {
    display: inline-block;
    background: rgba(255,255,255,0.15);
    color: #fff;
    border-radius: 10px;
    padding: 0 8px;
    font-size: 15px;
    font-weight: 700;
    line-height: 20px;
    margin-right: 8px;
}



/* â”€â”€ Calendar Ticker Icon â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.cal-ticker-logo-wrap {
    display: inline-flex;
    vertical-align: middle;
    margin-right: 6px;
    width: 22px;
    height: 22px;
    position: relative;
    align-items: center;
    justify-content: center;
}

.cal-ticker-img {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: contain;
    background: #fff;
}

.cal-ticker-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    min-width: 22px;
    border-radius: 50%;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    vertical-align: middle;
}

.cal-ticker-logo-wrap .cal-ticker-icon {
    margin-right: 0;
}
.cal-star {
    color: rgba(255, 255, 255, 0.1);
    font-size: 18px;
    margin-right: 1px;
    letter-spacing: -2px;
}

.cal-star.active {
    color: var(--neon-cyan);
    text-shadow: 0 0 8px rgba(0, 240, 255, 0.6);
}

.cal-impact {
    white-space: nowrap;
    min-width: 60px;
}

.cal-now-line td {
    padding: 0 !important;
    height: 2px !important;
    background: #ff4444;
    box-shadow: 0 0 10px rgba(255, 68, 68, 0.4);
    border: none !important;
}

.sunrise { color: #ff9f43 !important; filter: drop-shadow(0 0 5px rgba(255, 159, 67, 0.4)); }
.moon { color: #54a0ff !important; filter: drop-shadow(0 0 5px rgba(84, 160, 255, 0.4)); }
.cal-time.sunrise span { color: #ff9f43; text-shadow: 0 0 5px rgba(255, 159, 67, 0.3); }
.cal-time.moon span { color: #54a0ff; text-shadow: 0 0 5px rgba(84, 160, 255, 0.3); }

/* â”€â”€ Calendar Table Alignment â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.cal-table {
    table-layout: fixed;
    width: 100%;
}

.cal-table th, .cal-table td {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 11px 12px;
}

.cal-table th.cal-time, .cal-table td.cal-time {
    overflow: visible;
    text-overflow: clip;
}

/* Economy 7-col: Time | Impact | Country(flag+name) | Event | Actual | Forecast | Prior */
.cal-table-economy th:nth-child(1), .cal-table-economy td:nth-child(1) { width: 10%; }
.cal-table-economy th:nth-child(2), .cal-table-economy td:nth-child(2) { width: 8%; }
.cal-table-economy th:nth-child(3), .cal-table-economy td:nth-child(3) { width: 24%; }
.cal-table-economy th:nth-child(4), .cal-table-economy td:nth-child(4) { width: 34%; }
.cal-table-economy th:nth-child(5), .cal-table-economy td:nth-child(5) { width: 8%; }
.cal-table-economy th:nth-child(6), .cal-table-economy td:nth-child(6) { width: 8%; }
.cal-table-economy th:nth-child(7), .cal-table-economy td:nth-child(7) { width: 8%; }

/* Earnings 8-col: Time | Company(logo+name) | MktCap | Est EPS | Act EPS | EPS Surp | Revenue | Rev Surp */
.cal-table-earnings th:nth-child(1), .cal-table-earnings td:nth-child(1) { width: 8%; }
.cal-table-earnings th:nth-child(2), .cal-table-earnings td:nth-child(2) { width: 26%; }
.cal-table-earnings th:nth-child(3), .cal-table-earnings td:nth-child(3) { width: 9%; }
.cal-table-earnings th:nth-child(4), .cal-table-earnings td:nth-child(4) { width: 9%; }
.cal-table-earnings th:nth-child(5), .cal-table-earnings td:nth-child(5) { width: 9%; }
.cal-table-earnings th:nth-child(6), .cal-table-earnings td:nth-child(6) { width: 10%; }
.cal-table-earnings th:nth-child(7), .cal-table-earnings td:nth-child(7) { width: 12%; }
.cal-table-earnings th:nth-child(8), .cal-table-earnings td:nth-child(8) { width: 10%; }

/* Dividends: Symbol(15%), Mkt Cap(15%), Div(12%), Adj Div(12%), Record(15%), Payment(15%), Decl(16%) */
.cal-table-dividends th:nth-child(1), .cal-table-dividends td:nth-child(1) { width: 15%; }
.cal-table-dividends th:nth-child(2), .cal-table-dividends td:nth-child(2) { width: 15%; }
.cal-table-dividends th:nth-child(3), .cal-table-dividends td:nth-child(3) { width: 12%; }
.cal-table-dividends th:nth-child(4), .cal-table-dividends td:nth-child(4) { width: 12%; }
.cal-table-dividends th:nth-child(5), .cal-table-dividends td:nth-child(5) { width: 15%; }
.cal-table-dividends th:nth-child(6), .cal-table-dividends td:nth-child(6) { width: 15%; }
.cal-table-dividends th:nth-child(7), .cal-table-dividends td:nth-child(7) { width: 16%; }

/* IPOs: Symbol(15%), Company(40%), Exchange(15%), Price Range(15%), Shares(15%) */
.cal-table-ipos th:nth-child(1), .cal-table-ipos td:nth-child(1) { width: 15%; }
.cal-table-ipos th:nth-child(2), .cal-table-ipos td:nth-child(2) { width: 40%; }
.cal-table-ipos th:nth-child(3), .cal-table-ipos td:nth-child(3) { width: 15%; }
.cal-table-ipos th:nth-child(4), .cal-table-ipos td:nth-child(4) { width: 15%; }
.cal-table-ipos th:nth-child(5), .cal-table-ipos td:nth-child(5) { width: 15%; }

/* Splits: Symbol(20%), Mkt Cap(20%), Label(20%), Num(20%), Den(20%) */
.cal-table-splits th:nth-child(1), .cal-table-splits td:nth-child(1) { width: 20%; }
.cal-table-splits th:nth-child(2), .cal-table-splits td:nth-child(2) { width: 20%; }
.cal-table-splits th:nth-child(3), .cal-table-splits td:nth-child(3) { width: 20%; }
.cal-table-splits th:nth-child(4), .cal-table-splits td:nth-child(4) { width: 20%; }
.cal-table-splits th:nth-child(5), .cal-table-splits td:nth-child(5) { width: 20%; }

.cal-date-header {
    font-size: 18px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.95);
    padding: 8px 14px;
    background: rgba(0, 240, 255, 0.05);
    border-top: 1px solid rgba(0, 240, 255, 0.15);
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

/* â”€â”€ Calendar View Toggle â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.cal-view-toggle {
    display: flex;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2px;
    margin-left: auto;
}

.view-btn {
    background: transparent;
    border: none;
    padding: 4px 12px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-muted);
    border-radius: 18px;
    cursor: pointer;
    transition: all 0.2s;
    outline: none;
}

.view-btn.active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--neon-cyan);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* ═══════════════════════════════════════════════════════════════════════
   NEWS WALL — Metro Tile Layout v2
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Ticker bar at TOP ─────────────────────────────────────────── */
.nw-ticker-bar {
    width: 100%;
    height: 46px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    overflow: hidden;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    position: relative;
    margin-bottom: 8px;
    border-radius: 4px 4px 0 0;
}

/* Wrapper clips the scrolling track without constraining its width */
.nw-ticker-wrapper {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    height: 100%;
    display: flex;
    align-items: center;
}

.nw-ticker-track {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    animation: nw-scroll 480s linear infinite;
    /* No flex:1, no overflow — let the wrapper clip */
}

@keyframes nw-scroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

.nw-tb-ticker {
    font-size: 15px;
    font-weight: 900;
    margin-right: 6px;
    letter-spacing: 0.05em;
    padding: 2px 6px;
    border: 1px solid;
    border-radius: 3px;
    flex-shrink: 0;
    transition: background 0.15s, box-shadow 0.15s, opacity 0.15s;
    cursor: pointer;
}

.nw-tb-ticker:hover {
    brightness: 1.3;
    opacity: 0.85;
    background: rgba(255,255,255,0.12) !important;
    box-shadow: 0 0 8px currentColor;
    transition: all 0.15s;
}

.nw-tb-text {
    font-size: 15px;
    color: rgba(255,255,255,0.7);
    margin-right: 8px;
}

.nw-tb-sep {
    font-size: 9px;
    color: rgba(255,255,255,0.18);
    margin: 0 14px;
    flex-shrink: 0;
}


/* Right side of ticker bar: timestamp + reload */
.nw-bar-right {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 8px 0 6px;
    flex-shrink: 0;
    background: var(--bg-primary);
    height: 100%;
}

/* "Last Updated" inline timestamp */
.nw-last-updated {
    font-size: 15px;
    font-weight: 600;
    color: rgba(255,255,255,0.55);
    letter-spacing: 0.05em;
    white-space: nowrap;
}

/* Reload button */
.nw-reload-btn { display: none; /* hidden */

    background: none;
    border: 1px solid rgba(0,229,255,0.2);
    border-radius: 4px;
    color: rgba(0,229,255,0.55);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    transition: color 0.2s, border-color 0.2s, transform 0.2s;
    flex-shrink: 0;
}
.nw-reload-btn:hover {
    color: var(--neon-cyan, #00e5ff);
    border-color: rgba(0,229,255,0.5);
    transform: rotate(30deg);
}
.nw-reload-btn.nw-reload-spinning svg {
    animation: nw-spin 0.8s linear infinite;
}
@keyframes nw-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* ── Outer layout: ruler | tile grid ───────────────────────────── */
.nw-layout {
    display: flex;
    gap: 0;
    width: 100%;
    position: relative;
    min-height: 600px;
}

/* ── Relative-time Ruler ────────────────────────────────────────── */
.nw-timeline {
    width: 56px;
    flex-shrink: 0;
    align-self: flex-start;
    padding: 0;
    border-right: none;
    margin-right: 0;
    display: block;
    overflow: visible;
}

/* Simple thin vertical line — no glow */
.nw-timeline::before {
    content: '';
    position: absolute;
    right: 4px;
    top: 0;
    bottom: 0;
    width: 1px;
    background: rgba(255,255,255,0.3);
    opacity: 1;
}

/* Each tick row */
.nw-tl-tick {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 10px 10px 10px 6px;
    position: relative;
    cursor: default;
    flex: 1;
}

/* Horizontal tick mark — plain */
.nw-tl-mark {
    position: absolute;
    right: 0;
    width: 6px;
    height: 1px;
    background: rgba(255,255,255,0.2);
}

.nw-tl-tick--now .nw-tl-mark {
    width: 10px;
    background: rgba(255,255,255,0.4);
}

/* Time label */
.nw-tl-label {
    font-size: 15px;
    font-weight: 500;
    color: rgba(255,255,255,0.45);
    letter-spacing: 0.02em;
    white-space: nowrap;
    text-align: right;
    flex: 1;
}

.nw-tl-tick--now .nw-tl-label {
    color: rgba(255,255,255,0.75);
    font-weight: 600;
    font-size: 15px;
}

/* Count badge — hidden */
.nw-tl-count {
    display: none;
    font-size: 12px;
    font-weight: 600;
    color: rgba(255,255,255,0.45);
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 0 5px;
    min-width: 16px;
    text-align: center;
    margin-right: 2px;
}

/* ── Tile Grid ─────────────────────────────────────────────────── */
.nw-wall {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-auto-rows: 160px;
    gap: 4px;
    align-content: start;
    margin-left: 4px;
}

/* ── Individual Tile ───────────────────────────────────────────── */
.nw-tile {
    display: block;
    position: relative;
    overflow: hidden;
    border-radius: 3px;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}
.nw-tile:hover {
    transform: scale(1.025);
    box-shadow: 0 8px 32px rgba(0,0,0,0.6);
    filter: brightness(1.1);
    z-index: 2;
}

.nw-tile-bg {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 9px;
}


/* Keep content above the scrim */
.nw-tile-top,
.nw-tile-bottom {
    position: relative;
    z-index: 1;
}


.nw-tile--hero .nw-tile-title { font-size: 15px; line-height: 1.35; }
.nw-tile--wide .nw-tile-title { font-size: 15px; line-height: 1.35; }
.nw-tile--tall .nw-tile-title { font-size: 15px; line-height: 1.35; }

.nw-tile-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
}

.nw-ticker-badge {
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0.06em;
    border: 1px solid;
    border-radius: 4px;
    padding: 4px 10px;
    text-transform: uppercase;
    white-space: nowrap;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    transition: opacity 0.15s;
    flex-shrink: 0;
}
.nw-ticker-badge:hover { opacity: 0.75; }

.nw-time {
    font-size: 15px;
    color: rgba(255,255,255,0.6);
    white-space: nowrap;
    margin-left: auto;
}

.nw-tile-bottom {
    display: flex;
    flex-direction: column;
    gap: 3px;
    background: rgba(5, 10, 20, 0.62);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border-radius: 6px;
    padding: 6px 8px;
    margin: 0 -2px -2px;
}


.nw-tile-title {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-shadow: 0 1px 5px rgba(0,0,0,0.7);
}
.nw-tile--hero .nw-tile-title { -webkit-line-clamp: 5; }
.nw-tile--tall .nw-tile-title { -webkit-line-clamp: 5; }

.nw-tile-src {
    font-size: 9px;
    font-weight: 600;
    color: rgba(255,255,255,0.4);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Section overrides ─────────────────────────────────────────── */
#section-news .section-title { margin-bottom: 6px; }
#section-news .section-body  { padding: 0; overflow: visible; }

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .nw-wall { grid-template-columns: repeat(5, 1fr); }
    .nw-timeline { display: none; }
}
@media (max-width: 540px) {
    .nw-wall { grid-template-columns: repeat(2, 1fr); }
}

/* ── Flow Sub-Tabs ────────────────────────────────────────────────────── */
.flow-sub-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.flow-tab {
    padding: 7px 18px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(255,255,255,0.10);
    background: transparent;
    color: var(--text-muted);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.02em;
}
.flow-tab:hover {
    background: rgba(255,255,255,0.05);
    color: var(--text-secondary);
    border-color: rgba(255,255,255,0.18);
}
.flow-tab.active {
    background: rgba(0,229,255,0.08);
    color: var(--neon-cyan);
    border-color: rgba(0,229,255,0.4);
}

/* Flow search input */
.flow-search {
    width: 100%;
    padding: 10px 16px 10px 40px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s ease, background 0.2s ease;
    margin-bottom: 20px;
    box-sizing: border-box;
}
.flow-search:focus {
    border-color: rgba(0,229,255,0.4);
    background: rgba(255,255,255,0.06);
}
.flow-search::placeholder {
    color: var(--text-muted);
}

/* Flow stat card */
.flow-stat {
    flex: 1;
    min-width: 150px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
}
.flow-stat-label {
    font-size: 20px;
    color: var(--text-primary);
    margin-bottom: 12px;
    font-weight: 600;
    font-family: var(--font-sans);
}
.flow-stat-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    font-family: var(--font-mono);
    line-height: 1;
}
.flow-stat-sub {
    font-size: 11.5px;
    font-weight: 500;
    color: var(--text-muted);
    margin-top: 6px;
}


/* -- Market Tape ---------------------------------------------------------------- */
.market-tape-wrap {
    overflow: hidden;
    position: relative;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--bg-card);
    padding: 10px 0;
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 5%, black 95%, transparent 100%);
    mask-image: linear-gradient(to right, transparent 0%, black 5%, black 95%, transparent 100%);
}

.market-tape-track {
    display: flex;
    gap: 10px;
    width: max-content;
    animation: tape-scroll linear infinite;
    padding: 0 10px;
}

.market-tape-track:hover {
    animation-play-state: paused;
}

@keyframes tape-scroll {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.tape-card {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 13px 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    min-width: 180px;
    max-width: 200px;
    cursor: pointer;
    flex-shrink: 0;
    transition: border-color 0.2s ease;
    font-family: var(--font-sans);
}

.tape-card:hover {
    border-color: rgba(0, 240, 255, 0.2);
}

.tape-card-header {
    display: flex;
    align-items: center;
    gap: 6px;
}

.tape-card-logo {
    width: 42px;
    height: 42px;
    border-radius: 4px;
    object-fit: contain;
    background: white;
    flex-shrink: 0;
}

.tape-card-sym {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
}

.tape-card-name {
    font-size: 15px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tape-card-bottom {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
}

.tape-card-price {
    font-size: 15px;
    font-weight: 300;
    color: var(--text-primary);
    white-space: nowrap;
}

.tape-card-chg {
    font-size: 14px;
    font-weight: 300;
    white-space: nowrap;
}

/* -- Movers Table Redesign ---------------------------------------------------- */
.movers-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-sans);
}

.movers-table thead th {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.movers-th-sort:hover { color: var(--text-secondary); }

.mover-row {
    border-bottom: 1px solid rgba(255,255,255,0.04);
    transition: background 0.15s ease;
}

.mover-row:hover { background: rgba(255,255,255,0.04); }
.mover-row:last-child { border-bottom: none; }

/* Logo cell */
.mover-logo-cell { padding: 10px 8px 10px 12px; width: 52px; }

.mover-logo-wrap {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--border);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mover-logo-img {
    width: 38px;
    height: 38px;
    object-fit: contain;
    display: block;
}

.mover-logo-init {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0;
}

/* Identity: name + ticker stacked */
.mover-identity {
    padding: 10px 12px;
    display: table-cell;
    vertical-align: middle;
}

.mover-name-text {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 240px;
}

.mover-sym-text {
    display: block;
    font-size: 12px;
    font-weight: 400;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Price, % change, volume cells */
.mover-price-cell {
    padding: 10px 12px;
    text-align: right;
    font-size: 15px;
    font-weight: 300;
    color: var(--text-primary);
    white-space: nowrap;
}

.mover-pct-cell {
    padding: 10px 12px;
    text-align: right;
    font-size: 15px;
    font-weight: 400;
    white-space: nowrap;
}

.mover-vol-cell {
    padding: 10px 12px;
    text-align: right;
    font-size: 15px;
    color: var(--text-muted);
    white-space: nowrap;
}

/* -- Movers 3-column side-by-side grid ------------------------------------- */
.movers-panels-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    align-items: start;
}

.movers-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}

.movers-panel-header {
    padding: 12px 16px 10px;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.01em;
    border-bottom: 1px solid var(--border);
    background: rgba(0, 240, 255, 0.03);
}

/* Compact variants for use inside the narrower 3-col panels */
.movers-table--compact thead th {
    font-size: 13px;
    padding: 8px 10px;
}

/* Sort-direction badge on the active column header (▼ 1D) */
.movers-sort-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-muted);
    transition: background 0.15s, color 0.15s;
}

.movers-sort-badge.active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.mover-logo-cell--sm {
    padding: 7px 6px 7px 10px !important;
    width: 36px !important;
}

.mover-logo-wrap--sm {
    width: 30px !important;
    height: 30px !important;
    border-radius: 6px !important;
}

.mover-logo-init--sm {
    width: 30px !important;
    height: 30px !important;
    font-size: 11px !important;
}

.mover-identity--sm {
    padding: 7px 8px !important;
}

.mover-name-text--sm {
    font-size: 15px !important;
    max-width: 160px !important;
}

.mover-price-cell--sm {
    padding: 7px 8px !important;
    font-size: 15px !important;
}

.mover-pct-cell--sm {
    padding: 7px 10px 7px 6px !important;
    font-size: 15px !important;
}

/* World index table: name cell fills remaining space, % chips don't wrap */
.world-index-table td { vertical-align: middle; }
.world-index-table .mover-identity--sm { width: auto; }
.world-index-table .mover-pct-cell--sm { font-size: 15px !important; }

/* Region group separator row */
.world-group-row td {
    background: rgba(0, 240, 255, 0.05);
    border-top: 1px solid rgba(0, 240, 255, 0.15);
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
    padding: 8px 14px;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.95);
    cursor: pointer;
}



/* Tape card: base border + smooth glow-fade transition */
.tape-card {
    border: 1px solid transparent;
    border-radius: 8px;
    transition: box-shadow 0.8s ease, border-color 0.8s ease;
}


/* Suppress jsvectormap's built-in purple country tooltip */
.jvm-tooltip { display: none !important; }

/* Period selector + jsvectormap zoom buttons */

#world-period-toggle .chart-period-btn {
    font-size: 15px;
    font-family: var(--font-sans);
}

.jvm-zoom-btn {
    font-size: 18px !important;
    font-family: var(--font-sans) !important;
    font-weight: 500 !important;
    line-height: 1 !important;
    width: 32px !important;
    height: 32px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 8px !important;
    cursor: pointer !important;
}

.jvm-zoom-btn.jvm-zoomin  { top: 10px !important; }
.jvm-zoom-btn.jvm-zoomout { top: 48px !important; }

/* Flag emoji rendered inside the stock-logo-style square box */
.world-flag-box {
    background: var(--bg-card) !important;
    border: 1px solid var(--border) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px;
}

.world-flag-emoji {
    font-size: 20px;
    line-height: 1;
    display: block;
}


@media (max-width: 860px) {
    .movers-panels-grid {
        grid-template-columns: 1fr;
    }
}

/* -- Index Cards (sparkline design) ---------------------------------------- */
.index-cards {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-bottom: 0;
}

.index-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 16px 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: border-color 0.4s ease, background 0.15s ease;
    overflow: hidden;
}

.index-card:hover { background: var(--bg-hover, rgba(255,255,255,0.04)); }

.ic-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 6px;
}

.ic-name {
    font-size: 18px;
    font-weight: 600;
    font-family: var(--font-sans);
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ic-pct {
    font-size: 18px;
    font-weight: 500;
    font-family: var(--font-sans);
    white-space: nowrap;
    flex-shrink: 0;
}

.ic-mid {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 6px;
}

.ic-price {
    font-size: 15px;
    font-weight: 300;
    font-family: var(--font-sans);
    color: var(--text-primary);
}

.ic-delta {
    font-size: 15px;
    font-weight: 400;
    font-family: var(--font-sans);
    white-space: nowrap;
}

.ic-spark {
    margin: 6px -16px -10px -16px;  /* bleed past card padding on all sides */
    line-height: 0;
    border-radius: 0 0 10px 10px;
    overflow: hidden;
}

.ic-spark svg { width: 100%; height: 36px; display: block; }

/* Tape card row layout: logo left, identity right */
.tape-card-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.tape-card-identity {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Currency Matrix — Premium Glass Design
   ═══════════════════════════════════════════════════════════════════════════ */

.fx-matrix-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(10, 11, 18, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.fx-matrix-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-sans);
    table-layout: fixed;
    min-width: 800px;
}

.fx-matrix-corner {
    width: 80px;
    background: rgba(10, 11, 18, 0.9);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    border-right: 1px solid rgba(255,255,255,0.06);
}

.fx-matrix-header-cell {
    padding: 10px 4px;
    text-align: center;
    font-size: 15px;
    font-weight: 700;
    color: rgba(255,255,255,0.88);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: rgba(10, 11, 18, 0.9);
    border-bottom: 1px solid rgba(0, 240, 255, 0.12);
    border-right: 1px solid rgba(255,255,255,0.04);
    white-space: nowrap;
}

.fx-matrix-header-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.fx-matrix-row-header {
    padding: 8px 10px;
    font-size: 15px;
    font-weight: 700;
    color: rgba(255,255,255,0.88);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: rgba(10, 11, 18, 0.9);
    border-right: 1px solid rgba(0, 240, 255, 0.12);
    border-bottom: 1px solid rgba(255,255,255,0.04);
    white-space: nowrap;
    position: sticky;
    left: 0;
    z-index: 2;
}

.fx-matrix-row-header .fx-matrix-header-inner {
    flex-direction: row;
    gap: 6px;
}

.fx-matrix-cell {
    padding: 8px 6px;
    text-align: center;
    border-right: 1px solid rgba(255,255,255,0.03);
    border-bottom: 1px solid rgba(255,255,255,0.03);
    transition: background 0.2s ease, transform 0.15s ease;
    cursor: default;
    position: relative;
}

.fx-matrix-cell:hover {
    background: rgba(0, 240, 255, 0.08) !important;
    z-index: 1;
}

.fx-matrix-rate {
    font-size: 15px;
    font-weight: 600;
    font-family: var(--font-sans);
    color: rgba(255,255,255,0.92);
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.fx-matrix-chg {
    font-size: 13px;
    font-weight: 500;
    line-height: 1.2;
    opacity: 0.85;
}

/* Diagonal cells — dark with subtle slash */
.fx-matrix-diag {
    background: rgba(8, 9, 14, 0.85) !important;
    cursor: default;
}

.fx-matrix-diag-line {
    display: block;
    width: 20px;
    height: 1px;
    background: rgba(255,255,255,0.12);
    margin: 8px auto;
    transform: rotate(-45deg);
}

.fx-matrix-diag:hover {
    background: rgba(8, 9, 14, 0.85) !important;
}

/* Legend bar */
.fx-matrix-legend {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
    padding: 0 2px;
}

.fx-matrix-legend-bar {
    flex: 1;
    height: 10px;
    border-radius: 3px;
    background: linear-gradient(to right,
        rgb(180, 60, 60),
        rgb(108, 55, 55),
        #1e2028,
        rgb(50, 100, 70),
        rgb(74, 222, 128));
}

/* Responsive: smaller cells on narrow screens */
@media (max-width: 1100px) {
    .fx-matrix-table { min-width: 700px; }
    .fx-matrix-rate { font-size: 11px; }
    .fx-matrix-chg  { font-size: 9px; }
    .fx-matrix-cell { padding: 6px 4px; }
}

/* ═══════════════════════════════════════════════════════════════════════
   TECHNICAL ANALYSIS TAB
   ═══════════════════════════════════════════════════════════════════════ */

.ta-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.ta-tf-pills {
    display: flex;
    gap: 4px;
}

.ta-tf-pill {
    padding: 6px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-muted);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.ta-tf-pill:hover { border-color: var(--border-active); color: var(--text-primary); }
.ta-tf-pill.active { background: rgba(255,255,255,0.08); border-color: var(--border-active); color: var(--text-primary); font-weight: 600; }

.ta-view-toggle {
    display: flex;
    gap: 4px;
}

.ta-view-btn {
    padding: 6px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-muted);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.ta-view-btn:hover { border-color: var(--border-active); color: var(--text-primary); }
.ta-view-btn.active { background: rgba(0,240,255,0.08); border-color: var(--neon-cyan); color: var(--neon-cyan); font-weight: 600; }

/* Gauges row */
.ta-gauges-row {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 32px;
}

.ta-gauge {
    text-align: center;
    flex: 0 0 200px;
}

.ta-gauge-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.ta-gauge-svg {
    width: 240px;
    height: 140px;
}

.ta-gauge-label {
    font-size: 20px;
    font-weight: 700;
    margin-top: -4px;
    margin-bottom: 10px;
}

.ta-gauge-counts {
    display: flex;
    justify-content: space-around;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
}

.ta-gauge-counts span {
    line-height: 1.5;
}

.ta-sell-count { color: #b05252; }
.ta-buy-count { color: #4d9e6e; }
.ta-neutral-count { color: var(--text-muted); }

/* Tables */
.ta-tables-row {
    display: flex;
    gap: 24px;
}

.ta-table-col {
    flex: 1;
}

.ta-table-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.ta-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    font-family: var(--font-body, 'Inter', sans-serif);
}

.ta-table th {
    text-align: left;
    color: var(--text-muted);
    font-weight: 500;
    padding: 5px 8px;
    border-bottom: 1px solid var(--border);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ta-table th:nth-child(2),
.ta-table th:nth-child(3) {
    text-align: right;
}

.ta-table td {
    padding: 5px 8px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    color: var(--text-secondary);
}

.ta-table td.ta-val {
    text-align: right;
    color: var(--text-primary);
}

.ta-table td.ta-buy     { text-align: right; color: var(--gain);      font-weight: 600; }
.ta-table td.ta-sell    { text-align: right; color: var(--loss);      font-weight: 600; }
.ta-table td.ta-neutral { text-align: right; color: var(--text-muted); font-weight: 500; }

/* ── AI Summary Panel (ta-ai-*) ─────────────────────────────────────────────── */

.ta-ai-wrap {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 6px;
    max-width: 100%;
}

/* Two-column paired layout (Key Levels|Volume, Momentum|MAs, Setup|Risk) */
.ta-ai-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    align-items: start;
}

/* 2-col KV grid for use inside a half-width column */
.ta-ai-kv-grid--2col {
    grid-template-columns: repeat(2, 1fr) !important;
}

/* Stale banner */
.ta-ai-stale {
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.30);
    border-radius: var(--radius-sm);
    padding: 7px 14px;
    font-size: 14px;
    color: #f59e0b;
    letter-spacing: 0.2px;
}

/* Header card */
.ta-ai-header {
    background: linear-gradient(135deg, rgba(0,240,255,0.05) 0%, rgba(0,240,255,0.01) 100%);
    border: 1px solid rgba(0,240,255,0.18);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ta-ai-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ta-ai-badge {
    font-size: 14px;
    font-weight: 700;
    color: var(--neon-cyan);
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.ta-ai-date {
    font-size: 14px;
    color: var(--text-muted);
}

.ta-ai-header-signals {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.ta-ai-signal-pill {
    display: inline-flex;
    align-items: center;
    padding: 5px 14px;
    border-radius: var(--radius-full);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1px;
    border: 1px solid transparent;
    flex-shrink: 0;
}

.ta-ai-conf {
    font-size: 14px;
    color: var(--text-muted);
}
.ta-ai-conf strong {
    color: var(--text-secondary);
    font-weight: 600;
}

.ta-ai-align {
    font-size: 14px;
    color: var(--text-muted);
    font-style: italic;
    padding-top: 8px;
    border-top: 1px solid var(--border);
    line-height: 1.5;
}

/* Section cards */
.ta-ai-section {
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 13px 15px;
}

.ta-ai-section-label {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 10px;
    padding-bottom: 7px;
    border-bottom: 1px solid var(--border);
}

.ta-ai-prose {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-secondary);
    margin: 0;
}

/* Timeframe grid */
.ta-ai-tf-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.ta-ai-tf-card {
    background: rgba(255,255,255,0.025);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
}

.ta-ai-tf-head {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}

.ta-ai-tf-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.ta-ai-tf-desc {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.55;
}

/* KV grid — 3 columns for dense sections */
.ta-ai-kv-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.ta-ai-kv {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 9px 11px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.ta-ai-kv-label {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
    white-space: nowrap;
}

.ta-ai-kv-value {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.4;
    word-break: break-word;
}

.ta-ai-kv-full {
    grid-column: 1 / -1;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.55;
    padding-top: 6px;
    border-top: 1px solid var(--border);
    margin-top: 2px;
}

.ta-ai-italic { font-style: italic; }

/* Trade setup — hero metric layout */
.ta-ai-setup {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Bias pill: auto-width, not full-stretch */
.ta-ai-setup > .ta-ai-signal-pill {
    align-self: flex-start;
    font-size: 14px;
    padding: 5px 16px;
}

/* Trade setup KV: 4 columns for entry/stop/t1/t2 */
.ta-ai-setup-grid {
    grid-template-columns: repeat(4, 1fr) !important;
    margin-top: 2px;
}

.ta-ai-setup-grid .ta-ai-kv {
    border-color: rgba(0,240,255,0.10);
    background: rgba(0,240,255,0.03);
}

.ta-ai-setup-grid .ta-ai-kv-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.ta-ai-invalidation {
    font-size: 14px;
    color: var(--loss);
    font-style: italic;
    padding-top: 4px;
    opacity: 0.85;
}

/* Caution flags */
.ta-ai-flags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding-top: 2px;
}

.ta-ai-flag {
    background: rgba(176, 82, 82, 0.09);
    border: 1px solid rgba(176, 82, 82, 0.22);
    border-radius: var(--radius-sm);
    padding: 3px 10px;
    font-size: 14px;
    color: var(--loss);
    line-height: 1.4;
}

/* Footer row (patterns + events side by side) */
.ta-ai-footer-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.ta-ai-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.ta-ai-tag {
    background: rgba(0,240,255,0.04);
    border: 1px solid rgba(0,240,255,0.12);
    border-radius: var(--radius-sm);
    padding: 3px 10px;
    font-size: 14px;
    color: var(--text-secondary);
}

/* Key price levels table */
/* Key Price Levels table — responsive */
.ta-ai-levels-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.ta-ai-levels-table {
    width: 100%;
    min-width: 320px;
    border-collapse: collapse;
}
.ta-ai-levels-table th,
.ta-ai-levels-table td {
    font-size: 14px;
    padding: 5px 8px;
    white-space: nowrap;
}
/* TYPE column */
.ta-ai-levels-table th:nth-child(1),
.ta-ai-levels-table td:nth-child(1) { width: 30%; }
/* LEVEL column */
.ta-ai-levels-table td:nth-child(2) {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    font-size: 14px;
    text-align: right;
    width: 22%;
}
/* SOURCE column — truncate on small screens */
.ta-ai-levels-table td:nth-child(3) {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-muted);
    font-size: 14px;
}
/* STRENGTH column — monospace dots */
.ta-ai-levels-table th:nth-child(4),
.ta-ai-levels-table td:nth-child(4) {
    font-family: monospace;
    color: var(--text-muted);
    letter-spacing: 2px;
    text-align: center;
    width: 14%;
}
/* Hide Strength column on narrow panels */
@media (max-width: 600px) {
    .ta-ai-levels-table th:nth-child(4),
    .ta-ai-levels-table td:nth-child(4) { display: none; }
    .ta-ai-levels-table td:nth-child(3) { max-width: 80px; }
}

/* Placeholder (no data yet) */
.ta-ai-placeholder {
    text-align: center;
    padding: 52px 24px;
    background: rgba(0,240,255,0.015);
    border: 1px dashed rgba(0,240,255,0.12);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.ta-ai-ph-icon { font-size: 38px; }

.ta-ai-ph-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.2px;
}

.ta-ai-ph-sub {
    font-size: 14px;
    color: var(--text-muted);
    max-width: 340px;
    line-height: 1.6;
}

/* Responsive */
@media (max-width: 900px) {
    .ta-ai-setup-grid { grid-template-columns: repeat(2, 1fr) !important; }
}
@media (max-width: 768px) {
    .ta-ai-two-col      { grid-template-columns: 1fr; }
    .ta-ai-tf-row       { grid-template-columns: 1fr; }
    .ta-ai-kv-grid      { grid-template-columns: repeat(2, 1fr); }
    .ta-ai-kv-grid--2col{ grid-template-columns: 1fr !important; }
    .ta-ai-footer-row   { grid-template-columns: 1fr; }
    .ta-ai-setup-grid   { grid-template-columns: repeat(2, 1fr) !important; }
}
@media (max-width: 480px) {
    .ta-ai-kv-grid      { grid-template-columns: 1fr; }
    .ta-ai-kv-grid--2col{ grid-template-columns: 1fr !important; }
    .ta-ai-setup-grid   { grid-template-columns: 1fr !important; }
}


/* Chart view */
.ta-overlay-toggles {
    display: flex;
    gap: 16px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.ta-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
    cursor: pointer;
}

.ta-toggle input[type="checkbox"] {
    accent-color: var(--neon-cyan);
}

.ta-ohlc-legend {
    font-size: 13px;
    font-family: var(--font-body, 'Inter', sans-serif);
    color: var(--text-primary);
    padding: 6px 0;
    letter-spacing: 0.3px;
}

.ta-ohlc-legend span {
    margin-right: 4px;
}

#ta-lw-main, #ta-lw-rsi, #ta-lw-macd {
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.ta-panel-label {
    position: absolute;
    top: 6px;
    left: 8px;
    font-size: 11px;
    color: rgba(255,255,255,0.35);
    z-index: 2;
    pointer-events: none;
    font-family: var(--font-body, 'Inter', sans-serif);
}

/* Chart row: main charts + right indicator panel */
.ta-chart-row {
    display: flex;
    gap: 0;
}

.ta-chart-col {
    flex: 1;
    min-width: 0;
}

.ta-indicators-panel {
    width: 90px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 10px;
    border-left: 1px solid var(--border);
    background: rgba(0,0,0,0.1);
}

.ta-ind-item {
    font-size: 11px;
    font-family: var(--font-body, 'Inter', sans-serif);
    color: rgba(255,255,255,0.2);
    cursor: pointer;
    padding: 4px 0;
    transition: color 0.15s ease, opacity 0.15s ease;
    user-select: none;
    white-space: nowrap;
}

.ta-ind-item:hover {
    color: rgba(255,255,255,0.5);
}

.ta-ind-item.active {
    color: var(--ind-color, var(--text-primary));
    font-weight: 600;
}

/* Hide Lightweight Charts watermark */
#ta-lw-main a[href*="tradingview"],
#ta-lw-rsi a[href*="tradingview"],
#ta-lw-macd a[href*="tradingview"],
#ta-lw-main div[style*="bottom: 4px"],
#ta-lw-rsi div[style*="bottom: 4px"],
#ta-lw-macd div[style*="bottom: 4px"] {
    display: none !important;
}

.ta-rsi-val, .ta-rsi-ma-val {
    font-family: var(--font-mono);
    font-weight: 600;
}


/* Source icon on cell hover */
.kf-src-icon { position: absolute; top: 2px; right: 2px; font-size: 11px; color: rgba(255,255,255,0.2); cursor: pointer; opacity: 0; transition: opacity 0.15s; line-height: 1; padding: 2px; }
td:hover .kf-src-icon { opacity: 1; color: rgba(0,180,220,0.7); }
.kf-src-icon:hover { color: rgba(0,200,240,1) !important; }
/* Tooltip source block (Perplexity-style) */
.kf-tip-source { margin-top: 10px; padding-top: 8px; border-top: 1px solid rgba(255,255,255,0.08); display: flex; gap: 10px; align-items: flex-start; }
.kf-badge-lg { padding: 4px 10px; font-size: 11px; min-width: 36px; text-align: center; }
.kf-tip-reported { font-size: 12px; color: var(--text-secondary); line-height: 1.6; }
/* Tooltip badge stack (filing type + section label) */
.kf-tip-badge-stack { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 50px; }
.kf-tip-section { font-size: 10px; color: rgba(255,255,255,0.35); text-align: center; line-height: 1.2; }
/* Cell hover highlight (border glow) */
.kf-cell-hover { outline: 1px solid rgba(255,255,255,0.25); outline-offset: -1px; background: rgba(255,255,255,0.04) !important; }
/* Input cells highlighted for computed rows (teal/cyan) */
.kf-cell-input { background: rgba(0,180,200,0.12) !important; outline: 1px solid rgba(0,180,200,0.3); outline-offset: -1px; }
/* Source icon repositioned LEFT of value */
.kf-src-icon { position: absolute; left: 4px; top: 50%; transform: translateY(-50%); display: flex; align-items: center; justify-content: center; width: 20px; height: 20px; font-size: 8px; font-weight: 700; font-family: var(--font-mono); color: rgba(255,255,255,0.2); cursor: pointer; opacity: 0; transition: opacity 0.15s; border: 1px solid rgba(255,255,255,0.15); border-radius: 50%; z-index: 2; }
td:hover .kf-src-icon { opacity: 1; color: rgba(0,240,255,0.9); border-color: rgba(0,240,255,0.4); text-shadow: 0 0 6px rgba(0,240,255,0.5); }
.kf-src-icon:hover { color: rgba(0,255,255,1) !important; border-color: rgba(0,255,255,0.6) !important; background: rgba(0,240,255,0.15); text-shadow: 0 0 8px rgba(0,255,255,0.7) !important; }

/* ── Integrated App Navigation & Responsive Styles ────────────────── */
.app-header {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 64px;
    background: rgba(5, 10, 20, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border); /* Horizontal line side to side */
    padding: 0 !important;
    display: flex !important;
    align-items: center;
    box-sizing: border-box;
    z-index: 1100;
}

.header-row {
    display: flex;
    align-items: center;
    width: 100%;
    height: 100% !important;
    gap: 12px;
}

.header-row .mobile-menu-toggle {
    flex-shrink: 0;
}

.header-row .search-container {
    flex: 1;
    max-width: 600px;
    margin: 0 auto;
}

/* Breadcrumbs inside header — positioned after logo + divider + hamburger */
.navbar-breadcrumb-container {
    display: flex;
    align-items: center;
    position: absolute;
    left: 130px;
}

/* Sidebar as a drawer underneath the header, no vertical border */
.app-sidebar {
    width: 260px !important;
    min-width: 260px !important;
    height: calc(100vh - 64px) !important;
    background: var(--bg-sidebar);
    border-right: none !important; /* No vertical line */
    display: flex !important;
    flex-direction: column;
    position: fixed;
    top: 64px;
    left: 0;
    z-index: 950;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 10px 10px 30px rgba(0, 0, 0, 0.4);
    box-sizing: border-box;
    padding-top: 12px;
}

.sidebar-sections {
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* On desktop, sidebar drawer starts open by default */
@media (min-width: 769px) {
    .app-sidebar {
        transform: translateX(0);
    }
    
    .app-right {
        padding-left: 260px;
        transition: padding-left 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                    padding-right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    body.sidebar-closed .app-sidebar {
        transform: translateX(-100%);
    }
    
    body.sidebar-closed .app-right {
        padding-left: 0;
    }

    /* Right sidebar: push central area left when open */
    body.right-sidebar-open .app-right {
        padding-right: 260px;
    }
}

/* Main app content area shifts down for the fixed header */
.app-right {
    margin-left: 0;
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    padding-top: 64px; /* Space for fixed header */
    box-sizing: border-box;
}

/* Subsection pills row — hidden per user preference */
.navbar-subsections-row {
    display: none !important;
}

.nav-subpill {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    padding: 6px 14px;
    border-radius: 20px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nav-subpill:hover {
    color: var(--text-primary);
    background: rgba(0, 240, 255, 0.03);
    border-color: rgba(0, 240, 255, 0.2);
}

.nav-subpill.active {
    color: #050a14;
    background: var(--neon-cyan);
    border-color: var(--neon-cyan);
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.4);
    font-weight: 600;
}

.nav-subpill-icon {
    font-size: 13px;
    display: flex;
    align-items: center;
}

/* Hamburger toggle button */
.mobile-menu-toggle {
    display: flex !important; /* Visible on desktop and mobile */
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    transition: all 0.2s ease;
}

.mobile-menu-toggle:hover {
    color: var(--neon-cyan);
    background: rgba(0, 240, 255, 0.05);
}

/* Fullscreen Mobile Menu Overlay */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #050a14;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.mobile-menu-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    height: 64px;
}

.mobile-menu-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-menu-close:hover {
    color: var(--loss);
    background: rgba(255, 255, 255, 0.05);
}

.mobile-menu-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.mobile-menu-nav {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Tree Navigation elements */
.nav-tree-group {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.nav-tree-category {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 12px 20px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
    gap: 12px;
}

.nav-tree-category:hover {
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.02);
}

.nav-tree-category.active {
    color: var(--neon-cyan);
    background: rgba(0, 242, 254, 0.03);
}

.nav-tree-icon {
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.nav-tree-chevron {
    margin-left: auto;
    font-size: 10px;
    color: var(--text-muted);
    opacity: 0.7;
}

.nav-tree-subsections {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 4px 0;
    background: rgba(0, 0, 0, 0.1);
}

.nav-tree-sub-divider {
    height: 1px;
    background: linear-gradient(90deg, rgba(0, 242, 254, 0.15), transparent);
    width: 80%;
    margin: 6px auto;
}

.nav-tree-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text-secondary);
    padding: 8px 36px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nav-tree-item:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
}

.nav-tree-item.active {
    color: var(--neon-cyan);
    font-weight: 600;
    background: rgba(0, 240, 255, 0.05);
}

.nav-tree-sub-icon {
    font-size: 13px;
    display: flex;
    align-items: center;
}

/* ── Flow: Sector Filter Bar ─────────────────────────────────────────── */
.flow-sector-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding: 2px 0 6px;
    flex-wrap: nowrap;
}
.flow-sector-bar::-webkit-scrollbar { display: none; }

.flow-sector-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font-sans);
    font-size: 12px;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.flow-sector-pill:hover {
    color: var(--text-primary);
    border-color: rgba(0, 240, 255, 0.3);
    background: rgba(0, 240, 255, 0.04);
}

.flow-sector-pill.active {
    color: var(--neon-cyan);
    border-color: var(--neon-cyan);
    background: rgba(0, 240, 255, 0.08);
    box-shadow: 0 0 8px rgba(0, 240, 255, 0.15);
}

.flow-sector-count {
    font-size: 10px;
    font-family: var(--font-mono);
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.06);
    padding: 1px 5px;
    border-radius: 8px;
    line-height: 1.3;
}

.flow-sector-pill.active .flow-sector-count {
    color: var(--neon-cyan);
    background: rgba(0, 240, 255, 0.12);
}

/* Responsive Overrides */
@media (max-width: 768px) {
    .app-sidebar {
        display: none !important;
    }
    
    .app-right {
        padding-left: 0 !important;
    }
    
    .app-header {
        padding: 0 !important;
    }
    
    .search-dropdown {
        position: fixed !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        width: 100vw !important;
        max-width: 100vw !important;
        top: 64px !important;
        border-radius: 0 !important;
        box-sizing: border-box !important;
        max-height: calc(100vh - 64px) !important;
        margin-top: 0 !important;
    }
    
    .wl-search-dropdown,
    [id$="-search-dd"] {
        position: absolute !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        width: 100vw !important;
        max-width: 100vw !important;
        border-radius: 0 !important;
        border-left: none !important;
        border-right: none !important;
        box-sizing: border-box !important;
        z-index: 1200 !important;
    }
    
    .mobile-menu-toggle {
        display: flex;
        margin-right: 4px;
    }
    
    #markets-content {
        padding: 12px;
    }
    
    .main-content {
        padding: 12px;
    }

    /* Index cards: 1 per line on mobile */
    .index-cards {
        grid-template-columns: 1fr !important;
        gap: 8px;
    }

    /* Tables: horizontal scroll on mobile */
    .world-indexes,
    .overview-block,
    .market-section {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .world-index-table,
    .movers-table,
    table {
        min-width: 600px;
    }

    .world-index-table td, .world-index-table th {
        padding: 8px 8px;
        font-size: 13px;
        white-space: nowrap;
    }

    /* Calendar: day cards — swipeable carousel, 1 visible at a time */
    .cal-days {
        display: flex !important;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 8px;
        padding-bottom: 4px;
    }
    .cal-days::-webkit-scrollbar { display: none; }

    .cal-day-card {
        flex: 0 0 100%;
        scroll-snap-align: center;
        box-sizing: border-box;
    }

    /* Calendar: nav row wraps */
    .cal-nav {
        flex-wrap: wrap;
        gap: 6px;
    }
    .cal-week-label {
        font-size: 16px;
    }

    /* Calendar: tabs row wraps */
    .cal-tabs-row {
        flex-wrap: wrap;
        gap: 8px;
    }

    /* Calendar: table scrolls horizontally, wider */
    .cal-table {
        min-width: 800px;
    }
    .cal-table td, .cal-table th {
        padding: 10px 12px;
        font-size: 14px;
        white-space: nowrap;
    }
    .cal-company {
        max-width: 200px;
    }

    /* Prediction cards & movers panels: 1 per line on mobile — all sections */
    .movers-panels-grid,
    [id^="pm-grid-"],
    #predictions-grid,
    [id$="-predictions-body"] > div[style*="grid"],
    [id$="-predictions-body"] > div > div[style*="grid"] {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    /* Flow section: swipeable carousel, 1 column at a time */
    #section-funds-body > div[style*="grid-template-columns"],
    #section-funds-body div[style*="repeat(4"] {
        display: flex !important;
        overflow-x: auto !important;
        scroll-snap-type: x mandatory !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
        gap: 10px !important;
        padding-bottom: 6px;
    }
    #section-funds-body > div[style*="grid-template-columns"]::-webkit-scrollbar,
    #section-funds-body div[style*="repeat(4"]::-webkit-scrollbar {
        display: none;
    }

    #section-funds-body .flow-stat {
        flex: 0 0 100% !important;
        scroll-snap-align: center;
        box-sizing: border-box;
    }

    /* ── Segments / Screener mobile ──────────────────────────── */

    /* Stack the two-column layout (pills left, controls right) vertically */
    #section-segments-body > div[style*="display:flex"][style*="gap:16px"] {
        flex-direction: column !important;
        gap: 12px !important;
    }

    /* Controls row: full width on top */
    #section-segments-body > div[style*="display:flex"][style*="gap:16px"] > div[style*="min-width:160px"] {
        width: 100% !important;
        min-width: 0 !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
    }

    /* Filter pills: smaller on mobile */
    .scr-pill-wrap button,
    #section-segments-body button[style*="border-radius:20px"] {
        font-size: 13px !important;
        padding: 5px 10px !important;
    }

    /* Screener data table: horizontal scroll */
    #scr-table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    #scr-table-wrap table {
        min-width: 700px;
    }

    /* Flow sub-tabs and period toggles wrap on mobile */
    .flow-sub-tabs,
    .period-toggle,
    #flow-sub-tabs {
        flex-wrap: wrap !important;
    }

    /* Data tables in general: horizontal scroll */
    .data-table {
        min-width: 700px;
    }
    div[style*="overflow-x:auto"] {
        -webkit-overflow-scrolling: touch;
    }

    /* Flow search inputs: full width */
    .flow-search,
    input[id^="flow-"] {
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Flow header rows with search: stack vertically */
    #section-funds-body > div[style*="display:flex"][style*="margin-bottom:14px"] {
        flex-wrap: wrap !important;
        gap: 8px !important;
    }
    #section-funds-body > div[style*="display:flex"][style*="margin-bottom:14px"] > div[style*="flex:0 0 260px"] {
        flex: 1 1 100% !important;
    }

    /* ── Economic Indicators mobile ─────────────────────────── */

    /* Table: scrollable horizontally */
    #econ-table-wrap {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }
    #econ-table-wrap table {
        min-width: 800px !important;
        table-layout: auto !important;
    }
    #econ-table-wrap td,
    #econ-table-wrap th {
        font-size: 13px !important;
        padding: 6px 8px !important;
        white-space: nowrap !important;
    }

    /* Chart: slightly shorter on mobile */
    #econ-chart-wrap {
        height: 180px !important;
    }

    /* Granularity toggle: wrap */
    #econ-gran-toggle {
        flex-wrap: wrap;
    }

    /* Performance tables in all sections: scrollable */
    [id$="-tbl"] {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    [id$="-tbl"] table {
        min-width: 600px;
    }

    /* Chart period buttons: wrap on mobile */
    .chart-periods {
        flex-wrap: wrap !important;
        gap: 4px !important;
    }

    /* World map: reduced height on mobile */
    [id^="wrm-map-"] {
        height: 280px !important;
    }

    /* ── Single stock: profile + description stacked ────────── */

    /* The parent flex row containing sidebar-profile and sidebar-description */
    #tab-overview > .overview-card + div[style*="display:flex"][style*="gap:24px"] {
        flex-direction: column !important;
        gap: 16px !important;
    }

    /* Profile table: full width instead of fixed 310px */
    #sidebar-profile {
        flex: 1 1 100% !important;
        width: 100% !important;
    }

    /* Description: full width */
    #sidebar-description {
        flex: 1 1 100% !important;
        width: 100% !important;
    }

    /* ── Technicals: gauges + tables stacked ─────────────────── */

    /* Gauges: horizontal scroll, one at a time */
    .ta-gauges-row {
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        scroll-snap-type: x mandatory !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        justify-content: flex-start !important;
        gap: 0 !important;
        padding-bottom: 4px;
    }
    .ta-gauges-row::-webkit-scrollbar {
        display: none;
    }
    .ta-gauge {
        flex: 0 0 100% !important;
        scroll-snap-align: center;
    }
    .ta-gauge-svg {
        width: 200px !important;
        height: 120px !important;
    }

    /* Tables: stack vertically */
    .ta-tables-row {
        flex-direction: column !important;
        gap: 16px !important;
    }

    /* Technicals toolbar: wrap */
    .ta-toolbar {
        flex-wrap: wrap !important;
        gap: 8px !important;
    }

    /* Chart indicators panel: horizontal scroll */
    .ta-indicators-panel {
        flex-direction: row !important;
        flex-wrap: wrap !important;
        gap: 6px !important;
    }

    /* Chart row: stack chart + indicators */
    .ta-chart-row {
        flex-direction: column !important;
    }

    /* ── Benchmark: peers table mobile ────────────────────────── */

    /* Benchmark chart section: no horizontal scroll needed now */
    #benchmark-chart-section,
    #overview-peers {
        overflow-x: hidden !important;
    }

    /* Remove min-width */
    #benchmark-chart-section > div:last-child,
    #overview-peers > div:last-child {
        min-width: 0 !important;
    }

    /* Peers table: hide $ change (child 5), 5D (7), 1M (8), YTD (9), 1Y (10) — keep Price (4) and 1D (6) */
    [data-bm-row] > div:nth-child(5),
    [data-bm-row] > div:nth-child(7),
    [data-bm-row] > div:nth-child(8),
    [data-bm-row] > div:nth-child(9),
    [data-bm-row] > div:nth-child(10) {
        display: none !important;
    }

    /* Same for the header row */
    div:has(> [data-bm-row]) > div:not([data-bm-row]) > div:nth-child(5),
    div:has(> [data-bm-row]) > div:not([data-bm-row]) > div:nth-child(7),
    div:has(> [data-bm-row]) > div:not([data-bm-row]) > div:nth-child(8),
    div:has(> [data-bm-row]) > div:not([data-bm-row]) > div:nth-child(9),
    div:has(> [data-bm-row]) > div:not([data-bm-row]) > div:nth-child(10) {
        display: none !important;
    }

    /* Growth / Quality / Valuation tables: logo only, hide ticker text */
    #benchmark-peers-section .card {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }
    #benchmark-peers-section .data-table {
        min-width: 0 !important;
    }
    #benchmark-peers-section .data-table th:not(:first-child) {
        font-size: 0 !important;
        min-width: 50px !important;
        padding: 8px 4px !important;
    }
    #benchmark-peers-section .data-table th img {
        font-size: 14px;
        width: 22px !important;
        height: 22px !important;
    }
    #benchmark-peers-section .data-table td {
        font-size: 11px !important;
        padding: 6px 4px !important;
        min-width: 50px !important;
    }
    #benchmark-peers-section .data-table td:first-child {
        font-size: 12px !important;
        min-width: 100px !important;
    }

    /* Period pills in benchmark: wrap */
    #benchmark-sub-tabs {
        flex-wrap: wrap !important;
    }
}

/* ═══════════════════════════════════════════════════════════════════════
   Header Logo + Neon Dividers
   ═══════════════════════════════════════════════════════════════════════ */

.header-logo {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 64px !important;
    height: 64px !important;
    flex-shrink: 0;
    padding: 0 !important;
    margin: 0 !important;
    cursor: pointer;
    transition: opacity 0.2s;
    box-sizing: border-box !important;
    border-right: 1px solid var(--border) !important;
}

.header-logo:hover {
    opacity: 0.8;
}

.header-logo-img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

/* Thin vertical neon line — full height of header bar */
.header-neon-divider {
    display: none !important;
}

.header-row > .header-neon-divider:first-of-type {
    display: none !important;
}

/* ═══════════════════════════════════════════════════════════════════════
   Auth Circle Button (matches login-button.tsx)
   ═══════════════════════════════════════════════════════════════════════ */

.auth-container {
    width: 64px !important;
    height: 64px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0;
    position: relative;
    margin: 0 !important;
    margin-left: 0 !important;
    box-sizing: border-box !important;
    border-left: 1px solid var(--border) !important;
}

/* Circle button — used for both login and avatar states */
.auth-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--neon-cyan);
    background: rgba(0, 240, 255, 0.10);
    color: var(--neon-cyan);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    padding: 0;
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.2);
}

.auth-circle:hover {
    background: rgba(0, 240, 255, 0.20);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.4);
}

.auth-circle svg {
    filter: drop-shadow(0 0 5px rgba(0, 240, 255, 0.5));
}

/* Avatar variant — shows user picture */
.auth-circle--avatar {
    padding: 0;
    overflow: hidden;
    border: 2px solid var(--neon-cyan);
    background: transparent;
}

.auth-avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

/* Initials fallback when no profile picture (like Manawa "F") */
.auth-avatar-initials {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 700;
    color: var(--neon-cyan);
    background: rgba(0, 240, 255, 0.08);
    text-shadow: 0 0 8px rgba(0, 240, 255, 0.5);
    letter-spacing: 0.5px;
}

/* Hover overlay with gear icon */
.auth-avatar-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.auth-avatar-overlay--gear {
    color: var(--neon-cyan);
}

.auth-circle--avatar:hover .auth-avatar-overlay {
    opacity: 1;
}

.auth-circle--avatar:hover {
    box-shadow: 0 0 12px rgba(0, 255, 200, 0.3);
}

/* Avatar wrap — relative container for dropdown */
.auth-avatar-wrap {
    position: relative;
}

/* Dropdown menu */
.auth-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    background: var(--bg-card);
    border: 1px solid rgba(0, 240, 255, 0.15);
    border-radius: 10px;
    padding: 12px 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transform: translateY(-4px);
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
    z-index: 500;
}

.auth-dropdown.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

.auth-dropdown-name {
    padding: 4px 16px 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.auth-dropdown-email {
    padding: 2px 16px 8px;
    font-size: 11px;
    color: rgba(0, 240, 255, 0.7);
}

.auth-dropdown-divider {
    border: none;
    border-top: 1px solid rgba(0, 240, 255, 0.10);
    margin: 4px 0;
}

.auth-dropdown-item {
    display: block;
    width: 100%;
    padding: 8px 16px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 13px;
    font-family: var(--font-sans);
    text-align: left;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.auth-dropdown-item:hover {
    background: rgba(0, 240, 255, 0.08);
    color: var(--text-primary);
}

.auth-dropdown-item--danger:hover {
    color: var(--loss);
    background: rgba(239, 68, 68, 0.08);
}

/* ═══════════════════════════════════════════════════════════════════════
   Settings Hub
   ═══════════════════════════════════════════════════════════════════════ */

.settings-page {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 40px;
    position: relative;
}

.settings-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--text-muted);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 10;
}

.settings-close-btn:hover {
    color: var(--text-primary);
    background: rgba(0, 240, 255, 0.08);
    border-color: rgba(0, 240, 255, 0.3);
}

.settings-container {
    max-width: 860px;
    margin: 0 auto;
    width: 100%;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    scrollbar-width: thin;
}

/* ── Top-Level Tab Navigation ──────────────────────────────────────── */

.settings-nav {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 32px;
}

.settings-nav-btn {
    padding: 12px 24px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.settings-nav-btn:hover {
    color: var(--text-primary);
}

.settings-nav-btn.active {
    color: var(--text-primary);
    border-bottom-color: var(--neon-cyan);
    text-shadow: 0 0 8px rgba(0, 240, 255, 0.3);
}

/* ── Tab Content Panels ────────────────────────────────────────────── */

.settings-tab {
    display: none;
}

.settings-tab.active {
    display: block;
    animation: settings-fade-in 0.2s ease;
}

@keyframes settings-fade-in {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── Sub-Tab Navigation (API Keys) ─────────────────────────────────── */

.settings-sub-nav {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
    margin: 32px 0 24px;
}

.settings-sub-nav-btn {
    padding: 10px 20px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: all 0.2s;
}

.settings-sub-nav-btn:hover {
    color: var(--text-secondary);
}

.settings-sub-nav-btn.active {
    color: var(--neon-cyan);
    border-bottom-color: var(--neon-cyan);
}

.settings-subtab {
    display: none;
}

.settings-subtab.active {
    display: block;
    animation: settings-fade-in 0.2s ease;
}

/* ── Shared Section Styles ─────────────────────────────────────────── */

.settings-section {
    margin-bottom: 32px;
}

.settings-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.settings-section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.settings-section-desc {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.settings-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
}

/* ── Profile Row ───────────────────────────────────────────────────── */

.settings-profile-row {
    display: flex;
    align-items: center;
    gap: 16px;
}

.settings-profile-avatar {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
}

.settings-profile-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.settings-profile-email {
    font-size: 14px;
    color: rgba(0, 240, 255, 0.7);
    margin-top: 2px;
}

.settings-logout-btn {
    margin-left: auto;
    padding: 8px 20px;
    background: none;
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-sm);
    color: var(--loss);
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: all 0.2s;
}

.settings-logout-btn:hover {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.5);
}

.settings-keys-empty p {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 8px;
}

/* ── Skeleton Loading ────────────────────────────────────────────── */
.skeleton-row {
    display: grid;
    grid-template-columns: 1fr 140px 100px 100px 40px;
    align-items: center;
    padding: 14px 16px;
    gap: 8px;
    border-bottom: 1px solid var(--border);
}

.skeleton-row:last-child {
    border-bottom: none;
}

.skeleton-bar {
    height: 14px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.03) 25%, rgba(255, 255, 255, 0.08) 50%, rgba(255, 255, 255, 0.03) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ═══════════════════════════════════════════════════════════════════════
   Integrations Tab
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Toggle Switches ───────────────────────────────────────────────── */

.settings-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.settings-toggle-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.settings-toggle-row:first-child {
    padding-top: 0;
}

.settings-toggle-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    display: block;
}

.settings-toggle-desc {
    font-size: 12px;
    color: var(--text-muted);
    display: block;
    margin-top: 2px;
}

.settings-switch {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.settings-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.settings-switch-slider {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    cursor: pointer;
    transition: all 0.3s;
}

.settings-switch-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    bottom: 3px;
    background: var(--text-muted);
    border-radius: 50%;
    transition: all 0.3s;
}

.settings-switch input:checked + .settings-switch-slider {
    background: rgba(0, 240, 255, 0.3);
}

.settings-switch input:checked + .settings-switch-slider::before {
    transform: translateX(20px);
    background: var(--neon-cyan);
    box-shadow: 0 0 8px rgba(0, 240, 255, 0.5);
}

.settings-switch--disabled {
    opacity: 0.4;
    pointer-events: none;
}

/* ═══════════════════════════════════════════════════════════════════════
   Billing Tab
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Usage Bars ────────────────────────────────────────────────────── */

.billing-usage-bars {
    display: flex;
    gap: 16px;
}

.billing-usage-card {
    flex: 1;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
}

.billing-usage-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.billing-usage-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
}

.billing-usage-count {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    font-family: var(--font-mono);
}

.billing-usage-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 8px;
}

.billing-usage-fill {
    height: 100%;
    border-radius: 8px;
    background: linear-gradient(90deg, var(--neon-cyan), #00c896);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 8px rgba(0, 240, 255, 0.3);
}

.billing-usage-fill--warn {
    background: linear-gradient(90deg, #fbbf24, #f59e0b);
    box-shadow: 0 0 8px rgba(251, 191, 36, 0.3);
}

.billing-usage-fill--danger {
    background: linear-gradient(90deg, #ef4444, #dc2626);
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.3);
}

.billing-usage-bar--credits .billing-usage-fill,
.billing-usage-fill--credits {
    background: linear-gradient(90deg, #a78bfa, #7c3aed);
    box-shadow: 0 0 8px rgba(167, 139, 250, 0.3);
}

.billing-usage-plan {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

.billing-topup-btn-sm {
    background: none;
    border: 1px solid rgba(167, 139, 250, 0.3);
    color: #a78bfa;
    font-size: 11px;
    font-weight: 600;
    font-family: var(--font-sans);
    padding: 2px 10px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.billing-topup-btn-sm:hover {
    background: rgba(167, 139, 250, 0.1);
    border-color: rgba(167, 139, 250, 0.5);
}

/* ── Package Cards ─────────────────────────────────────────────────── */

.billing-packages {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.billing-pkg-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 28px 24px;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: all 0.3s;
}

.billing-pkg-card:hover {
    border-color: rgba(0, 240, 255, 0.2);
    transform: translateY(-2px);
}

.billing-pkg-card.active {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.1), inset 0 0 20px rgba(0, 240, 255, 0.03);
}

.billing-pkg-card--featured {
    border-color: rgba(0, 240, 255, 0.3);
    background: linear-gradient(180deg, rgba(0, 240, 255, 0.04) 0%, transparent 40%);
}

.billing-pkg-badge {
    position: absolute;
    top: -1px;
    right: 16px;
    background: var(--neon-cyan);
    color: #000;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 10px;
    border-radius: 0 0 6px 6px;
}

.billing-pkg-popular {
    position: absolute;
    top: -1px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(90deg, var(--neon-cyan), #00c896);
    color: #000;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 12px;
    border-radius: 0 0 6px 6px;
}

.billing-pkg-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 8px 0 4px;
}

.billing-pkg-price {
    margin-bottom: 20px;
}

.billing-pkg-amount {
    font-size: 36px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -1px;
}

.billing-pkg-period {
    font-size: 14px;
    color: var(--text-muted);
    margin-left: 2px;
}

.billing-pkg-features {
    list-style: none;
    padding: 0;
    margin: 0 0 24px;
    flex: 1;
}

.billing-pkg-features li {
    font-size: 14px;
    color: var(--text-secondary);
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    display: flex;
    align-items: center;
    gap: 8px;
}

.billing-pkg-features li::before {
    content: '✓';
    color: var(--neon-cyan);
    font-weight: 700;
    font-size: 12px;
}

.billing-pkg-btn {
    width: 100%;
    padding: 12px;
    border: 1px solid rgba(0, 240, 255, 0.2);
    border-radius: var(--radius-sm);
    background: rgba(0, 240, 255, 0.06);
    color: var(--neon-cyan);
    font-size: 14px;
    font-weight: 700;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: all 0.2s;
}

.billing-pkg-btn:hover:not(:disabled) {
    background: rgba(0, 240, 255, 0.12);
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.2);
}

.billing-pkg-btn--current {
    background: rgba(0, 240, 255, 0.08);
    border-color: var(--neon-cyan);
    cursor: default;
    opacity: 0.7;
}

.billing-pkg-btn--featured {
    background: var(--neon-cyan);
    color: #000;
    border-color: var(--neon-cyan);
}

.billing-pkg-btn--featured:hover:not(:disabled) {
    background: #33f5ff;
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.4);
}

.billing-pkg-btn--confirm {
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.6);
    color: #4ade80;
    animation: confirmPulse 1s ease-in-out infinite alternate;
}

.billing-pkg-btn--confirm:hover:not(:disabled) {
    background: rgba(34, 197, 94, 0.22);
    box-shadow: 0 0 16px rgba(34, 197, 94, 0.35);
}

.billing-pkg-btn--confirm-danger {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.5);
    color: #f87171;
    animation: confirmPulseDanger 1s ease-in-out infinite alternate;
}

.billing-pkg-btn--confirm-danger:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.18);
    box-shadow: 0 0 16px rgba(239, 68, 68, 0.3);
}

.billing-pkg-btn--danger {
    border-color: rgba(239, 68, 68, 0.3);
    color: #f87171;
    background: rgba(239, 68, 68, 0.06);
}

@keyframes confirmPulse {
    from { box-shadow: 0 0 4px rgba(34, 197, 94, 0.1); }
    to   { box-shadow: 0 0 16px rgba(34, 197, 94, 0.3); }
}

@keyframes confirmPulseDanger {
    from { box-shadow: 0 0 4px rgba(239, 68, 68, 0.1); }
    to   { box-shadow: 0 0 16px rgba(239, 68, 68, 0.3); }
}

/* ── Credits Section ───────────────────────────────────────────────── */

.billing-credit-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.billing-credit-balance {
    font-size: 28px;
    font-weight: 800;
    color: #a78bfa;
    font-family: var(--font-mono);
}

.billing-credit-equiv {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 4px;
}

.billing-topup-btn {
    padding: 10px 24px;
    background: linear-gradient(135deg, rgba(167, 139, 250, 0.15), rgba(124, 58, 237, 0.1));
    border: 1px solid rgba(167, 139, 250, 0.3);
    border-radius: var(--radius-sm);
    color: #a78bfa;
    font-size: 14px;
    font-weight: 700;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: all 0.2s;
}

.billing-topup-btn:hover {
    background: linear-gradient(135deg, rgba(167, 139, 250, 0.25), rgba(124, 58, 237, 0.15));
    box-shadow: 0 0 16px rgba(167, 139, 250, 0.2);
}

.billing-topup-btn:disabled,
.billing-pkg-btn:disabled,
.settings-btn-primary:disabled,
.settings-btn-outline:disabled,
.settings-btn-danger:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* ── Promo Code ────────────────────────────────────────────────────── */

.billing-promo-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.billing-promo-input {
    flex: 1;
    font-family: var(--font-mono);
    font-size: 14px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.billing-promo-msg {
    margin-top: 10px;
    font-size: 13px;
    min-height: 18px;
    transition: color 0.2s;
}

.billing-promo-msg--success {
    color: var(--gain);
}

.billing-promo-msg--error {
    color: var(--loss);
}

/* ── Billing Toasts ─────────────────────────────────────────────────── */

.billing-toast {
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 12px;
    animation: slideInDown 0.3s ease;
}

@keyframes slideInDown {
    from { transform: translateY(-8px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.billing-toast--success {
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #4ade80;
}

.billing-toast--error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #f87171;
}


/* ── Usage Chart ───────────────────────────────────────────────────── */

.billing-chart-container {
    width: 100%;
    height: 200px;
    position: relative;
}

.billing-chart-container canvas {
    width: 100% !important;
    height: 100% !important;
}

/* ── Usage Chart Skeleton ────────────────────────────────────────── */
.billing-chart-skeleton {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    padding: 20px 16px 30px 40px; /* same as chart drawing context */
    box-sizing: border-box;
    background: transparent;
    pointer-events: none;
}

.billing-chart-skeleton-bar {
    flex: 1;
    margin: 0 2px;
    background: linear-gradient(90deg, rgba(0, 240, 255, 0.04) 25%, rgba(0, 240, 255, 0.15) 50%, rgba(0, 240, 255, 0.04) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 2px 2px 0 0;
}

/* ── Payment & Invoices ────────────────────────────────────────────── */

.billing-payment-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.billing-payment-card {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-secondary);
    font-size: 14px;
}

.billing-payment-card svg {
    color: var(--text-muted);
}

.billing-invoices-list {
    max-height: 300px;
    overflow-y: auto;
}

/* ── Buttons ───────────────────────────────────────────────────────── */

.settings-btn-outline {
    padding: 8px 16px;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: all 0.2s;
}

.settings-btn-outline:hover {
    border-color: rgba(0, 240, 255, 0.3);
    color: var(--text-primary);
}

.settings-btn-primary {
    padding: 8px 20px;
    background: var(--neon-cyan);
    border: none;
    border-radius: var(--radius-sm);
    color: #000;
    font-size: 14px;
    font-weight: 700;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: all 0.2s;
}

.settings-btn-primary:hover {
    background: #33f5ff;
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.4);
}

.settings-btn-danger {
    padding: 10px 24px;
    background: none;
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-sm);
    color: var(--loss);
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: all 0.2s;
}

.settings-btn-danger:hover {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.5);
}

/* Small inline button (for Telegram link/unlink etc.) */
.settings-btn-sm {
    padding: 5px 12px;
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.35);
    border-radius: var(--radius-sm);
    color: #a5b4fc;
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.settings-btn-sm:hover {
    background: rgba(99, 102, 241, 0.22);
    border-color: rgba(99, 102, 241, 0.55);
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.25);
}

.settings-btn-sm--ghost {
    background: none;
    border-color: var(--border);
    color: var(--text-muted);
}

.settings-btn-sm--ghost:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.15);
    color: var(--text-secondary);
    box-shadow: none;
}

/* Thin horizontal divider inside settings-card between toggle rows */
.settings-toggle-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.05);
    margin: 4px 0;
}

/* ═══════════════════════════════════════════════════════════════════════
   API Keys Tab
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Create Key Button ─────────────────────────────────────────────── */

.settings-create-key-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(0, 240, 255, 0.10);
    border: 1px solid var(--neon-cyan);
    border-radius: var(--radius-sm);
    color: var(--neon-cyan);
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: all 0.2s;
}

.settings-create-key-btn:hover {
    background: rgba(0, 240, 255, 0.20);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.3);
}

.settings-create-key-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ── Create Key Modal ──────────────────────────────────────────────── */

.settings-create-modal {
    margin: 16px 0;
}

.settings-create-modal-body {
    background: var(--bg-card);
    border: 1px solid rgba(0, 240, 255, 0.2);
    border-radius: var(--radius-md);
    padding: 24px;
}

.settings-create-modal-body h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 16px;
}

.settings-input-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.settings-input {
    width: 100%;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    font-family: var(--font-sans);
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.settings-input:focus {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 0 2px rgba(0, 240, 255, 0.1);
}

.settings-input::placeholder {
    color: var(--text-muted);
}

.settings-create-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 16px;
}

/* ── New Key Banner ────────────────────────────────────────────────── */

.settings-new-key-banner {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px 18px;
    background: rgba(0, 240, 255, 0.03);
    border: 1px solid rgba(0, 240, 255, 0.15);
    border-radius: var(--radius-md);
    margin: 16px 0;
    box-shadow: var(--glow-sm);
}

.settings-new-key-header {
    width: 100%;
}

.settings-new-key-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.settings-new-key-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--neon-cyan);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.settings-new-key-value {
    width: 100%;
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-primary);
    background: rgba(0, 0, 0, 0.4);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    word-break: break-all;
    user-select: all;
    box-sizing: border-box;
}

.settings-copy-key-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(0, 240, 255, 0.08);
    border: 1px solid var(--neon-cyan);
    border-radius: var(--radius-sm);
    color: var(--neon-cyan);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.settings-copy-key-btn:hover {
    background: rgba(0, 240, 255, 0.18);
    box-shadow: 0 0 8px rgba(0, 240, 255, 0.25);
}

.settings-copy-key-btn.copied {
    color: var(--gain) !important;
    border-color: var(--gain) !important;
    background: rgba(77, 158, 110, 0.15) !important;
    box-shadow: 0 0 8px rgba(77, 158, 110, 0.25) !important;
}

.settings-new-key-warning {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.settings-new-key-warning svg {
    flex-shrink: 0;
}

/* ── Key Search ────────────────────────────────────────────────────── */

.settings-key-search {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
}

.settings-key-search svg {
    color: var(--text-muted);
    flex-shrink: 0;
}

.settings-key-search-input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 13px;
    font-family: var(--font-sans);
}

.settings-key-search-input::placeholder {
    color: var(--text-muted);
}

/* ── Keys Table ────────────────────────────────────────────────────── */

.settings-keys-list {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.settings-key-header,
.settings-key-row {
    display: grid;
    grid-template-columns: 1fr 140px 100px 100px 40px;
    align-items: center;
    padding: 10px 16px;
    gap: 8px;
}

.settings-key-header {
    background: rgba(0, 0, 0, 0.2);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}

.settings-key-row {
    border-bottom: 1px solid var(--border);
    transition: background 0.15s, opacity 0.3s;
}

.settings-key-row:last-child { border-bottom: none; }
.settings-key-row:hover { background: rgba(255, 255, 255, 0.02); }

.settings-key-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.settings-key-prefix code {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--neon-cyan);
    background: rgba(0, 240, 255, 0.08);
    padding: 2px 8px;
    border-radius: 4px;
}

.settings-key-date {
    font-size: 12px;
    color: var(--text-muted);
}

.settings-key-revoke {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.settings-key-revoke:hover {
    color: var(--loss);
    background: rgba(239, 68, 68, 0.10);
}

.settings-keys-empty {
    padding: 40px 20px;
    text-align: center;
}

.settings-keys-empty p {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 8px;
}

/* ═══════════════════════════════════════════════════════════════════════
   Integrations Tab
   ═══════════════════════════════════════════════════════════════════════ */

.integration-platforms {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.integration-platform-btn {
    padding: 8px 20px;
    background: rgba(0, 240, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: all 0.2s;
}

.integration-platform-btn:hover {
    border-color: rgba(0, 240, 255, 0.2);
    color: var(--text-secondary);
}

.integration-platform-btn.active {
    background: rgba(0, 240, 255, 0.1);
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.15);
}

.integration-guide {
    display: none;
}

.integration-guide.active {
    display: block;
    animation: settings-fade-in 0.2s ease;
}

.integration-steps {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px;
}

.integration-step {
    display: flex;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.integration-step:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.integration-step:first-child {
    padding-top: 0;
}

.integration-step-num {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid rgba(0, 240, 255, 0.3);
    color: var(--neon-cyan);
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    text-shadow: 0 0 8px rgba(0, 240, 255, 0.4);
}

.integration-step-content {
    flex: 1;
}

.integration-step-content strong {
    font-size: 15px;
    color: var(--text-primary);
    display: block;
    margin-bottom: 4px;
}

.integration-step-content p {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0;
}

.integration-fields-list {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.integration-field-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.integration-field-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 600;
}

.integration-field-row .integration-copy-block {
    margin-top: 0;
}

.integration-copy-block {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
}

.integration-copy-block code {
    flex: 1;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--neon-cyan);
    word-break: break-all;
}

.integration-copy-btn {
    padding: 6px 14px;
    background: rgba(0, 240, 255, 0.1);
    border: 1px solid rgba(0, 240, 255, 0.25);
    border-radius: var(--radius-sm);
    color: var(--neon-cyan);
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.integration-copy-btn:hover {
    background: rgba(0, 240, 255, 0.2);
}

.integration-example {
    color: rgba(0, 240, 255, 0.6) !important;
    font-style: italic;
    font-size: 14px;
}

.integration-instruction-block {
    padding: 12px 16px;
    background: rgba(0, 240, 255, 0.03);
    border: 1px dashed rgba(0, 240, 255, 0.15);
    border-left: 3px solid var(--neon-cyan);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    margin: 8px 0;
    box-shadow: var(--glow-sm);
}

/* ═══════════════════════════════════════════════════════════════════════
   Developer Playground
   ═══════════════════════════════════════════════════════════════════════ */

.playground-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 32px;
}

.playground-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid var(--border);
}

.playground-method {
    background: rgba(0, 240, 255, 0.15);
    color: var(--neon-cyan);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 800;
    font-family: var(--font-mono);
}

.playground-endpoint {
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--text-secondary);
    flex: 1;
}

.playground-run-btn {
    padding: 6px 16px;
    background: var(--neon-cyan);
    border: none;
    border-radius: var(--radius-sm);
    color: #000;
    font-size: 14px;
    font-weight: 700;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: all 0.2s;
}

.playground-run-btn:hover {
    background: #33f5ff;
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.4);
}

.playground-run-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.playground-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 200px;
}

.playground-panel {
    padding: 16px;
}

.playground-panel:first-child {
    border-right: 1px solid var(--border);
}

.playground-panel-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.playground-input-group {
    margin-bottom: 12px;
}

.playground-label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.playground-select {
    width: 100%;
    padding: 8px 10px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    font-family: var(--font-sans);
    outline: none;
}

.playground-select option {
    background: #0a1628;
    color: var(--text-primary);
    padding: 8px;
}

.playground-textarea {
    width: 100%;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    font-family: var(--font-mono);
    resize: vertical;
    outline: none;
    box-sizing: border-box;
}

.playground-textarea:focus {
    border-color: var(--neon-cyan);
}

.playground-output {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-secondary);
    overflow: auto;
    max-height: 300px;
    white-space: pre-wrap;
    word-break: break-word;
    margin: 0;
}

/* ── Developer Docs ────────────────────────────────────────────────── */

.dev-docs {
    margin-top: 8px;
}

.dev-docs-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 24px 0 8px;
}

.dev-docs-block {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
}

.dev-docs-block code {
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--neon-cyan);
    word-break: break-all;
}

.dev-docs-block pre {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
}

.dev-docs-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
}

.dev-docs-table th {
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
}

.dev-docs-table td {
    font-size: 14px;
    color: var(--text-secondary);
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

/* Neon separator line */
.dev-docs-separator {
    height: 1px;
    margin: 28px 0;
    background: linear-gradient(90deg, transparent, var(--neon-cyan), transparent);
    opacity: 0.4;
}

/* Language selector pills */
.dev-docs-lang-pills {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
}

.dev-lang-pill {
    padding: 6px 16px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-mono);
}

.dev-lang-pill:hover {
    color: var(--text-primary);
    border-color: var(--text-secondary);
}

.dev-lang-pill.active {
    background: rgba(0, 255, 200, 0.08);
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
    box-shadow: 0 0 8px rgba(0, 255, 200, 0.15);
}

/* Language panels */
.dev-lang-panel {
    display: none;
}

.dev-lang-panel.active {
    display: block;
}

/* Syntax highlighting */
.code-keyword {
    color: var(--neon-cyan);
    font-weight: 500;
}

.code-string {
    color: #7deba0;
}

/* ── Mini Usage Bar (API Keys tab) ────────────────────────────────── */
.mini-usage-bar {
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
}

.mini-usage-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.mini-usage-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.mini-usage-text {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

.mini-usage-track {
    height: 4px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 2px;
    overflow: hidden;
}

.mini-usage-fill {
    height: 100%;
    border-radius: 2px;
    background: var(--neon-cyan);
    box-shadow: 0 0 6px rgba(0, 255, 200, 0.3);
    transition: width 0.6s ease;
}

.mini-usage-fill--warn {
    background: #f0a040;
    box-shadow: 0 0 6px rgba(240, 160, 64, 0.3);
}

.mini-usage-fill--danger {
    background: #f04040;
    box-shadow: 0 0 6px rgba(240, 64, 64, 0.3);
}
/* ── Settings Responsive ───────────────────────────────────────────── */

@media (max-width: 768px) {
    .settings-page { padding: 20px 16px; }
    .billing-packages { grid-template-columns: 1fr; }
    .billing-usage-bars { flex-direction: column; }
    .playground-body { grid-template-columns: 1fr; }
    .playground-panel:first-child { border-right: none; border-bottom: 1px solid var(--border); }
    .settings-key-header, .settings-key-row { grid-template-columns: 1fr 100px 40px; }
    .settings-key-header span:nth-child(3), .settings-key-row span:nth-child(3),
    .settings-key-header span:nth-child(4), .settings-key-row span:nth-child(4) { display: none; }
}




/* ═══════════════════════════════════════════════════════════════════════
   HEADER ICON BUTTONS (split-view toggle, right sidebar toggle)
   ═══════════════════════════════════════════════════════════════════════ */

.header-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.header-icon-btn:hover {
    background: rgba(0, 240, 255, 0.1);
    color: var(--neon);
}

.header-icon-btn.active {
    background: rgba(0, 240, 255, 0.15);
    color: var(--neon);
    box-shadow: 0 0 8px rgba(0, 240, 255, 0.2);
}


/* ── Right Sidebar ─────────────────────────────────────────────────────
   Exact mirror of left sidebar (.app-sidebar at line 5174).
   position: fixed, top: 64px, right: 0, width: 260px.
   ───────────────────────────────────────────────────────────────────── */

.right-sidebar {
    width: 260px !important;
    min-width: 260px !important;
    height: calc(100vh - 64px) !important;
    background: var(--bg-sidebar);
    border-left: none !important;
    display: flex !important;
    flex-direction: column;
    position: fixed;
    top: 64px;
    right: 0;
    z-index: 950;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -10px 10px 30px rgba(0, 0, 0, 0.4);
    box-sizing: border-box;
    padding-top: 12px;
}

.right-sidebar.open {
    transform: translateX(0);
}

/* Content nav — exact copy of .sidebar-sections */
.right-sidebar-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0;
    scrollbar-width: none;
}

.right-sidebar-content::-webkit-scrollbar { display: none; }

/* Delete confirmation (✓ | ✕) */
.rs-item--confirming {
    background: rgba(255, 80, 80, 0.08) !important;
}

.rs-confirm-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
    flex-shrink: 0;
}

.rs-confirm-yes, .rs-confirm-no {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    transition: all 0.15s ease;
}

.rs-confirm-yes {
    background: rgba(255, 80, 80, 0.15);
    color: #ff5050;
}

.rs-confirm-yes:hover {
    background: rgba(255, 80, 80, 0.3);
}

.rs-confirm-divider {
    color: var(--text-muted);
    opacity: 0.3;
    font-size: 12px;
}

.rs-confirm-no {
    background: rgba(0, 240, 255, 0.08);
    color: var(--neon);
}

.rs-confirm-no:hover {
    background: rgba(0, 240, 255, 0.2);
}

/* Empty & loading states */
.rs-empty, .rs-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 13px;
    text-align: center;
}

.rs-loading { color: var(--neon); font-size: 12px; }

.rs-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid rgba(0, 240, 255, 0.15);
    border-top-color: var(--neon);
    border-radius: 50%;
    animation: rs-spin 0.8s linear infinite;
}

@keyframes rs-spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 768px) {
    .right-sidebar { display: none !important; }
}


/* ═══════════════════════════════════════════════════════════════════════
   RIGHT SIDEBAR — Detail View
   ═══════════════════════════════════════════════════════════════════════ */

.rs-detail {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.rs-detail-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(0, 240, 255, 0.1);
    flex-shrink: 0;
}

.rs-detail-back {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: rgba(0, 240, 255, 0.06);
    color: var(--neon);
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.rs-detail-back:hover {
    background: rgba(0, 240, 255, 0.15);
}

.rs-detail-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary, #e0e6ed);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rs-detail-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.rs-detail-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--neon);
    opacity: 0.6;
    margin-bottom: 8px;
}

.rs-detail-symbols {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
}

.rs-detail-symbol {
    padding: 8px 12px;
    background: rgba(0, 240, 255, 0.04);
    border: 1px solid rgba(0, 240, 255, 0.08);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary, #e0e6ed);
    letter-spacing: 0.5px;
}

.rs-detail-add-row {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.rs-detail-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid rgba(0, 240, 255, 0.15);
    border-radius: 8px;
    background: rgba(0, 240, 255, 0.04);
    color: var(--text-primary, #e0e6ed);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease;
}

.rs-detail-input:focus {
    border-color: var(--neon);
    box-shadow: 0 0 0 2px rgba(0, 240, 255, 0.1);
}

.rs-detail-input::placeholder {
    color: var(--text-muted, #556677);
}

.rs-detail-add-btn {
    padding: 8px 16px;
    border: 1px solid rgba(0, 240, 255, 0.2);
    border-radius: 8px;
    background: rgba(0, 240, 255, 0.08);
    color: var(--neon);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.rs-detail-add-btn:hover {
    background: rgba(0, 240, 255, 0.18);
}

.rs-detail-holding {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 8px;
    background: rgba(0, 240, 255, 0.04);
    border: 1px solid rgba(0, 240, 255, 0.08);
    margin-bottom: 4px;
}

.rs-detail-holding-sym {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary, #e0e6ed);
    min-width: 60px;
}

.rs-detail-holding-shares {
    font-size: 13px;
    color: var(--text-secondary, #8899aa);
    flex: 1;
}

.rs-detail-holding-cost {
    font-size: 13px;
    color: var(--text-muted, #556677);
}

.rs-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(0, 240, 255, 0.06);
    font-size: 14px;
    color: var(--text-primary, #e0e6ed);
}

.rs-detail-row .rs-detail-label {
    margin-bottom: 0;
}


/* ═══════════════════════════════════════════════════════════════════════
   ALERT SYSTEM STYLES
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Alert Create Form ────────────────────────────────────────────────── */

.alert-create-view,
.alert-detail-view {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.alert-field-group {}

.alert-field-label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 8px;
}

/* Toggle button group */
.alert-toggle-group {
    display: flex;
    gap: 6px;
}

.alert-toggle-btn {
    flex: 1;
    padding: 10px 8px;
    border: 1px solid rgba(0, 240, 255, 0.12);
    border-radius: 8px;
    background: rgba(0, 240, 255, 0.03);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.alert-toggle-btn:hover {
    border-color: rgba(0, 240, 255, 0.25);
    background: rgba(0, 240, 255, 0.06);
    color: var(--text-secondary);
}

.alert-toggle-btn.active {
    border-color: rgba(0, 240, 255, 0.4);
    background: rgba(0, 240, 255, 0.08);
    color: var(--accent-primary, #00f0ff);
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.08);
}

/* Direction group */
.alert-dir-group .alert-toggle-btn {
    min-width: 0;
    flex: 1;
}

/* Ticker card (pre-filled) */
.alert-ticker-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid rgba(0, 240, 255, 0.1);
    border-radius: 10px;
    background: rgba(0, 240, 255, 0.03);
}

.alert-ticker-logo-wrap {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: rgba(0, 240, 255, 0.06);
}

.alert-ticker-logo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.alert-ticker-sym {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.alert-ticker-name {
    font-size: 11px;
    color: var(--text-muted);
}

.alert-ticker-price {
    margin-left: auto;
    font-size: 14px;
    font-weight: 700;
    color: var(--accent-primary, #00f0ff);
}

/* Value input */
.alert-value-input-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    border: 1px solid rgba(0, 240, 255, 0.12);
    border-radius: 8px;
    background: rgba(0, 240, 255, 0.03);
    transition: border-color 0.2s ease;
}

.alert-value-input-wrap:focus-within {
    border-color: rgba(0, 240, 255, 0.35);
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.06);
}

.alert-value-prefix {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    min-width: 14px;
}

.alert-value-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
}

.alert-value-input::placeholder {
    color: rgba(255, 255, 255, 0.2);
}

.alert-ref-line {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 6px;
}

/* Event type pills */
.alert-pill-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.alert-pill {
    padding: 8px 14px;
    border: 1px solid rgba(0, 240, 255, 0.12);
    border-radius: 20px;
    background: rgba(0, 240, 255, 0.03);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.alert-pill:hover {
    border-color: rgba(0, 240, 255, 0.25);
    color: var(--text-secondary);
}

.alert-pill.active {
    border-color: rgba(0, 240, 255, 0.5);
    background: rgba(0, 240, 255, 0.1);
    color: var(--accent-primary, #00f0ff);
    box-shadow: 0 0 16px rgba(0, 240, 255, 0.08);
}

/* Submit button */
.alert-create-submit {
    width: 100%;
    padding: 14px;
    border: 1px solid rgba(0, 240, 255, 0.3);
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.08), rgba(0, 200, 255, 0.04));
    color: var(--accent-primary, #00f0ff);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.alert-create-submit:hover:not(:disabled) {
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.14), rgba(0, 200, 255, 0.08));
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.1);
}

.alert-create-submit:disabled {
    opacity: 0.5;
    cursor: default;
}

/* ── Sidebar Alert Items ──────────────────────────────────────────────── */

.alert-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-right: 4px;
}

.alert-sidebar-meta {
    font-size: 10px;
    color: var(--text-muted);
    opacity: 0.6;
    margin-left: auto;
    margin-right: 6px;
    white-space: nowrap;
}

.alert-notif-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #fbbf24;
    flex-shrink: 0;
    animation: alert-notif-pulse 2s ease-in-out infinite;
}

@keyframes alert-notif-pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 4px rgba(251, 191, 36, 0.4); }
    50% { opacity: 0.5; box-shadow: 0 0 8px rgba(251, 191, 36, 0.6); }
}

/* ── Notification Banner ──────────────────────────────────────────────── */

.alert-notif-banner {
    width: 100%;
    z-index: 100;
    background: linear-gradient(90deg, rgba(251, 191, 36, 0.08), rgba(0, 240, 255, 0.04));
    border-bottom: 1px solid rgba(251, 191, 36, 0.2);
    animation: alert-banner-slide 0.3s ease-out;
}

@keyframes alert-banner-slide {
    from { opacity: 0; transform: translateY(-100%); }
    to { opacity: 1; transform: translateY(0); }
}

.alert-notif-banner-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    max-width: 1400px;
    margin: 0 auto;
}

.alert-notif-banner-icon {
    color: #fbbf24;
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.alert-notif-banner-msg {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
    cursor: pointer;
}

.alert-notif-banner-msg:hover {
    text-decoration: underline;
    text-decoration-color: rgba(251, 191, 36, 0.5);
}

.alert-notif-banner-more {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
}

.alert-notif-banner-dismiss {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.15s ease;
}

.alert-notif-banner-dismiss:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

/* ── Investing Menu Notification Dot ──────────────────────────────────── */

.investing-notif-dot {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #fbbf24;
    border: 2px solid var(--bg-primary, #050a14);
    animation: alert-notif-pulse 2s ease-in-out infinite;
}

/* ── Logged-out sidebar state and login button ──────────────────────── */

.rs-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 24px;
    text-align: center;
    color: var(--text-muted);
    gap: 16px;
}

.rs-login-btn {
    padding: 10px 24px;
    background: rgba(0, 240, 255, 0.1);
    border: 2px solid var(--neon-cyan);
    border-radius: var(--radius-md);
    color: var(--neon-cyan);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-shadow: 0 0 8px rgba(0, 240, 255, 0.3);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.1);
    margin-top: 8px;
}

.rs-login-btn:hover {
    background: rgba(0, 240, 255, 0.2);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.3);
    transform: translateY(-1px);
}

.rs-login-btn:active {
    transform: translateY(0);
}

/* ── Index Card Grid Layout for Desktop ── */
.index-card-left {
    display: grid;
    grid-template-areas:
        "name pct"
        "price delta";
    grid-template-columns: 1fr auto;
    gap: 4px;
    align-items: baseline;
    width: 100%;
}
.ic-name { grid-area: name; }
.ic-pct { grid-area: pct; }
.ic-price { grid-area: price; }
.ic-delta { grid-area: delta; }
.ic-stats { display: contents; }

/* ── Right Sidebar Mobile Header ── */
.right-sidebar-mobile-header {
    display: none;
}

/* ── Responsive Overrides (max-width: 768px) ── */
@media (max-width: 768px) {
    /* 1. Movers Tables Value Fix */
    .movers-table {
        min-width: 0 !important;
        width: 100% !important;
    }
    .mover-name-text--sm {
        max-width: 100px !important;
    }

    /* 2. Slim Index Cards */
    .index-card {
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        padding: 8px 12px !important;
        gap: 12px !important;
        height: 56px !important;
    }
    .index-card-left {
        display: flex !important;
        flex-direction: column !important;
        gap: 2px !important;
        flex: 1 !important;
        min-width: 0 !important;
    }
    .ic-stats {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 8px !important;
    }
    .ic-name {
        font-size: 15px !important;
    }
    .ic-price {
        font-size: 13px !important;
    }
    .ic-delta, .ic-pct {
        font-size: 13px !important;
    }
    .ic-spark {
        width: 90px !important;
        height: 28px !important;
        margin: 0 !important;
        flex-shrink: 0 !important;
    }

    /* 3. Fullscreen Right Sidebar & Hiding Split View Toggle */
    .right-sidebar {
        display: flex !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        transform: none !important;
        opacity: 0 !important;
        pointer-events: none !important;
        transition: opacity 0.3s ease !important;
        z-index: 10000 !important;
        background: #050a14 !important;
        padding-top: 0 !important;
    }
    .right-sidebar.open {
        opacity: 1 !important;
        pointer-events: all !important;
    }
    .right-sidebar-mobile-header {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        padding: 16px 24px !important;
        border-bottom: 1px solid var(--border) !important;
        height: 64px !important;
        width: 100% !important;
        box-sizing: border-box !important;
        flex-shrink: 0 !important;
    }
    .right-sidebar-mobile-title {
        font-size: 16px !important;
        font-weight: 600 !important;
        color: var(--text-primary) !important;
    }
    .right-sidebar-mobile-close {
        background: transparent !important;
        border: none !important;
        color: var(--text-secondary) !important;
        cursor: pointer !important;
        padding: 8px !important;
        border-radius: 8px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    .right-sidebar-mobile-close:hover {
        color: var(--loss) !important;
        background: rgba(255, 255, 255, 0.05) !important;
    }
    #split-view-toggle,
    #split-divider {
        display: none !important;
    }

    /* 4. Technicals Table Sizing */
    .ta-table {
        min-width: 0 !important;
        width: 100% !important;
        table-layout: fixed !important;
    }
    .ta-table th:first-child,
    .ta-table td:first-child {
        width: 45% !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
    .ta-table th:nth-child(2),
    .ta-table td:nth-child(2) {
        width: 25% !important;
        white-space: nowrap !important;
    }
    .ta-table th:nth-child(3),
    .ta-table td:nth-child(3) {
        width: 30% !important;
        white-space: nowrap !important;
    }

    /* 5. Relocated Technical Indicators Selector */
    .ta-chart-row {
        display: flex !important;
        flex-direction: column !important;
    }
    .ta-indicators-panel {
        order: -1 !important;
        width: 100% !important;
        box-sizing: border-box !important;
        border-left: none !important;
        border-bottom: 1px solid var(--border) !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
        padding: 10px 12px !important;
        background: rgba(0,0,0,0.2) !important;
    }
    .ta-ind-item {
        padding: 6px 12px !important;
        background: rgba(255,255,255,0.04) !important;
        border-radius: 4px !important;
        font-size: 12px !important;
    }
    .ta-ind-item.active {
        background: rgba(0, 240, 255, 0.1) !important;
    }

    /* 6. Billing Package mobile collapsing */
    .billing-pkg-features li:not(:first-child) {
        display: none !important;
    }
    .billing-pkg-card.expanded .billing-pkg-features li:not(:first-child) {
        display: list-item !important;
    }
    .billing-pkg-more-toggle {
        display: block !important;
    }

    /* 7. Settings Mobile Alignment */
    .settings-page {
        padding: 20px 16px !important;
    }
    .settings-section-header {
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 12px !important;
    }
    .settings-create-key-btn {
        padding: 6px 12px !important;
        font-size: 13px !important;
        white-space: nowrap !important;
    }
}

