/* ==========================================================================
   StockVanta — High-Performance Quantitative Derivatives & Analytics
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=JetBrains+Mono:wght@500;600;700;800&display=swap');

:root {
    /* StockVanta Brand Colors (from Playbook) */
    --vanta-blue: #003366;
    --vanta-blue-dark: #001F3F;
    --vanta-blue-light: #004D99;
    --electric-orange: #FF6600;
    --electric-orange-glow: rgba(255, 102, 0, 0.4);
    --steel-gray: #555A66;

    --bg-base: #0A1118;
    --bg-surface: #131722;
    --bg-card: #1C1F2A;
    --bg-card-hover: #242836;
    --bg-subtle: rgba(255, 255, 255, 0.03);

    --border-color: rgba(255, 255, 255, 0.08);
    --border-highlight: rgba(255, 255, 255, 0.16);

    --text-primary: #FFFFFF;
    --text-secondary: #D1D4DC;
    --text-muted: #787B86;
    --text-dim: #4A4D58;

    --accent-blue: #387ED1;
    --accent-blue-hover: #2968B2;
    --bull-green: #26A69A;
    --bull-green-bg: rgba(38, 166, 154, 0.12);
    --bear-red: #EF5350;
    --bear-red-bg: rgba(239, 83, 80, 0.12);
    --warn-gold: #F0B90B;
    --warn-gold-bg: rgba(240, 185, 11, 0.12);

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-full: 9999px;

    --shadow-card: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-modal: 0 12px 36px rgba(0, 0, 0, 0.6);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 13px;
    line-height: 1.45;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    font-variant-numeric: slashed-zero tabular-nums;
    font-feature-settings: "zero" 1, "tnum" 1, "cv01" 1;
}

/* ── Typography, Tabular Numbers & Slashed Zero (Sensibull / TradingView style) ── */
.mono,
.tabular,
.price,
.oi,
.badge-mono,
td,
th,
input,
select,
.kpi-value,
.data-stat-val {
    font-variant-numeric: slashed-zero tabular-nums;
    font-feature-settings: "zero" 1, "tnum" 1, "cv01" 1;
}

.mono,
.tabular,
.price,
.oi,
.badge-mono {
    font-family: var(--font-mono);
}

/* ── Header Bar ─────────────────────────────────────────────────────────── */
.terminal-header {
    background: linear-gradient(90deg, #0A1118 0%, #0E1A29 60%, #0A1118 100%);
    border-bottom: 1px solid rgba(0, 51, 102, 0.6);
    padding: 8px 20px 0 20px;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.6);
}

/* ── Top row: brand + meta ──────────────────────────────────────────────── */
.header-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 6px;
}

.brand-section {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

/* Upward Arch Logo Icon */
.brand-arch-icon {
    display: inline-block;
    filter: drop-shadow(0 0 6px rgba(255, 102, 0, 0.45));
    transition: transform 0.2s ease;
}
.brand-arch-icon:hover {
    transform: scale(1.08);
}

/* Brand wordmark — "StockVanta" (Clean Georgia Serif, White, No Background) */
.brand-badge,
.brand-wordmark {
    background: transparent !important;
    background-color: transparent !important;
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    color: #FFFFFF !important;
    font-family: 'Georgia', 'Cambria', 'Times New Roman', serif;
    font-size: 19px;
    font-weight: 600;
    letter-spacing: 0.3px;
    line-height: 1;
    white-space: nowrap;
    display: inline-block;
    vertical-align: middle;
}

/* Legacy title-word hidden */
.brand-title-word {
    display: none;
}

/* "by Hetal Patel" muted */
.brand-author {
    font-size: 12px;
    color: #94A3B8;
    font-weight: 500;
    white-space: nowrap;
    margin-left: 3px;
    vertical-align: middle;
}

/* Separator "|" */
.header-sep {
    color: rgba(255, 255, 255, 0.15);
    font-size: 13px;
    font-weight: 300;
    user-select: none;
}

/* · dot */
.hdr-dot {
    color: #787B86;
    font-size: 13px;
    user-select: none;
}

/* Label "Expiry:" */
.hdr-label {
    font-size: 11px;
    color: #787B86;
    font-weight: 500;
}

/* Pill chips */
.hdr-pill {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: var(--radius-full);
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.pill-tf {
    background: rgba(56, 126, 209, 0.18);
    color: #7EB5F5;
    border: 1px solid rgba(56, 126, 209, 0.35);
}

/* NSE Equity — teal (default) */
.pill-seg {
    background: rgba(38, 166, 154, 0.14);
    color: #4DD0C4;
    border: 1px solid rgba(38, 166, 154, 0.3);
}

/* NSE Index — blue-violet */
.pill-index {
    background: rgba(100, 80, 220, 0.18);
    color: #A78BFA;
    border: 1px solid rgba(100, 80, 220, 0.35);
}

/* BSE — orange */
.pill-bse {
    background: rgba(255, 140, 0, 0.15);
    color: #FFB84D;
    border: 1px solid rgba(255, 140, 0, 0.35);
}

/* MCX Commodity — amber-gold */
.pill-mcx {
    background: rgba(234, 179, 8, 0.15);
    color: #FDE047;
    border: 1px solid rgba(234, 179, 8, 0.4);
}

.pill-expiry {
    background: rgba(240, 185, 11, 0.12);
    color: #F0C040;
    border: 1px solid rgba(240, 185, 11, 0.3);
    font-family: var(--font-mono);
}

/* ── Right meta group ───────────────────────────────────────────────────── */
.header-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.hdr-status-group {
    display: flex;
    align-items: center;
}

.status-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    margin-right: 5px;
    flex-shrink: 0;
}

.status-dot.online {
    background: #00E676;
    box-shadow: 0 0 7px #00E676;
}

.status-dot.offline {
    background: #EF5350;
    box-shadow: 0 0 7px #EF5350;
}

/* Vertical separator line */
.header-vsep {
    display: inline-block;
    width: 1px;
    height: 18px;
    background: rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

/* Auto-refresh control */
.hdr-refresh-ctrl {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.05);
    padding: 3px 8px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.09);
}

