/* ==========================================================================
   APP BASE STYLES — WRAPPED IN W3C CASCADE LAYER (BASE)
   Lower specificity layer allowing components and theme overrides to cascade naturally.
   ========================================================================== */

@layer base {
  /* Global Native Date Picker Color Scheme */

  :root,
  [data-theme="dark"] { color-scheme: dark; }

  [data-theme="light"] { color-scheme: light; }

  input[type="date"] { color-scheme: dark; }

  [data-theme="light"] input[type="date"] { color-scheme: light; }

  /* ==========================================================================
   ASH INFINITY ENGINE — MISSION CONTROL DESIGN SYSTEM
   Theme: Cyber Obsidian Glassmorphism (Mobile-First & Desktop Cockpit)
   ========================================================================== */

  /* Legacy font @import removed; canonical Google Sans font is loaded in tokens.css */

  :root,
  [data-theme="dark"] {
    /* ================================================================
    NEW DESIGN PALETTE (official canonical tokens)
    ================================================================ */
    /* Surfaces (60% Deep Obsidian & Quartz Graphite) */
    --bg:           var(--surface-canvas, #07090E);
    --sidebar:      var(--surface-structural, #0B0E14);
    --card:         var(--surface-card, #0F131A);
    --card-hi:      var(--surface-card-hover, #141922);
    --border:       var(--border-subtle, rgba(148, 163, 184, 0.10));
    --muted:        var(--text-secondary, #94A3B8);
    /* Text (30% Silver Stone & Platinum) */
    --text:         var(--text-primary, #F1F5F9);
    --text-dim:     var(--text-secondary, #94A3B8);
    --text-mute:    var(--text-secondary, #94A3B8);
    /* Brand / Actions (Mapped to Single-Point Action Accent) */
    --primary:      var(--accent-action, var(--accent-apple-blue, #3B82F6));
    --primary-soft: var(--accent-action-soft, var(--accent-blue-soft, rgba(59, 130, 246, 0.14)));
    --indigo:       var(--accent-action, var(--accent-sniper-violet, #3B82F6));
    --cyan:         var(--accent-action, var(--accent-apple-blue, #3B82F6));
    --accent-rose:  var(--accent-rose, #F43F5E);
    --rose-soft:    var(--accent-rose-soft, rgba(244, 63, 94, 0.14));
    /* Trading Semantics */
    --profit:       var(--trade-profit, #10B981);
    --profit-bg:    var(--trade-profit-soft, rgba(16, 185, 129, 0.12));
    --loss:         var(--trade-loss, #EF4444);
    --loss-bg:      var(--trade-loss-soft, rgba(239, 68, 68, 0.12));
    --warn:         var(--trade-warning, #F59E0B);
    /* ================================================================
    LEGACY ALIASES — every existing var(--emerald), var(--bg-card),
    var(--text-main) etc. continues to resolve correctly.
    DO NOT REMOVE — used throughout the entire CSS & JS.
    ================================================================ */
    --bg-base:          var(--bg);
    --bg-surface:       var(--sidebar);
    --bg-card:          var(--card);
    --bg-card-hover:    var(--card-hi);
    --border-glass:     rgba(255, 255, 255, 0.08);   /* glass-overlay borders keep alpha */
    --border-accent:    rgba(19, 187, 132, 0.3);
    --emerald:          var(--profit);
    --emerald-glow:     var(--profit-bg);
    --cyan-glow:        rgba(34, 211, 238, 0.18);
    --purple:           var(--indigo);
    --purple-glow:      rgba(79, 71, 231, 0.2);
    --gold:             var(--warn);
    --gold-glow:        rgba(247, 120, 22, 0.18);
    --rose:             var(--loss);
    --rose-glow:        var(--loss-bg);
    --accent:           var(--primary);
    --text-main:        var(--text);
    --text-muted:       var(--text-dim);
    --text-sub:         var(--text-mute);
    /* Typography aliases wired to tokens.css */
    --font-heading: var(--font-sans, 'Google Sans', 'Inter', sans-serif);
    --font-body:    var(--font-sans, 'Google Sans', 'Inter', sans-serif);
    --font-mono:    var(--font-sans, 'Google Sans', 'Inter', sans-serif);
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 24px rgba(19, 187, 132, 0.12);
    --nav-height-mobile:    58px;
    --sidebar-width-desktop: 260px;
  }

  [data-theme="light"] {
    --bg-base: var(--surface-canvas, #ffffff);
    --bg-surface: var(--surface-structural, #f8fafc);
    --bg-card: var(--surface-card, #f3f4f6);
    --bg-card-hover: var(--surface-card-hover, #e2e8f0);
    --border-glass: rgba(15, 23, 42, 0.12);
    --border-accent: rgba(5, 150, 105, 0.4);
    --emerald: #059669;
    --emerald-glow: rgba(5, 150, 105, 0.18);
    --cyan: #0284c7;
    --cyan-glow: rgba(2, 132, 199, 0.18);
    --purple: var(--accent-sniper-violet, #2563eb);
    --purple-glow: var(--accent-violet-soft, rgba(37, 99, 235, 0.18));
    --gold: #d97706;
    --gold-glow: rgba(217, 119, 6, 0.18);
    --rose: #dc2626;
    --rose-glow: rgba(220, 38, 38, 0.18);
    --text-main: #0f172a;
    --text-muted: #475569;
    --text-sub: #94a3b8;
    --shadow-card: 0 4px 20px rgba(15, 23, 42, 0.06);
    --shadow-glow: 0 0 20px rgba(5, 150, 105, 0.1);
  }

  * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
  }

  body {
    background-color: var(--bg-base);
    background-image:
    radial-gradient(circle at 15% 15%, rgba(38, 100, 236, 0.06) 0%, transparent 45%),
    radial-gradient(circle at 85% 85%, rgba(79, 71, 231, 0.05) 0%, transparent 45%),
    radial-gradient(circle at 50% 50%, rgba(19, 187, 132, 0.03) 0%, transparent 60%);
    color: var(--text-main);
    font-family: var(--font-body);
    min-height: 100vh;
    overflow-x: clip;
    font-size: 14px;
    line-height: 1.5;
  }

  /* Scrollbars */

  ::-webkit-scrollbar {
    width: 6px;
    height: 6px;
  }

  ::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.2); }

  ::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
  }

  ::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.25); }

  /* Light Mode Background & Core Component Overrides */

  [data-theme="light"] body {
    background-color: var(--bg-base);
    background-image:
    radial-gradient(circle at 15% 15%, rgba(38, 100, 236, 0.04) 0%, transparent 45%),
    radial-gradient(circle at 85% 85%, rgba(79, 71, 231, 0.04) 0%, transparent 45%),
    radial-gradient(circle at 50% 50%, rgba(19, 187, 132, 0.03) 0%, transparent 60%);
    color: var(--text-main);
  }

  [data-theme="light"] ::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.04); }

  [data-theme="light"] ::-webkit-scrollbar-thumb { background: rgba(15, 23, 42, 0.2); }

  [data-theme="light"] .sidebar {
    background: rgba(255, 255, 255, 0.96);
    border-right: 1px solid var(--border-subtle);
  }

  [data-theme="light"] .glass-card,
  [data-theme="light"] .trade-table-container,
  [data-theme="light"] .orders-table-container {
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.04);
  }

  [data-theme="light"] .trade-table th {
    background: #f8fafc;
    color: var(--text-muted);
  }

  [data-theme="light"] .trade-table tr:hover td { background: #f1f5f9; }

  [data-theme="light"] .trade-table td {
    color: var(--text-main);
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  }

  [data-theme="light"] .filter-select,
  [data-theme="light"] .filter-input,
  [data-theme="light"] .modern-date-input,
  [data-theme="light"] .modern-nav-btn {
    background: #f8fafc;
    border: 1px solid rgba(15, 23, 42, 0.12);
    color: var(--text-main);
  }

  [data-theme="light"] .modal-card,
  [data-theme="light"] .trade-modal-box,
  [data-theme="light"] .morning-intel-modal-box,
  [data-theme="light"] .trade-logs-modal-box {
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.12);
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.15);
  }

  [data-theme="light"] .modal-title,
  [data-theme="light"] .trade-modal-header h2 { color: #0f172a; }

  /* Light theme: make the SVG crossover mask match the light sidebar background */

  [data-theme="light"] .bottom-nav {
    background: rgba(255, 255, 255, 0.96);
    border-top: 1px solid rgba(15, 23, 42, 0.08);
  }

  [data-theme="light"] .page-header {
    background: rgba(248, 250, 252, 0.95);
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  }

  [data-theme="light"] .header-title-area h1 { color: #0f172a; }

  /* Mobile Header Actions (Hidden on Desktop by default) */

  /* Theme Toggle Button */

  /* Quick Controls Trigger Pill (Mobile) */

  /* Native Bottom Sheets Components */

  .sheet-drag-handle {
    width: 40px;
    height: 4px;
    border-radius: 2px;
    background: var(--text-muted);
    opacity: 0.35;
    margin: 0 auto 14px auto;
    cursor: grab;
  }

  .sheet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-subtle);
  }

  .sheet-close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
  }

  .sheet-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
  }

  .sheet-section-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 6px;
  }

  /* ==========================================================================
   LAYOUT STRUCTURE
   ========================================================================== */

  #app-container {
    display: flex;
    min-height: 100vh;
  }

  /* Sidebar (Desktop) */

  .sidebar {
    display: none;
    width: var(--sidebar-width-desktop);
    background: var(--bg-surface);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-subtle);
    padding: 24px 20px;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
  }

  /* Main Content Viewport */

  .main-viewport {
    flex: 1;
    padding: 20px 16px calc(var(--nav-height-mobile) + 24px) 16px;
    max-width: 1440px;
    margin: 0 auto;
    width: 100%;
  }

  @media (min-width: 768px) {
    .sidebar { display: flex; }

    .main-viewport {
      margin-left: var(--sidebar-width-desktop);
      padding: 28px 36px 36px 36px;
    }
  }

  /* Mobile Bottom Navigation Bar */

  .bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--nav-height-mobile);
    background: rgba(8, 12, 22, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-glass);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 999;
    padding: 0 10px;
  }

  @media (min-width: 768px) {
    .bottom-nav { display: none; }
  }

  .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 11px;
    font-weight: 500;
    gap: 4px;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    cursor: pointer;
    background: none;
    border: none;
  }

  .nav-item svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    transition: all 0.2s ease;
  }

  .nav-item.active { color: var(--primary); }

  .nav-item.active svg {
    stroke: var(--primary);
    filter: drop-shadow(0 0 8px rgba(38, 100, 236, 0.4));
  }

  /* Desktop Sidebar Nav Elements */

  .brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
    padding: 0 8px;
  }

  /* Ash Infinity Logo mark in the sidebar */

  /* 1. BRAND TAG — blue UI chrome, not financial */

  .sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
  }

  .sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s ease;
    cursor: pointer;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
  }

  .sidebar-link svg {
    width: 18px;
    height: 18px;
  }

  .sidebar-link:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-main);
  }

  .sidebar-link.active {
    background: var(--primary-soft);
    color: var(--primary);
    border: 1px solid rgba(38, 100, 236, 0.25);
  }

  /* Fix 1 — Pin Settings button permanently to the bottom of the sidebar */

  .sidebar-link[data-tab="settings"] { margin-top: auto; }

  /* System Heartbeat Pill */

  .pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--emerald);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    animation: none;
  }

  #sse-indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--rose);
    flex-shrink: 0;
    transition: background 0.3s ease;
    cursor: default;
  }

  @keyframes pulse-dot-anim {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(19, 187, 132, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(19, 187, 132, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(19, 187, 132, 0); }
}

  /* ==========================================================================
   HEADER SECTION
   ========================================================================== */

  .page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    gap: 16px;
    flex-wrap: wrap;
  }

  .header-title-area h1 {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: #ffffff;
    margin-bottom: 4px;
  }

  @media (min-width: 768px) {
    .header-title-area h1 { font-size: 30px; }
  }

  .header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
  }

  /* Compact market status dots in the header subtitle row */

  .market-status-compact {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 2px 7px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: border-color 0.3s ease, background 0.3s ease;
  }

  .market-status-compact.open {
    color: var(--emerald);
    background: rgba(19, 187, 132, 0.08);
    border-color: rgba(19, 187, 132, 0.25);
  }

  .market-status-compact.closed {
    color: var(--rose);
    background: rgba(244, 63, 94, 0.08);
    border-color: rgba(244, 63, 94, 0.25);
  }

  .market-status-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    flex-shrink: 0;
  }

  @media (max-width: 768px) {
    .header-actions { display: none !important; }

    .morning-intel-btn {
      flex: 1 1 auto;
      font-size: 11px;
      padding: 6px 10px;
    }

    .market-pill {
      flex: 1;
      justify-content: center;
      padding: 6px 10px;
      font-size: 11px;
      white-space: nowrap;
    }
  }

  .market-pill {
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
  }

  .market-pill.open {
    background: rgba(19, 187, 132, 0.1);
    border-color: rgba(19, 187, 132, 0.3);
    color: var(--emerald);
  }

  .market-pill.closed {
    background: rgba(244, 63, 94, 0.1);
    border-color: rgba(244, 63, 94, 0.3);
    color: var(--rose);
  }

  /* ==========================================================================
   CARDS & TILES
   ========================================================================== */

  .glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-card);
    transition: transform 0.2s ease, border-color 0.2s ease;
  }

  .glass-card:hover { border-color: var(--border-glass); }

  /* Metric KPI Grid */

  .kpi-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 24px;
  }

  @media (min-width: 768px) {
    .kpi-grid {
      grid-template-columns: repeat(2, 1fr);
      gap: 16px;
    }
  }

  .kpi-card { padding: 18px 16px; }

  .kpi-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .kpi-value {
    font-family: var(--font-mono);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: #ffffff;
  }

  @media (min-width: 768px) {
    .kpi-value { font-size: 26px; }
  }

  .kpi-value.green { color: var(--emerald); text-shadow: none; }

  .kpi-value.cyan { color: var(--cyan); text-shadow: none; }

  .kpi-value.gold { color: var(--gold); text-shadow: none; }

  .kpi-value.purple { color: var(--purple); text-shadow: none; }

  .kpi-sub {
    font-size: 11px;
    color: var(--text-sub);
    margin-top: 4px;
  }

  /* ==========================================================================
   DESK CARDS (4 DESKS)
   ========================================================================== */

  .desks-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 24px;
  }

  @media (min-width: 768px) {
    .desks-grid,
    .desks-grid--five,
    body[data-engine="runner"]  .desks-grid,
    body[data-engine="scalper"] .desks-grid,
    body[data-engine="spot"]    .desks-grid,
    body[data-engine="direct"]  .desks-grid {
      grid-template-columns: repeat(2, 1fr);
      gap: 16px;
    }

    .desks-grid > .desk-card:last-child:nth-child(odd) { grid-column: 1 / -1; }
  }

  .desk-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
  }

  /* Engine-selector: hide MCX desk card for Runner/Scalper (and legacy Spot/Direct) engines.
   Uses body[data-engine] so it fires immediately on click, before async fetch. */

  body[data-engine="runner"]  [data-desk-card="mcx"],
  body[data-engine="scalper"] [data-desk-card="mcx"],
  body[data-engine="spot"]    [data-desk-card="mcx"],
  body[data-engine="direct"]  [data-desk-card="mcx"],
  body[data-engine="equity"]  [data-desk-card="mcx"] { display: none !important; }

  .desk-card--active {
    outline: 2px solid var(--accent, #00f5a0);
    outline-offset: -2px;
    box-shadow: 0 0 0 4px rgba(0,245,160,0.15);
  }

  .desk-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
  }

  .desk-title {
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    flex-shrink: 0;
  }

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

  .desk-badge {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 4px;
    letter-spacing: 0.5px;
    white-space: nowrap;
  }

  .desk-badge.nifty {
    background: rgba(34, 211, 238, 0.12); color: var(--cyan); border: 1px solid rgba(34, 211, 238, 0.3);
  }

  .desk-badge.sensex {
    background: var(--surface-card, #15161B); color: var(--text-secondary, #94A3B8); border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  }

  .desk-badge.mcx {
    background: rgba(247, 120, 22, 0.12); color: var(--gold); border: 1px solid rgba(247, 120, 22, 0.3);
  }

  .desk-badge.equities {
    background: rgba(19, 187, 132, 0.12); color: var(--emerald); border: 1px solid rgba(19, 187, 132, 0.3);
  }

  .desk-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    background: rgba(0, 0, 0, 0.3);
    padding: 12px 10px;
    border-radius: var(--radius-md);
  }

  @media (max-width: 680px) {
    .desk-stats-row {
      grid-template-columns: repeat(2, 1fr);
      gap: 10px;
    }
  }

  .stat-cell { text-align: center; }

  .stat-cell-label {
    font-size: 11px;
    color: var(--text-sub);
    margin-bottom: 2px;
  }

  .stat-cell-val {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 14px;
  }

  /* Instrument Segmented Tab Bar */

  .instrument-tabs-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
  }

  .instrument-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 8px;
    color: var(--text-sub);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    user-select: none;
  }

  .instrument-tab-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
  }

  .instrument-tab-btn.active {
    background: var(--primary-soft);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  }

  .instrument-tab-btn .tab-count {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
  }

  .instrument-tab-btn.active .tab-count {
    background: rgba(38, 100, 236, 0.25);
    color: var(--primary);
  }

  .clickable-desk-card {
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  }

  .clickable-desk-card:hover {
    transform: translateY(-2px);
    border-color: rgba(34, 211, 238, 0.35);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  }

  /* ==========================================================================
   ACTIVE POSITIONS RADAR
   ========================================================================== */

  .active-positions-section { margin-bottom: 28px; }

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

  .section-title {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .position-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 18px;
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    overflow: hidden;
  }

  .position-card::before { display: none !important; width: 0; }

  .position-card.sell-card::before {
    background: var(--rose);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  }

  .position-card.swap-card::before {
    background: var(--purple);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  }

  .pos-top-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 8px;
  }

  .pos-symbol {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
  }

  .pos-model-tag {
    font-size: 11px;
    background: rgba(255, 255, 255, 0.06);
    padding: 2px 8px;
    border-radius: 4px;
    color: var(--text-muted);
  }

  .pos-price-ladder {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    background: rgba(0, 0, 0, 0.35);
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-family: var(--font-mono);
    font-size: 12px;
  }

  .ladder-item {
    display: flex;
    flex-direction: column;
  }

  .ladder-label {
    font-size: 11px;
    color: var(--text-sub);
  }

  .ladder-val { font-weight: 600; }

  /* Trailing SL Progress Meter */

  .meter-track {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
  }

  .meter-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--cyan), var(--emerald));
    border-radius: 3px;
    transition: width 0.4s ease;
  }

  .meter-stage-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--emerald);
  }

  /* ==========================================================================
   COMPACT POSITION CARDS (3+ positions — threshold mode)
   ========================================================================== */

  /* Container — same visual foundation as position-card */

  .pos-compact-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    margin-bottom: 8px;
    position: relative;
    overflow: hidden;
    transition: border-color 0.2s ease;
  }

  .pos-compact-card:hover { border-color: rgba(255, 255, 255, 0.14); }

  /* Coloured left bar — same as position-card::before */

  .pos-compact-card::before { display: none !important; width: 0; }

  .pos-compact-card.sell-card::before { background: var(--rose);   box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); }

  .pos-compact-card.swap-card::before { background: var(--purple); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); }

  /* One-row summary — the clickable trigger */

  .pos-compact-main {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 11px 14px 11px 18px;
    cursor: pointer;
    user-select: none;
    flex-wrap: nowrap;
  }

  /* Symbol column (largest, flex-grows) */

  .pos-compact-symbol-col {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1 1 160px;
    min-width: 0;
  }

  .pos-compact-symbol {
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-main);
  }

  /* LTP + delta column */

  .pos-compact-ltp-col {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    flex-shrink: 0;
    min-width: 100px;
  }

  .pos-compact-ltp {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 700;
    color: var(--cyan);
  }

  .pos-compact-delta {
    font-size: 11px;
    font-weight: 600;
    margin-top: 1px;
  }

  /* SL column */

  .pos-compact-sl-col {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    flex-shrink: 0;
    min-width: 80px;
  }

  .pos-compact-field-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-sub);
  }

  .pos-compact-sl {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    color: var(--rose);
  }

  /* T1 column */

  .pos-compact-t1-col {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    flex-shrink: 0;
    min-width: 80px;
  }

  .pos-compact-t1 {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    color: var(--emerald);
  }

  /* Stage indicator pill */

  .pos-compact-stage-col {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
    min-width: 110px;
  }

  .pos-compact-stage-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
  }

  .pos-compact-stage-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-sub);
    white-space: nowrap;
  }

  /* Expand chevron button */

  .pos-expand-chevron {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    color: var(--text-sub);
    transition: transform 0.25s ease, background 0.2s ease, color 0.2s ease;
  }

  .pos-expand-chevron.open {
    transform: rotate(180deg);
    background: rgba(19, 187, 132, 0.1);
    border-color: rgba(19, 187, 132, 0.3);
    color: var(--emerald);
  }

  /* Expandable detail section — smooth height animation via grid trick */

  .pos-compact-detail {
    display: grid;
    grid-template-rows: 0fr;
    overflow: hidden;   /* prevent content bleed when collapsed */
    transition: grid-template-rows 0.3s ease;
  }

  .pos-compact-detail.open { grid-template-rows: 1fr; }

  .pos-compact-detail-inner {
    overflow: hidden;
    min-height: 0;   /* required for grid-template-rows:0fr collapse to fully clip content */
    padding: 0 14px 0 18px;
    /* padding-bottom animates via the grid expansion */
  }

  .pos-compact-detail.open .pos-compact-detail-inner {
    padding-bottom: 14px;
    border-top: 1px solid var(--border-subtle);
    padding-top: 12px;
  }

  /* -----------------------------------------------------------------------
   Responsive: hide T1 and stage columns on small screens, keep essentials
   ----------------------------------------------------------------------- */

  @media (max-width: 640px) {
    .pos-compact-t1-col { display: none; }

    .pos-compact-stage-col { display: none; }

    .pos-compact-sl-col { min-width: 70px; }

    .pos-compact-ltp-col { min-width: 85px; }

    .pos-compact-symbol { font-size: 12px; }
  }

  /* ==========================================================================
   TRADE LOGS TABLE
   ========================================================================== */

  .table-container {
    overflow-x: auto;
    border-radius: var(--radius-md);
    background: rgba(0, 0, 0, 0.3);
  }

  table.trade-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 13px;
  }

  table.trade-table th {
    padding: 12px 14px;
    color: var(--text-sub);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-subtle);
    background: rgba(0, 0, 0, 0.2);
  }

  table.trade-table td {
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    font-family: var(--font-mono);
  }

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

  .outcome-pill {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    display: inline-block;
  }

  .outcome-pill.win { background: rgba(19, 187, 132, 0.15); color: var(--emerald); }

  .outcome-pill.loss { background: rgba(244, 63, 94, 0.15); color: var(--rose); }

  .outcome-pill.be { background: rgba(255, 255, 255, 0.1); color: #ffffff; }

  .outcome-pill.active {
    background: rgba(34, 211, 238, 0.18); color: var(--cyan); border: 1px solid rgba(34, 211, 238, 0.45); font-weight: 700;
  }

  /* ==========================================================================
   SETTINGS CONTROL PANEL (TOGGLES & SLIDERS)
   ========================================================================== */

  .setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: rgba(16, 24, 42, 0.4);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    transition: all 0.2s ease;
  }

  .setting-row:hover {
    background: rgba(22, 33, 58, 0.6);
    border-color: var(--border-glass);
  }

  .setting-info { max-width: 75%; }

  .setting-name {
    font-weight: 600;
    font-size: 14px;
    color: #ffffff;
    margin-bottom: 2px;
  }

  .setting-desc {
    font-size: 12px;
    color: var(--text-muted);
  }

  /* Custom iOS-style Switch */

  .switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
  }

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

  .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.15);
    transition: .3s;
    border-radius: 26px;
    border: 1px solid var(--border-subtle);
  }

  .slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.4);
  }

  /* 2. SETTINGS TOGGLE SWITCHES — blue for UI controls */

  input:checked + .slider {
    background-color: var(--primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  }

  input:checked + .slider:before { transform: translateX(22px); }

  /* Save Settings Button */

  /* 3. SAVE CONFIGURATION BUTTON — primary blue action */

  .btn-save {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--indigo) 100%);
    color: #ffffff;
    font-weight: 700;
    font-size: 14px;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px var(--primary-soft);
    transition: all 0.2s ease;
    width: 100%;
  }

  @media (min-width: 768px) {
    .btn-save { width: auto; }
  }

  .btn-save:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  }

  /* ==========================================================================
   PIN SECURITY MODAL
   ========================================================================== */

  #pin-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(4, 7, 14, 0.96);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
  }

  .pin-modal-box {
    background: var(--bg-surface);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-xl);
    padding: 36px 28px;
    max-width: 360px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
  }

  .keypad-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }

  .keypad-btn {
    height: 58px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    color: #ffffff;
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
  }

  .keypad-btn:active {
    background: rgba(19, 187, 132, 0.2);
    transform: scale(0.95);
  }

  /* Active tab view switching */

  .view-panel { display: none; }

  .view-panel.active { display: block; }

  /* ==========================================================================
   HORIZON SWITCHER (LIVE SESSION VS 1-YEAR BACKTEST)
   ========================================================================== */

  .live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    animation: none;
  }

  /* Timeframe Switcher display behavior: Strictly hidden on Live trades, only shown on 10Y Backtest */

  #timeframe-switch-container { display: none !important; }

  body.mode-backtest #timeframe-switch-container { display: flex; }

  /* ==========================================================================
   TRADE BOOK DESK FILTERS & PAGINATION
   ========================================================================== */

  .desk-filter-bar {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    margin: 0;
    border-bottom: none;
    padding: 2px 3px;
  }

  .desk-filter-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 10px;
    height: 26px;
    line-height: 26px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    color: var(--text-muted);
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    box-sizing: border-box;
  }

  .desk-filter-pill:hover {
    background: var(--card-hover, rgba(255, 255, 255, 0.05));
    color: #ffffff;
  }

  .desk-filter-pill.active {
    background: var(--card, rgba(255, 255, 255, 0.1));
    color: var(--accent, #4C8DFF);
    border-color: transparent;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  }

  .pill-badge {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-muted, #94A3B8);
    padding: 0 5px;
    height: 16px;
    line-height: 16px;
    border-radius: 9999px;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* ── NSE Instrument Toggle Pills ── */

  .instrument-toggle-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 10px;
    height: 26px;
    line-height: 26px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    color: var(--text-muted);
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    box-sizing: border-box;
  }

  .instrument-toggle-pill.active {
    background: var(--card, rgba(255, 255, 255, 0.1));
    border-color: transparent;
    color: var(--accent, #4C8DFF);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  }

  .instrument-toggle-pill:not(.active) { opacity: 1; }

  .instrument-toggle-pill:hover {
    background: var(--card-hover, rgba(255, 255, 255, 0.05));
    color: #ffffff;
  }

  /* ── Engine Calibration Timeframe Pills ── */

  .engine-tf-pills {
    display: flex;
    gap: 5px;
  }

  .engine-tf-pill {
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid rgba(255,255,255,0.15);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.15s ease;
  }

  .engine-tf-pill.active {
    background: var(--cyan, #00d4ff);
    color: #0a0e1a;
    border-color: var(--cyan, #00d4ff);
  }

  .engine-tf-pill:hover {
    border-color: rgba(0, 212, 255, 0.5);
    color: var(--cyan, #00d4ff);
  }

  .engine-tf-pill.active:hover { color: #0a0e1a; }

  .filter-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-sub);
    white-space: nowrap;
  }

  .filter-select,
  .filter-input {
    background: rgba(8, 12, 20, 0.8);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: #ffffff;
    padding: 7px 12px;
    font-size: 12px;
    font-family: var(--font-body);
    outline: none;
    transition: all 0.2s ease;
  }

  .filter-select:focus,
  .filter-input:focus {
    border-color: var(--cyan);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  }

  .filter-select option,
  .filter-select optgroup {
    background: #0d131f;
    color: #e2e8f0;
  }

  .filter-select optgroup {
    font-weight: 700;
    color: var(--cyan);
  }

  .btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(19, 187, 132, 0.1);
    border: 1px solid rgba(19, 187, 132, 0.3);
    color: var(--emerald);
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
  }

  .btn-refresh:hover {
    background: rgba(19, 187, 132, 0.2);
    transform: translateY(-1px);
  }

  /* Cyber-Glass Institutional Reset Button */

  .pagination-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--border-subtle);
    gap: 12px;
  }

  .pagination-info {
    font-size: 12px;
    color: var(--text-muted);
  }

  .pagination-controls {
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .page-current {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--cyan);
    padding: 0 8px;
  }

  /* ==========================================================================
   IMG 1: DYNAMIC OUTCOME SUMMARY STRIP
   ========================================================================== */

  .ledger-outcome-summary-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-top: 12px;
    margin-bottom: 14px;
    padding: 10px 14px;
    background: rgba(10, 15, 29, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-sm);
  }

  .outcome-stat-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
  }

  .outcome-stat-pill .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
  }

  .outcome-stat-pill.win {
    background: rgba(19, 187, 132, 0.08);
    border: 1px solid rgba(19, 187, 132, 0.25);
    color: var(--emerald);
  }

  .outcome-stat-pill.win .dot {
    background: var(--emerald);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  }

  .outcome-stat-pill.be {
    background: rgba(247, 120, 22, 0.08);
    border: 1px solid rgba(247, 120, 22, 0.25);
    color: var(--gold);
  }

  .outcome-stat-pill.be .dot {
    background: var(--gold);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  }

  .outcome-stat-pill.loss {
    background: rgba(244, 63, 94, 0.08);
    border: 1px solid rgba(244, 63, 94, 0.25);
    color: var(--rose);
  }

  .outcome-stat-pill.loss .dot {
    background: var(--rose);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  }

  .outcome-stat-pill.pnl {
    margin-left: auto;
    background: rgba(34, 211, 238, 0.08);
    border: 1px solid rgba(34, 211, 238, 0.25);
    color: var(--cyan);
    font-family: var(--font-mono);
  }

  .outcome-stat-pill .sub {
    font-size: 11px;
    opacity: 0.8;
    font-family: var(--font-mono);
  }

  /* ==========================================================================
   IMG 2: CLICKABLE TABLE ROWS & TRADE DETAIL MODAL
   ========================================================================== */

  .trade-table tbody tr {
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
  }

  .trade-table tbody tr:hover { background: rgba(19, 187, 132, 0.06); }

  .trade-table tbody tr:hover td:nth-child(2) strong {
    color: var(--cyan);
    text-shadow: none;
  }

  .trade-table tbody tr:active { background: rgba(19, 187, 132, 0.12); }

  /* Modal Overlay & Box */

  .modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(4, 6, 14, 0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
  }

  .modal-overlay.active,
  .modal-overlay.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .trade-modal-box {
    background: linear-gradient(145deg, rgba(16, 24, 42, 0.96), rgba(10, 15, 29, 0.98));
    border: 1px solid rgba(19, 187, 132, 0.25);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.85);
    border-radius: var(--radius-lg);
    max-width: 680px;
    width: 100%;
    max-height: 88vh;
    overflow-y: auto;
    padding: 24px;
    transform: scale(0.96);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .modal-overlay.active .trade-modal-box,
  .modal-overlay.open .trade-modal-box { transform: scale(1); }

  .trade-modal-header,
  .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-subtle);
    width: 100%;
    box-sizing: border-box;
  }

  .modal-pretitle {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--cyan);
    text-transform: uppercase;
    letter-spacing: 0.08em;
  }

  .modal-title {
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
    margin-top: 4px;
  }

  .modal-close-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    color: var(--text-sub);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-left: 12px;
  }

  .modal-close-btn:hover {
    background: rgba(244, 63, 94, 0.2);
    border-color: var(--rose);
    color: #fff;
  }

  /* Hero Outcome Banner */

  .modal-hero-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 18px;
  }

  .modal-hero-banner.win {
    background: linear-gradient(135deg, rgba(19, 187, 132, 0.12), rgba(34, 211, 238, 0.08));
    border: 1px solid rgba(19, 187, 132, 0.35);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  }

  .modal-hero-banner.be {
    background: linear-gradient(135deg, rgba(247, 120, 22, 0.12), rgba(247, 120, 22, 0.05));
    border: 1px solid rgba(247, 120, 22, 0.35);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  }

  .modal-hero-banner.loss {
    background: linear-gradient(135deg, rgba(244, 63, 94, 0.12), rgba(244, 63, 94, 0.05));
    border: 1px solid rgba(244, 63, 94, 0.35);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  }

  .hero-left {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .hero-icon { font-size: 28px; }

  .hero-title {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.04em;
  }

  .modal-hero-banner.win .hero-title { color: var(--emerald); }

  .modal-hero-banner.be .hero-title { color: var(--gold); }

  .modal-hero-banner.loss .hero-title { color: var(--rose); }

  .hero-reason {
    font-size: 12px;
    color: var(--text-sub);
    margin-top: 2px;
  }

  .hero-right {
    text-align: right;
    font-family: var(--font-mono);
  }

  .hero-pnl {
    font-size: 18px;
    font-weight: 800;
  }

  .modal-hero-banner.win .hero-pnl { color: var(--emerald); }

  .modal-hero-banner.be .hero-pnl { color: var(--gold); }

  .modal-hero-banner.loss .hero-pnl { color: var(--rose); }

  .hero-rmult {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
  }

  /* 4-Tile Telemetry Grid */

  .modal-grid-4 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 18px;
  }

  @media (min-width: 600px) {
    .modal-grid-4 { grid-template-columns: repeat(4, 1fr); }
  }

  .modal-tile {
    background: rgba(10, 15, 29, 0.7);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 12px;
  }

  .modal-tile .tile-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    margin-bottom: 4px;
  }

  .modal-tile .tile-val {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 700;
  }

  .modal-tile .tile-sub {
    font-size: 11px;
    color: var(--text-sub);
    margin-top: 3px;
  }

  /* Stepper Progression Tracker */

  .stepper-card {
    background: rgba(10, 15, 29, 0.6);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 14px;
    margin-bottom: 18px;
  }

  .stepper-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-sub);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 10px;
  }

  .stepper-track {
    display: flex;
    align-items: center;
    position: relative;
    gap: 8px;
  }

  .step-node {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
  }

  .step-circle {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    margin-bottom: 6px;
    z-index: 2;
    transition: all 0.2s ease;
  }

  .step-node.completed .step-circle {
    background: var(--emerald);
    color: #000;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  }

  .step-node.active .step-circle {
    background: var(--cyan);
    color: #000;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  }

  .step-node.stopped .step-circle {
    background: var(--rose);
    color: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  }

  .step-node.pending .step-circle {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
  }

  .step-label {
    font-size: 11px;
    color: var(--text-sub);
    font-weight: 500;
    line-height: 1.3;
  }

  .step-node.completed .step-label,
  .step-node.active .step-label { color: #ffffff; }

  /* Narrative Breakdown Card */

  .narrative-card {
    background: rgba(10, 15, 29, 0.85);
    border: 1px solid rgba(34, 211, 238, 0.2);
    border-radius: var(--radius-sm);
    padding: 18px;
  }

  .narrative-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    color: var(--cyan);
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }

  .narrative-section { margin-bottom: 12px; }

  .narrative-sub {
    font-size: 11px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 4px;
  }

  .narrative-text {
    font-size: 12px;
    line-height: 1.6;
    color: var(--text-muted);
    margin: 0;
  }

  /* ==========================================================================
   DESK TELEMETRY & UNDERLYING MODEL AUDIT (REQUIREMENT 2)
   ========================================================================== */

  .clickable-desk-card {
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
  }

  .clickable-desk-card:hover {
    transform: translateY(-3px);
    border-color: rgba(34, 211, 238, 0.4);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  }

  .desk-click-hint {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
    background: rgba(34, 211, 238, 0.1);
    border: 1px solid rgba(34, 211, 238, 0.3);
    color: var(--cyan);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    letter-spacing: 0.03em;
    transition: all 0.2s ease;
  }

  .clickable-desk-card:hover .desk-click-hint {
    background: var(--cyan);
    color: #060911;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  }

  .desk-breakdown-modal-box {
    background: linear-gradient(135deg, rgba(13, 20, 36, 0.96), rgba(8, 12, 22, 0.98));
    border: 1px solid rgba(34, 211, 238, 0.25);
    border-radius: var(--radius-md);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.7);
    width: 92%;
    max-width: 860px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 24px;
    backdrop-filter: blur(20px);
    position: relative;
    z-index: 10001;
  }

  .desk-modal-kpi-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    background: rgba(10, 15, 29, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin-top: 14px;
    margin-bottom: 16px;
  }

  .desk-instrument-tab-section { margin-bottom: 12px; }

  .desk-instrument-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .desk-inst-pill,
  .analytics-inst-pill {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
  }

  .desk-inst-pill:hover,
  .analytics-inst-pill:hover {
    background: rgba(34, 211, 238, 0.1);
    color: #ffffff;
    border-color: rgba(34, 211, 238, 0.3);
  }

  .desk-inst-pill.active,
  .analytics-inst-pill.active {
    background: var(--primary-soft);
    color: var(--primary);
    border-color: var(--cyan);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  }

  .desk-models-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .model-card {
    background: rgba(10, 15, 29, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    transition: all 0.2s ease;
  }

  .model-card:hover {
    border-color: rgba(34, 211, 238, 0.3);
    background: rgba(13, 20, 36, 0.95);
  }

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

  .model-title {
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .model-stats-strip {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 12px;
  }

  .model-stat-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: var(--font-mono);
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.03);
  }

  .model-progress-bar-container {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 2px;
    margin-top: 10px;
    overflow: hidden;
  }

  .model-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--cyan), var(--emerald));
    border-radius: 2px;
    transition: width 0.4s ease;
  }

  /* Model Outcome Badges & Deep-Dive Accordion */

  .model-outcome-strip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
  }

  .model-outcome-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: var(--font-mono);
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid transparent;
    font-weight: 600;
  }

  .model-outcome-pill.win {
    background: rgba(0, 255, 163, 0.08);
    border-color: rgba(0, 255, 163, 0.25);
    color: var(--emerald);
  }

  .model-outcome-pill.be {
    background: rgba(255, 184, 0, 0.08);
    border-color: rgba(255, 184, 0, 0.25);
    color: var(--gold);
  }

  .model-outcome-pill.loss {
    background: rgba(255, 59, 92, 0.08);
    border-color: rgba(255, 59, 92, 0.25);
    color: var(--rose);
  }

  .model-deepdive-toggle-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-muted);
    font-family: var(--font-heading);
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
  }

  .model-deepdive-toggle-btn:hover {
    background: rgba(34, 211, 238, 0.1);
    border-color: rgba(34, 211, 238, 0.4);
    color: #fff;
  }

  .model-deepdive-toggle-btn.active {
    background: rgba(34, 211, 238, 0.15);
    border-color: var(--cyan);
    color: var(--cyan);
  }

  .model-deep-dive-panel {
    display: none;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    animation: fadeIn 0.25s ease forwards;
  }

  .model-deep-dive-panel.active { display: block; }

  .model-deep-dive-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 8px;
  }

  @media (max-width: 900px) {
    .model-deep-dive-grid { grid-template-columns: repeat(2, 1fr); }
  }

  .model-deep-dive-tile {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    padding: 8px 10px;
  }

  .model-deep-dive-tile .tile-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 3px;
  }

  .model-deep-dive-tile .tile-main {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 2px;
  }

  .model-deep-dive-tile .tile-sub {
    font-size: 11px;
    color: var(--text-muted);
  }

  .model-drilldown-action-row {
    display: flex;
    justify-content: flex-end;
    margin-top: 6px;
  }

  .model-drilldown-btn {
    background: rgba(34, 211, 238, 0.08);
    border: 1px solid rgba(34, 211, 238, 0.3);
    color: var(--cyan);
    font-size: 11px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
  }

  .model-drilldown-btn:hover {
    background: rgba(34, 211, 238, 0.2);
    border-color: var(--cyan);
    color: #fff;
    transform: translateX(2px);
  }

  /* ==============================================================
   09:20 AM MORNING INTELLIGENCE BUTTON & MODAL
   ============================================================== */

  /* 5. MORNING INTELLIGENCE BUTTON — primary blue UI action */

  .morning-intel-btn {
    background: linear-gradient(135deg, rgba(38, 100, 236, 0.18), rgba(79, 71, 231, 0.12));
    border: 1px solid rgba(38, 100, 236, 0.35);
    color: #fff;
    font-family: var(--font-heading);
    font-size: 12px;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 20px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.25s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  }

  .morning-intel-btn:hover {
    background: linear-gradient(135deg, rgba(38, 100, 236, 0.3), rgba(79, 71, 231, 0.25));
    border-color: var(--primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    transform: translateY(-1px);
  }

  .morning-intel-modal-box {
    background: linear-gradient(145deg, rgba(14, 20, 36, 0.98), rgba(9, 13, 25, 0.99));
    border: 1px solid rgba(34, 211, 238, 0.3);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.9);
    border-radius: var(--radius-lg);
    max-width: 1180px;
    width: 96%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 24px;
    transform: scale(0.97);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .modal-overlay.active .morning-intel-modal-box { transform: scale(1); }

  .intel-header-action-group {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  /* 6. INTEL ACTION BUTTON (Broadcast to Telegram, etc.) — blue UI action */

  .intel-btn-action {
    background: var(--primary-soft);
    border: 1px solid rgba(38, 100, 236, 0.35);
    color: var(--emerald);
    font-size: 11px;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
  }

  .intel-btn-action:hover {
    background: rgba(38, 100, 236, 0.25);
    border-color: var(--primary);
    color: #fff;
  }

  .intel-section-title {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 18px 0 10px 0;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .intel-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11.5px;
    margin-bottom: 16px;
  }

  .intel-table th {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.06em;
    padding: 9px 12px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .intel-table td {
    padding: 11px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    vertical-align: middle;
  }

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

  .intel-contract-chip {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    padding: 6px 10px;
    font-family: var(--font-mono);
  }

  .intel-contract-chip.call { border-left: 1px solid var(--border, rgba(255,255,255,0.1)); }

  .intel-contract-chip.put { border-left: 1px solid var(--border, rgba(255,255,255,0.1)); }

  .intel-dhan-badge {
    background: rgba(34, 211, 238, 0.12);
    color: var(--cyan);
    border: 1px solid rgba(34, 211, 238, 0.3);
    font-size: 11px;
    padding: 1px 6px;
    border-radius: 3px;
    margin-left: 4px;
    font-family: var(--font-mono);
    font-weight: 600;
  }

  /* ==============================================================
   ANGEL ONE LIVE TRADE LOGS & TELEMETRY MODAL STYLES
   ============================================================== */

  .trade-logs-modal-box {
    background: linear-gradient(145deg, rgba(14, 20, 36, 0.98), rgba(9, 13, 25, 0.99));
    border: 1px solid rgba(19, 187, 132, 0.3);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.9);
    border-radius: var(--radius-lg);
    max-width: 1180px;
    width: 96%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 24px;
    transform: scale(0.97);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .modal-overlay.active .trade-logs-modal-box { transform: scale(1); }

  .trade-logs-grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
    margin-top: 16px;
    margin-bottom: 20px;
  }

  .trade-log-stat-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    padding: 14px 16px;
  }

  .trade-log-stat-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
  }

  .trade-log-stat-val {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    margin-top: 4px;
    font-family: var(--font-mono);
  }

  .trade-log-stat-sub {
    font-size: 11px;
    color: var(--text-sub);
    margin-top: 3px;
  }

  .trade-log-desk-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-sub);
    font-size: 11px;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
  }

  .trade-log-desk-btn:hover {
    background: rgba(19, 187, 132, 0.15);
    border-color: rgba(19, 187, 132, 0.35);
    color: #fff;
  }

  .trade-log-desk-btn.active {
    background: var(--emerald);
    border-color: var(--emerald);
    color: #000;
    font-weight: 800;
  }

  /* ==============================================================
   LIVE TRADES & LOGS FULL-PAGE VIEW & PERIOD FILTER STYLES
   ============================================================== */

  .live-session-card {
    background: linear-gradient(135deg, rgba(14, 25, 45, 0.75), rgba(9, 15, 30, 0.85));
    border: 1px solid rgba(19, 187, 132, 0.25);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255,255,255,0.05);
    border-radius: var(--radius-md);
    padding: 16px 20px;
  }

  .live-session-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
  }

  /* Period Filter Bar for Live Trades */

  .period-filter-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 10px;
    height: 26px;
    line-height: 26px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    box-sizing: border-box;
  }

  .period-filter-pill:hover {
    background: var(--card-hover, rgba(255, 255, 255, 0.05));
    color: #fff;
  }

  .period-filter-pill.active {
    background: var(--card, rgba(255, 255, 255, 0.1));
    border-color: transparent;
    color: var(--accent, #4C8DFF);
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  }

  /* Sub-Tab Toggle inside Trade Book */

  .sub-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-sub);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
  }

  .sub-tab-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.07);
  }

  .sub-tab-btn.active {
    color: #fff;
    background: var(--primary-soft);
    border-color: rgba(38, 100, 236, 0.5);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    border-color: rgba(19, 187, 132, 0.4);
    font-weight: 700;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  }

  /* ==============================================================
   LIVE MARKET RADAR & OPTIONS SCANNER (MATCHING SCREENSHOTS)
   ============================================================== */

  .radar-poll-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
  }

  .scanner-pill {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-sub);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
  }

  .scanner-pill:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
  }

  .scanner-pill.active {
    background: rgba(19, 187, 132, 0.15);
    border-color: rgba(19, 187, 132, 0.4);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  }

  /* Live Instruments Radar accordion desk tabs — same visuals as .scanner-pill but isolated class */

  .instr-radar-tab {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-sub);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
  }

  .instr-radar-tab:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
  }

  .instr-radar-tab.active {
    background: rgba(19, 187, 132, 0.15);
    border-color: rgba(19, 187, 132, 0.4);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  }

  /* Strength Gauge Bar */

  .market-strength-gauge-card {
    background: rgba(8, 12, 22, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 12px 18px;
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 14px;
    flex-wrap: wrap;
  }

  .strength-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  .strength-badge.bullish {
    background: rgba(19, 187, 132, 0.15);
    color: var(--emerald);
    border: 1px solid rgba(19, 187, 132, 0.3);
  }

  .strength-badge.bearish {
    background: rgba(244, 63, 94, 0.15);
    color: var(--rose);
    border: 1px solid rgba(244, 63, 94, 0.3);
  }

  .high-low-stats {
    font-size: 12px;
    font-family: var(--font-mono);
    display: flex;
    align-items: center;
  }

  /* Day Range Slider Column */

  .day-range-container {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
  }

  .day-range-num {
    font-size: 11px;
    color: var(--text-sub);
    font-family: var(--font-mono);
    min-width: 42px;
  }

  .day-range-track {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    position: relative;
  }

  .day-range-dot {
    position: absolute;
    top: -4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--cyan);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    transform: translateX(-50%);
  }

  /* Sparkline column */

  .sparkline-svg {
    display: block;
    overflow: visible;
  }

  /* Scrip Badges */

  .scrip-cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .scrip-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .scrip-name {
    font-weight: 700;
    color: #fff;
    font-size: 13px;
  }

  .badge-ce {
    background: rgba(19, 187, 132, 0.15);
    color: var(--emerald);
    border: 1px solid rgba(19, 187, 132, 0.3);
    font-size: 11px;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: 3px;
    font-family: var(--font-mono);
  }

  .badge-pe {
    background: rgba(244, 63, 94, 0.15);
    color: var(--rose);
    border: 1px solid rgba(244, 63, 94, 0.3);
    font-size: 11px;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: 3px;
    font-family: var(--font-mono);
  }

  .badge-atm {
    background: rgba(247, 120, 22, 0.18);
    color: var(--gold);
    border: 1px solid rgba(247, 120, 22, 0.4);
    font-size: 11px;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: 3px;
    font-family: var(--font-mono);
  }

  .scrip-meta-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: var(--text-muted);
  }

  /* ==========================================================================
   SIGNAL BADGES (BUY / HOLD / SELL)
   ========================================================================== */

  .signal-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
  }

  .signal-badge.buy {
    background: rgba(19, 187, 132, 0.16);
    color: var(--emerald);
    border: 1px solid rgba(19, 187, 132, 0.45);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  }

  .signal-badge.sell {
    background: rgba(244, 63, 94, 0.16);
    color: var(--rose);
    border: 1px solid rgba(244, 63, 94, 0.45);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  }

  .signal-badge.hold {
    background: rgba(247, 120, 22, 0.14);
    color: var(--gold);
    border: 1px solid rgba(247, 120, 22, 0.35);
  }

  /* Market Cap Badges */

  /* ==========================================================================
   MULTI-CAP STOCK SCREENER STYLES
   ========================================================================== */

  /* Custom Universe Toggle Switch */

  /* Action button to expand drawer */

  /* ==========================================================================
   STOCK ACCORDION DRAWER & BLUEPRINTS
   ========================================================================== */

  /* Individual Stock Strength Gauge */

  /* Dual Execution Blueprint Grid */

  /* Interactive Option Chain Strip */

  /* Clickable Stock Main Rows */

  /* Screener Pagination Controls */

  /* =========================================================================
   3-WAVE COHORT SELECTOR & TOP 10 FOCUS STYLES
   ========================================================================= */

  /* =========================================================================
   EQUITY SIGNALS & EOD AUDIT JOURNAL CARDS
   ========================================================================= */

  /* Dual Setup Body */

  /* Progress & Milestones Footer */

  /* =========================================================================
   OPTION STRIKE MODE SELECTOR IN NAVBAR
   ========================================================================= */

  /* =========================================================================
   MULTI-YEAR HISTORY SYNC TOOLBAR
   ========================================================================= */

  .multi-year-sync-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    background: rgba(16, 24, 42, 0.65);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    flex-wrap: wrap;
  }

  .year-filter-group {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
  }

  .btn-year-filter {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    padding: 5px 12px;
    border-radius: var(--radius-sm);
    font-family: var(--font-heading);
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
  }

  .btn-year-filter:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
  }

  .btn-year-filter.active {
    background: var(--primary-soft);
    color: var(--primary);
    border-color: rgba(34, 211, 238, 0.4);
  }

  /* =========================================================================
   EQUITY JOURNAL DATE TOOLBAR & HIGH-DENSITY TABLE
   ========================================================================= */

  /* Modern Cyber-Glass Date Navigator */

  .modern-date-navigator {
    display: inline-flex;
    align-items: center;
    background: rgba(12, 19, 35, 0.85);
    border: 1px solid rgba(34, 211, 238, 0.22);
    border-radius: 8px;
    padding: 3px 5px;
    gap: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255,255,255,0.05);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .modern-date-navigator:hover,
  .modern-date-navigator:focus-within {
    border-color: rgba(34, 211, 238, 0.5);
    box-shadow: 0 4px 16px rgba(34, 211, 238, 0.15), inset 0 1px 0 rgba(255,255,255,0.05);
  }

  @media (min-width: 769px) {
    .modern-nav-btn[id*="prev"] { order: 2; }

    .modern-nav-btn[id*="next"] { order: 4; }
  }

  .modern-nav-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #d1d5db;
    height: 30px;
    padding: 0 10px;
    border-radius: 6px;
    font-size: 11.5px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
  }

  .modern-nav-btn:hover {
    background: rgba(34, 211, 238, 0.15);
    border-color: rgba(34, 211, 238, 0.4);
    color: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    transform: translateY(-1px);
  }

  .modern-nav-btn:active { transform: translateY(0); }

  .modern-date-input {
    background: transparent;
    border: none;
    color: var(--text-main, #F1F5F9);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    height: 26px;
    padding: 0 4px;
    outline: none;
    cursor: pointer;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
    color-scheme: dark;
  }

  .modern-date-input:hover,
  .modern-date-input:focus {
    border: none;
    outline: none;
    box-shadow: none;
    background: transparent;
  }

  input[type="date"]::-webkit-calendar-picker-indicator,
  .modern-date-input::-webkit-calendar-picker-indicator {
    cursor: pointer;
    filter: brightness(0) saturate(100%) invert(75%) sepia(80%) saturate(3000%) hue-rotate(140deg);
    opacity: 1;
    padding: 3px 5px;
    margin-left: 4px;
    border-radius: 4px;
    background-color: rgba(0, 240, 255, 0.12);
    border: 1px solid rgba(0, 240, 255, 0.25);
    transition: transform 0.2s ease, filter 0.2s ease, background-color 0.2s ease;
  }

  input[type="date"]::-webkit-calendar-picker-indicator:hover,
  .modern-date-input::-webkit-calendar-picker-indicator:hover {
    transform: scale(1.1);
    background-color: rgba(0, 240, 255, 0.3);
    border-color: var(--cyan);
    filter: brightness(0) saturate(100%) invert(100%);
  }

  /* =========================================================================
   GLASSMORPHISM INSPECTION & MONTHLY PERFORMANCE MODALS
   ========================================================================= */

  /* ==============================================================
   NIFTY OPTION SCALPER (5m) STYLES
   ============================================================== */

  /* Scalper Trade Book Filters & Date Navigation */

  /* ==========================================================================
   COMPREHENSIVE MOBILE VIEWPORT OPTIMIZATION SUITE (<= 768px & <= 480px)
   ========================================================================== */

  /* Universal Responsive Table Wrapper */

  .table-container {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    position: relative;
  }

  .table-container::-webkit-scrollbar { height: 6px; }

  .table-container::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.25); }

  .table-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 4px;
  }

  /* Mobile Menu & Drawer Components */

  .sidebar-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
  }

  .sidebar-close-btn {
    display: none;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    font-size: 16px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
  }

  .sidebar-close-btn:hover {
    background: rgba(244, 63, 94, 0.25);
    color: var(--rose);
    border-color: var(--rose);
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
  }

  .sidebar-backdrop.active {
    opacity: 1;
    visibility: visible;
  }

  /* Medium & Small Mobile Breakpoint (< 768px) */

  @media (max-width: 768px) {
    /* Prevent horizontal screen sway without breaking position:sticky */

    body,
    html {
      overflow-x: clip;
      width: 100%;
    }

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

    /* Slide-in Navigation Drawer */

    .sidebar {
      display: flex;
      position: fixed;
      top: 0;
      bottom: 0;
      left: 0;
      width: 290px;
      max-width: 85vw;
      z-index: 1050;
      transform: translateX(-100%);
      transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
      background: rgba(8, 12, 22, 0.98);
      backdrop-filter: blur(24px);
      -webkit-backdrop-filter: blur(24px);
      box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
      border-right: 1px solid rgba(34, 211, 238, 0.2);
      overflow-y: auto;
      padding: 20px 16px;
    }

    /* Main Viewport Adjustments */

    .main-viewport {
      margin-left: 0;
      padding: 14px 12px calc(var(--nav-height-mobile) + 24px) 12px;
      max-width: 100vw;
      overflow: visible;
    }

    /* ==============================================================
     TOP PAGE HEADER (NATIVE 54PX MOBILE APP BAR)
     ============================================================== */

    .page-header {
      position: sticky;
      top: 0;
      z-index: 1000;
      height: 54px;
      min-height: 54px;
      background: var(--bg-surface);
      backdrop-filter: blur(24px);
      -webkit-backdrop-filter: blur(24px);
      border-bottom: 1px solid var(--border-glass);
      box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
      padding: 0 12px;
      margin: -14px -12px 14px -12px;
      display: flex;
      flex-direction: row;
      justify-content: space-between;
      align-items: center;
      gap: 8px;
      box-sizing: border-box;
    }

    .header-title-area {
      display: flex;
      justify-content: flex-start;
      align-items: center;
      flex: 1;
      min-width: 0;
      gap: 8px;
    }

    .header-title-area > div {
      display: flex;
      align-items: baseline;
      gap: 6px;
      min-width: 0;
      overflow: hidden;
    }

    .header-title-area h1 {
      font-size: 16px;
      font-weight: 800;
      line-height: 1;
      margin: 0;
      color: var(--text-main);
      letter-spacing: -0.3px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    /* Mobile App Bar Actions */

    /* Hide Desktop Header Actions on Mobile */

    .header-actions { display: none !important; }

    .mob-only { display: inline; }

    .desk-only { display: none !important; }

    /* Live Session Banner */

    .live-session-card {
      padding: 12px 14px;
      margin-bottom: 14px;
    }

    .live-session-header {
      gap: 12px;
      flex-direction: column;
      align-items: stretch;
    }

    #btn-banner-view-trades {
      grid-column: span 2;
      justify-content: center;
    }

    /* Performance Telemetry & Instrument Tabs */

    .instrument-tabs-bar {
      width: 100%;
      overflow-x: auto;
      flex-wrap: nowrap;
      -webkit-overflow-scrolling: touch;
      padding-bottom: 4px;
      margin-bottom: 12px;
      gap: 6px;
      scrollbar-width: none;
    }

    .instrument-tabs-bar::-webkit-scrollbar { display: none; }

    .instrument-tab-btn {
      flex-shrink: 0;
      padding: 6px 10px;
      font-size: 11px;
      border-radius: 6px;
    }

    .instrument-tab-btn .tab-count {
      font-size: 11px;
      padding: 1px 5px;
    }

    /* Master KPI Cards */

    .kpi-grid {
      grid-template-columns: repeat(2, 1fr);
      gap: 8px;
      margin-bottom: 14px;
    }

    .kpi-card { padding: 12px 10px; }

    .kpi-label {
      font-size: 11px;
      margin-bottom: 3px;
    }

    .kpi-value {
      font-size: 17px;
      letter-spacing: -0.3px;
    }

    .kpi-sub-inr { font-size: 11.5px; }

    .kpi-sub {
      font-size: 11px;
      margin-top: 2px;
    }

    /* Desks Telemetry Grid */

    .desks-grid {
      grid-template-columns: 1fr;
      gap: 12px;
    }

    .desk-card {
      padding: 14px 12px;
      gap: 10px;
    }

    .desk-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 8px;
    }

    .desk-header .desk-channel-badge { display: none !important; }

    .desk-title {
      font-size: 14px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      min-width: 0;
    }

    .desk-badge {
      font-size: 11px;
      padding: 2px 6px;
    }

    .desk-stats-row {
      grid-template-columns: repeat(2, 1fr);
      gap: 8px;
      padding: 10px 8px;
    }

    .stat-cell {
      min-width: 0;
      overflow: hidden;
    }

    .stat-cell-label { font-size: 11px; }

    .stat-cell-val {
      font-size: 12.5px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .stat-cell-sub-inr {
      font-size: 11px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    /* Active Position Radar */

    .active-positions-section { margin-bottom: 16px; }

    .section-title { font-size: 15px; }

    /* Tables: Trade Book, Scalper, Equity Journal */

    .intel-table,
    .trade-table {
      min-width: 600px;
      font-size: 12px;
    }

    .intel-table th,
    .intel-table td,
    .trade-table th,
    .trade-table td { padding: 8px 6px; }

    /* Multi-Year History Sync Toolbar & Ledger Filters */

    .multi-year-sync-container {
      width: 100%;
      flex-wrap: wrap;
      gap: 5px;
    }

    .multi-year-sync-container.hidden,
    .multi-year-sync-container[style*="display: none"],
    #backtest-year-toolbar.hidden,
    #backtest-year-toolbar[style*="display: none"] { display: none !important; }

    .year-filter-group {
      width: 100%;
      display: flex;
      flex-wrap: wrap;
      gap: 5px;
    }

    .btn-year-filter {
      flex: 1 1 35px;
      padding: 6px 4px;
      font-size: 11px;
      text-align: center;
    }

    /* Upgraded 2-Tier Outcome Summary Bar on Mobile */

    .ledger-outcome-summary-bar {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 6px;
      padding: 8px 10px;
      border-radius: 12px;
      width: 100%;
      box-sizing: border-box;
    }

    .ledger-outcome-summary-bar .outcome-stat-pill {
      padding: 6px 4px;
      font-size: 11px;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 3px;
      border-radius: 8px;
      margin: 0;
      white-space: nowrap;
      min-width: 0;
      overflow: hidden;
    }

    .ledger-outcome-summary-bar .outcome-stat-pill .dot { display: none !important; }

    .ledger-outcome-summary-bar .outcome-stat-pill .label {
      font-size: 11px;
      white-space: nowrap;
    }

    .ledger-outcome-summary-bar .outcome-stat-pill strong {
      font-size: 11px;
      white-space: nowrap;
    }

    .ledger-outcome-summary-bar .outcome-stat-pill .sub {
      font-size: 11px;
      opacity: 0.8;
      white-space: nowrap;
    }

    .ledger-outcome-summary-bar .outcome-stat-pill.pnl {
      grid-column: 1 / -1;
      margin-left: 0;
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 8px 10px;
      font-size: 11.5px;
      font-weight: 700;
      border-radius: 8px;
      width: 100%;
      box-sizing: border-box;
    }

    /* Upgraded Mobile Filter Controls Row (Sub-Filter-Row & Filter-Controls-Row) */

    /* Analytics Screen Mobile Filter Controls */

    .analytics-filter-header-row {
      flex-direction: column;
      align-items: stretch;
      gap: 10px;
    }

    .glass-card { padding: 14px 12px; }

    /* Pagination Bar on Mobile */

    .pagination-bar {
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 8px;
      text-align: center;
      padding-top: 10px;
    }

    .pagination-controls { justify-content: center; }

    /* Scalper Panel on Mobile */

    /* Analytics & Charts on Mobile */

    #chart-model-donut { max-width: 100%; }

    /* Native Bottom Sheets on Mobile */

    .modal-overlay {
      padding: 0;
      align-items: flex-end;
      justify-content: center;
    }

    .trade-modal-box,
    .desk-breakdown-modal-box,
    .morning-intel-modal-box,
    .trade-logs-modal-box,
    .bottom-sheet-card {
      width: 100%;
      max-width: 100%;
      max-height: 88vh;
      padding: 16px 18px calc(env(safe-area-inset-bottom, 16px) + 20px) 18px;
      border-radius: 24px 24px 0 0;
      border-bottom: none;
      margin: 0;
      animation: slideUpSheet 0.32s cubic-bezier(0.32, 0.72, 0, 1);
      box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.6);
    }

    @keyframes slideUpSheet {
    from {
      transform: translateY(100%);
    }
    to {
      transform: translateY(0);
    }
  }

    /* Scalper Strikes Grid on Mobile */

    /* Settings Rows on Mobile */

    .setting-row {
      flex-wrap: wrap;
      gap: 12px;
      padding: 12px 14px;
    }

    .setting-info {
      max-width: 100%;
      flex: 1 1 200px;
    }

    .setting-row select,
    .setting-row input[type="text"],
    .setting-row input[type="number"] {
      width: 100%;
      max-width: 100%;
    }

    /* Radar & Screener Header Rows on Mobile */

    .radar-header-left { width: 100%; }

    /* Scanner Filter Bar on Mobile */

    /* Screener Control Bar on Mobile */

    /* Equity Journal Date Bar on Mobile */

    .modern-date-navigator {
      width: 100%;
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      padding: 6px;
      box-sizing: border-box;
      background: rgba(12, 19, 35, 0.9);
      border: 1px solid rgba(34, 211, 238, 0.28);
      border-radius: 10px;
      box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255,255,255,0.05);
    }

    .modern-nav-btn {
      flex: 1 1 0;
      min-width: 0;
      height: 34px;
      padding: 0 4px;
      font-size: 11px;
      font-weight: 700;
      text-align: center;
      justify-content: center;
      white-space: nowrap;
      border-radius: 6px;
    }

    .modern-date-input {
      width: 100%;
      height: 36px;
      font-size: 12.5px;
      font-weight: 700;
      text-align: center;
      padding: 0 10px;
      box-sizing: border-box;
      background: rgba(6, 10, 20, 0.95);
      border: 1px solid rgba(34, 211, 238, 0.35);
      border-radius: 6px;
      color: var(--cyan);
    }

    /* Donut chart wrap */

    /* Viewport and Layout Overflow Safeguards */

    body,
    .app-container {
      overflow-x: clip;
      max-width: 100vw;
    }

    /* Mobile Bottom Navigation Bar */

    .bottom-nav {
      height: 58px;
      padding: 0 4px;
    }

    .nav-item {
      font-size: 11px;
      padding: 4px 6px;
      gap: 2px;
    }

    .nav-item svg {
      width: 18px;
      height: 18px;
    }
  }

  /* Extra Small Phones (< 400px) */

  @media (max-width: 400px) {
    .kpi-value { font-size: 15px; }

    .stat-cell-val { font-size: 12px; }

    .header-title-area h1 { font-size: 18px; }
  }

  /* ==============================================================
   NATIVE MOBILE CARDS & HAPTIC TOUCH SYSTEM (DESKTOP BASELINE)
   ============================================================== */

  @media (min-width: 1025px) {
    .mob-only { display: none !important; }

    .desk-only { display: inline; }
  }

  @media (max-width: 1024px) {
    .desk-only { display: none !important; }

    .mob-only { display: inline; }
  }

  button,
  a,
  .nav-item,
  .scanner-pill,
  .clickable-trade-row,
  .modern-nav-btn {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  /* ==============================================================
   NATIVE MOBILE EXPERIENCES (PHONES <= 768px)
   ============================================================== */

  @media (max-width: 768px) {
    /* Safe Area Insets for iPhones with Home Indicator */

    .bottom-nav {
      padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
      height: calc(62px + env(safe-area-inset-bottom, 0px));
    }

    body { padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }

    /* Native Touch Active Feedback */

    button:active,
    .clickable-trade-row:active,
    .nav-item:active {
      transform: scale(0.975);
      transition: transform 0.08s ease;
    }

    /* ------------------------------------------------------------
     1. LIVE TRADE BOOK VIEW MODE INTEGRATION (DELEGATED TO Q-M3)
     ------------------------------------------------------------ */

    #trade-table-container:not([data-view-mode="table"]) table,
    #sniper-table-container:not([data-view-mode="table"]) table,
    #sniper-armed-setups-body:not([data-view-mode="table"]) table { display: none !important; }

    #trade-table-container:not([data-view-mode="table"]) .qm3-mobile-ledger-cards,
    #sniper-table-container:not([data-view-mode="table"]) .qm3-mobile-ledger-cards,
    #sniper-armed-setups-body:not([data-view-mode="table"]) .qm3-mobile-ledger-cards { display: flex; }

    #trade-table-container[data-view-mode="table"] table,
    #sniper-table-container[data-view-mode="table"] table,
    #sniper-armed-setups-body[data-view-mode="table"] table { display: table; }

    #trade-table-container[data-view-mode="table"] .qm3-mobile-ledger-cards,
    #sniper-table-container[data-view-mode="table"] .qm3-mobile-ledger-cards,
    #sniper-armed-setups-body[data-view-mode="table"] .qm3-mobile-ledger-cards { display: none !important; }

    @media (min-width: 901px) {
      #trade-table-container:not([data-view-mode="cards"]) .qm3-mobile-ledger-cards,
      #sniper-table-container:not([data-view-mode="cards"]) .qm3-mobile-ledger-cards,
      #sniper-armed-setups-body:not([data-view-mode="cards"]) .qm3-mobile-ledger-cards { display: none !important; }

      #trade-table-container[data-view-mode="cards"] table,
      #sniper-table-container[data-view-mode="cards"] table,
      #sniper-armed-setups-body[data-view-mode="cards"] table { display: none !important; }

      #trade-table-container[data-view-mode="cards"] .qm3-mobile-ledger-cards,
      #sniper-table-container[data-view-mode="cards"] .qm3-mobile-ledger-cards,
      #sniper-armed-setups-body[data-view-mode="cards"] .qm3-mobile-ledger-cards { display: flex; }
    }

    /* ------------------------------------------------------------
     3. NATIVE iOS / ANDROID BOTTOM SHEETS
     ------------------------------------------------------------ */

    .modal-overlay {
      align-items: flex-end;
      padding: 0;
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
    }

    .trade-modal-box,
    .desk-modal-box,
    .desk-breakdown-modal-box,
    .morning-intel-modal-box,
    .trade-logs-modal-box {
      width: 100%;
      max-width: 100%;
      max-height: 88vh;
      overflow-y: auto;
      padding: 10px 16px calc(24px + env(safe-area-inset-bottom, 0px)) 16px;
      border-radius: 24px 24px 0 0;
      border: 1px solid rgba(34, 211, 238, 0.35);
      border-bottom: none;
      margin: 0;
      box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.85);
      animation: sheetSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
      -webkit-overflow-scrolling: touch;
    }

    /* iOS Grab Handle Indicator */

    .trade-modal-box::before,
    .desk-modal-box::before,
    .desk-breakdown-modal-box::before,
    .morning-intel-modal-box::before,
    .trade-logs-modal-box::before {
      content: '';
      display: block;
      width: 44px;
      height: 5px;
      border-radius: 4px;
      background: rgba(255, 255, 255, 0.28);
      margin: 4px auto 14px auto;
    }

    /* Horizontal Scrolling Pills Bar */

    /* ------------------------------------------------------------
     4. LIVE MARKET RADAR NATIVE CONTRACT QUOTE CARDS
     ------------------------------------------------------------ */

    #table-market-radar {
      display: block;
      width: 100%;
      min-width: 0;
      border-collapse: separate;
    }

    #table-market-radar thead { display: none !important; }

    #table-market-radar tbody {
      display: flex;
      flex-direction: column;
      gap: 10px;
      width: 100%;
    }

    .radar-card-row {
      display: grid;
      grid-template-columns: 1fr auto;
      grid-template-rows: auto auto auto auto;
      gap: 6px 10px;
      padding: 12px 14px;
      background: linear-gradient(145deg, rgba(16, 25, 44, 0.94), rgba(8, 14, 26, 0.98));
      border: 1px solid rgba(34, 211, 238, 0.22);
      border-radius: 14px;
      box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
      position: relative;
      width: 100%;
      box-sizing: border-box;
    }

    .radar-col-scrip {
      grid-column: 1 / 2;
      grid-row: 1 / 2;
      padding: 0;
      border: none;
      display: flex;
      align-items: center;
    }

    .radar-col-scrip .scrip-name {
      font-size: 13.5px;
      font-weight: 800;
      color: #fff;
    }

    .radar-col-ltp {
      grid-column: 2 / 3;
      grid-row: 1 / 2;
      padding: 0;
      border: none;
      text-align: right;
      justify-self: end;
    }

    .radar-col-ltp .radar-ltp-val {
      font-size: 14px;
      font-weight: 800;
      font-family: var(--font-mono);
      color: #fff;
    }

    .radar-col-ltp .radar-chg-val {
      font-size: 11px;
      font-weight: 700;
    }

    /* Day Range Full Width Slider */

    .radar-col-range {
      grid-column: 1 / -1;
      grid-row: 2 / 3;
      padding: 6px 0;
      border: none;
      border-top: 1px solid rgba(255, 255, 255, 0.07);
    }

    .radar-col-range .day-range-container {
      width: 100%;
      min-width: 0;
    }

    /* OI Metric & Sparkline */

    .radar-col-oi {
      grid-column: 1 / 2;
      grid-row: 3 / 4;
      padding: 0;
      border: none;
      display: flex;
      align-items: center;
    }

    .radar-col-spark {
      grid-column: 2 / 3;
      grid-row: 3 / 4;
      padding: 0;
      border: none;
      text-align: right;
      justify-self: end;
    }

    .radar-col-spark svg {
      max-width: 90px;
      height: 20px;
    }

    /* Signal Badge & Model Setup Tag */

    .radar-col-signal {
      grid-column: 1 / 2;
      grid-row: 4 / 5;
      padding: 2px 0 0 0;
      border: none;
      display: flex;
      align-items: center;
    }

    .radar-col-setup {
      grid-column: 2 / 3;
      grid-row: 4 / 5;
      padding: 2px 0 0 0;
      border: none;
      text-align: right;
      justify-self: end;
    }

    /* Hide raw Open/High/Low numbers on mobile cards */

    .radar-col-open,
    .radar-col-high,
    .radar-col-low { display: none !important; }

    /* ------------------------------------------------------------
     5. MULTI-CAP STOCK SCREENER NATIVE CARDS
     ------------------------------------------------------------ */

    /* Day Range Bar full width */

    /* Confluence & Signal Badges */

    /* Action button to open blueprint drawer */

    /* Blueprint Accordion Drawer on Mobile */

    /* ------------------------------------------------------------
     6. EQUITY SIGNALS & EOD AUDIT JOURNAL NATIVE CARDS
     ------------------------------------------------------------ */

    /* Milestone Status Pill Full Width */

    /* Levels (Entry / SL) & Capital */

    /* Inspect Action Button Full Width */
  }

  @keyframes sheetSlideUp {
  from {
    transform: translateY(100%);
    opacity: 0.5;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

  /* ==============================================================
   SWING EQUITY SCREENER & ACTIVE PORTFOLIO STYLING
   ============================================================== */

  /* Swing Portfolio Cards Grid */

  /* Swing Milestone Progress Meter */

  /* Day-by-Day Telemetry Timeline */

  /* Card Actions Row */

  /* Mobile Media Queries for Swing UI */

  /* ==============================================================
   CYBER INSTITUTIONAL COMMAND BAR & INPUTS STYLING
   ============================================================== */

  /* 7. BTN-CYBER-PRIMARY — blue primary action style */

  .filter-input,
  .filter-select {
    background: rgba(8, 12, 20, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    color: #ffffff;
    padding: 8px 12px;
    font-size: 12px;
    font-family: var(--font-body);
    outline: none;
    transition: all 0.2s ease;
  }

  .filter-input:focus,
  .filter-select:focus {
    border-color: var(--cyan);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    background: rgba(10, 16, 28, 0.95);
  }

  /* Modal visibility override */

  .modal-overlay.active {
    display: flex;
    opacity: 1;
    visibility: visible;
  }

  /* ==============================================================
   UNIVERSAL INSTITUTIONAL LEFT BORDER ON TABLE ROW HOVER & SWING DESIGNS
   ============================================================== */

  /* Universal row hover emerald highlight for ALL tables in the application */

  .trade-table tbody tr:hover,
  .intel-table tbody tr:hover {
    background: rgba(19, 187, 132, 0.045);
    cursor: pointer;
  }

  .trade-table tbody tr:hover td:first-child,
  .intel-table tbody tr:hover td:first-child {
    border-left: 1px solid var(--border, rgba(255,255,255,0.1));
    transition: border-left 0.15s ease;
  }

  /* Desktop Swing Screener & Closed Table */

  /* Swing Pagination Controls */

  /* ==============================================================
   MOBILE CARD TRANSFORMATION (Max-Width: 768px)
   Matches the design of other screener cards without horizontal overflow
   ============================================================== */

  @media (max-width: 768px) {
    /* Prevent any horizontal screen bleed */

    #view-swing-screener {
      width: 100%;
      max-width: 100vw;
      overflow-x: hidden;
      box-sizing: border-box;
      padding: 10px 10px 80px 10px;
    }

    #view-swing-screener .table-container {
      overflow-x: visible;
      padding: 0;
      border: none;
      background: transparent;
      width: 100%;
      box-sizing: border-box;
    }

    /* Reset tables to block for card transformation */

    /* -------------------------------------------------------------
     1. SWING SCREENER STOCK CARD (Mobile)
     ------------------------------------------------------------- */

    /* Row 1: Stock Symbol & Sector (Left) */

    /* Row 1: LTP & 52W Dist (Right) */

    /* Row 2: Pattern Badge (Left) */

    /* Row 2: RS Rating (Right) */

    /* Row 3: Delivery % & RVOL (Full width strip) */

    /* Row 4: 1-Share Execution Levels (Entry, SL, Targets) */

    /* Row 5: F&O Spread Note */

    /* Row 6: Action Buttons */

    /* -------------------------------------------------------------
     BLUEPRINT ACCORDION DRAWER ON MOBILE
     ------------------------------------------------------------- */

    /* Dual blueprints stack in 1 column on mobile */

    /* -------------------------------------------------------------
     2. AUDITED CLOSED SWINGS LEDGER CARD (Mobile)
     ------------------------------------------------------------- */

    /* Pagination Bar on Mobile */
  }

  /* ==============================================================
   STOCK NOTES & WATCHLIST IDEAS STYLES
   ============================================================== */

  .notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 18px;
  }

  .note-card {
    background: rgba(14, 20, 36, 0.82);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 18px 20px;
    position: relative;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }

  .note-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  }

  .note-card.pinned {
    border-color: rgba(255, 193, 7, 0.35);
    background: linear-gradient(180deg, rgba(255, 193, 7, 0.04) 0%, rgba(14, 20, 36, 0.85) 100%);
  }

  .note-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    gap: 10px;
  }

  .note-card-ticker-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
  }

  .note-card-title {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
    line-height: 1.4;
  }

  .note-card-content {
    font-size: 12px;
    color: #cbd5e1;
    line-height: 1.6;
    margin-bottom: 14px;
    flex: 1;
    white-space: pre-wrap;
    word-break: break-word;
  }

  .note-card-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 12px;
  }

  .note-card-tag {
    font-size: 11px;
    font-weight: 600;
    color: var(--cyan);
    background: rgba(0, 217, 245, 0.08);
    padding: 2px 7px;
    border-radius: 4px;
    border: 1px solid rgba(0, 217, 245, 0.15);
  }

  .note-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 10px;
    font-size: 11px;
    color: var(--text-muted);
  }

  .note-card-actions {
    display: flex;
    gap: 6px;
    align-items: center;
  }

  /* Screener note button */

  /* Stock Notes Modal Overlay explicit support */

  #modal-stock-note { display: none; }

  #modal-stock-note.active,
  #modal-stock-note.open {
    display: flex;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  #modal-stock-note.active .trade-modal-box,
  #modal-stock-note.open .trade-modal-box { transform: scale(1); }

  /* Delete Confirmation Modal Overlay */

  #modal-confirm-delete-note { display: none; }

  #modal-confirm-delete-note.active,
  #modal-confirm-delete-note.open {
    display: flex;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  #modal-confirm-delete-note.active .trade-modal-box,
  #modal-confirm-delete-note.open .trade-modal-box { transform: scale(1); }

  /* Plain Note Badge & Card enhancements */

  /* Mobile Media Queries for Notes */

  @media (max-width: 768px) {
    .notes-grid { grid-template-columns: 1fr; }

    .note-card { padding: 14px 16px; }
  }

  /* ==========================================================================
   Spot Index & Underlying Technical Levels (Audit Modal Section)
   ========================================================================== */

  .spot-reference-card {
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(56, 189, 248, 0.22);
    border-radius: 12px;
    padding: 16px 20px;
    margin-top: 18px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(8px);
  }

  .spot-reference-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .spot-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .spot-icon { font-size: 16px; }

  .spot-title {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #e2e8f0;
    text-transform: uppercase;
  }

  .spot-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
  }

  .spot-subtile {
    background: rgba(8, 14, 26, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .spot-sublabel {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted, #94a3b8);
    text-transform: uppercase;
    letter-spacing: 0.4px;
  }

  .spot-val {
    font-family: var(--font-mono, monospace);
    font-size: 13px;
    font-weight: 700;
    color: #f1f5f9;
  }

  .spot-val.rose { color: var(--rose, #f43f5e); }

  .spot-val.gold { color: var(--gold, #f59e0b); }

  .spot-val.green { color: var(--emerald, #10b981); }

  .spot-val.cyan { color: var(--cyan, #06b6d4); }

  @media (max-width: 768px) {
    .spot-grid-4 {
      grid-template-columns: repeat(2, 1fr);
      gap: 8px;
    }

    .spot-reference-card { padding: 12px 14px; }
  }

  /* ==========================================================================
   NSE STOCKS (EQUITY JOURNAL) — MOBILE-ONLY FIXES
   All rules scoped to #view-equity-journal so desktop is completely unaffected.
   ========================================================================== */

  @media (max-width: 768px) {
    /* 1. Header title: smaller font, flex-wrap so audit pill drops to its own line */

    /* 2. Poll meta (wave schedule + "Top 10" text):
        stack vertically, hide bullet separators, trim font */

    #view-equity-journal .radar-poll-meta {
      flex-direction: column;
      align-items: flex-start;
      gap: 3px;
      margin-top: 4px;
    }

    /* Hide the plain bullet separator spans (they have no id or style attr) */

    #view-equity-journal .radar-poll-meta > span:not([id]):not([style]) { display: none !important; }

    #view-equity-journal .radar-poll-meta > span[id],
    #view-equity-journal .radar-poll-meta > span[style] {
      font-size: 11px;
      line-height: 1.5;
    }

    /* 3. Metric badges: 2-column grid instead of horizontal scroll
        Makes all 5 badges visible without scrolling */

    /* 5th badge spans full width */

    /* 4. VIEW COHORT wave buttons: add right-fade to hint scrollability */

    /* Subtle right-fade scroll hint */

    /* Make wave buttons slightly smaller on mobile */

    /* 5. Session badge + reset button: SINGLE ROW — badge expands, button stays compact */

    /* 6. Cohort info text + refresh button: SINGLE ROW side by side */

    /* 7. Stock cards — tighten entry/SL/capital section spacing */

    /* Journal cohort-label on mobile */

    /* 8. Stock card row 2 — Win % and R-Multiple alignment fix.
        eq-col-roi (+45.0%) and eq-col-netr (+1.50R) share the same grid cell.
        Stack them cleanly: roi (% gain) on top, netr (R-multiple) below.
        Both right-aligned. Remove the margin-right hack. */
  }

  /* end @media (max-width: 768px) — NSE Stocks mobile fixes */

  /* ============================================================
   ASH OPTIONS — Page & Settings Styles
   ============================================================ */

  /* ── Period / Instrument pills on Ash Options page ── */

  /* ── Period / Instrument pills on Option Strike page (identical to ao-*) ── */

  /* ── Ash Options Settings Group ── */

  .ao-settings-group {
    background: rgba(0, 212, 255, 0.03);
    border: 1px solid rgba(0, 212, 255, 0.15);
    border-radius: 12px;
    padding: 18px 20px;
    margin-top: 24px;
  }

  /* ── Instrument card grid ── */

  .ao-instr-card {
    background: var(--surface-2, rgba(255,255,255,0.04));
    border: 1px solid var(--border-glass);
    border-radius: 10px;
    padding: 14px 16px;
    transition: border-color 0.18s;
  }

  .ao-instr-card:hover { border-color: rgba(0, 212, 255, 0.3); }

  /* ── Model chips ── */

  .ao-instr-models {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 4px;
  }

  .ao-model-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 12px;
    border: 1px solid var(--border-glass);
    background: transparent;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
  }

  .ao-model-chip input[type="checkbox"] { display: none; }

  .ao-model-chip.checked {
    background: rgba(0, 212, 255, 0.12);
    border-color: var(--cyan);
    color: var(--cyan);
  }

  .ao-model-chip:hover { border-color: rgba(0, 212, 255, 0.4); }

  /* ── Sidebar crosshair icon colour (Ash Options item) ── */

  .sidebar-link[data-tab="ash-options"].active svg,
  .sidebar-link[data-tab="ash-options"]:hover svg { stroke: var(--cyan); }

  /* ── Active position card (compact variant used on Ash Options) ── */

  .pos-symbol {
    font-size: 13px;
    font-weight: 800;
    color: var(--text-primary, #e8eaf6);
  }

  /* ── Day nav buttons for Ash Options ── */

  /* ── Responsive ── */

  /* ── Ash Options collapsible sections ── */

  /* ============================================================
   Instruments Radar Accordion — row padding & hover
   ============================================================ */

  #instruments-radar-rows table { border-spacing: 0; }

  #instruments-radar-rows .radar-card-row {
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: background 0.15s;
  }

  #instruments-radar-rows .radar-card-row:hover { background: rgba(255, 255, 255, 0.03); }

  #instruments-radar-rows .radar-card-row td { padding: 9px 8px; }

  #instruments-radar-rows .radar-card-row td:first-child { padding-left: 4px; }

  #instruments-radar-rows thead tr th {
    padding: 8px 8px 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  /* Settings button pinned to sidebar bottom — direct sidebar child, not inside sidebar-menu */

  .sidebar-link-settings {
    margin-top: auto;
    margin-bottom: 12px;
  }

  @media (min-width: 769px) {
    #sidebar-main .sidebar-link-settings {
      margin-top: auto;
      margin-bottom: 8px;
      width: 44px;
      height: 44px;
      min-height: 44px;
      padding: 0;
      margin-left: auto;
      margin-right: auto;
      border-radius: var(--r-sm, 6px);
      display: flex;
      align-items: center;
      justify-content: center;
    }
  }

  /* ==============================================================
   PWA & LOGO BRANDING SUITE
   ============================================================== */

  /* PIN Modal Logo */

  /* Header Mini Brand Mark */

  /* Sidebar Install Button */

  .sidebar-link-install {
    color: #00f5a0;
    margin-bottom: 12px;
    transition: all 0.2s ease;
  }

  .sidebar-link-install svg {
    color: #00f5a0;
    transition: transform 0.2s ease;
  }

  .sidebar-link-install:hover { background: rgba(0, 245, 160, 0.1); }

  .sidebar-link-install:hover svg { transform: translateY(2px); }

  @media (min-width: 769px) {
    #sidebar-main .sidebar-link-install {
      margin-bottom: 8px;
      width: 44px;
      height: 44px;
      min-height: 44px;
      padding: 0;
      margin-left: auto;
      margin-right: auto;
      border-radius: var(--r-sm, 6px);
      display: flex;
      align-items: center;
      justify-content: center;
    }
  }

  /* Desktop Header Install Button */

  /* Mobile Header Install Button Compact */

  /* PWA Floating Install Toast Banner */

  .pwa-install-banner {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    background: rgba(10, 15, 29, 0.94);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));
    border-radius: 14px;
    padding: 12px 18px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.65);
    animation: pwaSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    max-width: 440px;
  }

  @keyframes pwaSlideUp {
  from { transform: translateY(80px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

  .pwa-install-content {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .pwa-banner-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    flex-shrink: 0;
  }

  .pwa-banner-title {
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    font-family: var(--font-heading);
    letter-spacing: -0.2px;
  }

  .pwa-banner-subtitle {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.3;
    margin-top: 2px;
  }

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

  .pwa-btn-install {
    background: var(--accent-blue, #38bdf8);
    color: #060911;
    border: none;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
  }

  .pwa-btn-install:hover {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    transform: scale(1.02);
  }

  .pwa-btn-dismiss {
    background: transparent;
    color: var(--text-muted);
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 6px;
    border-radius: 6px;
    transition: color 0.15s ease;
  }

  .pwa-btn-dismiss:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
  }

  @media (max-width: 600px) {
    .pwa-install-banner {
      bottom: 74px;
      left: 12px;
      right: 12px;
      max-width: none;
      flex-wrap: wrap;
      gap: 12px;
    }

    .pwa-banner-actions {
      width: 100%;
      justify-content: flex-end;
    }
  }

  /* iOS Safari PWA Installation Sheet Modal */

  .ios-pwa-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
  }

  .ios-pwa-sheet {
    background: #0d1528;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px 20px 0 0;
    padding: 24px;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.7);
    animation: pwaSheetUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }

  @keyframes pwaSheetUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

  .ios-pwa-header {
    display: flex;
    align-items: center;
    gap: 14px;
    position: relative;
    margin-bottom: 20px;
  }

  .ios-pwa-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  }

  .ios-pwa-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
  }

  .ios-pwa-header p {
    margin: 4px 0 0;
    font-size: 12px;
    color: var(--text-muted);
  }

  .ios-pwa-close {
    position: absolute;
    right: 0;
    top: 0;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    padding: 6px;
  }

  .ios-pwa-close:hover { color: #fff; }

  .ios-pwa-steps {
    display: flex;
    flex-direction: column;
    gap: 14px;
  }

  .ios-step {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: #e6eaf2;
  }

  .step-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(0, 245, 160, 0.18);
    color: #00f5a0;
    font-weight: 700;
    font-size: 12px;
    flex-shrink: 0;
  }

  /* =============================================================================
   TRADE JOURNAL STYLES
   ============================================================================= */

  /* Generic badge styles */

  .badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
  }

  .badge-green {
    background: rgba(19, 187, 132, 0.15);
    color: var(--emerald);
  }

  .badge-red {
    background: rgba(244, 63, 94, 0.15);
    color: var(--rose);
  }

  .badge-amber {
    background: rgba(247, 120, 22, 0.18);
    color: var(--gold);
  }

  .badge-muted {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
  }

  /* Tag style */

  .tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    background: rgba(99, 102, 241, 0.12);
    color: var(--indigo);
  }

  /* Journal detail sections */

  .detail-section {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    padding: 14px 16px;
    border: 1px solid rgba(255, 255, 255, 0.04);
  }

  .detail-section-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
  }

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

  .detail-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .detail-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.02em;
  }

  .detail-value {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
  }

  /* Journal trades table */

  /* Journal modal */

  /* Responsive adjustments */

  @media (max-width: 768px) {
    .detail-grid { grid-template-columns: repeat(2, 1fr); }
  }

  /* ==========================================================================
   ACTIVITY LOG PAGE — MISSION CONTROL AUDIT TRAIL
   ========================================================================== */

  /* Activity Log Stats Row */

  .actlog-stats {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
  }

  .actlog-stat {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 140px;
  }

  .actlog-stat-value {
    font-size: 20px;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
  }

  .actlog-stat-label {
    color: var(--text-dim);
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  /* Activity Log Filter Bar */

  .actlog-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 16px;
    align-items: center;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 16px;
  }

  .actlog-filters .filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .actlog-filters label {
    color: var(--text-dim);
    font-size: 12px;
    font-weight: 600;
  }

  .actlog-filters select,
  .actlog-filters input[type="text"],
  .actlog-filters input[type="date"] {
    background: var(--card-hi);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 13px;
    padding: 6px 10px;
    outline: none;
  }

  .actlog-filters select:focus,
  .actlog-filters input:focus { border-color: var(--primary); }

  .actlog-filters input[type="text"] { width: 130px; }

  /* Activity Log Table */

  .actlog-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    font-size: 13px;
  }

  .actlog-table thead th {
    color: var(--text-dim);
    font-weight: 600;
    font-size: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    background: var(--card-hi);
    white-space: nowrap;
  }

  .actlog-table tbody td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
  }

  .actlog-table tbody tr:nth-child(even) { background: rgba(255, 255, 255, 0.015); }

  .actlog-table tbody tr:hover { background: rgba(38, 100, 236, 0.08); }

  /* Column styles */

  .actlog-table th.col-time,
  .actlog-table td.col-time {
    width: 160px;
    text-align: left;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--text-dim);
    white-space: nowrap;
  }

  .actlog-table th.col-cat,
  .actlog-table td.col-cat {
    width: 110px;
    text-align: center;
    white-space: nowrap;
  }

  .actlog-table th.col-sev,
  .actlog-table td.col-sev {
    width: 105px;
    text-align: center;
    white-space: nowrap;
  }

  .actlog-table th.col-sym,
  .actlog-table td.col-sym {
    width: 190px;
    max-width: 220px;
    text-align: left;
    padding-left: 8px;
    padding-right: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    font-size: 11.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .actlog-table th.col-act,
  .actlog-table td.col-act {
    width: 140px;
    text-align: left;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .actlog-table th.col-details,
  .actlog-table td.col-details {
    width: auto;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-dim);
  }

  /* Category Badges */

  .cat-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  .cat-signal { background: rgba(34, 211, 238, 0.15); color: #22d3ee; }

  .cat-order { background: rgba(19, 187, 132, 0.15); color: #13bb84; }

  .cat-position {
    background: var(--surface-card, #15161B); color: var(--text-secondary, #94A3B8);
  }

  .cat-engine { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }

  .cat-scanner { background: rgba(6, 182, 212, 0.15);  color: #22d3ee; }

  .cat-broker { background: rgba(244, 63, 94, 0.15);  color: #f43f5e; }

  .cat-settings {
    background: var(--surface-card, #15161B); color: var(--text-secondary, #94A3B8);
  }

  .cat-server {
    background: rgba(14, 165, 233, 0.15); color: #0ea5e9; border: 1px solid rgba(14, 165, 233, 0.3);
  }

  /* Severity styles */

  .sev-info { color: #38bdf8; font-weight: 600; font-size: 11px; text-transform: uppercase; }

  .sev-warning { color: #fbbf24; font-weight: 600; font-size: 11px; text-transform: uppercase; }

  .sev-error { color: #f87171; font-weight: 700; font-size: 11px; text-transform: uppercase; }

  .sev-critical {
    color: #f43f5e; font-weight: 800; font-size: 11px; text-transform: uppercase; background: rgba(244, 63, 94, 0.15); padding: 2px 6px; border-radius: 3px;
  }

  .sev-success { color: #34d399; font-weight: 600; font-size: 11px; text-transform: uppercase; }

  /* Clear date button */

  .btn-clear-date {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 16px;
    cursor: pointer;
    padding: 0 4px;
  }

  .btn-clear-date:hover { color: var(--loss); }

  /* Activity Log Pagination Bar */

  .actlog-pagination-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 18px;
    border-top: 1px solid var(--border);
    background: var(--card-hi);
    font-size: 12px;
    color: var(--text-dim);
    flex-wrap: wrap;
    gap: 12px;
  }

  /* Responsive activity log */

  @media (max-width: 760px) {
    .actlog-filters {
      flex-direction: column;
      align-items: stretch;
    }

    .actlog-filters .filter-group { justify-content: space-between; }

    .actlog-pagination-bar {
      flex-direction: column;
      align-items: stretch;
    }
  }

  /* ==========================================================================
   SNIPER CHART & 3-ENGINE EXECUTION MATRIX STYLES
   ========================================================================== */

  .sniper-chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px 16px;
  }

  .sniper-chart-controls-left,
  .sniper-chart-controls-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
  }

  .sniper-select {
    background: var(--bg-card, #131215);
    color: var(--text, #f4f4f5);
    border: 1px solid var(--border, #26262a);
    border-radius: 6px;
    padding: 6px 12px;
    font-weight: 600;
    font-size: 0.88rem;
    outline: none;
  }

  .sniper-tf-group {
    display: flex;
    background: var(--bg, #000000);
    border-radius: 6px;
    padding: 3px;
    border: 1px solid var(--border, #26262a);
  }

  .tf-pill {
    background: transparent;
    color: var(--text-dim, #a1a1aa);
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
  }

  .tf-pill:hover { color: #fff; }

  .tf-pill.active {
    background: var(--primary, #2664ec);
    color: #ffffff;
  }

  .overlay-pill {
    background: var(--bg-card, #131215);
    color: var(--text-dim, #a1a1aa);
    border: 1px solid var(--border, #26262a);
    border-radius: 16px;
    padding: 5px 12px;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
  }

  .overlay-pill.active {
    border-color: var(--cyan, #22d3ee);
    color: var(--cyan, #22d3ee);
    background: rgba(34, 211, 238, 0.12);
  }

  .sniper-chart-wrapper {
    position: relative;
    height: calc(100vh - 220px);
    min-height: 520px;
    overflow: hidden;
    border-radius: var(--radius-md, 14px);
  }

  .sniper-chart-canvas {
    width: 100%;
    height: 100%;
  }

  .sniper-chart-legend {
    position: absolute;
    top: 12px;
    left: 14px;
    z-index: 10;
    display: flex;
    gap: 14px;
    font-size: 0.82rem;
    background: rgba(11, 15, 25, 0.85);
    padding: 6px 14px;
    border-radius: 8px;
    border: 1px solid var(--border, #26262a);
    backdrop-filter: blur(8px);
    pointer-events: none;
  }

  .legend-sym {
    font-weight: 700;
    color: var(--cyan, #22d3ee);
  }

  .sniper-armed-banner {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
  }

  .armed-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(247, 120, 22, 0.12);
    border: 1px solid rgba(247, 120, 22, 0.45);
    color: var(--warn, #f77816);
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.84rem;
  }

  .armed-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--warn, #f77816);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    animation: none;
  }

  /* Sniper Metrics Grid */

  .sniper-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
  }

  .metric-card {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .metric-title {
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--text-dim, #a1a1aa);
  }

  .metric-value {
    font-size: 1.6rem;
    font-weight: 800;
    font-family: var(--font-mono, monospace);
    color: var(--text, #f4f4f5);
  }

  .metric-sub {
    font-size: 0.8125rem;
    color: var(--text-mute, #71717a);
  }

  /* 3-Engine Settings Matrix */

  .sniper-engines-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 16px;
  }

  .sniper-engine-panel {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 18px;
  }

  .engine-badge {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 4px;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.04em;
  }

  .engine-main {
    background: rgba(34, 211, 238, 0.15); color: var(--cyan, #22d3ee); border: 1px solid rgba(34, 211, 238, 0.35);
  }

  .engine-spot {
    background: rgba(79, 71, 231, 0.18); color: #818cf8; border: 1px solid rgba(79, 71, 231, 0.35);
  }

  .engine-equity {
    background: rgba(16, 185, 129, 0.18); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.35);
  }

  .engine-direct {
    background: rgba(247, 120, 22, 0.15); color: var(--warn, #f77816); border: 1px solid rgba(247, 120, 22, 0.35);
  }

  .default-pill {
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 6px;
    font-weight: 700;
  }

  .default-pill.cyan { background: rgba(34, 211, 238, 0.15); color: var(--cyan, #22d3ee); }

  .default-pill.indigo {
    background: var(--surface-card, #15161B); color: var(--text-secondary, #94A3B8);
  }

  .default-pill.amber { background: rgba(247, 120, 22, 0.18); color: var(--warn, #f77816); }

  .sniper-inst-card {
    background: var(--bg-card, #131215);
    border: 1px solid var(--border, #26262a);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
  }

  .chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

  .chip-toggle {
    display: inline-flex;
    align-items: center;
    padding: 4px 9px;
    border-radius: 5px;
    font-size: 0.8125rem;
    font-weight: 600;
    background: var(--bg, #000000);
    color: var(--text-dim, #a1a1aa);
    border: 1px solid var(--border, #26262a);
    cursor: pointer;
    user-select: none;
    transition: all 0.15s ease;
  }

  .chip-toggle input { display: none; }

  .chip-toggle.active {
    background: rgba(34, 211, 238, 0.18);
    color: var(--cyan, #22d3ee);
    border-color: var(--cyan, #22d3ee);
  }

  .chip-toggle.model-chip.active {
    background: rgba(19, 187, 132, 0.18);
    color: var(--profit, #13bb84);
    border-color: var(--profit, #13bb84);
  }

  .lots-input {
    width: 55px;
    background: var(--bg, #000000);
    color: var(--text, #f4f4f5);
    border: 1px solid var(--border, #26262a);
    border-radius: 5px;
    padding: 3px 6px;
    font-size: 0.8rem;
    text-align: center;
  }

  /* Switch Styles */

  .save-status-pill {
    font-size: 0.8rem;
    font-weight: 600;
  }

  .save-status-pill.ok { color: var(--profit, #13bb84); }

  .save-status-pill.warn { color: var(--amber, #f59e0b); }

  .save-status-pill.err { color: var(--loss, #f43f5e); }

  /* Unified Sniper Execution Ledger Styles */

  .sniper-dir-pill {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 4px;
    letter-spacing: 0.04em;
  }

  .sniper-dir-pill.dir-long {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
  }

  .sniper-dir-pill.dir-short {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
  }

  .sniper-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    white-space: nowrap;
  }

  .sniper-status-pill.status-live {
    background: rgba(56, 189, 248, 0.16);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.35);
    animation: sniperPulse 2s infinite;
  }

  .sniper-status-pill.status-be {
    background: rgba(6, 182, 212, 0.16);
    color: #06b6d4;
    border: 1px solid rgba(6, 182, 212, 0.35);
  }

  .sniper-status-pill.status-win {
    background: rgba(16, 185, 129, 0.16);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.35);
  }

  .sniper-status-pill.status-loss {
    background: rgba(239, 68, 68, 0.16);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.35);
  }

  .pulse-live-dot { animation: sniperPulse 2s infinite; }

  @keyframes sniperPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.4); }
  50% { box-shadow: 0 0 0 5px rgba(56, 189, 248, 0); }
}

  /* Armed Setups Radar Styling */

  .sniper-row-armed:hover { background: rgba(245, 158, 11, 0.08); }

  .sniper-status-pill.status-armed {
    background: rgba(245, 158, 11, 0.16);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.35);
    animation: armedAmberPulse 2s infinite;
  }

  .sniper-status-pill.status-inzone {
    background: rgba(234, 179, 8, 0.25);
    color: #fde047;
    border: 1px solid rgba(234, 179, 8, 0.6);
    font-weight: 800;
    animation: armedFastPulse 1s infinite;
  }

  @keyframes armedAmberPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4); }
  50% { box-shadow: 0 0 0 5px rgba(245, 158, 11, 0); }
}

  @keyframes armedFastPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(234, 179, 8, 0.6); }
  50% { box-shadow: 0 0 0 8px rgba(234, 179, 8, 0); }
}

  .btn-disarm-xs {
    background: rgba(239, 68, 68, 0.12);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 4px;
    padding: 3px 8px;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
  }

  .btn-disarm-xs:hover {
    background: rgba(239, 68, 68, 0.3);
    color: #fee2e2;
    border-color: rgba(239, 68, 68, 0.6);
  }

  .highlight-pulse { animation: cardHighlight 2s ease-out; }

  @keyframes cardHighlight {
  0% { outline: 2px solid #f59e0b; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); }
  100% { outline: 2px solid transparent; box-shadow: none; }
}

  /* Trade Micro-tags (SPOT, OPT, LTP, EXIT) */

  /* Item 4 — Institutional live value-change protocol on LTP / P&L cells (glow & micro-chevron) */

  .sniper-tick-indicator {
    display: inline-block;
    font-size: 11px;
    line-height: 1;
    font-weight: 800;
    vertical-align: middle;
    margin-left: 3px;
    margin-right: 1px;
    transition: opacity 0.4s ease, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .sniper-tick-indicator.tick-up {
    color: #34d399;
    text-shadow: none;
    animation: tickArrowPop 0.85s ease-out;
  }

  .sniper-tick-indicator.tick-down {
    color: #f87171;
    text-shadow: none;
    animation: tickArrowPop 0.85s ease-out;
  }

  @keyframes tickArrowPop {
  0% { transform: scale(1.4); opacity: 1; }
  60% { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(1); opacity: 0.85; }
}

  /* LTP Cell: Modern Typographic Luminance Glow (No Opaque Background Blocks) */

  .sniper-flash-up { animation: sniperInstTickUp 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards; }

  .sniper-flash-down { animation: sniperInstTickDown 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards; }

  @keyframes sniperInstTickUp {
  0% {
    color: #34d399;
    text-shadow: none;
    background: rgba(16, 185, 129, 0.08);
    box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.35);
    border-radius: 4px;
  }
  100% {
    text-shadow: none;
    background: transparent;
    box-shadow: inset 0 0 0 1px transparent;
  }
}

  @keyframes sniperInstTickDown {
  0% {
    color: #f87171;
    text-shadow: none;
    background: rgba(239, 68, 68, 0.08);
    box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.35);
    border-radius: 4px;
  }
  100% {
    text-shadow: none;
    background: transparent;
    box-shadow: inset 0 0 0 1px transparent;
  }
}

  /* P&L Cell: Subtle Relative Profitability Shimmer (Preserves Net PnL Color) */

  .sniper-pnl-flash-up { animation: sniperPnlTickUp 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards; }

  .sniper-pnl-flash-down { animation: sniperPnlTickDown 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards; }

  @keyframes sniperPnlTickUp {
  0% {
    filter: brightness(1.3);
    background: rgba(16, 185, 129, 0.07);
    box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.28);
    border-radius: 4px;
  }
  100% {
    filter: brightness(1);
    background: transparent;
    box-shadow: inset 0 0 0 1px transparent;
  }
}

  @keyframes sniperPnlTickDown {
  0% {
    filter: brightness(0.85);
    background: rgba(239, 68, 68, 0.07);
    box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.28);
    border-radius: 4px;
  }
  100% {
    filter: brightness(1);
    background: transparent;
    box-shadow: inset 0 0 0 1px transparent;
  }
}

  /* Item 5 — collapsible Stage-1 Armed Setups radar */

  .sniper-armed-header { transition: background 0.2s ease; }

  .sniper-armed-header:hover { background: rgba(255, 255, 255, 0.02); }

  .sniper-armed-card.is-collapsed { margin-bottom: 16px; }

  .sniper-armed-card.is-collapsed .sniper-armed-header { border-bottom: none; }

  .sniper-armed-collapsible {
    max-height: 2000px;
    opacity: 1;
    transition: max-height 0.35s ease, opacity 0.25s ease;
  }

  .sniper-armed-collapsible.collapsed {
    display: none !important;
    max-height: 0;
    height: 0;
    margin: 0;
    padding: 0;
    border: none;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
  }

  /* Unified Execution Ledger Desktop Fit */

  @media (min-width: 1024px) {
    .sniper-unified-table {
      table-layout: fixed;
      width: 100%;
      min-width: 100%;
      font-size: 0.8125rem;
    }

    .sniper-unified-table th,
    .sniper-unified-table td {
      padding: 6px 3px;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .col-trajectory svg { max-width: 100%; }

    .sniper-status-pill {
      font-size: 11px;
      padding: 2px 4px;
      white-space: nowrap;
    }
  }

  .sniper-armed-chevron .sniper-chevron {
    display: inline-block;
    transition: transform 0.2s ease;
  }

  .expiry-track {
    width: 60px;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    display: inline-block;
    vertical-align: middle;
    margin-right: 6px;
  }

  .expiry-fill {
    height: 100%;
    transition: width 0.3s ease;
  }

  /* =========================================================================
   INSTITUTIONAL STATS KPI CARDS & REAL-TIME TICK STREAM SYSTEM
   ========================================================================= */

  .inst-metrics-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 20px;
  }

  @media (max-width: 1280px) {
    .inst-metrics-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  }

  @media (max-width: 680px) {
    .inst-metrics-grid {
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 8px;
      margin-bottom: 14px;
    }
  }

  .inst-metric-card {
    position: relative;
    background: var(--surface-card, #15161B);
    border: 1px solid var(--border-subtle, #1B2232);
    border-radius: 12px;
    padding: 12px 14px;
    overflow: hidden;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 4px 18px -2px rgba(0, 0, 0, 0.38);
  }

  .inst-metric-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 8%;
    right: 8%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-light-edge, rgba(255, 255, 255, 0.12)), transparent);
    opacity: 0.6;
  }

  .inst-metric-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-medium, rgba(255, 255, 255, 0.16));
    box-shadow: 0 8px 26px -4px rgba(0, 0, 0, 0.4);
  }

  .inst-metric-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 4px;
    margin-bottom: 3px;
  }

  .inst-metric-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .inst-tag {
    font-size: 11px;
    font-weight: 750;
    padding: 1px 4px;
    border-radius: 4px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    line-height: 1.2;
  }

  .inst-tag.violet {
    background: rgba(59, 130, 246, 0.16);
    color: #93c5fd;
    border: 1px solid rgba(59, 130, 246, 0.35);
  }

  .inst-tag.cyan {
    background: rgba(6, 182, 212, 0.16);
    color: #67e8f9;
    border: 1px solid rgba(6, 182, 212, 0.35);
  }

  .inst-tag.emerald {
    background: rgba(16, 185, 129, 0.16);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, 0.35);
  }

  .inst-tag.amber {
    background: rgba(245, 158, 11, 0.16);
    color: #fcd34d;
    border: 1px solid rgba(245, 158, 11, 0.35);
  }

  .inst-tag-live {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 750;
    padding: 1.5px 6px;
    border-radius: 4px;
    background: rgba(52, 211, 153, 0.15);
    color: #34d399;
    border: 1px solid rgba(52, 211, 153, 0.38);
    letter-spacing: 0.06em;
  }

  .inst-tag-live.standby {
    background: rgba(148, 163, 184, 0.12);
    color: #94a3b8;
    border-color: rgba(148, 163, 184, 0.25);
  }

  .beacon-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #34d399;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    animation: none;
  }

  .inst-tag-live.standby .beacon-dot {
    background: #94a3b8;
    box-shadow: none;
    animation: none;
  }

  @keyframes instBeaconPulse {
  0% { transform: scale(0.9); opacity: 0.65; }
  50% { transform: scale(1.25); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.65; }
}

  .inst-metric-value {
    font-family: var(--font-mono, monospace);
    font-size: 1.62rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: #f1f5f9;
    margin: 5px 0 3px 0;
  }

  .inst-metric-value.text-emerald {
    color: #34d399;
    text-shadow: none;
  }

  .inst-metric-value.text-rose {
    color: #f87171;
    text-shadow: none;
  }

  .inst-metric-value.text-cyan {
    color: #38bdf8;
    text-shadow: none;
  }

  .inst-metric-value.text-amber {
    color: #fbbf24;
    text-shadow: none;
  }

  .inst-metric-sub {
    font-size: 11px;
    color: #94a3b8;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    font-variant-numeric: tabular-nums;
    margin-top: 3px;
  }

  .inst-sub-val { font-weight: 600; }

  .inst-sub-val.emerald { color: #34d399; }

  .inst-sub-val.cyan { color: #38bdf8; }

  .inst-sub-val.rose { color: #f87171; }

  .inst-sub-val.amber { color: #fbbf24; }

  .inst-sub-val.chgs {
    color: #fb923c;
    cursor: help;
    transition: opacity 0.2s;
  }

  .inst-sub-val.chgs:hover {
    opacity: 0.8;
    text-decoration: underline dotted;
  }

  .inst-sub-dot {
    color: #475569;
    font-size: 11px;
  }

  /* 3-Segment Proportional Win/BE/Loss Track */

  .inst-win-track {
    display: flex;
    width: 100%;
    height: 4px;
    background: rgba(30, 41, 59, 0.85);
    border-radius: 999px;
    overflow: hidden;
    margin: 5px 0 5px 0;
    gap: 1px;
  }

  .win-seg {
    height: 100%;
    transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .win-seg.win { background: #10b981; }

  .win-seg.be { background: #06b6d4; }

  .win-seg.loss { background: #f43f5e; }

  /* ==========================================================================
   MODERN 7-COLUMN PRO SNIPER TRADE BOOK & BENTO DOSSIER DESIGN SYSTEM
   ========================================================================== */

  /* 7-Column Table Layout */

  .table-sniper-pro {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
  }

  .table-sniper-pro th {
    padding: 12px 14px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--text-mute, #94a3b8);
    text-transform: uppercase;
    border-bottom: 1px solid var(--border);
    background: rgba(4, 8, 18, 0.7);
  }

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

  .table-sniper-pro tr.row-live-trade {
    background: rgba(10, 132, 255, 0.03);
    border-left: 1px solid var(--border, rgba(255,255,255,0.1));
  }

  .table-sniper-pro tr.row-live-trade:hover { background: rgba(10, 132, 255, 0.06); }

  /* Cell 1: Asset & Signal */

  .cell-asset {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
    overflow: hidden;
  }

  .asset-top {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
  }

  .asset-name {
    font-size: 13.5px;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--text, #f8fafc);
  }

  .tf-badge {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-dim, #94a3b8);
    background: rgba(255, 255, 255, 0.06);
    padding: 1px 5px;
    border-radius: 4px;
    font-family: var(--font-mono);
  }

  .dir-badge-pill {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    letter-spacing: 0.02em;
  }

  .dir-badge-pill.long {
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.25);
  }

  .dir-badge-pill.short {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.25);
  }

  .asset-sub {
    font-size: 11px;
    color: var(--text-mute, #94a3b8);
    font-family: var(--font-mono);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    column-gap: 5px;
    row-gap: 4px;
    min-width: 0;
  }

  .model-pill-tag {
    color: #93c5fd;
    background: rgba(59, 130, 246, 0.12);
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 10.5px;
    font-weight: 600;
    white-space: nowrap;
  }

  /* Cell 2: Contract & Capital */

  .cell-contract {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    overflow: hidden;
  }

  .contract-title {
    font-size: 12.5px;
    font-weight: 600;
    color: #e2e8f0;
    font-family: var(--font-mono);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .contract-sub {
    font-size: 11px;
    color: var(--text-dim, #94a3b8);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    column-gap: 6px;
    row-gap: 2px;
  }

  .capital-pill-val {
    color: #fbbf24;
    font-weight: 600;
    font-family: var(--font-mono);
  }

  /* Cell 3: Execution */

  .cell-exec {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-family: var(--font-mono);
  }

  .exec-main {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text, #f8fafc);
    display: flex;
    align-items: center;
    gap: 5px;
  }

  .exec-arrow {
    color: var(--text-mute, #94a3b8);
    font-size: 11px;
  }

  .exec-ltp { font-weight: 700; }

  .exec-ltp.profit { color: var(--profit, #10b981); }

  .exec-ltp.loss { color: var(--loss, #ef4444); }

  .exec-sub {
    font-size: 11px;
    color: var(--text-mute, #94a3b8);
    white-space: nowrap;
  }

  /* Cell 4: Dynamic Target Rail */

  .target-rail-container {
    width: 100%;
    max-width: 290px;
    display: flex;
    flex-direction: column;
    gap: 5px;
  }

  .rail-labels {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--text-mute, #94a3b8);
  }

  .rail-labels .label-sl { color: #f87171; }

  .rail-labels .label-t1 { color: #34d399; }

  .rail-labels .label-t2 { color: #10b981; }

  .rail-labels .label-t3 { color: #059669; }

  .rail-track {
    position: relative;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    display: flex;
    align-items: center;
  }

  .rail-fill {
    position: absolute;
    height: 100%;
    border-radius: 6px;
    transition: width 0.3s ease;
  }

  .rail-fill.profit { background: linear-gradient(90deg, #10b981 0%, #34d399 100%); }

  .rail-fill.loss { background: linear-gradient(90deg, #ef4444 0%, #f87171 100%); }

  .rail-milestone {
    position: absolute;
    width: 2px;
    height: 10px;
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(-50%);
  }

  .rail-milestone.entry {
    background: #cbd5e1;
    height: 12px;
    width: 3px;
    border-radius: 1px;
  }

  .rail-milestone.hit {
    background: #10b981;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  }

  .rail-pin-current {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent-action);
    border: 2px solid #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    transform: translate(-50%, -50%);
    top: 50%;
    z-index: 2;
    transition: left 0.3s ease;
  }

  .rail-pin-current.pulse { animation: livePulseRail 1.8s infinite; }

  @keyframes livePulseRail {
  0% { box-shadow: 0 0 0 0 rgba(10, 132, 255, 0.7); }
  70% { box-shadow: 0 0 0 6px rgba(10, 132, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(10, 132, 255, 0); }
}

  .rail-caption {
    font-size: 11px;
    font-family: var(--font-mono);
    color: var(--text-dim, #94a3b8);
    display: flex;
    justify-content: space-between;
  }

  /* Cell 5: Net PnL & R */

  .cell-pnl-r {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .r-hero-val {
    font-size: 14.5px;
    font-weight: 800;
    font-family: var(--font-mono);
    letter-spacing: -0.01em;
  }

  .r-hero-val.profit { color: var(--profit, #10b981); }

  .r-hero-val.loss { color: var(--loss, #ef4444); }

  .r-hero-val.neutral { color: var(--text-dim, #94a3b8); }

  .pnl-sub-val {
    font-size: 11px;
    color: var(--text-dim, #94a3b8);
    font-family: var(--font-mono);
  }

  /* Cell 6: Status Outcome */

  .status-pill-modern {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 7px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    white-space: nowrap;
  }

  .status-pill-modern.live {
    background: rgba(10, 132, 255, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(10, 132, 255, 0.3);
  }

  .status-pill-modern.runner {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
  }

  .status-pill-modern.sl {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
  }

  .status-pill-modern.be {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
  }

  /* Cell 7: Action Button */

  .btn-action-pro {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text-dim, #94a3b8);
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
  }

  .btn-action-pro:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--text, #f8fafc);
    border-color: rgba(255, 255, 255, 0.2);
  }

  .btn-action-pro.close-live {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    color: #fca5a5;
  }

  .btn-action-pro.close-live:hover {
    background: rgba(239, 68, 68, 0.25);
    color: #fff;
  }

  /* ================================================================
   PANORAMIC DYNAMIC TARGET RAIL (FOR MODAL)
   ================================================================ */

  .panoramic-rail-card {
    background: rgba(11, 21, 40, 0.45);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
  }

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

  .rail-card-title {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--text-dim, #94a3b8);
    text-transform: uppercase;
  }

  .rail-telemetry-badge {
    background: rgba(10, 132, 255, 0.15);
    border: 1px solid rgba(10, 132, 255, 0.3);
    color: #93c5fd;
    font-size: 11px;
    font-weight: 600;
    font-family: var(--font-mono);
    padding: 2px 8px;
    border-radius: 4px;
  }

  .panoramic-track-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px 6px;
  }

  .pano-labels-top {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    font-weight: 700;
    font-family: var(--font-mono);
  }

  .pano-track {
    position: relative;
    height: 10px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    display: flex;
    align-items: center;
  }

  .pano-fill {
    position: absolute;
    height: 100%;
    border-radius: 8px;
    background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
    transition: width 0.3s ease;
  }

  .pano-pin-node {
    position: absolute;
    transform: translate(-50%, -50%);
    top: 50%;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: left 0.3s ease;
  }

  .pano-pin-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent-action);
    border: 2px solid #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    animation: none;
  }

  @keyframes livePulsePano {
  0% { box-shadow: 0 0 0 0 rgba(10, 132, 255, 0.8); }
  70% { box-shadow: 0 0 0 8px rgba(10, 132, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(10, 132, 255, 0); }
}

  .pano-tick-mark {
    position: absolute;
    width: 2px;
    height: 16px;
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(-50%);
  }

  .pano-tick-mark.entry {
    background: #cbd5e1;
    width: 3px;
    height: 18px;
  }

  .pano-labels-bottom {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-dim, #94a3b8);
    font-family: var(--font-mono);
  }

  .tactical-stats-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.05));
  }

  .tactical-chip {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.05));
    padding: 8px 10px;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .tactical-chip .lbl {
    font-size: 11px;
    color: var(--text-mute, #94a3b8);
    text-transform: uppercase;
    font-weight: 600;
  }

  .tactical-chip .val {
    font-size: 11.5px;
    color: var(--text, #f8fafc);
    font-family: var(--font-mono);
    font-weight: 700;
  }

  /* ================================================================
   BENTO MODAL GRIDS & FINANCIAL RECEIPT
   ================================================================ */

  .dossier-bento-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }

  .dossier-bento-card {
    background: rgba(11, 21, 40, 0.35);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .dossier-bento-title {
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--text-dim, #94a3b8);
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .dossier-receipt-table {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 11.5px;
    font-family: var(--font-mono);
  }

  .dossier-receipt-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.05));
  }

  .dossier-receipt-row.highlight {
    background: rgba(16, 185, 129, 0.08);
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid rgba(16, 185, 129, 0.2);
    margin-top: 4px;
  }

  .dossier-receipt-label { color: var(--text-mute, #94a3b8); }

  .dossier-receipt-val { font-weight: 600; color: var(--text, #f8fafc); }

  .dossier-receipt-val.profit { color: #10b981; }

  .dossier-receipt-val.chg { color: #f59e0b; }

  .dossier-spectrum-wrapper {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .dossier-spectrum-bar {
    position: relative;
    height: 10px;
    border-radius: 5px;
    display: flex;
    overflow: hidden;
  }

  .dossier-spectrum-seg { height: 100%; flex: 1; }

  .dossier-seg-l4 { background: #e11d48; }

  .dossier-seg-l3 { background: #f43f5e; opacity: 0.8; }

  .dossier-seg-piv { background: #94a3b8; opacity: 0.5; }

  .dossier-seg-h3 { background: #10b981; opacity: 0.8; }

  .dossier-seg-h4 { background: #059669; }

  .dossier-spectrum-pointer {
    position: absolute;
    top: -4px;
    bottom: -4px;
    width: 4px;
    background: #fff;
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    transform: translateX(-50%);
    transition: left 0.3s ease;
  }

  .dossier-spectrum-legend {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-mute, #94a3b8);
    font-family: var(--font-mono);
  }

  @media (max-width: 900px) {
    .dossier-bento-grid { grid-template-columns: 1fr; }

    .tactical-stats-strip { grid-template-columns: repeat(2, 1fr); }
  }

  /* ==============================================================
   PRO MOBILE CARD ARCHITECTURE (SNIPER, MONTE & CORE)
   ============================================================== */

  .qm3-mobile-ledger-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
  }

  .m3-pro-card {
    position: relative;
    background: linear-gradient(145deg, rgba(13, 20, 36, 0.95), rgba(8, 12, 22, 0.98));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 14px 14px 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
    display: flex;
    flex-direction: column;
    gap: 12px;
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
  }

  .m3-pro-card:active { transform: scale(0.985); }

  .m3-pro-card.is-live {
    border-color: rgba(14, 165, 233, 0.45);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  }

  .m3-pro-card.is-live::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #38bdf8, #818cf8);
  }

  .m3-pro-card.is-win { border-left: 1px solid var(--border, rgba(255,255,255,0.1)); }

  .m3-pro-card.is-loss { border-left: 1px solid var(--border, rgba(255,255,255,0.1)); }

  .m3-pro-card.is-be { border-left: 1px solid var(--border, rgba(255,255,255,0.1)); }

  /* Card Header: Strike, Direction, Model, Capital */

  .m3-pro-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
  }

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

  .m3-card-title-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
  }

  .m3-card-symbol {
    font-size: 14px;
    font-weight: 800;
    color: #fff;
    letter-spacing: 0.02em;
  }

  .m3-card-tf-pill {
    font-size: 11px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.08);
    color: #94a3b8;
    font-family: var(--font-mono);
  }

  .m3-card-contract-sub {
    font-size: 11px;
    font-family: var(--font-mono);
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
  }

  .m3-card-capital-pill {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-end;
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.3);
    padding: 4px 8px;
    border-radius: 8px;
    flex-shrink: 0;
  }

  .m3-card-capital-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #818cf8;
    letter-spacing: 0.04em;
  }

  .m3-card-capital-val {
    font-size: 12.5px;
    font-weight: 800;
    font-family: var(--font-mono);
    color: #f8fafc;
  }

  /* Mobile Dynamic Target Rail */

  .m3-card-rail-section {
    background: rgba(4, 8, 18, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 10px 10px 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  .m3-rail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    font-family: var(--font-mono);
  }

  .m3-rail-title {
    font-weight: 700;
    letter-spacing: 0.05em;
    color: #94a3b8;
    text-transform: uppercase;
  }

  .m3-rail-track-container {
    position: relative;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    margin: 10px 4px 6px;
  }

  .m3-rail-fill {
    position: absolute;
    top: 0;
    bottom: 0;
    border-radius: 3px;
    transition: width 0.3s ease;
  }

  .m3-rail-fill.target {
    left: 22.2%;
    background: linear-gradient(90deg, #10b981, #06b6d4);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  }

  .m3-rail-fill.invalidation {
    right: 77.8%;
    background: linear-gradient(270deg, #f43f5e, #e11d48);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  }

  .m3-rail-marker {
    position: absolute;
    top: -3px;
    width: 2px;
    height: 12px;
    background: rgba(255, 255, 255, 0.25);
    transform: translateX(-50%);
    z-index: 2;
  }

  .m3-rail-marker.marker-entry {
    background: rgba(255, 255, 255, 0.7);
    width: 2px;
  }

  .m3-rail-marker.marker-sl { background: #f43f5e; }

  .m3-rail-marker.marker-target { background: #10b981; }

  .m3-rail-pin {
    position: absolute;
    top: 50%;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: 4;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    transition: left 0.3s ease;
  }

  .m3-rail-pin.pulse { animation: pinPulse 1.8s infinite ease-in-out; }

  @keyframes pinPulse {
  0% { transform: translate(-50%, -50%) scale(1); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); }
  50% { transform: translate(-50%, -50%) scale(1.3); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); }
  100% { transform: translate(-50%, -50%) scale(1); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); }
}

  .m3-rail-labels-row {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    font-family: var(--font-mono);
    color: #94a3b8;
    margin-top: 2px;
  }

  .m3-rail-labels-row span {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .m3-rail-labels-row strong {
    color: #cbd5e1;
    font-size: 11px;
    font-weight: 700;
  }

  /* Card Body & Footer: Execution levels & Dominant P&L */

  .m3-pro-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding-top: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
  }

  .m3-card-execution-summary {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-family: var(--font-mono);
    font-size: 11px;
  }

  .m3-card-exec-line {
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 4px;
  }

  .m3-card-exec-line strong { color: #f1f5f9; }

  .m3-card-pnl-cluster {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
  }

  .m3-card-r-badge {
    font-size: 13.5px;
    font-weight: 800;
    font-family: var(--font-mono);
    padding: 3px 8px;
    border-radius: 6px;
    letter-spacing: 0.02em;
  }

  .m3-card-r-badge.is-win {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
  }

  .m3-card-r-badge.is-loss {
    background: rgba(244, 63, 94, 0.15);
    color: #f43f5e;
    border: 1px solid rgba(244, 63, 94, 0.3);
  }

  .m3-card-r-badge.is-active {
    background: rgba(14, 165, 233, 0.15);
    color: #38bdf8;
    border: 1px solid rgba(14, 165, 233, 0.3);
  }

  .m3-card-pnl-rupees {
    font-size: 11px;
    font-weight: 700;
    font-family: var(--font-mono);
    color: #94a3b8;
  }

  .m3-card-outcome-tag {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 1px 6px;
    border-radius: 4px;
  }

  /* ==============================================================
   7-COLUMN PRO TABLE STYLING FOR CORE
   ============================================================== */

  .table-core-pro {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
  }

  .table-core-pro th {
    padding: 12px 14px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--text-mute, #94a3b8);
    text-transform: uppercase;
    border-bottom: 1px solid var(--border);
    background: rgba(4, 8, 18, 0.7);
  }

  .table-core-pro td {
    padding: 12px 14px;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.05));
  }

  .table-core-pro tr:hover { background: rgba(255, 255, 255, 0.02); }
}

/* iPhone Dynamic Island / notch safe-area top padding */
@media (max-width: 768px) {
  body {
    padding-top: max(0px, calc(env(safe-area-inset-top, 0px) - 22px));
  }
  .top-header {
    flex-direction: row-reverse;
  }
  #tab-analytics,
  #tab-analytics .card,
  #tab-analytics .chart-container,
  #tab-analytics [class*="grid"] > div {
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
  }
  #tab-analytics canvas {
    max-width: 100% !important;
  }
}