/* ── IST Clock block ────────────────────────────────────────────────────── */
.hdr-clock-block {
    display: flex;
    align-items: center;
    gap: 5px;
}

.hdr-clock-icon {
    font-size: 12px;
    opacity: 0.6;
}

.hdr-clock-label {
    font-size: 11px;
    color: #787B86;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.hdr-clock-time {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    color: #D1D4DC;
    letter-spacing: 0.5px;
}

.hdr-clock-sep {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.2);
    margin: 0 2px;
}

.hdr-clock-date {
    font-size: 11px;
    color: #787B86;
    font-weight: 500;
    white-space: nowrap;
}

/* ── User badge ─────────────────────────────────────────────────────────── */
.hdr-user-badge {
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 3px 10px;
    border-radius: var(--radius-full);
}

.hdr-user-icon {
    font-size: 12px;
    opacity: 0.7;
}

.hdr-user-name {
    font-size: 11px;
    font-weight: 700;
    color: #D1D4DC;
}

.hdr-user-role {
    font-size: 10px;
    font-weight: 700;
    color: #26A69A;
    background: rgba(38, 166, 154, 0.14);
    border: 1px solid rgba(38, 166, 154, 0.3);
    border-radius: var(--radius-full);
    padding: 1px 6px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

/* ── Subtitle row ───────────────────────────────────────────────────────── */
.header-subtitle-row {
    font-size: 11px;
    color: #7EC8F5;
    font-weight: 500;
    letter-spacing: 0.2px;
    opacity: 0.8;
    padding: 5px 0 7px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 2px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.header-subtitle-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    flex-shrink: 1;
}

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

/* ── Buttons ────────────────────────────────────────────────────────────── */
.header-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 5px 11px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 600;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s ease;
    white-space: nowrap;
    font-family: var(--font-sans);
}

.header-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #FFFFFF;
    border-color: var(--border-highlight);
}

.header-btn.primary {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: #FFFFFF;
}

.header-btn.primary:hover {
    background: var(--accent-blue-hover);
}

/* ── Quick Jump Bar ─────────────────────────────────────────────────────── */
.quick-jump-bar {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    padding: 6px 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
}

.quick-label {
    font-size: 11px;
    font-weight: 800;
    color: var(--accent-blue);
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.jump-chip {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 3px 10px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.jump-chip:hover {
    border-color: var(--accent-blue);
    color: #FFFFFF;
}

.jump-chip.active {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: #FFFFFF;
}

/* ── Context Selector Bar (Symbol + Expiry + Market Status) ──────────────── */
.context-bar {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.select-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.select-wrapper {
    position: relative;
}

select.terminal-select {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 6px 30px 6px 12px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    appearance: none;
}

select.terminal-select:focus {
    border-color: var(--accent-blue);
}

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

.market-badge.live {
    background: var(--bull-green-bg);
    color: var(--bull-green);
    border: 1px solid var(--bull-green);
}

.market-badge.closed {
    background: var(--bear-red-bg);
    color: var(--bear-red);
    border: 1px solid var(--bear-red);
}

/* ── Prominent Top Trade Signal Card ────────────────────────────────────── */
.top-trade-container {
    padding: 14px 20px;
}

.top-trade-card {
    background: linear-gradient(135deg, #182030, #131722);
    border: 1px solid rgba(56, 126, 209, 0.4);
    border-radius: var(--radius-lg);
    padding: 18px 24px;
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
}

.top-trade-card.bullish {
    border-color: rgba(38, 166, 154, 0.5);
    background: linear-gradient(135deg, rgba(38, 166, 154, 0.12), #131722);
}

.top-trade-card.bearish {
    border-color: rgba(239, 83, 80, 0.5);
    background: linear-gradient(135deg, rgba(239, 83, 80, 0.12), #131722);
}

.trade-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 10px;
}

.trade-title {
    font-size: 20px;
    font-weight: 800;
    color: #FFFFFF;
    display: flex;
    align-items: center;
    gap: 10px;
}

.trade-pill {
    padding: 3px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
}

.trade-pill.call {
    background: #26A69A;
    color: #FFFFFF;
}

.trade-pill.put {
    background: #EF5350;
    color: #FFFFFF;
}

.trade-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
    margin: 14px 0;
}

.trade-metric-box {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 8px 12px;
    text-align: center;
}

.trade-metric-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 2px;
}

.trade-metric-val {
    font-size: 17px;
    font-weight: 800;
    color: #FFFFFF;
}

/* ── LTP Progress Bar ────────────────────────────────────────────────────── */
.progress-bar-wrap {
    background: rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-full);
    height: 8px;
    position: relative;
    margin: 12px 0 6px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #387ED1, #00E676);
    border-radius: var(--radius-full);
    transition: width 0.3s ease;
}

/* ── Pulsing Live Dot Animation ── */
@keyframes pulseGlow {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(0, 230, 118, 0.7);
    }

    70% {
        transform: scale(1.1);
        box-shadow: 0 0 0 6px rgba(0, 230, 118, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(0, 230, 118, 0);
    }
}

@keyframes pulseGlowRed {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(239, 83, 80, 0.7);
    }

    70% {
        transform: scale(1.1);
        box-shadow: 0 0 0 6px rgba(239, 83, 80, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(239, 83, 80, 0);
    }
}

.pulsing-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    display: inline-block;
    animation: pulseGlow 1.8s infinite;
}

.pulsing-dot.red {
    animation: pulseGlowRed 1.8s infinite;
}

.top-trade-layout {
    display: grid;
    grid-template-columns: 1fr 180px;
    gap: 14px;
    align-items: stretch;
}

@media (max-width: 960px) {
    .top-trade-layout {
        grid-template-columns: 1fr;
    }
}

.top-trade-action-col {
    display: flex;
    flex-direction: column;
    gap: 8px;
    justify-content: center;
}

.top-trade-action-col .header-btn {
    width: 100%;
    justify-content: center;
    padding: 9px 12px;
    font-size: 12px;
    font-weight: 700;
}

/* ── Categorized Navigation Tab Bar (4 Groups in 2 Lines) ────────────────── */
.nav-tab-container {
    background: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    padding: 8px 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nav-tab-line {
    display: flex;
    gap: 12px;
    align-items: center;
    overflow-x: auto;
}

.nav-tab-group {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-md);
    padding: 3px 6px;
}

.nav-group-tag {
    font-size: 10px;
    font-weight: 800;
    color: var(--text-muted);
    letter-spacing: 0.6px;
    padding: 0 6px;
    white-space: nowrap;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.tab-btn-cluster {
    display: flex;
    gap: 4px;
}

.nav-tab-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.tab-icon {
    font-size: 12px;
    line-height: 1;
    display: inline-block;
    flex-shrink: 0;
    pointer-events: none;
}

.tab-label {
    pointer-events: none;
}

.tab-kbd {
    font-size: 9px;
    font-family: var(--font-mono, monospace);
    color: #787B86;
    background: rgba(255, 255, 255, 0.06);
    padding: 1px 4px;
    border-radius: 3px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    pointer-events: none;
    margin-left: 2px;
}

.tab-pill-badge {
    font-size: 9px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 8px;
    background: rgba(255, 152, 0, 0.15);
    color: #FF9800;
    border: 1px solid rgba(255, 152, 0, 0.3);
    pointer-events: none;
}

.tab-live-badge {
    background: rgba(0, 230, 118, 0.15) !important;
    color: #00E676 !important;
    border-color: rgba(0, 230, 118, 0.3) !important;
}

.nav-tab-btn:hover {
    background: var(--bg-card-hover);
    color: #FFFFFF;
    border-color: var(--border-highlight);
}

.nav-tab-btn.active {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: #FFFFFF;
    box-shadow: 0 2px 8px rgba(56, 126, 209, 0.35);
}

.secondary-tab-btn {
    opacity: 0.65;
    background: rgba(255, 255, 255, 0.02) !important;
    border: 1px dashed rgba(255, 255, 255, 0.12) !important;
    font-size: 11px !important;
    color: #90A4AE !important;
}

.secondary-tab-btn:hover {
    opacity: 1.0;
    border-style: solid !important;
    color: #FFFFFF !important;
    background: rgba(255, 255, 255, 0.06) !important;
}

.secondary-tab-btn.active {
    opacity: 1.0;
    border-style: solid !important;
    color: #FFFFFF !important;
    background: var(--accent-blue) !important;
}

/* ── Tab Content Views ───────────────────────────────────────────────────── */
.tab-content-area {
    padding: 20px;
    min-height: 600px;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
    animation: fadeIn 0.2s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Option Chain Table (Sensibull Style) ────────────────────────────────── */
.table-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-top: 14px;
}

table.option-chain-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    text-align: right;
}

table.option-chain-table th {
    background: #141720;
    color: var(--text-muted);
    padding: 10px 8px;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
}

table.option-chain-table td {
    padding: 7px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

table.option-chain-table tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.strike-cell {
    background: #181C26;
    color: var(--warn-gold);
    font-weight: 800;
    text-align: center;
    font-family: var(--font-mono);
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
}

.itm-call {
    background: rgba(16, 56, 52, 0.65) !important;
}

.itm-put {
    background: rgba(60, 20, 26, 0.60) !important;
}

.atm-row {
    background: rgba(145, 110, 15, 0.40) !important;
    border-top: 1px solid rgba(240, 185, 11, 0.8) !important;
    border-bottom: 1px solid rgba(240, 185, 11, 0.8) !important;
}

.atm-strike-cell {
    background: rgba(195, 150, 18, 0.55) !important;
    color: #FFD700 !important;
}

.resist-strike-cell {
    background: rgba(239, 83, 80, 0.38) !important;
    color: #FF6B6B !important;
}

.support-strike-cell {
    background: rgba(38, 166, 154, 0.40) !important;
    color: #00E676 !important;
}

.resist-row {
    border-top: 1px dashed rgba(239, 83, 80, 0.6) !important;
    border-bottom: 1px dashed rgba(239, 83, 80, 0.6) !important;
}

.support-row {
    border-top: 1px dashed rgba(38, 166, 154, 0.6) !important;
    border-bottom: 1px dashed rgba(38, 166, 154, 0.6) !important;
}

/* ── Badges & Chips ──────────────────────────────────────────────────────── */
.tag-chip {
    font-size: 9px;
    font-weight: 800;
    padding: 1px 5px;
    border-radius: 4px;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    line-height: 1.2;
    white-space: nowrap;
}

.tag-atm {
    background: rgba(240, 185, 11, 0.2);
    border: 1px solid #F0B90B;
    color: #FFD700;
    box-shadow: 0 0 6px rgba(240, 185, 11, 0.3);
}

.tag-resist {
    background: rgba(239, 83, 80, 0.2);
    border: 1px solid #EF5350;
    color: #FF6B6B;
    box-shadow: 0 0 6px rgba(239, 83, 80, 0.3);
}

.tag-support {
    background: rgba(38, 166, 154, 0.2);
    border: 1px solid #26A69A;
    color: #00E676;
    box-shadow: 0 0 6px rgba(38, 166, 154, 0.3);
}

.tag-maxpain {
    background: rgba(255, 152, 0, 0.2);
    border: 1px solid #FF9800;
    color: #FFA726;
}

.buildup-badge {
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 700;
}

.buildup-long {
    background: rgba(38, 166, 154, 0.2);
    color: #26A69A;
}

.buildup-short {
    background: rgba(239, 83, 80, 0.2);
    color: #EF5350;
}

.buildup-cover {
    background: rgba(0, 230, 118, 0.2);
    color: #00E676;
}

.buildup-unwind {
    background: rgba(255, 152, 0, 0.2);
    color: #FF9800;
}

/* ── Modal / Dialog ──────────────────────────────────────────────────────── */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 999;
    align-items: center;
    justify-content: center;
}

.modal-overlay.open {
    display: flex;
}

.modal-card {
    background: var(--bg-card);
    border: 1px solid var(--border-highlight);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 540px;
    padding: 24px;
    box-shadow: var(--shadow-modal);
}

/* ── Toast Notifications ─────────────────────────────────────────────────── */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column-reverse;
    /* Newest toast appears neatly at bottom */
    gap: 8px;
    max-height: 220px;
    overflow: hidden;
    pointer-events: none;
}

.toast-msg {
    background: var(--bg-card);
    border: 1px solid var(--border-highlight);
    border-left: 4px solid var(--accent-blue);
    padding: 10px 16px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    color: #FFFFFF;
    font-size: 12px;
    font-weight: 600;
    pointer-events: auto;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ── Custom Range Slider Styling ─────────────────────────────────────────── */
input[type=range] {
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.1);
    height: 4px;
    border-radius: 2px;
    outline: none;
    margin: 6px 0;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent-blue);
    cursor: pointer;
    box-shadow: 0 0 4px rgba(56, 126, 209, 0.8);
    transition: transform 0.1s ease;
}

input[type=range]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

/* ── Live Alerts Badge Pill & Unusual Activity Cards ──────────────────────── */
.alert-count-pill {
    background: #FF5252;
    color: #FFFFFF;
    font-size: 10px;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: var(--radius-full);
    margin-left: 4px;
    box-shadow: 0 0 8px rgba(255, 82, 82, 0.6);
    animation: pulseGlow 2s infinite;
}

@keyframes pulseGlow {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.08);
        opacity: 0.85;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.unusual-alert-card {
    background: #1C1F2A;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 12px;
    transition: all 0.2s ease-in-out;
    position: relative;
}

.unusual-alert-card:hover {
    border-color: rgba(56, 126, 209, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.unusual-alert-card.bullish {
    border-left: 4px solid #26A69A;
}

.unusual-alert-card.bearish {
    border-left: 4px solid #EF5350;
}

.unusual-alert-card.neutral {
    border-left: 4px solid #F0B90B;
}

.speed-badge-pill {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.speed-badge-pill.institutional {
    background: rgba(255, 82, 82, 0.15);
    color: #FF5252;
    border: 1px solid rgba(255, 82, 82, 0.35);
}

.speed-badge-pill.standard {
    background: rgba(56, 126, 209, 0.15);
    color: #64B5F6;
    border: 1px solid rgba(56, 126, 209, 0.35);
}

.speed-badge-pill.retail {
    background: rgba(120, 123, 134, 0.15);
    color: #B0BEC5;
    border: 1px solid rgba(120, 123, 134, 0.35);
}

/* Screener Table Styles */
table.screener-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    background: #141722;
}

table.screener-table th {
    background: #191D2B;
    color: #848E9C;
    padding: 12px 14px;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

table.screener-table th.th-left,
table.screener-table td.td-left {
    text-align: left;
    padding-left: 18px;
}

table.screener-table th.th-center,
table.screener-table td.td-center {
    text-align: center;
}

table.screener-table th.th-right,
table.screener-table td.td-right {
    text-align: right;
    padding-right: 18px;
}

table.screener-table td {
    padding: 11px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    vertical-align: middle;
}

table.screener-table tr:hover td {
    background: rgba(255, 255, 255, 0.035);
}

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

/* Button & Action Styles */
.header-btn {
    background: #202430;
    color: #E8EAED;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: all 0.2s ease;
    user-select: none;
    text-decoration: none;
}

.header-btn:hover {
    background: #2A2F3E;
    border-color: rgba(255, 255, 255, 0.25);
    color: #FFFFFF;
}

.header-btn.primary {
    background: rgba(56, 126, 209, 0.2);
    border-color: #387ED1;
    color: #64B5F6;
}

.header-btn.primary:hover {
    background: #387ED1;
    color: #FFFFFF;
}

.header-btn.success {
    background: rgba(0, 230, 118, 0.15);
    border-color: #00E676;
    color: #00E676;
}

.header-btn.success:hover {
    background: #00E676;
    color: #12141A;
}

.header-btn.danger {
    background: rgba(255, 82, 82, 0.15);
    border-color: #FF5252;
    color: #FF5252;
}

.header-btn.danger:hover {
    background: #FF5252;
    color: #FFFFFF;
}

/* ── Gamma Blast Detector Styles ────────────────────────────────────────── */
@keyframes pulse-orange-red {
    0% {
        box-shadow: 0 0 10px rgba(255, 82, 82, 0.35);
        border-color: rgba(255, 82, 82, 0.5);
    }

    50% {
        box-shadow: 0 0 22px rgba(255, 152, 0, 0.7);
        border-color: rgba(255, 152, 0, 0.85);
    }

    100% {
        box-shadow: 0 0 10px rgba(255, 82, 82, 0.35);
        border-color: rgba(255, 82, 82, 0.5);
    }
}

.gamma-blast-pulse-card {
    background: linear-gradient(135deg, rgba(28, 31, 42, 0.98), rgba(19, 23, 34, 0.99));
    border: 2px solid #FF5252;
    border-radius: 12px;
    padding: 18px 22px;
    margin-bottom: 14px;
    animation: pulse-orange-red 2.2s infinite ease-in-out;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gamma-blast-pulse-card:hover {
    transform: translateY(-2px);
}

.gamma-warning-banner {
    background: linear-gradient(135deg, rgba(239, 83, 80, 0.15), rgba(255, 152, 0, 0.12));
    border: 2px solid #EF5350;
    border-radius: 10px;
    padding: 14px 18px;
    margin-bottom: 18px;
}

.gamma-metric-card {
    background: #1C1F2A;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 12px 16px;
    text-align: center;
}

/* ── Method Selection Modal Buttons ── */
.method-select-btn {
    display: block;
    width: 100%;
    text-align: left;
    white-space: normal;
    padding: 14px 16px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: #181C28 !important;
    color: #F0F3FA !important;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-sans);
    box-sizing: border-box;
    outline: none;
}

.method-select-btn:hover {
    border-color: #387ED1 !important;
    background: #1E2436 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
}

.method-select-btn.active-default {
    border-color: #00E676 !important;
    background: #132420 !important;
}

.method-select-btn.active-default:hover {
    border-color: #00E676 !important;
    background: #18332A !important;
}

/* ══════════════════════════════════════════════════════════════════════════════
   DASHBOARD REDESIGN & A/B PREVIEW SYSTEM (Option 1 vs Option 2 vs Classic)
   ══════════════════════════════════════════════════════════════════════════════ */

/* ── 1. Layout Mode Switcher Pills (Header) ── */
.layout-mode-pill-group {
    display: inline-flex;
    align-items: center;
    background: #141722;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    padding: 3px 5px;
    gap: 4px;
    margin-left: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.layout-mode-label {
    font-size: 10px;
    font-weight: 800;
    color: #FFD700;
    padding: 0 5px;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    user-select: none;
}

.layout-pill-btn {
    background: transparent;
    border: none;
    color: #848E9C;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    outline: none;
}

.layout-pill-btn:hover {
    color: #F0F3FA;
    background: rgba(255, 255, 255, 0.08);
}

.layout-pill-btn.active {
    background: linear-gradient(135deg, #2962FF 0%, #1E88E5 100%);
    color: #FFFFFF !important;
    font-weight: 700;
    box-shadow: 0 2px 10px rgba(41, 98, 255, 0.45);
}

/* ── 2. Collapsible Signal HUD Strip ── */
.signal-hud-strip {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(90deg, rgba(38, 166, 154, 0.12) 0%, rgba(41, 98, 255, 0.09) 100%);
    border: 1px solid rgba(38, 166, 154, 0.3);
    border-radius: 8px;
    padding: 7px 14px;
    margin-bottom: 14px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.signal-hud-strip:hover {
    border-color: rgba(38, 166, 154, 0.6);
    background: linear-gradient(90deg, rgba(38, 166, 154, 0.18) 0%, rgba(41, 98, 255, 0.14) 100%);
}

.hud-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    cursor: pointer;
}

.hud-tag {
    background: rgba(38, 166, 154, 0.22);
    color: #26A69A;
    font-weight: 800;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 4px;
    letter-spacing: 0.5px;
    border: 1px solid rgba(38, 166, 154, 0.35);
}

.hud-summary {
    color: #EAEDF5;
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.2px;
}

.hud-right {
    display: flex;
    align-items: center;
}

.hud-toggle-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #D1D4DC;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.hud-toggle-btn:hover {
    background: rgba(41, 98, 255, 0.25);
    border-color: #2962FF;
    color: #FFFFFF;
}

/* ── 3. Option 1: Pro Clean Modern Terminal ── */
body.as-mode-opt1 .terminal-main-layout {
    display: block;
    width: 100%;
}

body.as-mode-opt1 #nav-tab-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    background: #171A24;
    padding: 7px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 14px;
}

body.as-mode-opt1 .nav-tab-btn {
    padding: 7px 13px;
    font-size: 12px;
    border-radius: 6px;
}

/* ── 4. Option 2: Executive Sidebar Terminal (Accessible & Clear) ── */
body.as-mode-opt2 .terminal-main-layout {
    display: flex;
    flex-direction: row;
    gap: 16px;
    align-items: flex-start;
    width: 100%;
    box-sizing: border-box;
}

body.as-mode-opt2 #nav-tab-container {
    width: 246px;
    min-width: 246px;
    max-width: 246px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #141722;
    padding: 14px 10px 24px 10px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    position: sticky;
    top: 70px;
    height: calc(100vh - 99px);
    max-height: calc(100vh - 99px);
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    transition: width 0.22s cubic-bezier(0.4, 0, 0.2, 1), padding 0.22s ease;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

body.as-mode-opt2 #nav-tab-container::-webkit-scrollbar {
    width: 4px;
}

body.as-mode-opt2 #nav-tab-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.14);
    border-radius: 4px;
}

/* Sidebar Top Header & Collapse Control */
.sidebar-top-ctrl {
    display: none;
}

body.as-mode-opt2 .sidebar-top-ctrl {
    display: block;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-title-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-title-badge {
    font-size: 11px;
    font-weight: 800;
    color: #448AFF;
    letter-spacing: 0.8px;
    user-select: none;
}

.sidebar-toggle-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #B0BEC5;
    border-radius: 6px;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.18s ease;
    font-size: 11px;
    padding: 0;
    outline: none;
}

.sidebar-toggle-btn:hover {
    background: rgba(41, 98, 255, 0.25);
    border-color: #2979FF;
    color: #FFFFFF;
}

/* Vertical Group Reset */
body.as-mode-opt2 .nav-tab-line {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    overflow: visible;
}

body.as-mode-opt2 .nav-tab-group {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 2px;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
}

/* Clean Category Section Headers */
body.as-mode-opt2 .nav-group-tag {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 9.5px;
    font-weight: 800;
    color: #787B86;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    padding: 6px 8px 4px 8px;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 3px;
    user-select: none;
}

body.as-mode-opt2 .tab-btn-cluster {
    display: flex;
    flex-direction: column;
    gap: 3px;
    width: 100%;
}

/* Accessible & High-Contrast Tab Buttons */
body.as-mode-opt2 .nav-tab-btn {
    width: 100%;
    text-align: left;
    padding: 8px 10px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    border: 1px solid transparent;
    border-left: 3px solid transparent;
    background: transparent;
    color: #A6ACBA;
    transition: all 0.16s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-sizing: border-box;
    cursor: pointer;
}

body.as-mode-opt2 .nav-tab-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #FFFFFF;
    border-color: rgba(255, 255, 255, 0.08);
    transform: translateX(3px);
}

/* Active State: Distinct Left Accent + Subtle Glow */
body.as-mode-opt2 .nav-tab-btn.active {
    background: linear-gradient(90deg, rgba(41, 98, 255, 0.22) 0%, rgba(41, 98, 255, 0.05) 100%) !important;
    color: #448AFF !important;
    border-color: rgba(41, 98, 255, 0.35) !important;
    border-left: 3px solid #2979FF !important;
    font-weight: 700;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    transform: translateX(2px);
}

body.as-mode-opt2 .nav-tab-btn.active .tab-label {
    color: #FFFFFF;
}

/* Secondary Tools Muted in Sidebar */
body.as-mode-opt2 .secondary-tab-btn {
    opacity: 0.75;
    border: 1px solid transparent !important;
    border-left: 3px solid transparent !important;
    color: #848E9C !important;
    font-size: 11.5px !important;
    padding: 6px 10px;
}

body.as-mode-opt2 .secondary-tab-btn:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.04) !important;
    color: #FFFFFF !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

body.as-mode-opt2 .secondary-tab-btn.active {
    opacity: 1;
    background: linear-gradient(90deg, rgba(41, 98, 255, 0.2) 0%, rgba(41, 98, 255, 0.05) 100%) !important;
    color: #448AFF !important;
    border-color: rgba(41, 98, 255, 0.35) !important;
    border-left: 3px solid #2979FF !important;
}

body.as-mode-opt2 #tab-content-area {
    flex: 1;
    min-width: 0;
    width: calc(100% - 262px);
}

/* ── Collapsible Rail Mode (When user clicks ◀ / ▶) ── */
body.as-mode-opt2.sidebar-collapsed #nav-tab-container {
    width: 58px;
    min-width: 58px;
    max-width: 58px;
    padding: 12px 6px;
}

body.as-mode-opt2.sidebar-collapsed .sidebar-title-badge {
    display: none;
}

body.as-mode-opt2.sidebar-collapsed .sidebar-title-box {
    justify-content: center;
}

body.as-mode-opt2.sidebar-collapsed .nav-group-tag {
    font-size: 0;
    height: 1px;
    padding: 0;
    margin: 4px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

body.as-mode-opt2.sidebar-collapsed .tab-label,
body.as-mode-opt2.sidebar-collapsed .tab-kbd,
body.as-mode-opt2.sidebar-collapsed .tab-pill-badge {
    display: none;
}

body.as-mode-opt2.sidebar-collapsed .tab-icon {
    font-size: 16px;
    margin: 0 auto;
}

body.as-mode-opt2.sidebar-collapsed .nav-tab-btn {
    justify-content: center;
    padding: 10px 0;
    border-left-width: 3px;
}

body.as-mode-opt2.sidebar-collapsed .nav-tab-btn:hover {
    transform: scale(1.08);
}

body.as-mode-opt2.sidebar-collapsed #tab-content-area {
    width: calc(100% - 74px);
}

/* ── 5. Classic Layout (Original Fallback) ── */
body.as-mode-classic .terminal-main-layout {
    display: block;
    width: 100%;
}

body.as-mode-classic #signal-hud-strip {
    display: none !important;
}

/* ── 6. Mobile & Tablet Responsive Architecture ───────────────────────────── */

/* Mobile Controls Base Elements */
.mobile-menu-btn {
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 8px;
    cursor: pointer;
    padding: 6px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.mobile-menu-btn:hover,
.mobile-menu-btn:active {
    background: rgba(41, 98, 255, 0.2);
    border-color: #2979FF;
}

.mobile-menu-btn .hamburger-bar {
    display: block;
    width: 18px;
    height: 2px;
    background: #FFFFFF;
    border-radius: 2px;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.sidebar-mobile-close-btn {
    display: none;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: #CBD5E1;
    border-radius: 6px;
    width: 26px;
    height: 26px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    transition: all 0.18s ease;
}

.sidebar-mobile-close-btn:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: #EF5350;
    color: #FFFFFF;
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9998;
    opacity: 0;
    transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

/* Mobile Bottom Navigation Bar */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: rgba(14, 18, 28, 0.96);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.5);
    z-index: 9990;
    justify-content: space-around;
    align-items: center;
    padding: 0 6px;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.mobile-nav-btn {
    flex: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: #848E9C;
    cursor: pointer;
    gap: 3px;
    transition: all 0.16s ease;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.mobile-nav-btn .nav-icon {
    font-size: 18px;
    line-height: 1;
    transition: transform 0.16s ease;
}

.mobile-nav-btn .nav-text {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.mobile-nav-btn.active,
.mobile-nav-btn:active {
    color: #2979FF;
}

.mobile-nav-btn.active .nav-icon {
    transform: scale(1.15);
}

.mobile-nav-btn.active .nav-text {
    color: #FFFFFF;
    font-weight: 700;
}

.oc-delta-rollover-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

/* ── Option Chain Modern Sticky Header and Strike Column (Phase 2) ───── */
.option-chain-table {
    border-collapse: collapse;
}

.option-chain-table thead th {
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
}

.option-chain-table th:nth-child(5),
.option-chain-table td:nth-child(5) {
    border-left: 2px solid rgba(255, 255, 255, 0.14) !important;
    border-right: 2px solid rgba(255, 255, 255, 0.14) !important;
}

/* ── Tablet Optimization (769px - 1024px) ─────────────────────────────────── */
@media (min-width: 769px) and (max-width: 1024px) {
    body.as-mode-opt2 #nav-tab-container {
        width: 195px;
        min-width: 195px;
        max-width: 195px;
        padding: 12px 6px;
    }

    body.as-mode-opt2 #tab-content-area {
        width: calc(100% - 211px);
    }

    .brand-author,
    .hdr-build-badge {
        display: none;
    }

    .contextual-kpi-row {
        grid-template-columns: repeat(4, 1fr) !important;
    }

    .oc-delta-rollover-grid {
        grid-template-columns: 1fr;
    }

    .header-top-row {
        gap: 8px;
    }

    .header-subtitle-row {
        font-size: 10.5px;
    }

    /* Phase 2: Tablet Grids for Deep Analysis & Positional */
    .deep-blueprint-grid,
    .deep-action-dual-grid,
    .deep-advisory-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }

    .positional-kpi-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

/* ── Mobile Optimization (<= 768px) ─────────────────────────────────────── */
@media (max-width: 768px) {
    body {
        padding-bottom: 64px !important;
    }

    /* Header adjustments */
    .terminal-header {
        padding: 6px 12px 0 12px;
    }

    .header-top-row {
        flex-wrap: wrap;
        gap: 8px;
        padding-bottom: 4px;
    }

    .brand-section {
        gap: 6px;
        flex: 1 1 auto;
    }

    .mobile-menu-btn {
        display: inline-flex;
    }

    .brand-wordmark {
        font-size: 17px !important;
    }

    .brand-author,
    .hdr-build-badge,
    .header-sep,
    #hdr-expiry-pill,
    .hdr-label,
    .header-vsep {
        display: none !important;
    }

    .header-meta {
        gap: 6px;
    }

    .hdr-status-group {
        padding: 2px 6px;
        font-size: 10px;
    }

    .hdr-clock-block {
        padding: 2px 6px;
        font-size: 10px;
    }

    .header-subtitle-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        padding: 4px 0 6px 0;
    }

    .header-subtitle-actions {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 2px;
        -webkit-overflow-scrolling: touch;
    }

    /* Quick Jump Chips Bar */
    .quick-jump-bar {
        padding: 6px 10px;
        gap: 6px;
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .quick-jump-bar::-webkit-scrollbar {
        display: none;
    }

    .quick-label {
        font-size: 10px;
    }

    .jump-chip {
        flex-shrink: 0;
        padding: 5px 11px;
        font-size: 11.5px;
        min-height: 32px;
    }

    /* Context Bar (Symbol / Expiry / Spot / KPIs) */
    .context-bar {
        padding: 8px 12px;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .select-group {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        width: 100%;
    }

    .select-wrapper {
        flex: 1 1 calc(50% - 4px);
    }

    select.terminal-select {
        width: 100%;
        min-height: 38px;
        font-size: 12.5px;
    }

    /* Off-Canvas Navigation Drawer */
    .sidebar-backdrop {
        display: block;
    }

    body.mobile-sidebar-open .sidebar-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    body.as-mode-opt2 .terminal-main-layout,
    body.as-mode-opt1 .terminal-main-layout,
    .terminal-main-layout {
        display: block !important;
        width: 100% !important;
        padding: 0 !important;
    }

    body.as-mode-opt2 #nav-tab-container,
    body.as-mode-opt1 #nav-tab-container,
    #nav-tab-container {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        bottom: 0 !important;
        width: 285px !important;
        max-width: 85vw !important;
        height: 100vh !important;
        max-height: 100vh !important;
        z-index: 10000 !important;
        background: #0E121E !important;
        box-shadow: 6px 0 28px rgba(0, 0, 0, 0.85) !important;
        transform: translateX(-100%) !important;
        transition: transform 0.26s cubic-bezier(0.4, 0, 0.2, 1) !important;
        border-radius: 0 !important;
        border: none !important;
        border-right: 1px solid rgba(255, 255, 255, 0.1) !important;
        padding: 16px 12px 90px 12px !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        display: flex !important;
        flex-direction: column !important;
    }

    body.mobile-sidebar-open #nav-tab-container {
        transform: translateX(0) !important;
    }

    .sidebar-top-ctrl {
        display: block !important;
        margin-bottom: 12px;
        padding-bottom: 10px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .sidebar-toggle-btn {
        display: none !important;
    }

    .sidebar-mobile-close-btn {
        display: inline-flex !important;
    }

    body.as-mode-opt2 .nav-tab-btn,
    .nav-tab-btn {
        padding: 10px 12px;
        font-size: 13px;
        min-height: 42px;
    }

    body.as-mode-opt2 #tab-content-area,
    #tab-content-area {
        width: 100% !important;
        max-width: 100vw !important;
        padding: 10px 10px 80px 10px !important;
        box-sizing: border-box !important;
    }

    /* Content and Card Grids Collapse to 1 Column */
    .contextual-kpi-row {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }

    .oc-delta-rollover-grid {
        grid-template-columns: 1fr !important;
    }

    .top-trade-layout {
        grid-template-columns: 1fr !important;
    }

    /* Tables horizontal touch scrolling */
    #option-chain-container,
    .option-chain-table-container,
    .table-responsive {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    /* Bottom Navigation Bar visible */
    .mobile-bottom-nav {
        display: flex !important;
    }

    /* Phase 2: Deep Analysis Responsive Grids */
    .deep-blueprint-grid,
    .deep-action-dual-grid,
    .deep-advisory-grid,
    .deep-participant-bars-grid,
    .deep-forensic-grid {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    .deep-metrics-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }

    /* Phase 2: Option Chain Mobile Table Polish */
    .option-chain-table th,
    .option-chain-table td {
        white-space: nowrap;
        font-size: 11.5px;
        padding: 7px 6px !important;
    }

    .option-chain-table th:nth-child(5),
    .option-chain-table td:nth-child(5) {
        font-size: 12px !important;
        padding: 7px 10px !important;
        font-weight: 800 !important;
    }

    /* Phase 2: Positional Screener Mobile Polish */
    .positional-card-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 10px !important;
    }

    .positional-card-actions {
        width: 100% !important;
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
    }

    .positional-card-actions button {
        flex: 1 1 calc(50% - 8px) !important;
        min-height: 40px !important;
        text-align: center !important;
        justify-content: center !important;
    }

    .positional-kpi-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }
}