    :root {
      /* ── Surfaces ─ four-layer system, calmer contrast steps ────────── */
      --bg:           #0a0b0e;
      --bg-surface:   #101116;
      --bg-elevated:  #15171d;
      --bg-hot:       #1b1d25;
      --bg-overlay:   rgba(10,11,14,0.72);

      /* ── Borders ─ subtle by default, strong only when truly needed ── */
      --border:        #1d1f27;
      --border-soft:   #16181f;
      --border-strong: #2a2d38;

      /* ── Text ─ tighter contrast ladder ─────────────────────────────── */
      --text:        #ecedf1;
      --text-dim:    #a8abb6;
      --text-mute:   #6a6e7c;
      --text-faint:  #45495a;

      /* ── Accent ─ premium institutional blue. Gold reserved for KPI
            value emphasis (account balance, PnL, etc.) — NOT for chrome. */
      --accent:        #6b8afd;
      --accent-soft:   rgba(107,138,253,0.14);
      --accent-line:   rgba(107,138,253,0.28);
      --accent-strong: #8aa3ff;

      --gold:        #d4b86a;
      --gold-soft:   rgba(212,184,106,0.12);

      /* ── Semantic ─ bullish / bearish / warn / info ─────────────────── */
      --bull:        #4ec38a;
      --bull-soft:   rgba(78,195,138,0.12);
      --bull-line:   rgba(78,195,138,0.28);
      --bear:        #e26464;
      --bear-soft:   rgba(226,100,100,0.12);
      --bear-line:   rgba(226,100,100,0.28);
      --warn:        #f2b341;
      --warn-soft:   rgba(242,179,65,0.12);
      --warn-line:   rgba(242,179,65,0.28);
      --liq:         var(--warn);
      --info:        var(--accent);
      --info-soft:   var(--accent-soft);

      /* ── Spacing scale ──────────────────────────────────────────────── */
      --space-1:  4px;
      --space-2:  8px;
      --space-3:  12px;
      --space-4:  16px;
      --space-5:  20px;
      --space-6:  24px;
      --space-8:  32px;
      --space-10: 40px;
      --space-12: 56px;

      /* ── Radii ─ one radius for cards, one for chips, one for buttons ─ */
      --r-chip:    6px;
      --r-btn:     8px;
      --r-card:    12px;
      --r-hero:    16px;
      --r-pill:    999px;

      /* ── Shadows ─ very soft, layered ───────────────────────────────── */
      --shadow-card:  0 1px 0 rgba(255,255,255,0.02) inset, 0 8px 24px rgba(0,0,0,0.25);
      --shadow-hero:  0 1px 0 rgba(255,255,255,0.03) inset, 0 16px 48px rgba(0,0,0,0.35);
      --shadow-pop:   0 12px 36px rgba(0,0,0,0.45);

      /* ── Type scale ─────────────────────────────────────────────────── */
      --fs-display:  32px;   /* page hero */
      --fs-title:    22px;   /* section title */
      --fs-h3:       16px;   /* card title (display) */
      --fs-body:     14px;   /* default body */
      --fs-meta:     12px;   /* helper / metadata */
      --fs-micro:    10px;   /* uppercase tracked labels */
      --fs-kpi-lg:   28px;   /* primary KPI value */
      --fs-kpi:      18px;   /* secondary KPI value */

      --lh-tight:   1.2;
      --lh-snug:    1.4;
      --lh-normal:  1.55;

      --font-display: 'Instrument Serif', serif;
      --font-ui:      'Geist', system-ui, sans-serif;
      --font-mono:    'JetBrains Mono', ui-monospace, monospace;

      /* ── Motion ─────────────────────────────────────────────────────── */
      --t-fast:   120ms;
      --t-base:   180ms;
      --t-slow:   260ms;
      --ease:     cubic-bezier(0.2, 0.7, 0.2, 1);
    }

    * { margin: 0; padding: 0; box-sizing: border-box; }
    /* overflow-x: hidden on both root and body kills any phantom
       horizontal scroll caused by deep-nested children that exceed the
       viewport (e.g. inline min-widths inside modals/filters). */
    html { scroll-behavior: smooth; overflow-x: hidden; }
    body {
      overflow-x: hidden;
      max-width: 100vw;
      background: var(--bg);
      color: var(--text);
      font-family: var(--font-ui);
      font-size: var(--fs-body);
      line-height: var(--lh-normal);
      font-weight: 400;
      font-feature-settings: 'ss01','ss02','cv11';
      -webkit-font-smoothing: antialiased;
      -moz-osx-font-smoothing: grayscale;
    }

    /* Layered ambient background — extremely subtle radial wash so the
       page doesn't feel like a flat black wall. Doesn't compete with cards. */
    body::before {
      content: '';
      position: fixed; inset: 0;
      background:
        radial-gradient(1200px 600px at 80% -10%, rgba(107,138,253,0.05), transparent 60%),
        radial-gradient(800px 500px at -10% 60%, rgba(212,184,106,0.025), transparent 60%);
      pointer-events: none;
      z-index: 0;
    }
    .shell, .autopilot-bar { position: relative; z-index: 1; }

    /* ═══════════════════════════════════
       AUTOPILOT TOP BAR
    ═══════════════════════════════════ */
    .autopilot-bar {
      position: fixed;
      top: 0; left: 0; right: 0;
      /* iOS standalone (Add to Home Screen) + viewport-fit=cover puts the
         top of the viewport behind the status bar / Dynamic Island. Extend
         the bar's painted height by the inset and pad content down by the
         same amount so the bar reads full-height *below* the notch. */
      height: calc(56px + env(safe-area-inset-top));
      padding-top: env(safe-area-inset-top);
      padding-left: env(safe-area-inset-left);
      padding-right: env(safe-area-inset-right);
      background: rgba(10,11,14,0.78);
      border-bottom: 1px solid var(--border-soft);
      display: flex;
      align-items: center;
      gap: 0;
      z-index: 100;
      backdrop-filter: blur(18px) saturate(140%);
      -webkit-backdrop-filter: blur(18px) saturate(140%);
    }

    /* Topbar segment — no hard borders, subtle dot dividers between meaningful
       groups (added via .ap-segment + .ap-segment::before). Calmer, less
       "cockpit panel". */
    .ap-segment {
      display: flex;
      align-items: center;
      gap: var(--space-2);
      padding: 0 var(--space-5);
      height: 100%;
      font-family: var(--font-mono);
      font-size: var(--fs-meta);
      position: relative;
    }
    .ap-segment + .ap-segment::before {
      content: '';
      position: absolute;
      left: 0; top: 50%;
      width: 1px; height: 22px;
      background: var(--border-soft);
      transform: translateY(-50%);
    }

    .ap-label {
      color: var(--text-mute);
      font-size: var(--fs-micro);
      text-transform: uppercase;
      letter-spacing: 0.12em;
      font-weight: 500;
    }

    /* Topbar values are NOT gold anymore. Plain text reads cleaner; specific
       semantic states (PnL up/down) carry the color, not the label itself. */
    .ap-value {
      font-weight: 600;
      color: var(--text);
      letter-spacing: 0.01em;
    }
    .ap-value.is-bull { color: var(--bull); }
    .ap-value.is-bear { color: var(--bear); }
    .ap-value.is-warn { color: var(--warn); }
    .ap-value.is-accent { color: var(--accent-strong); }

    .session-badge {
      padding: 4px 10px;
      border-radius: var(--r-chip);
      font-size: var(--fs-micro);
      font-weight: 600;
      font-family: var(--font-mono);
      letter-spacing: 0.08em;
      text-transform: uppercase;
      background: var(--accent-soft);
      color: var(--accent-strong);
      border: 1px solid transparent;
    }

    .sync-dot {
      width: 7px; height: 7px;
      border-radius: 50%;
      background: var(--bull);
      box-shadow: 0 0 0 3px rgba(78,195,138,0.16);
      animation: pulse 2s infinite;
    }
    @keyframes pulse {
      0%, 100% { opacity: 1; }
      50% { opacity: 0.35; }
    }

    .ap-brand {
      flex: 1;
      padding: 0 var(--space-5);
      display: flex;
      align-items: center;
      gap: var(--space-3);
    }
    .ap-brand .logo {
      font-family: var(--font-display);
      font-size: 20px;
      letter-spacing: -0.01em;
      color: var(--text);
      background: linear-gradient(180deg, #f3f0e6 0%, #d4b86a 100%);
      -webkit-background-clip: text;
      background-clip: text;
      -webkit-text-fill-color: transparent;
    }
    .ap-brand .v { color: var(--text-faint); font-size: var(--fs-micro); font-family: var(--font-mono); letter-spacing: 0.08em; }

    /* ═══════════════════════════════════
       LAYOUT
    ═══════════════════════════════════ */
    .shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; padding-top: 56px; }

    nav.side {
      position: sticky; top: 56px; height: calc(100vh - 56px); overflow-y: auto;
      background:
        linear-gradient(180deg, rgba(255,255,255,0.012) 0%, transparent 200px),
        var(--bg-surface);
      border-right: 1px solid var(--border-soft);
      padding: var(--space-5) 0 var(--space-8);
      z-index: 10;
      scrollbar-width: thin;
      scrollbar-color: rgba(107,138,253,0.18) transparent;
    }
    nav.side::-webkit-scrollbar { width: 6px; }
    nav.side::-webkit-scrollbar-track { background: transparent; }
    nav.side::-webkit-scrollbar-thumb {
      background: rgba(107,138,253,0.18);
      border-radius: 3px;
    }
    nav.side::-webkit-scrollbar-thumb:hover { background: rgba(107,138,253,0.4); }

    .brand {
      padding: 0 var(--space-5) var(--space-5);
      border-bottom: 1px solid var(--border-soft);
      margin-bottom: var(--space-4);
    }
    .brand .logo {
      font-family: var(--font-display);
      font-size: 24px;
      letter-spacing: -0.01em;
      background: linear-gradient(180deg, #f3f0e6 0%, #d4b86a 100%);
      -webkit-background-clip: text;
      background-clip: text;
      -webkit-text-fill-color: transparent;
    }
    .brand .sub {
      font-family: var(--font-mono);
      font-size: var(--fs-micro);
      color: var(--text-faint);
      margin-top: 6px;
      letter-spacing: 0.18em;
      text-transform: uppercase;
      font-weight: 500;
    }

    /* Visual section group label (e.g. "Navigation", "Watchlist"). Used to
       break the long sidebar into scannable groups instead of one long list. */
    .side-group-label {
      padding: var(--space-4) var(--space-5) var(--space-2);
      font-family: var(--font-mono);
      font-size: 10px;
      color: var(--text-faint);
      text-transform: uppercase;
      letter-spacing: 0.16em;
      font-weight: 500;
    }

    .side-nav button {
      width: calc(100% - 16px);
      margin: 0 var(--space-2) 2px;
      padding: 9px 12px;
      background: transparent;
      border: none;
      border-radius: var(--r-btn);
      color: var(--text-dim);
      font-family: var(--font-ui);
      font-size: 13px;
      font-weight: 500;
      letter-spacing: 0.005em;
      text-align: left;
      cursor: pointer;
      transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
      position: relative;
    }
    .side-nav button:hover {
      background: var(--bg-hot);
      color: var(--text);
    }
    /* Active nav uses a left accent bar (institutional pattern), not a
       gold border box. Background is a soft accent tint, text is full white. */
    .side-nav button.active {
      background: var(--accent-soft);
      color: var(--text);
      font-weight: 600;
    }
    .side-nav button.active::before {
      content: '';
      position: absolute;
      left: -2px; top: 8px; bottom: 8px;
      width: 3px;
      background: var(--accent-strong);
      border-radius: 0 2px 2px 0;
    }

    /* Expandable Live Chart section in sidebar */
    .side-nav-section { display: block; }
    .side-nav-toggle::after {
      content: '›';
      float: right;
      font-size: 16px;
      opacity: 0.5;
      transition: transform var(--t-base) var(--ease);
      line-height: 1;
      margin-top: 1px;
    }
    .side-nav-toggle.expanded::after { transform: rotate(90deg); opacity: 1; }
    .side-nav-children {
      display: none;
      margin: 0 var(--space-3) var(--space-2) var(--space-3);
      padding: var(--space-2) 0 var(--space-2) var(--space-3);
      border-left: 1px solid var(--border-soft);
      max-height: 320px;
      overflow-y: auto;
      scrollbar-width: thin;
      scrollbar-color: rgba(107,138,253,0.18) transparent;
    }
    .side-nav-children.expanded { display: block; }
    .side-nav-children::-webkit-scrollbar { width: 5px; }
    .side-nav-children::-webkit-scrollbar-track { background: transparent; }
    .side-nav-children::-webkit-scrollbar-thumb {
      background: rgba(107,138,253,0.18);
      border-radius: 3px;
    }
    .side-nav-children::-webkit-scrollbar-thumb:hover { background: rgba(107,138,253,0.4); }

    .side-search-asset {
      display: block;
      width: 100%;
      margin: 0 0 var(--space-2);
      padding: 7px 10px;
      background: rgba(255,255,255,0.04);
      border: 1px solid var(--border-strong);
      border-radius: var(--r-btn);
      color: var(--text);
      font-family: var(--font-mono);
      font-size: var(--fs-meta);
      font-weight: 600;
      letter-spacing: 0.04em;
      text-align: left;
      cursor: pointer;
      transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
    }
    .side-search-asset:hover {
      background: rgba(255,255,255,0.08);
      border-color: var(--accent-line);
      color: var(--accent-strong);
    }

    /* Standalone "+ Add asset" — replaces the old 4-icon toolbar inside the
       Live Chart dropdown. One clear action, no clutter. */
    .side-add-asset {
      display: block;
      width: 100%;
      margin: 0 0 var(--space-2);
      padding: 7px 10px;
      background: var(--accent-soft);
      border: 1px dashed var(--accent-line);
      border-radius: var(--r-btn);
      color: var(--accent-strong);
      font-family: var(--font-mono);
      font-size: var(--fs-meta);
      font-weight: 600;
      letter-spacing: 0.04em;
      text-align: left;
      cursor: pointer;
      transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
    }
    .side-add-asset:hover {
      background: rgba(107,138,253,0.22);
      border-color: var(--accent-strong);
    }

    /* Asset row in sidebar dropdown — scoped under .side-nav to override the
       broad .side-nav button cascade. */
    .side-nav .side-asset-group {
      margin: 12px 0 5px 0;
      color: var(--text-mute);
      font-family: 'JetBrains Mono', monospace;
      font-size: 9px;
      letter-spacing: 0.12em;
      text-transform: uppercase;
    }

    .side-nav .side-asset-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 6px;
      width: 100%;
      margin: 0 0 2px 0;
      padding: 7px 10px;
      background: transparent;
      border: 1px solid transparent;
      border-radius: 5px;
      color: var(--text-dim);
      font-size: 12px;
      text-align: left;
      cursor: pointer;
      transition: all 0.15s;
      font-family: inherit;
    }
    .side-nav .side-asset-row:hover {
      background: var(--bg-hot);
      color: var(--text);
    }
    .side-nav .side-asset-row.active {
      background: rgba(201,169,97,0.12);
      border-color: rgba(201,169,97,0.4);
      color: var(--gold);
    }
    /* Mobile picker rows are outside .side-nav, so re-state base styles */
    .mobile-asset-picker .side-asset-row {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 8px 12px;
      background: var(--bg-elevated);
      border: 1px solid var(--border);
      border-radius: 6px;
      color: var(--text-dim);
      font-size: 12px;
      cursor: pointer;
      flex: 0 0 auto;
      white-space: nowrap;
    }
    .mobile-asset-picker .side-asset-row.active {
      background: rgba(201,169,97,0.12);
      border-color: rgba(201,169,97,0.4);
      color: var(--gold);
    }
    .mobile-asset-picker .side-asset-group {
      align-self: center;
      color: var(--text-mute);
      flex: 0 0 auto;
      font-family: 'JetBrains Mono', monospace;
      font-size: 9px;
      letter-spacing: 0.08em;
      text-transform: uppercase;
    }

    .side-asset-row .sym {
      font-family: 'JetBrains Mono', monospace;
      font-weight: 700;
      font-size: 12px;
      letter-spacing: 0.04em;
    }
    .side-asset-row .meta {
      display: flex;
      gap: 4px;
      align-items: center;
    }
    .side-asset-row .meta .asset-bias,
    .side-asset-row .meta .asset-grade,
    .side-asset-row .meta .side-mode-badge,
    .side-asset-row .meta .side-zone-badge {
      font-size: 8px;
      padding: 2px 6px;
      margin: 0;
      line-height: 1.3;
      border-radius: 3px;
      font-weight: 700;
      letter-spacing: 0.04em;
    }
    .side-mode-badge.mode-fut {
      background: rgba(92,184,138,0.15);
      color: var(--bull);
    }
    .side-mode-badge.mode-spot {
      background: rgba(101,101,109,0.15);
      color: var(--text-mute);
    }
    /* AT BUY / AT SELL pulse so the user notices the actionable moments
       without needing the futures-style overlay; NEAR is calmer. */
    .side-zone-badge.zone-buy-at {
      background: rgba(201,169,97,0.28);
      color: var(--gold);
      animation: zone-pulse 1.6s ease-in-out infinite;
    }
    .side-zone-badge.zone-buy-near {
      background: rgba(201,169,97,0.12);
      color: var(--gold);
    }
    .side-zone-badge.zone-sell-at {
      background: rgba(92,184,138,0.28);
      color: var(--bull);
      animation: zone-pulse 1.6s ease-in-out infinite;
    }
    .side-zone-badge.zone-sell-near {
      background: rgba(92,184,138,0.12);
      color: var(--bull);
    }
    .side-asset-remove {
      border: 0;
      background: rgba(255,255,255,0.06);
      color: var(--text-mute);
      border-radius: 999px;
      min-width: 18px;
      height: 18px;
      padding: 0 5px;
      font-size: 10px;
      font-weight: 700;
      line-height: 18px;
      cursor: pointer;
      transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
    }
    .side-asset-remove:hover {
      background: rgba(226,100,100,0.18);
      color: var(--bear);
    }

    .asset-command-overlay {
      position: fixed;
      inset: 0;
      z-index: 5500;
      background: rgba(0,0,0,0.72);
      display: flex;
      align-items: flex-start;
      justify-content: center;
      padding: max(72px, env(safe-area-inset-top)) 16px 16px;
      backdrop-filter: blur(10px);
      -webkit-backdrop-filter: blur(10px);
    }
    .asset-command-box {
      width: min(720px, 100%);
      background: var(--bg-elevated);
      border: 1px solid var(--border-strong);
      border-radius: 14px;
      box-shadow: var(--shadow-pop);
      overflow: hidden;
    }
    .asset-command-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      padding: 16px 18px 10px;
    }
    .asset-command-title {
      font-size: 18px;
      font-weight: 700;
      color: var(--text);
    }
    .asset-command-sub {
      font-size: 12px;
      color: var(--text-mute);
      margin-top: 2px;
    }
    .asset-command-close {
      border: 1px solid var(--border-strong);
      background: rgba(255,255,255,0.04);
      color: var(--text-mute);
      border-radius: 999px;
      padding: 5px 10px;
      font: 600 11px var(--font-mono);
      cursor: pointer;
    }
    .asset-command-input {
      width: calc(100% - 24px);
      margin: 0 12px 12px;
      padding: 14px 16px;
      border-radius: 10px;
      border: 1px solid var(--border-strong);
      background: rgba(255,255,255,0.03);
      color: var(--text);
      font: 600 14px var(--font-ui);
      outline: none;
    }
    .asset-command-input:focus {
      border-color: var(--accent-line);
      box-shadow: 0 0 0 1px rgba(107,138,253,0.18);
    }
    .asset-command-results {
      max-height: min(60vh, 520px);
      overflow-y: auto;
      padding: 0 8px 10px;
    }
    .asset-command-section {
      padding: 10px 10px 6px;
      color: var(--text-mute);
      font: 600 10px var(--font-mono);
      letter-spacing: 0.1em;
      text-transform: uppercase;
    }
    .asset-command-item {
      width: 100%;
      border: 0;
      border-radius: 10px;
      background: transparent;
      color: var(--text);
      text-align: left;
      padding: 12px 10px;
      display: flex;
      flex-direction: column;
      gap: 2px;
      cursor: pointer;
    }
    .asset-command-item:hover {
      background: rgba(255,255,255,0.05);
    }
    .asset-command-item.add .asset-command-main {
      color: var(--accent-strong);
    }
    .asset-command-main {
      font: 700 13px var(--font-mono);
      letter-spacing: 0.03em;
    }
    .asset-command-meta {
      color: var(--text-mute);
      font-size: 11px;
    }
    .asset-command-empty {
      padding: 16px 12px 18px;
      color: var(--text-mute);
      font-size: 12px;
    }

    /* Asset Intel sheet — opened from the ⌘K palette. Shares the palette
       overlay; the box is taller and scrolls. */
    .asset-intel-box {
      width: min(780px, 100%);
      max-height: calc(100vh - 100px);
      overflow-y: auto;
      background: var(--bg-elevated);
      border: 1px solid var(--border-strong);
      border-radius: 14px;
      box-shadow: var(--shadow-pop);
      padding: 18px 20px 20px;
    }
    .asset-intel-box .bull { color: var(--bull); }
    .asset-intel-box .bear { color: var(--bear); }
    .asset-intel-box .gold { color: var(--gold); }
    .asset-intel-box .mute { color: var(--text-mute); }
    .ai-head {
      display: flex;
      align-items: flex-start;
      gap: 14px;
    }
    .ai-head > div:first-child { flex: 1; }
    .ai-symbol {
      font: 700 22px var(--font-mono);
      letter-spacing: 0.02em;
      color: var(--text);
    }
    .ai-name {
      font: 500 13px var(--font-ui);
      color: var(--text-mute);
      margin-left: 6px;
    }
    .ai-platform {
      font-size: 11px;
      color: var(--text-mute);
      margin-top: 2px;
    }
    .ai-head-right { text-align: right; }
    .ai-price {
      font: 700 20px var(--font-mono);
      color: var(--text);
    }
    .ai-change { font: 600 11px var(--font-mono); }
    .ai-badges {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      margin: 10px 0 4px;
    }
    .ai-badge {
      font: 600 10px var(--font-mono);
      letter-spacing: 0.06em;
      padding: 3px 8px;
      border-radius: 999px;
      border: 1px solid var(--border-strong);
      color: var(--text-dim);
    }
    .ai-badge.bull { border-color: rgba(78,195,138,0.35); }
    .ai-badge.bear { border-color: rgba(226,100,100,0.35); }
    .ai-badge.gold { border-color: rgba(212,184,106,0.35); }
    .ai-section {
      margin-top: 14px;
      padding: 12px 14px;
      border: 1px solid var(--border);
      border-radius: 10px;
      background: rgba(255,255,255,0.02);
    }
    .ai-section.strategy {
      border-color: var(--accent-line);
      background: var(--accent-soft);
    }
    .ai-section-title {
      font: 600 10px var(--font-mono);
      letter-spacing: 0.1em;
      text-transform: uppercase;
      color: var(--text-mute);
      margin-bottom: 8px;
    }
    .ai-strategy-title {
      font: 700 14px var(--font-ui);
      color: var(--accent-strong);
    }
    .ai-strategy-why {
      font-size: 12px;
      color: var(--text-dim);
      line-height: 1.55;
      margin-top: 4px;
    }
    .ai-playbook { margin-top: 8px; }
    .ai-playbook-row {
      font: 500 11.5px var(--font-mono);
      color: var(--text-dim);
      line-height: 1.7;
    }
    .ai-lab {
      margin-top: 10px;
      padding-top: 8px;
      border-top: 1px dashed var(--border-strong);
    }
    .ai-lab-head {
      font: 600 10px var(--font-mono);
      letter-spacing: 0.06em;
      text-transform: uppercase;
      color: var(--gold);
      margin-bottom: 4px;
    }
    .ai-lab-row {
      font: 500 11px var(--font-mono);
      color: var(--text-mute);
      line-height: 1.6;
    }
    .ai-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 0 14px;
    }
    @media (max-width: 640px) {
      .ai-grid { grid-template-columns: 1fr; }
    }
    .ai-row {
      display: flex;
      justify-content: space-between;
      gap: 12px;
      font-size: 12px;
      color: var(--text-mute);
      line-height: 1.9;
    }
    .ai-row b {
      font: 600 11.5px var(--font-mono);
      color: var(--text);
      text-align: right;
    }
    .ai-tf-chips {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
    }
    .ai-tf-chip {
      font: 600 10.5px var(--font-mono);
      padding: 4px 8px;
      border-radius: 8px;
      border: 1px solid var(--border-strong);
      background: rgba(255,255,255,0.03);
    }
    .ai-note {
      font-size: 12px;
      color: var(--text-dim);
      line-height: 1.6;
    }
    .ai-note.watch { margin-top: 6px; color: var(--text-mute); }
    .ai-drivers { margin-top: 8px; }
    .ai-news-row {
      display: block;
      font-size: 12px;
      color: var(--text-dim);
      line-height: 1.5;
      padding: 6px 0;
      text-decoration: none;
      border-bottom: 1px solid var(--border);
    }
    .ai-news-row:last-child { border-bottom: 0; }
    .ai-news-row:hover { color: var(--text); }
    .ai-news-row span {
      display: block;
      font: 500 10px var(--font-mono);
      color: var(--text-mute);
      margin-top: 1px;
    }
    .ai-empty {
      font-size: 12px;
      color: var(--text-mute);
      padding: 4px 0;
    }
    .ai-actions {
      display: flex;
      gap: 10px;
      margin-top: 16px;
    }
    .ai-action {
      flex: 1;
      border: 1px solid var(--accent-line);
      background: var(--accent-soft);
      color: var(--accent-strong);
      border-radius: 10px;
      padding: 12px;
      font: 600 13px var(--font-ui);
      cursor: pointer;
      transition: background var(--t-fast) var(--ease);
    }
    .ai-action:hover { background: rgba(107,138,253,0.22); }
    @keyframes zone-pulse {
      0%, 100% { opacity: 1; }
      50%      { opacity: 0.55; }
    }

    /* Live-trading kill-switch — always-visible floating button anchored
       to the bottom-right. Bottom placement keeps it out of the top
       autopilot-bar (which would otherwise overlap the Sync segment) and
       matches the "slam this if something's wrong" mental model. OFF state
       is green/calm; ON state is red with a slow pulse so it's impossible
       to miss while auto-execution can fire. */
    #liveKillSwitch {
      position: fixed;
      right: 16px;
      bottom: 16px;
      z-index: 5000;
      padding: 8px 16px;
      border-radius: 999px;
      border: 2px solid var(--bull);
      background: rgba(92,184,138,0.18);
      color: var(--bull);
      font-family: 'JetBrains Mono', monospace;
      font-size: 12px;
      font-weight: 800;
      letter-spacing: 0.06em;
      cursor: pointer;
      box-shadow: 0 4px 14px rgba(0,0,0,0.35);
      user-select: none;
      transition: transform 0.12s ease, background 0.12s ease;
    }
    #liveKillSwitch:hover { transform: translateY(-2px); }
    #liveKillSwitch:active { transform: translateY(0); }
    #liveKillSwitch.live-on {
      background: rgba(224,93,93,0.92);
      border-color: var(--bear);
      color: white;
      box-shadow: 0 6px 28px rgba(224,93,93,0.55);
      animation: kill-switch-pulse 1.4s ease-in-out infinite;
    }
    @keyframes kill-switch-pulse {
      0%, 100% { box-shadow: 0 6px 28px rgba(224,93,93,0.55); }
      50%      { box-shadow: 0 6px 36px rgba(224,93,93,0.95); }
    }

    /* Server-side AZC trader kill switch — sits above the browser AUTO toggle. */
    #azcTraderSwitch {
      position: fixed;
      right: 16px;
      bottom: 64px;
      z-index: 5000;
      padding: 8px 16px;
      border-radius: 999px;
      border: 2px solid var(--text-mute);
      background: rgba(106,110,124,0.18);
      color: var(--text-dim);
      font-family: 'JetBrains Mono', monospace;
      font-size: 12px;
      font-weight: 800;
      letter-spacing: 0.06em;
      cursor: pointer;
      box-shadow: 0 4px 14px rgba(0,0,0,0.35);
      user-select: none;
      transition: transform 0.12s ease, background 0.12s ease;
    }
    #azcTraderSwitch:hover { transform: translateY(-2px); }
    #azcTraderSwitch.trader-on {
      background: rgba(78,195,138,0.18);
      border-color: var(--bull);
      color: var(--bull);
    }
    #azcTraderSwitch.trader-position {
      background: rgba(107,138,253,0.22);
      border-color: var(--accent-strong);
      color: var(--accent-strong);
      box-shadow: 0 6px 28px rgba(107,138,253,0.45);
    }
    #azcTraderSwitch.trader-stopped {
      background: rgba(226,100,100,0.18);
      border-color: var(--bear);
      color: var(--bear);
    }

    /* Mobile-only asset picker (horizontal scroll chips on live-chart tab) */
    .mobile-asset-picker {
      display: none;
      gap: 6px;
      overflow-x: auto;
      padding: 8px 4px 12px;
      margin-bottom: 12px;
      border-bottom: 1px solid var(--border);
      scrollbar-width: none;
    }
    .mobile-asset-picker::-webkit-scrollbar { display: none; }
    @media (max-width: 900px) {
      .mobile-asset-picker { display: flex; }
    }

    /* Live-chart empty hint — premium, calmer. No dashed border. */
    .live-chart-empty {
      background:
        radial-gradient(600px 300px at 50% 0%, rgba(107,138,253,0.05), transparent 70%),
        var(--bg-surface);
      border: 1px solid var(--border-soft);
      border-radius: var(--r-hero);
      padding: 96px 24px;
      text-align: center;
      margin-bottom: var(--space-5);
      box-shadow: var(--shadow-hero);
    }
    .live-chart-empty .icon {
      font-size: 48px;
      opacity: 0.28;
      margin-bottom: var(--space-5);
      filter: grayscale(0.2);
    }
    .live-chart-empty .title {
      font-family: var(--font-display);
      font-size: 26px;
      color: var(--text);
      margin-bottom: var(--space-2);
      letter-spacing: -0.015em;
    }
    .live-chart-empty .sub {
      font-size: var(--fs-meta);
      color: var(--text-mute);
      max-width: 440px;
      margin: 0 auto;
      line-height: var(--lh-normal);
    }
    .live-chart-empty .sub strong {
      color: var(--accent-strong);
      font-weight: 600;
    }

    main { padding: var(--space-8) var(--space-8); overflow-x: hidden; max-width: 1640px; }

    .tab-content { display: none; }
    .tab-content.active { display: block; }

    /* ═══════════════════════════════════
       PAGE HEADER — primary tab title with optional subtitle
    ═══════════════════════════════════ */
    .page-header {
      margin-bottom: var(--space-8);
      padding-bottom: var(--space-5);
      border-bottom: 1px solid var(--border-soft);
      display: flex;
      align-items: flex-end;
      justify-content: space-between;
      flex-wrap: wrap;
      gap: var(--space-4);
    }
    .page-header h1 {
      font-family: var(--font-display);
      font-size: var(--fs-display);
      color: var(--text);
      letter-spacing: -0.015em;
      line-height: var(--lh-tight);
      font-weight: 400;
    }
    .page-header p {
      color: var(--text-mute);
      font-size: var(--fs-meta);
      margin-top: var(--space-2);
      line-height: var(--lh-snug);
      max-width: 720px;
    }

    /* ═══════════════════════════════════
       AUTOPILOT TAB
    ═══════════════════════════════════ */
    .ap-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 16px;
      margin-bottom: 24px;
    }

    /* ── Card system ─ one radius, one padding, soft shadow, subtle border.
          Accent emphasis is a 2px left bar (via .ap-card.is-accent), NOT a
          gold border around the whole box. */
    .ap-card {
      background: var(--bg-elevated);
      border: 1px solid var(--border-soft);
      border-radius: var(--r-card);
      padding: var(--space-6);
      box-shadow: var(--shadow-card);
      position: relative;
    }

    .ap-card.full { grid-column: 1 / -1; }

    /* Backwards-compat: gold-border was the old "emphasis" treatment.
       Render it as a left accent bar instead of a full gold border so it
       reads as priority without shouting. */
    .ap-card.gold-border,
    .ap-card.is-accent {
      border-color: var(--border);
    }
    .ap-card.gold-border::before,
    .ap-card.is-accent::before {
      content: '';
      position: absolute;
      left: 0; top: 16px; bottom: 16px;
      width: 3px;
      background: linear-gradient(180deg, var(--gold), rgba(212,184,106,0.2));
      border-radius: 0 2px 2px 0;
    }

    .ap-card-title {
      font-family: var(--font-mono);
      font-size: var(--fs-micro);
      color: var(--text-mute);
      text-transform: uppercase;
      letter-spacing: 0.16em;
      font-weight: 600;
      margin-bottom: var(--space-4);
    }

    /* Sessions timeline */
    .session-timeline {
      display: flex;
      flex-direction: column;
      gap: 8px;
    }

    .session-row {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 8px 12px;
      border-radius: 6px;
      background: var(--bg);
      border: 1px solid var(--border);
      transition: all 0.3s;
    }

    .session-row.active-session {
      background: rgba(92,184,138,0.08);
      border-color: var(--bull);
    }

    .session-row.dead-zone {
      background: rgba(224,93,93,0.06);
      border-color: rgba(224,93,93,0.3);
    }

    .session-row.macro-session {
      background: rgba(242,179,61,0.08);
      border-color: rgba(242,179,61,0.4);
    }

    .session-dot {
      width: 8px; height: 8px;
      border-radius: 50%;
      flex-shrink: 0;
    }

    .session-name {
      flex: 1;
      font-size: 13px;
      color: var(--text-dim);
    }

    .session-time {
      font-family: 'JetBrains Mono', monospace;
      font-size: 11px;
      color: var(--text-mute);
    }

    .session-status-label {
      font-family: 'JetBrains Mono', monospace;
      font-size: 10px;
      font-weight: 700;
      padding: 2px 8px;
      border-radius: 3px;
    }

    /* Signal cards */
    .signals-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
      gap: 10px;
    }

    .signal-card {
      background: var(--bg);
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 14px;
      cursor: pointer;
      transition: all 0.25s;
    }
    .signal-card:hover { border-color: var(--gold); transform: translateY(-2px); }
    .signal-card.enter { border-color: var(--bear); background: rgba(224,93,93,0.07); animation: enterPulse 1.5s infinite; }
    .signal-card.armed { border-color: var(--bull); background: rgba(92,184,138,0.05); }
    .signal-card.watch { border-color: var(--liq); background: rgba(242,179,61,0.05); }
    .signal-card.skip { opacity: 0.5; }
    @keyframes enterPulse { 0%,100% { box-shadow: 0 0 0 rgba(224,93,93,0); } 50% { box-shadow: 0 0 14px rgba(224,93,93,0.35); } }

    .sig-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
    .sig-symbol { font-family: 'Instrument Serif', serif; font-size: 20px; color: var(--gold); }
    .sig-badge {
      font-family: 'JetBrains Mono', monospace;
      font-size: 10px;
      font-weight: 700;
      padding: 3px 8px;
      border-radius: 3px;
    }
    /* ── Status chips ─ semantic, no borders. Filled-low-opacity bg with
          a single dot on the left for "live state" chips. */
    .badge-enter { background: var(--bear-soft); color: var(--bear); font-weight: 700; letter-spacing: .03em; animation: enterPulse 1.2s infinite; }
    .badge-armed { background: var(--bull-soft); color: var(--bull); font-weight: 600; }
    .badge-watch { background: var(--warn-soft); color: var(--warn); font-weight: 600; }
    .badge-wait  { background: rgba(106,110,124,0.16); color: var(--text-dim); font-weight: 600; }
    .badge-skip  { background: var(--bear-soft); color: var(--bear); font-weight: 600; }

    .sig-price {
      font-family: 'JetBrains Mono', monospace;
      font-size: 15px;
      font-weight: 500;
      margin-bottom: 4px;
    }

    .sig-entry { font-size: 11px; color: var(--text-mute); margin-bottom: 6px; }
    .sig-dist {
      font-family: 'JetBrains Mono', monospace;
      font-size: 11px;
      font-weight: 600;
    }

    .sig-reasoning {
      font-size: 11px;
      color: var(--text-mute);
      margin-top: 8px;
      line-height: 1.5;
      border-top: 1px solid var(--border);
      padding-top: 8px;
    }

    /* Countdown ring */
    .countdown-big {
      text-align: center;
      padding: 10px 0;
    }
    .countdown-big .ct-label { font-size: 11px; color: var(--text-mute); text-transform: uppercase; letter-spacing: 0.1em; }
    .countdown-big .ct-name { font-family: 'Instrument Serif', serif; font-size: 20px; color: var(--gold); margin: 4px 0; }
    .countdown-big .ct-time {
      font-family: 'JetBrains Mono', monospace;
      font-size: 36px;
      font-weight: 600;
      color: var(--text);
      letter-spacing: 0.05em;
    }
    /* Compact variant — used where the countdown shares a card with another
       panel, so it stays small enough to sit beside it. */
    .countdown-compact { padding: 4px 0; }
    .countdown-compact .ct-name { font-size: 15px; margin: 2px 0; }
    .countdown-compact .ct-time { font-size: 24px; }

    /* ═══════════════════════════════════
       DASHBOARD TAB (asset tiles)
    ═══════════════════════════════════ */
    .assets-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
      gap: 14px;
    }

    .asset-tile {
      background: var(--bg-elevated);
      border: 1px solid var(--border);
      border-radius: 10px;
      padding: 18px;
      cursor: pointer;
      transition: all 0.3s;
      position: relative;
      display: flex;
      flex-direction: column;
      align-items: center;
      text-align: center;
    }
    .asset-tile:hover {
      border-color: var(--gold);
      box-shadow: 0 10px 30px -10px rgba(201,169,97,0.3);
      transform: translateY(-4px);
    }
    .asset-tile.enter-tile { border-color: var(--bear); animation: enterPulse 1.5s infinite; }
    .asset-tile.armed-tile { border-color: var(--bull); }
    .asset-tile.watch-tile { border-color: rgba(242,179,61,0.5); }

    .asset-symbol {
      font-family: 'Instrument Serif', serif;
      font-size: 26px;
      color: var(--gold);
      margin-bottom: 6px;
    }

    .asset-platform {
      font-size: 10px;
      color: var(--text-mute);
      text-transform: uppercase;
      letter-spacing: 0.5px;
      margin-bottom: 8px;
    }

    .asset-price {
      font-family: 'JetBrains Mono', monospace;
      font-size: 16px;
      font-weight: 500;
      margin-bottom: 6px;
    }

    .asset-change {
      font-family: 'JetBrains Mono', monospace;
      font-size: 11px;
      margin-bottom: 8px;
    }

    .asset-bias {
      font-size: 10px;
      font-weight: 700;
      padding: 3px 10px;
      border-radius: 3px;
      margin-bottom: 6px;
    }
    .bias-bull { background: rgba(92,184,138,0.15); color: var(--bull); }
    .bias-bear { background: rgba(224,93,93,0.15); color: var(--bear); }
    .bias-flux { background: rgba(242,179,61,0.15); color: var(--liq); }

    .asset-grade {
      font-size: 10px;
      font-weight: 600;
      padding: 3px 10px;
      border-radius: 3px;
      background: rgba(201,169,97,0.12);
      color: var(--gold);
    }

    /* Inline level editor on asset tiles */

    .enter-indicator {
      position: absolute;
      top: 8px; right: 8px;
      background: var(--bear);
      color: #fff;
      font-size: 9px;
      padding: 2px 7px;
      border-radius: 9999px;
      font-weight: 900;
      letter-spacing: .04em;
      animation: enterPulse 1.2s infinite;
    }
    .armed-indicator {
      position: absolute;
      top: 8px; right: 8px;
      background: var(--bull);
      color: #000;
      font-size: 9px;
      padding: 2px 7px;
      border-radius: 9999px;
      font-weight: 700;
    }

    /* Sync bar */
    .sync-bar {
      display: flex;
      gap: 10px;
      margin-bottom: 20px;
      flex-wrap: wrap;
      align-items: center;
    }
    .sync-btn {
      padding: 7px 14px;
      font-size: 12px;
      background: transparent;
      border: 1px solid rgba(201,169,97,0.3);
      border-radius: 4px;
      color: var(--gold);
      cursor: pointer;
      transition: all 0.2s;
      font-family: 'Geist', sans-serif;
    }
    .sync-btn:hover { background: rgba(201,169,97,0.15); border-color: var(--gold); }
    .sync-status-text {
      font-family: 'JetBrains Mono', monospace;
      font-size: 11px;
      color: var(--text-mute);
    }

    /* ═══════════════════════════════════
       TOP SETUP TAB
    ═══════════════════════════════════ */
    .filter-buttons { display: flex; gap: 10px; margin-bottom: 20px; }
    .filter-btn {
      padding: 8px 18px;
      background: transparent;
      border: 1px solid var(--border);
      border-radius: 6px;
      color: var(--text-dim);
      cursor: pointer;
      font-weight: 500;
      transition: all 0.2s;
    }
    .filter-btn:hover { border-color: var(--gold); color: var(--text); }
    .filter-btn.active { background: rgba(201,169,97,0.15); border-color: var(--gold); color: var(--gold); }

    /* Top Setup uses same tile grid as Dashboard */
    .setup-list {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
      gap: 14px;
    }

    .setup-card {
      background: var(--bg-elevated);
      border: 1px solid var(--border);
      border-radius: 10px;
      padding: 20px;
      cursor: pointer;
      transition: all 0.3s;
      position: relative;
      display: flex;
      flex-direction: column;
      align-items: center;
      text-align: center;
    }
    .setup-card:hover {
      border-color: var(--gold);
      box-shadow: 0 10px 30px -10px rgba(201,169,97,0.3);
      transform: translateY(-4px);
    }
    .setup-card.near-armed { border-color: var(--bull); background: rgba(92,184,138,0.04); }
    .setup-card.near-watch { border-color: rgba(242,179,61,0.5); }

    .setup-symbol { font-family: 'Instrument Serif', serif; font-size: 28px; color: var(--gold); margin-bottom: 4px; }
    .setup-platform { font-size: 10px; color: var(--text-mute); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 10px; }
    .setup-price { font-family: 'JetBrains Mono', monospace; font-size: 17px; font-weight: 500; margin-bottom: 4px; }
    .setup-dist-badge {
      font-family: 'JetBrains Mono', monospace;
      font-size: 11px;
      font-weight: 700;
      padding: 3px 10px;
      border-radius: 3px;
      margin-bottom: 8px;
    }
    .setup-levels { font-size: 11px; color: var(--text-mute); line-height: 1.6; margin-bottom: 8px; }
    .setup-grade {
      padding: 4px 12px;
      border-radius: 4px;
      font-size: 11px;
      font-weight: 600;
      background: rgba(201,169,97,0.15);
      color: var(--gold);
    }
    .setup-entry-indicator {
      position: absolute;
      top: 8px; right: 8px;
      font-size: 9px;
      font-weight: 700;
      padding: 2px 7px;
      border-radius: 9999px;
    }

    /* ═══════════════════════════════════
       ICT METHODS
    ═══════════════════════════════════ */
    .methods-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
      gap: 14px;
    }
    .method-card {
      background: var(--bg-elevated);
      border: 1px solid var(--border-soft);
      border-radius: var(--r-card);
      overflow: hidden;
      cursor: pointer;
      transition: transform var(--t-base) var(--ease), border-color var(--t-base) var(--ease), box-shadow var(--t-base) var(--ease);
      box-shadow: var(--shadow-card);
    }
    .method-card:hover {
      border-color: var(--accent-line);
      transform: translateY(-2px);
      box-shadow: var(--shadow-pop);
    }
    .method-visual { height: 130px; background: var(--bg-surface); display: flex; align-items: center; justify-content: center; border-bottom: 1px solid var(--border-soft); padding: 12px; }
    .method-info { padding: var(--space-4) var(--space-4) var(--space-5); }
    .method-info h3 { font-family: var(--font-display); color: var(--text); font-size: var(--fs-h3); margin-bottom: 6px; letter-spacing: -0.005em; }
    .method-info p { color: var(--text-dim); font-size: var(--fs-meta); line-height: 1.55; }

    /* ═══════════════════════════════════
       RULES TAB
    ═══════════════════════════════════ */
    .rules-section {
      background: var(--bg-elevated);
      border: 1px solid var(--border);
      border-radius: 10px;
      padding: 22px;
      margin-bottom: 20px;
    }
    .rules-section h3 { font-family: 'Instrument Serif', serif; font-size: 17px; color: var(--gold); margin-bottom: 10px; }
    .rules-section p { color: var(--text-dim); font-size: 13px; line-height: 1.8; margin-bottom: 7px; }
    .rules-section ul { margin-left: 18px; color: var(--text-dim); font-size: 13px; line-height: 1.8; }
    .rules-section li { margin-bottom: 5px; }

    /* ═══════════════════════════════════
       MODAL
    ═══════════════════════════════════ */
    .modal {
      display: none;
      position: fixed; top: 0; left: 0; right: 0; bottom: 0;
      background: rgba(8,8,10,0.92);
      z-index: 1000;
      align-items: center;
      justify-content: center;
      padding: 20px;
    }
    .modal.active { display: flex; }
    .modal-content {
      background: var(--bg-elevated);
      border: 1px solid var(--gold);
      border-radius: 12px;
      max-width: 680px;
      width: 100%;
      max-height: 90vh;
      overflow-y: auto;
      box-shadow: 0 25px 50px -12px rgb(201 169 97 / 0.2);
    }
    .modal-header {
      padding: 22px 26px;
      border-bottom: 1px solid var(--border);
      display: flex;
      justify-content: space-between;
      align-items: center;
      position: sticky; top: 0;
      background: var(--bg-elevated);
      z-index: 10;
    }
    .modal-header h2 { font-family: 'Instrument Serif', serif; color: var(--gold); font-size: 26px; }
    .modal-close { background: none; border: none; font-size: 26px; color: var(--text-mute); cursor: pointer; }
    .modal-body { padding: 26px; }
    .setup-row { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
    .setup-row:last-child { border-bottom: none; }
    .setup-label { color: var(--text-mute); text-transform: uppercase; font-size: 11px; letter-spacing: 0.5px; }
    .setup-value { color: var(--gold); font-family: 'JetBrains Mono', monospace; }
    .grade-section { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 14px; margin: 18px 0; }
    .grade-title { color: var(--gold); font-weight: 600; margin-bottom: 10px; font-size: 13px; }
    .checklist { display: grid; gap: 5px; }
    .check-item { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 12px; color: var(--text-dim); }
    .check-item.yes { color: var(--bull); }
    .check-item.no { opacity: 0.5; }
    .check-icon { font-weight: 700; min-width: 16px; }

    /* Old tablet rule — now handled by new mobile blocks above */
    @media (max-width: 900px) {
      .shell { grid-template-columns: 1fr; }
      main { padding: 20px; }
    }

  /* ═══════════════════════════════════
     ARMED ALERT OVERLAY
  ═══════════════════════════════════ */
  .alert-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.88);
    z-index: 9999;
    display: flex; align-items: center; justify-content: center;
    backdrop-filter: blur(10px);
    animation: overlayIn .25s ease-out;
  }
  @keyframes overlayIn { from { opacity: 0; } to { opacity: 1; } }

  .alert-box {
    background: #0f0f13;
    border: 2px solid var(--bull);
    border-radius: 20px;
    padding: 40px 44px;
    max-width: 520px; width: 92%;
    /* Cap height + scroll inside the box. Without this, tall modals (Live
       Trading config + diagnostics panel) get cut off below the viewport on
       small displays — the Test Fire / Save buttons become unreachable. */
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 0 80px rgba(92,184,138,0.25), 0 32px 80px rgba(0,0,0,0.9);
    text-align: center;
    animation: alertIn .4s cubic-bezier(.34,1.56,.64,1);
    /* Quiet, theme-matched scrollbar (same look as the sidebar). */
    scrollbar-width: thin;
    scrollbar-color: rgba(201,169,97,0.20) transparent;
  }
  .alert-box::-webkit-scrollbar { width: 6px; }
  .alert-box::-webkit-scrollbar-track { background: transparent; }
  .alert-box::-webkit-scrollbar-thumb {
    background: rgba(201,169,97,0.20);
    border-radius: 3px;
  }
  .alert-box::-webkit-scrollbar-thumb:hover { background: rgba(201,169,97,0.40); }
  @keyframes alertIn {
    0% { transform: scale(0.7) translateY(20px); opacity: 0; }
    100% { transform: scale(1) translateY(0); opacity: 1; }
  }
  .alert-beacon {
    width: 64px; height: 64px; border-radius: 50%;
    background: rgba(92,184,138,0.15);
    border: 2px solid var(--bull);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 16px;
    font-size: 26px;
    animation: beaconPulse 1.2s infinite;
  }
  @keyframes beaconPulse {
    0%,100% { box-shadow: 0 0 0 0 rgba(92,184,138,0.5); }
    50% { box-shadow: 0 0 0 16px rgba(92,184,138,0); }
  }
  .alert-label {
    font-size: 11px; letter-spacing: .18em; color: var(--bull);
    font-family: 'JetBrains Mono', monospace; font-weight: 700;
    text-transform: uppercase; margin-bottom: 6px;
  }
  .alert-symbol-big {
    font-family: 'JetBrains Mono', monospace;
    font-size: 36px; font-weight: 700; color: var(--text);
    margin-bottom: 4px;
  }
  .alert-grade-badge {
    display: inline-block; padding: 3px 14px; border-radius: 20px;
    background: rgba(201,169,97,0.15); color: var(--gold);
    font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 700;
    border: 1px solid rgba(201,169,97,0.35); margin-bottom: 24px;
  }
  .alert-grid {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 10px; margin-bottom: 24px; text-align: left;
  }
  .alert-row {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: 10px; padding: 10px 14px;
  }
  .alert-row-label { font-size: 10px; color: var(--text-mute); text-transform: uppercase; letter-spacing: .1em; margin-bottom: 3px; }
  .alert-row-val { font-family: 'JetBrains Mono', monospace; font-size: 13px; font-weight: 600; color: var(--text); }
  .alert-analysis {
    background: rgba(92,184,138,0.05);
    border: 1px solid rgba(92,184,138,0.2);
    border-radius: 10px; padding: 12px 16px;
    font-size: 12px; color: var(--text-dim); text-align: left;
    line-height: 1.7; margin-bottom: 22px;
  }
  .alert-dismiss-btn {
    background: var(--bull); color: #08080a;
    border: none; border-radius: 10px; padding: 13px 40px;
    font-family: 'JetBrains Mono', monospace; font-size: 13px; font-weight: 700;
    cursor: pointer; letter-spacing: .08em; width: 100%;
    transition: opacity .2s;
  }
  .alert-dismiss-btn:hover { opacity: 0.85; }

  /* ═══════════════════════════════════
     ALERT LOG (in AutoPilot tab)
  ═══════════════════════════════════ */
  .alert-log-section { margin-top: 32px; }
  .alert-log-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 12px;
  }
  .alert-log-title { font-size: 11px; letter-spacing: .14em; color: var(--text-mute); text-transform: uppercase; }
  .alert-log-clear { font-size: 11px; color: var(--text-mute); cursor: pointer; background: none; border: none; font-family: inherit; }
  .alert-log-clear:hover { color: var(--text); }
  .alert-log-list { display: flex; flex-direction: column; gap: 8px; }
  .alert-log-item {
    background: var(--bg-surface); border: 1px solid var(--border);
    border-radius: 10px; padding: 12px 16px;
    display: grid; grid-template-columns: auto 1fr auto;
    align-items: center; gap: 14px;
  }
  .alert-log-item.armed-entry { border-left: 3px solid var(--bull); }
  .alert-log-item.watch-entry { border-left: 3px solid var(--liq); }
  .log-sym { font-family: 'JetBrains Mono', monospace; font-size: 13px; font-weight: 600; }
  .log-detail { font-size: 12px; color: var(--text-dim); }
  .log-time { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--text-mute); white-space: nowrap; }
  .log-empty { color: var(--text-mute); font-size: 13px; padding: 20px 0; text-align: center; }

  /* ═══════════════════════════════════
     ANALYSIS PANEL (Phase 3)
  ═══════════════════════════════════ */
  .analysis-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; margin-top: 16px; }
  .analysis-card {
    background: var(--bg-surface); border: 1px solid var(--border);
    border-radius: 12px; padding: 16px 18px;
    transition: border-color .2s;
  }
  .analysis-card.armed-analysis { border-color: var(--bull); }
  .analysis-card.watch-analysis { border-color: var(--liq); }
  .analysis-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
  .analysis-sym { font-family: 'JetBrains Mono', monospace; font-size: 14px; font-weight: 600; }
  .analysis-sig-badge { font-size: 10px; font-weight: 700; font-family: 'JetBrains Mono', monospace; padding: 2px 9px; border-radius: 4px; }
  .analysis-text { font-size: 12px; color: var(--text-dim); line-height: 1.75; }
  .analysis-score-bar { height: 3px; border-radius: 2px; background: var(--border); margin-top: 12px; overflow: hidden; }
  .analysis-score-fill { height: 100%; border-radius: 2px; background: var(--bull); transition: width .4s; }

  /* ═══════════════════════════════════
     ADD ASSET GATEWAY MODAL
  ═══════════════════════════════════ */
  .gateway-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 8000;
    display: flex; align-items: center; justify-content: center;
    backdrop-filter: blur(8px);
    animation: overlayIn .2s ease-out;
  }
  .gateway-box {
    background: #0f0f13;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 32px 36px;
    width: 560px; max-width: 95vw;
    max-height: 90vh; overflow-y: auto;
    box-shadow: 0 32px 80px rgba(0,0,0,0.8);
    animation: alertIn .35s cubic-bezier(.34,1.56,.64,1);
  }
  .gateway-title {
    font-size: 18px; font-weight: 600; color: var(--text);
    margin-bottom: 4px;
  }
  .gateway-sub { font-size: 12px; color: var(--text-mute); margin-bottom: 24px; }
  .gw-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
  .gw-row.three { grid-template-columns: 1fr 1fr 1fr; }
  .gw-row.full { grid-template-columns: 1fr; }
  .gw-field { display: flex; flex-direction: column; gap: 5px; }
  .gw-label { font-size: 10px; color: var(--text-mute); text-transform: uppercase; letter-spacing: .1em; font-family: 'JetBrains Mono', monospace; }
  .gw-input {
    background: var(--bg-elevated); border: 1px solid var(--border);
    border-radius: 8px; padding: 9px 12px;
    color: var(--text); font-family: 'JetBrains Mono', monospace; font-size: 13px;
    outline: none; transition: border-color .2s;
    width: 100%;
  }
  .gw-input:focus { border-color: var(--gold); }
  .gw-input.valid { border-color: var(--bull); }
  .gw-input.invalid { border-color: var(--bear); }
  .gw-select {
    background: var(--bg-elevated); border: 1px solid var(--border);
    border-radius: 8px; padding: 9px 12px;
    color: var(--text); font-family: 'JetBrains Mono', monospace; font-size: 12px;
    outline: none; cursor: pointer; width: 100%;
  }
  .gw-price-preview {
    padding: 10px 14px; border-radius: 8px;
    background: rgba(92,184,138,0.06);
    border: 1px solid rgba(92,184,138,0.25);
    font-family: 'JetBrains Mono', monospace; font-size: 12px;
    color: var(--bull); margin-bottom: 16px; display: none;
  }
  .gw-price-err {
    padding: 10px 14px; border-radius: 8px;
    background: rgba(224,93,93,0.06);
    border: 1px solid rgba(224,93,93,0.25);
    font-size: 12px; color: var(--bear); margin-bottom: 16px; display: none;
  }
  .gw-divider { border: none; border-top: 1px solid var(--border); margin: 18px 0; }
  .gw-triggers-label { font-size: 10px; color: var(--text-mute); text-transform: uppercase; letter-spacing: .1em; margin-bottom: 10px; font-family: 'JetBrains Mono', monospace; }
  .gw-triggers { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 18px; }
  .gw-trigger-item {
    display: flex; align-items: center; gap: 8px;
    padding: 7px 10px; border-radius: 7px;
    background: var(--bg-elevated); border: 1px solid var(--border);
    cursor: pointer; transition: border-color .15s;
    font-size: 11px; color: var(--text-dim);
  }
  .gw-trigger-item:hover { border-color: var(--gold); }
  .gw-trigger-item.checked { border-color: var(--bull); background: rgba(92,184,138,0.06); color: var(--text); }
  .gw-trigger-cb { width: 14px; height: 14px; accent-color: var(--bull); flex-shrink: 0; }
  .gw-actions { display: flex; gap: 10px; margin-top: 20px; }
  .gw-btn-add {
    flex: 1; background: var(--bull); color: #08080a;
    border: none; border-radius: 10px; padding: 12px;
    font-family: 'JetBrains Mono', monospace; font-size: 13px; font-weight: 700;
    cursor: pointer; transition: opacity .2s;
  }
  .gw-btn-add:hover { opacity: 0.85; }
  .gw-btn-add:disabled { opacity: 0.4; cursor: not-allowed; }
  .gw-btn-cancel {
    background: transparent; color: var(--text-mute);
    border: 1px solid var(--border); border-radius: 10px; padding: 12px 20px;
    font-family: 'JetBrains Mono', monospace; font-size: 13px; cursor: pointer;
    transition: border-color .2s;
  }
  .gw-btn-cancel:hover { border-color: var(--text-dim); color: var(--text); }
  .asset-custom-badge {
    position: absolute; top: 8px; left: 8px;
    font-size: 9px; font-weight: 700; font-family: 'JetBrains Mono', monospace;
    background: rgba(201,169,97,0.2); color: var(--gold);
    border: 1px solid rgba(201,169,97,0.35); border-radius: 4px; padding: 1px 6px;
    letter-spacing: .08em;
  }
  .gw-remove-btn {
    position: absolute; top: 8px; right: 8px;
    background: transparent; border: none; color: var(--text-mute);
    font-size: 14px; cursor: pointer; padding: 2px 5px; border-radius: 4px;
    transition: color .15s, background .15s; z-index: 2; display: none;
  }
  .asset-tile:hover .gw-remove-btn { display: block; }
  .gw-remove-btn:hover { color: var(--bear); background: rgba(224,93,93,0.1); }

  /* ═══════════════════════════════════════════════════
     MOBILE BOTTOM NAV
  ═══════════════════════════════════════════════════ */
  .mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    /* Extend painted height past the iOS home indicator so the nav reads
       as a full 64px touch row above the safe-area, not a clipped strip. */
    height: calc(64px + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: rgba(8,8,10,0.97);
    border-top: 1px solid var(--border);
    z-index: 200;
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
  }
  .mob-nav-items {
    display: flex;
    height: 100%;
    align-items: stretch;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .mob-nav-items::-webkit-scrollbar { display: none; }
  .mob-nav-btn {
    flex: 1;
    min-width: 48px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    background: transparent;
    border: none;
    color: var(--text-mute);
    cursor: pointer;
    padding: 6px 1px 8px;
    transition: color 0.2s;
    -webkit-tap-highlight-color: transparent;
    position: relative;
  }
  /* Below 380px (small phones) the 6-tab nav cramps. Shrink icon + label
     and zero out tab padding so all six fit cleanly without ellipsis. */
  @media (max-width: 380px) {
    .mob-nav-btn { min-width: 42px; padding: 6px 0 8px; }
    .mob-nav-btn .mob-icon { font-size: 17px; }
    .mob-nav-btn .mob-label { font-size: 9px; letter-spacing: 0.02em; }
  }
  .mob-nav-btn.active { color: var(--gold); }
  .mob-nav-btn.active::before {
    content: '';
    position: absolute;
    top: 0; left: 20%; right: 20%;
    height: 2px;
    background: var(--gold);
    border-radius: 0 0 2px 2px;
  }
  .mob-nav-btn .mob-icon { font-size: 20px; line-height: 1; }
  .mob-nav-btn .mob-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1;
  }

  /* ═══════════════════════════════════════════════════
     MOBILE RESPONSIVE ( ≤640px )
  ═══════════════════════════════════════════════════ */
  @media (max-width: 640px) {

    /* Show bottom nav, hide sidebar */
    .mobile-bottom-nav { display: block; }
    nav.side { display: none !important; }

    /* Shell: full width + room for bottom nav. Body already pads by
       env(safe-area-inset-bottom), so this 64px is on top of that. */
    .shell {
      grid-template-columns: 1fr;
      padding-top: 44px;
      padding-bottom: 64px;
    }

    /* Compact kill-switch on phones. Sits above the bottom nav (64px) plus
       the home-indicator inset so it never collides on notched iPhones. */
    #liveKillSwitch {
      right: 10px;
      bottom: calc(72px + env(safe-area-inset-bottom));
      padding: 5px 12px;
      font-size: 10px;
      letter-spacing: 0.04em;
    }
    /* Server-side AZC trader pill — stacks ABOVE the browser AUTO pill so
       both stay visible without overlapping the bottom nav. Without this
       override the desktop bottom:64px placement collides with the 64px
       bottom-nav rail, which is the "TRADER HALTED banner overlaps
       tabs" report from mobile. Padding/font shrunk so the long HALT
       status text doesn't span the screen width either. */
    #azcTraderSwitch {
      right: 10px;
      bottom: calc(118px + env(safe-area-inset-bottom));
      padding: 5px 12px;
      font-size: 10px;
      letter-spacing: 0.04em;
      max-width: calc(100vw - 20px);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    /* Compact top bar. Brand collapses to flex:0 so the timing segments
       (Clock, Session, Next KZ) take their natural width and fit on a
       375px phone. Sync stays hidden — debug surface, not actionable.
       GST/Session labels also hidden — the clock format and session
       pill are self-describing; the labels just added crowding.
       Next KZ keeps its label because the bare countdown is ambiguous. */
    .autopilot-bar { height: calc(44px + env(safe-area-inset-top)); }
    .ap-brand { padding: 0 8px; flex: 0 1 auto; min-width: 0; }
    .ap-brand .logo { font-size: 13px; white-space: nowrap; }
    .ap-brand .v { display: none; }
    .ap-segment { padding: 0 8px; font-size: 11px; gap: 4px; }
    .ap-label { font-size: 9px; }
    .ap-seg-sync { display: none; }
    .ap-segment:not(.ap-seg-nextkz) .ap-label { display: none; }
    /* Next KZ is the most actionable mobile info during sessions —
       gold value + slightly bolder so it pops when scanning fast. */
    .ap-seg-nextkz .ap-value { color: var(--gold); font-weight: 700; }

    /* Main content padding */
    main { padding: 14px 12px; }

    /* Page header smaller */
    .page-header { margin-bottom: 14px; padding-bottom: 12px; }
    .page-header h1 { font-size: 19px; }
    .page-header p { font-size: 11px; }

    /* AutoPilot cards grid */
    .ap-grid { grid-template-columns: 1fr; gap: 10px; margin-bottom: 16px; }
    .ap-card { padding: 14px; }
    .countdown-big .ct-time { font-size: 28px; }

    /* Signal cards: 2-column */
    .signals-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .signal-card { padding: 10px; }
    .sig-symbol { font-size: 16px; }

    /* Asset tiles: 2-column */
    .assets-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .asset-tile { padding: 12px 10px; }
    .asset-tile:hover { transform: none; }
    .asset-symbol { font-size: 20px; }
    .asset-price { font-size: 13px; }

    /* Remove button: always show on mobile (no hover) */
    .asset-tile .gw-remove-btn { display: none; } /* keep hidden — use modal to remove */

    /* Sync bar wraps */
    .sync-bar { flex-wrap: wrap; gap: 8px; }
    .sync-btn { font-size: 11px; padding: 8px 12px; min-height: 38px; }

    /* Asset modal: bottom sheet */
    .modal {
      align-items: flex-end !important;
      padding: 0 !important;
    }
    .modal-content {
      max-width: 100% !important;
      width: 100% !important;
      border-radius: 20px 20px 0 0 !important;
      max-height: 88vh;
      border-left: none !important;
      border-right: none !important;
      border-bottom: none !important;
    }
    .modal-header { padding: 16px 18px; }
    .modal-header h2 { font-size: 20px; }
    .modal-body { padding: 16px 18px 32px; }

    /* Add asset gateway modal: bottom sheet */
    #addAssetModal {
      align-items: flex-end !important;
      padding: 0 !important;
    }
    .gw-modal {
      border-radius: 20px 20px 0 0 !important;
      width: 100% !important;
      max-width: 100% !important;
      max-height: 90vh;
      overflow-y: auto;
      border-left: none !important;
      border-right: none !important;
      border-bottom: none !important;
    }

    /* Alert overlay: full screen */
    .alert-box {
      width: 95% !important;
      padding: 28px 20px !important;
    }

    /* Journal filters */
    .journal-filters { flex-wrap: wrap; gap: 6px; }

    /* Paper trading stats: 2-col */
    #paperStats { display: grid !important; grid-template-columns: repeat(2, 1fr) !important; gap: 8px; }

    /* Backtest */
    #btControls { flex-wrap: wrap !important; }

    /* ICT Methods table */
    .methods-table { font-size: 11px; }

    /* Session timeline rows */
    .session-row { padding: 7px 10px; }
    .session-name { font-size: 12px; }
    .session-time { font-size: 10px; }

    /* MTF alignment */
    #mtfAlignCard { padding: 12px; }

    /* Forms/inputs */
    input, select, textarea {
      font-size: 16px !important; /* prevents iOS zoom */
    }

    /* Capital strip — 2x2 grid on phones. The default flex-wrap stretched
       4 chips across one row at ~85px each, which clipped labels and
       collided dollar signs ("FP $100 $562" looked like garbage). Total
       chip drops to a full-width row below so the gold figure stays
       legible. */
    .cap-strip-row {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 6px;
    }
    .cap-chip {
      padding: 6px 10px;
      font-size: 11px;
      min-width: 0;
    }
    .cap-chip-val {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .cap-total-chip {
      grid-column: 1 / -1;
      margin-left: 0;
      justify-content: space-between;
      padding: 6px 12px;
    }
  }

  /* ═══ Tablet breakpoint ═══ */
  @media (max-width: 900px) and (min-width: 641px) {
    .mobile-bottom-nav { display: block; }
    nav.side { display: none !important; }
    .shell { grid-template-columns: 1fr; padding-bottom: 64px; }
    main { padding: 24px 20px; }
    .assets-grid { grid-template-columns: repeat(3, 1fr); }
    .signals-grid { grid-template-columns: repeat(3, 1fr); }
    .ap-grid { grid-template-columns: 1fr; }
  }

  /* ── iOS Safari fixes ───────────────────────────────────────────────
     1. font-size: 16px on text-style inputs prevents auto-zoom on focus
        (iOS auto-zooms whenever a focused input's font-size is < 16px).
     2. -webkit-tap-highlight-color: transparent kills the gray flash on
        every button tap.
     3. body padding uses safe-area-inset for notched iPhones (works only
        when viewport-fit=cover is set in the meta tag, which we do). */
  input[type="text"], input[type="number"], input[type="email"],
  input[type="search"], input[type="password"], textarea, select {
    font-size: 16px;
  }
  * { -webkit-tap-highlight-color: transparent; }
  body {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }

/* ── Buy Picks banner — sits below the sticky capital strip. Not sticky
   itself so the capital strip is the only thing pinned during scroll. */
#buyPicksBanner {
  z-index: 50;
  background: linear-gradient(180deg, rgba(92,184,138,0.16) 0%, rgba(92,184,138,0.06) 100%);
  border-bottom: 1px solid rgba(92,184,138,0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 8px 16px;
  font-family: 'JetBrains Mono', monospace;
}
.picks-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.picks-title {
  font-size: 11px;
  font-weight: 800;
  color: var(--bull);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.picks-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.picks-chip {
  background: rgba(0,0,0,0.35);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  cursor: pointer;
  transition: all 0.15s;
}
.picks-chip:hover {
  background: rgba(0,0,0,0.5);
  transform: translateY(-1px);
}
.picks-chip.pick-at {
  border-color: var(--bull);
  background: rgba(92,184,138,0.22);
  color: var(--bull);
}
.picks-chip.pick-near {
  border-color: rgba(92,184,138,0.5);
  color: var(--bull);
}
/* Holdings row — slightly different palette so it doesn't read as "another pick" */
.holds-bar {
  border-top: 1px dashed rgba(255,255,255,0.06);
  padding-top: 6px;
  margin-top: 4px;
}
.holds-title {
  color: var(--gold) !important;
}
.picks-chip.hold-up {
  border-color: var(--bull);
  background: rgba(92,184,138,0.12);
  color: var(--bull);
}
.picks-chip.hold-down {
  border-color: var(--bear);
  background: rgba(224,93,93,0.10);
  color: var(--bear);
}
.picks-chip.hold-flat {
  border-color: var(--text-mute);
  color: var(--text-dim);
}
/* Capital strip — top of every tab, sticky above the picks banner */
.capital-strip {
  position: sticky;
  top: 0;
  z-index: 60;
  background: linear-gradient(180deg, rgba(201,169,97,0.16) 0%, rgba(201,169,97,0.06) 100%);
  border-bottom: 1px solid rgba(201,169,97,0.32);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 6px 14px;
  font-family: 'JetBrains Mono', monospace;
}
.cap-strip-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.cap-chip {
  background: rgba(0,0,0,0.30);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 5px 11px;
  border-radius: 8px;
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s;
}
.cap-chip:hover {
  background: rgba(0,0,0,0.5);
  border-color: rgba(201,169,97,0.4);
}
.cap-chip-edit { border-style: dashed; }
.cap-chip-label {
  color: var(--text-mute);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}
.cap-chip-val {
  color: var(--text);
  font-weight: 700;
}
.cap-total-chip {
  background: rgba(201,169,97,0.20);
  border: 1px solid var(--gold);
  color: var(--gold);
  padding: 5px 14px;
  border-radius: 8px;
  font-size: 12px;
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  margin-left: auto;
}
.cap-total-val {
  color: var(--gold);
  font-weight: 800;
  font-size: 13px;
}
.cap-pnl-up   { color: var(--bull); font-size: 10px; margin-left: 4px; }
.cap-pnl-down { color: var(--bear); font-size: 10px; margin-left: 4px; }
.cap-note {
  color: var(--text-mute);
  font-size: 9px;
  margin-left: 4px;
  font-style: italic;
}

/* Zero-capital state — surfaces a clear "set balance to trade" prompt */
.capital-strip.cap-empty {
  background: linear-gradient(180deg, rgba(242,179,61,0.16) 0%, rgba(242,179,61,0.06) 100%);
  border-bottom-color: rgba(242,179,61,0.4);
}
.cap-empty-msg {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--liq);
}
.cap-edit-btn {
  background: rgba(242,179,61,0.18);
  border: 1px solid var(--liq);
  color: var(--liq);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  cursor: pointer;
}
.cap-empty-note {
  color: var(--text-mute);
  font-size: 10px;
  font-style: italic;
  width: 100%;
}

/* Held asset has hit / is approaching its sell zone — most actionable case;
   gold ring overrides P/L color emphasis so the user notices */
.picks-chip.hold-sell {
  box-shadow: 0 0 0 2px rgba(201,169,97,0.65);
  animation: hold-sell-pulse 1.6s ease-in-out infinite;
}
@keyframes hold-sell-pulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(201,169,97,0.65); }
  50%      { box-shadow: 0 0 0 4px rgba(201,169,97,0.35); }
}

/* ═══════════════════════════════════════════════════════════════════
   REUSABLE UI PRIMITIVES (added in UI redesign pass 1)
   Small, composable utility classes that any future markup can lean on
   instead of one-off inline styles. Keep tight, semantic, theme-aware.
═══════════════════════════════════════════════════════════════════ */

/* Status chip — replaces noisy outlined pills. No border, semantic bg+fg.
   Use modifier classes for the state: .chip.is-bull, .chip.is-bear, etc. */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: var(--r-chip);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.4;
  background: rgba(106,110,124,0.14);
  color: var(--text-dim);
  white-space: nowrap;
}
.chip.is-bull   { background: var(--bull-soft); color: var(--bull); }
.chip.is-bear   { background: var(--bear-soft); color: var(--bear); }
.chip.is-warn   { background: var(--warn-soft); color: var(--warn); }
.chip.is-info,
.chip.is-accent { background: var(--accent-soft); color: var(--accent-strong); }
.chip.is-muted  { background: rgba(106,110,124,0.14); color: var(--text-mute); }
.chip.is-gold   { background: var(--gold-soft); color: var(--gold); }
.chip .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

/* KPI stack — label above large value, optional delta below.
   For the topbar's account balance, PnL summary, kill-zone countdown. */
.kpi {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.kpi-label {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 500;
}
.kpi-value {
  font-family: var(--font-mono);
  font-size: var(--fs-kpi);
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  line-height: var(--lh-tight);
}
.kpi-value.is-lg   { font-size: var(--fs-kpi-lg); }
.kpi-value.is-bull { color: var(--bull); }
.kpi-value.is-bear { color: var(--bear); }
.kpi-value.is-gold { color: var(--gold); }
.kpi-delta {
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
  color: var(--text-mute);
  font-variant-numeric: tabular-nums;
}
.kpi-delta.is-bull { color: var(--bull); }
.kpi-delta.is-bear { color: var(--bear); }

/* Button family — sharp, minimal. .btn = base, modifiers stack on top.
   Existing inline-styled buttons throughout the app keep working; this
   is for any new markup or future refactor. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 8px 14px;
  border-radius: var(--r-btn);
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
  font-weight: 600;
  letter-spacing: 0.02em;
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
  white-space: nowrap;
  text-decoration: none;
}
.btn:hover { background: var(--bg-hot); border-color: var(--border-strong); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn.is-primary {
  background: linear-gradient(180deg, var(--accent-strong), var(--accent));
  border-color: transparent;
  color: #0a0b0e;
}
.btn.is-primary:hover { filter: brightness(1.08); }

.btn.is-ghost {
  background: transparent;
  border-color: var(--border-soft);
  color: var(--text-dim);
}
.btn.is-ghost:hover { color: var(--text); border-color: var(--border-strong); }

.btn.is-danger {
  background: var(--bear-soft);
  border-color: transparent;
  color: var(--bear);
}
.btn.is-danger:hover { background: rgba(226,100,100,0.2); }

.btn.is-sm { padding: 5px 10px; font-size: 11px; }

/* Section header — for sub-sections inside a tab (not the page-header H1).
   Adds the small all-caps eyebrow + light divider that mature dashboards
   use to break long pages without resorting to more cards. */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4);
  margin: var(--space-8) 0 var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border-soft);
}
.section-head h2 {
  font-family: var(--font-display);
  font-size: var(--fs-title);
  letter-spacing: -0.01em;
  color: var(--text);
}
.section-head .eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  margin-bottom: 4px;
  display: block;
}
.section-head .meta {
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
  color: var(--text-mute);
}

/* Loading skeleton — for empty/loading panels. Pulse animation. */
.skeleton {
  background: linear-gradient(90deg,
    var(--bg-elevated) 0%,
    var(--bg-hot) 50%,
    var(--bg-elevated) 100%);
  background-size: 200% 100%;
  border-radius: var(--r-chip);
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
}
@keyframes skeleton-shimmer {
  0%   { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* Subtle "data freshness" timestamp pill — for cards that show external feeds.
   Sits in the top-right of a card header. */
.freshness {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-faint);
  font-weight: 500;
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.freshness::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--bull);
  box-shadow: 0 0 0 2px rgba(78,195,138,0.18);
}
.freshness.is-stale::before { background: var(--warn); box-shadow: 0 0 0 2px rgba(242,179,65,0.18); }
.freshness.is-dead::before  { background: var(--bear); box-shadow: 0 0 0 2px rgba(226,100,100,0.18); }

/* Focus-visible — accessibility + makes keyboard nav feel premium */
:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 2px;
  border-radius: var(--r-btn);
}

/* ═══════════════════════════════════════════════════════════════════
   LIVE CHART — pass 2 layout
   Decision strip above, hero chart in the middle, deeper analysis card
   below, ICT methods dropdown at the very end (US100 only). Goal: the
   most actionable context is the first thing you see; the chart is the
   visual hero; everything else recedes into supporting detail.
═══════════════════════════════════════════════════════════════════ */

/* Trade State card — the dominant at-a-glance row above the chart.
   Three lanes: (1) huge live price + meta, (2) bias + plan-status chips,
   (3) primary + secondary actions. Calmer surface than a plain card —
   subtle gradient + accent ring on the left edge to read as "primary
   information." */
.lc-decision-strip {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  align-items: center;
  gap: var(--space-6);
  background:
    linear-gradient(135deg, rgba(107,138,253,0.04) 0%, transparent 40%),
    var(--bg-elevated);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-card);
  padding: var(--space-5) var(--space-6);
  margin-bottom: var(--space-4);
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}
.lc-decision-strip::before {
  content: '';
  position: absolute;
  left: 0; top: 16px; bottom: 16px;
  width: 3px;
  background: linear-gradient(180deg, var(--accent-strong), rgba(107,138,253,0.18));
  border-radius: 0 2px 2px 0;
}

.lc-decision-kpi { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.lc-decision-kpi .kpi-label {
  font-size: var(--fs-micro);
  letter-spacing: 0.16em;
}
.lc-decision-kpi .kpi-value {
  font-size: 38px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
}
.lc-decision-kpi .kpi-value.is-bull { color: var(--bull); }
.lc-decision-kpi .kpi-value.is-bear { color: var(--bear); }
.lc-decision-kpi .kpi-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-mute);
  margin-top: 2px;
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Middle lane: bias + plan status chips, stacked. */
.lc-decision-state {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
  min-width: 140px;
}
.lc-decision-state .chip { font-size: 11px; }

.lc-decision-actions {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

@media (max-width: 1100px) {
  .lc-decision-strip {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
  }
  .lc-decision-state { grid-column: 1 / -1; flex-direction: row; }
  .lc-decision-actions { grid-column: 1 / -1; justify-content: flex-start; }
}
@media (max-width: 900px) {
  .lc-decision-strip {
    grid-template-columns: 1fr;
    gap: var(--space-3);
    padding: var(--space-4);
  }
  .lc-decision-kpi .kpi-value { font-size: 28px; }
  .lc-decision-actions { justify-content: flex-start; }
}

.lc-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
}
.lc-tfs {
  display: inline-flex;
  background: var(--bg-elevated);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-btn);
  padding: 3px;
  gap: 2px;
}
.lc-tfs .tf-btn {
  padding: 6px 12px;
  background: transparent;
  border: none;
  border-radius: 5px;
  color: var(--text-mute);
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.lc-tfs .tf-btn:hover { color: var(--text); background: var(--bg-hot); }
.lc-tfs .tf-btn.active {
  background: var(--accent-soft);
  color: var(--accent-strong);
}
/* Existing .tf-btn elsewhere (if any) keep the old look outside this group */

.lc-quick-track {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.lc-quick-track input {
  background: var(--bg-elevated);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-btn);
  padding: 7px 12px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12px;
  width: 220px;
  outline: none;
  transition: border-color var(--t-fast) var(--ease);
}
.lc-quick-track input:focus { border-color: var(--accent-line); }
.lc-quick-track input::placeholder { color: var(--text-faint); }

/* The hero chart container — taller, framed by a subtle ring, with the
   premium shadow stack that lifts it off the page. */
.lc-chart-hero {
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-hero);
  overflow: hidden;
  height: clamp(560px, 70vh, 820px);
  min-height: 560px;
  box-shadow: var(--shadow-hero);
  position: relative;
}
.lc-chart-hero::after {
  /* Subtle inset ring so the chart feels embedded, not a flat iframe.
     Pointer-events none so it doesn't intercept TradingView controls. */
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--r-hero);
  pointer-events: none;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.025) inset;
}

@media (max-width: 900px) {
  .lc-chart-hero { height: clamp(420px, 56vh, 640px); min-height: 420px; }
  .lc-toolbar { gap: var(--space-2); }
  .lc-quick-track input { width: 160px; }
}

/* Chip pulse modifier — used by the fire-status chip when it goes "ready". */
.chip.is-pulsing { animation: chip-pulse 1.2s ease-in-out infinite; }
@keyframes chip-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(226,100,100,0.45); }
  50%      { box-shadow: 0 0 0 6px rgba(226,100,100,0); }
}

/* ═══════════════════════════════════════════════════════════════════
   CHART SKELETON — premium loading state inside .lc-chart-hero
   Resembles an actual chart shell (price axis + grid + ghost candles)
   so the panel never reads as broken. JS replaces this with the real
   TradingView widget on first asset click.
═══════════════════════════════════════════════════════════════════ */
.chart-skeleton {
  width: 100%; height: 100%;
  display: grid;
  grid-template-columns: 56px 1fr;
  grid-template-rows: 1fr 28px;
  grid-template-areas:
    "price canvas"
    "price time";
  background:
    radial-gradient(800px 400px at 60% 30%, rgba(107,138,253,0.04), transparent 70%),
    var(--bg-surface);
  font-family: var(--font-mono);
  color: var(--text-faint);
  position: relative;
}
.chart-skeleton .cs-pricecol {
  grid-area: price;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
  padding: 14px 10px 14px 0;
  font-size: 10px;
  border-right: 1px solid var(--border-soft);
  letter-spacing: 0.04em;
}
.chart-skeleton .cs-timecol {
  grid-area: time;
  grid-column: 2 / 3;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 14px;
  font-size: 10px;
  border-top: 1px solid var(--border-soft);
  letter-spacing: 0.04em;
}
.chart-skeleton .cs-canvas {
  grid-area: canvas;
  position: relative;
  overflow: hidden;
}
.chart-skeleton .cs-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 80px 60px;
  background-position: 0 0;
  mask-image: linear-gradient(180deg, rgba(0,0,0,0.7), rgba(0,0,0,0.3));
}
.chart-skeleton .cs-candle-row {
  position: absolute;
  inset: 24px 24px 24px 24px;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 12px;
}
.chart-skeleton .cs-candle {
  position: relative;
  flex: 1;
  height: var(--h, 50%);
  top: var(--top, 25%);
  border-radius: 2px;
  opacity: 0.18;
  background: linear-gradient(180deg,
    var(--bg-hot) 0%,
    var(--bull) 50%,
    var(--bg-hot) 100%);
  animation: cs-shimmer 2.4s ease-in-out infinite;
  animation-delay: calc(var(--h) * 1ms);
}
.chart-skeleton .cs-candle.is-up   { background: linear-gradient(180deg, rgba(78,195,138,0.55), rgba(78,195,138,0.15)); }
.chart-skeleton .cs-candle.is-down { background: linear-gradient(180deg, rgba(226,100,100,0.55), rgba(226,100,100,0.15)); }
.chart-skeleton .cs-candle::before {
  /* Wick line */
  content: '';
  position: absolute;
  left: 50%; top: -10%; bottom: -10%;
  width: 1px;
  background: currentColor;
  opacity: 0.4;
  transform: translateX(-50%);
}
.chart-skeleton .cs-label {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  font-size: var(--fs-meta);
  color: var(--text-mute);
  background: rgba(10,11,14,0.7);
  border: 1px solid var(--border-soft);
  padding: 6px 12px;
  border-radius: var(--r-pill);
  backdrop-filter: blur(6px);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: var(--font-mono);
}
.chart-skeleton .cs-label::before {
  content: '';
  display: inline-block;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent-strong);
  margin-right: 8px;
  vertical-align: 1px;
  animation: pulse 1.2s ease-in-out infinite;
}
@keyframes cs-shimmer {
  0%, 100% { opacity: 0.14; transform: translateY(0); }
  50%      { opacity: 0.32; transform: translateY(-2px); }
}

/* ═══════════════════════════════════════════════════════════════════
   PLAN DETAILS CARD — the only deep card under the chart now.
   No price / bias / plan-status duplication with the Trade State card.
═══════════════════════════════════════════════════════════════════ */
.plan-details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.plan-cell {
  background: var(--bg-elevated);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-btn);
  padding: var(--space-3) var(--space-4);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.plan-cell .plan-label {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 500;
}
.plan-cell .plan-value {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.005em;
  font-variant-numeric: tabular-nums;
}
.plan-cell .plan-value.is-bull { color: var(--bull); }
.plan-cell .plan-value.is-bear { color: var(--bear); }
.plan-cell .plan-value.is-gold { color: var(--gold); }

/* "Now" / decision-center card — was a one-off mess of inline styles. Use
   the design tokens; let the state color cascade from a single CSS var so
   the border stays semantic without us inlining hex colors. */
.lc-now-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-card);
  padding: var(--space-4) var(--space-5);
  margin-bottom: var(--space-4);
  box-shadow: var(--shadow-card);
  position: relative;
}
.lc-now-card::before {
  content: '';
  position: absolute;
  left: 0; top: 14px; bottom: 14px;
  width: 3px;
  background: var(--state-color, var(--accent-strong));
  border-radius: 0 2px 2px 0;
  opacity: 0.7;
}
.lc-now-head {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  justify-content: space-between;
  flex-wrap: wrap;
}
.lc-now-eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  margin-bottom: 4px;
  font-weight: 500;
}
.lc-now-label {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  color: var(--state-color, var(--text));
  letter-spacing: -0.005em;
  line-height: 1.15;
}
.lc-now-reason {
  margin-top: var(--space-3);
  font-size: var(--fs-body);
  color: var(--text-dim);
  line-height: 1.55;
}
.lc-now-risk {
  margin-top: 6px;
  font-size: var(--fs-meta);
  color: var(--text-mute);
  font-family: var(--font-mono);
}

/* ICT Methods dropdown — was inline-styled. Token it. Header is text, not
   gold, since the gold treatment was load-bearing elsewhere. */
.lc-methods {
  margin-top: var(--space-5);
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-card);
  overflow: hidden;
}
.lc-methods > summary {
  cursor: pointer;
  padding: var(--space-4) var(--space-5);
  font-family: var(--font-mono);
  font-size: var(--fs-body);
  font-weight: 600;
  color: var(--text);
  list-style: none;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  letter-spacing: 0.02em;
}
.lc-methods > summary::-webkit-details-marker { display: none; }
.lc-methods > summary:hover { background: var(--bg-elevated); }
.lc-methods .lc-methods-caret {
  display: inline-block;
  transition: transform var(--t-base) var(--ease);
  font-size: 18px;
  color: var(--text-mute);
  line-height: 1;
}
.lc-methods[open] .lc-methods-caret { transform: rotate(90deg); color: var(--accent-strong); }
.lc-methods .lc-methods-hint {
  font-size: 11px;
  color: var(--text-faint);
  font-weight: 500;
  margin-left: auto;
  letter-spacing: 0.04em;
}
.lc-methods .lc-methods-body {
  padding: 0 var(--space-5) var(--space-5);
}

/* Generic de-gold tune-ups — reduce gold by ~35% via these swaps in
   high-frequency places. Brand logos and explicit "grade" indicators keep
   their gold; everything frequent moves to neutral or accent. */

/* AZC glass cockpit refresh — visual layer only. Trading behavior lives in JS. */
:root {
  --azc-cyan: #64d8ff;
  --azc-grid-line: rgba(100,216,255,0.055);
  --azc-glass: rgba(13,18,27,0.78);
  --azc-glass-strong: rgba(18,25,37,0.88);
  --azc-card-sheen: rgba(255,255,255,0.045);
  --azc-glow-cyan: 0 0 28px rgba(100,216,255,0.18);
  --azc-glow-gold: 0 0 24px rgba(212,184,106,0.16);
  --azc-noise: linear-gradient(135deg, rgba(255,255,255,0.018) 0 1px, transparent 1px 4px);
  --accent: var(--azc-cyan);
  --accent-soft: rgba(100,216,255,0.13);
  --accent-line: rgba(100,216,255,0.28);
  --accent-strong: #9ee8ff;
  --bg: #07090d;
  --bg-surface: rgba(11,15,22,0.92);
  --bg-elevated: var(--azc-glass);
  --bg-hot: #131b27;
  --border-soft: rgba(255,255,255,0.075);
  --border: rgba(255,255,255,0.105);
  --border-strong: rgba(100,216,255,0.25);
  --shadow-card: 0 1px 0 rgba(255,255,255,0.035) inset, 0 18px 44px rgba(0,0,0,0.36);
}

body {
  background:
    radial-gradient(900px 520px at 74% -12%, rgba(100,216,255,0.11), transparent 62%),
    radial-gradient(740px 480px at 8% 18%, rgba(212,184,106,0.055), transparent 58%),
    linear-gradient(180deg, #07090d 0%, #090d13 48%, #07090d 100%);
}

body::before {
  background:
    radial-gradient(1000px 540px at 82% -14%, rgba(100,216,255,0.12), transparent 58%),
    radial-gradient(840px 520px at 0% 52%, rgba(212,184,106,0.055), transparent 62%),
    var(--azc-noise);
  opacity: 0.95;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    repeating-linear-gradient(90deg, transparent 0 79px, var(--azc-grid-line) 80px),
    repeating-linear-gradient(0deg, transparent 0 79px, var(--azc-grid-line) 80px),
    linear-gradient(90deg, rgba(100,216,255,0.08), transparent 18%, transparent 82%, rgba(212,184,106,0.05));
  mask-image: linear-gradient(180deg, rgba(0,0,0,0.8), rgba(0,0,0,0.2) 62%, transparent 100%);
}

.shell,
.autopilot-bar {
  position: relative;
  z-index: 1;
}

.autopilot-bar {
  background: linear-gradient(180deg, rgba(9,13,19,0.94), rgba(9,13,19,0.78));
  border-bottom-color: rgba(100,216,255,0.18);
  box-shadow: 0 14px 40px rgba(0,0,0,0.28), inset 0 -1px rgba(255,255,255,0.035);
}
.autopilot-bar::after {
  content: '';
  position: absolute;
  left: 248px;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--azc-cyan), rgba(212,184,106,0.58), transparent);
  opacity: 0.68;
}
.ap-brand .logo,
.brand .logo {
  background: linear-gradient(180deg, #fff9dc 0%, #d4b86a 45%, #64d8ff 140%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

nav.side {
  background:
    linear-gradient(180deg, rgba(100,216,255,0.045), transparent 230px),
    linear-gradient(90deg, rgba(255,255,255,0.02), transparent 38%),
    rgba(8,12,18,0.94);
  border-right-color: rgba(100,216,255,0.13);
  box-shadow: inset -1px 0 rgba(255,255,255,0.035);
}
.side-nav button {
  border: 1px solid transparent;
}
.side-nav button:hover {
  background: rgba(100,216,255,0.07);
  border-color: rgba(100,216,255,0.14);
}
.side-nav button.active {
  background: linear-gradient(90deg, rgba(100,216,255,0.14), rgba(212,184,106,0.055));
  border-color: rgba(100,216,255,0.2);
  box-shadow: var(--azc-glow-cyan);
}

.ap-card,
.azc-scan,
.azc-decisions,
.analysis-card,
.signal-card,
.session-row,
.cap-chip,
.cap-total-chip {
  background: var(--azc-glass);
  border-color: rgba(255,255,255,0.095);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(18px) saturate(132%);
  -webkit-backdrop-filter: blur(18px) saturate(132%);
}
.ap-card,
.azc-scan,
.analysis-card,
.signal-card {
  overflow: hidden;
}
.ap-card::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(135deg, var(--azc-card-sheen), transparent 32%),
    linear-gradient(180deg, rgba(100,216,255,0.035), transparent 48%);
  opacity: 0.72;
}
.ap-card > * {
  position: relative;
  z-index: 1;
}
.ap-card-title,
.azc-decisions-header {
  color: #c8d3df;
  letter-spacing: 0.14em;
}
.ap-card.gold-border::before,
.ap-card.is-accent::before {
  top: 14px;
  bottom: 14px;
  width: 2px;
  background: linear-gradient(180deg, #ffe3a0, rgba(212,184,106,0.34), rgba(100,216,255,0.2));
  box-shadow: var(--azc-glow-gold);
}

#laneNarrative {
  max-width: 82ch;
  color: #b8c1cf !important;
  line-height: 1.78 !important;
}

.azc-scan {
  position: relative;
  background:
    linear-gradient(180deg, rgba(100,216,255,0.07), transparent 44%),
    var(--azc-glass-strong) !important;
  border-color: rgba(100,216,255,0.18) !important;
}
.azc-scan::before {
  content: '';
  position: absolute;
  left: 16px;
  right: 16px;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--azc-cyan), rgba(212,184,106,0.72), transparent);
  box-shadow: var(--azc-glow-cyan);
}
.azc-scan-title,
.azc-tile-sym,
.sig-symbol,
.analysis-sym {
  text-shadow: 0 0 18px rgba(100,216,255,0.12);
}
.azc-tile {
  background: rgba(7,10,15,0.68) !important;
  border-color: rgba(255,255,255,0.09) !important;
}
.azc-tile.ready {
  border-color: rgba(78,195,138,0.46) !important;
  box-shadow: 0 0 0 1px rgba(78,195,138,0.08), 0 12px 34px rgba(0,0,0,0.24);
}

.signal-card {
  background: rgba(8,12,18,0.76);
  min-height: 158px;
}
.signal-card:hover {
  border-color: rgba(100,216,255,0.34);
  box-shadow: var(--azc-glow-cyan), 0 18px 42px rgba(0,0,0,0.34);
}
.signal-card.armed,
.signal-card.watch,
.signal-card.enter {
  box-shadow: 0 16px 38px rgba(0,0,0,0.3);
}
.sig-price {
  font-size: clamp(18px, 1.7vw, 26px);
  line-height: 1.15;
}
.sig-meta,
.sig-details {
  color: #9da8b8;
}

.analysis-card {
  position: relative;
  background: rgba(9,13,19,0.8);
  border-color: rgba(255,255,255,0.09);
}
.analysis-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 2px;
  background: linear-gradient(180deg, rgba(100,216,255,0.82), rgba(212,184,106,0.36));
  opacity: 0.72;
}
.analysis-card.armed-analysis::before { background: linear-gradient(180deg, var(--bull), rgba(100,216,255,0.38)); }
.analysis-card.watch-analysis::before { background: linear-gradient(180deg, var(--warn), rgba(100,216,255,0.32)); }
.analysis-text {
  max-width: 74ch;
  color: #b1bbc9;
  line-height: 1.82;
}
.analysis-sig-badge,
.sig-badge,
.session-status-label {
  border-radius: 6px !important;
  letter-spacing: 0.06em;
}
.analysis-score-bar {
  height: 4px;
  background: rgba(255,255,255,0.07);
}

.capital-strip {
  background: linear-gradient(180deg, rgba(12,17,25,0.94), rgba(12,17,25,0.76));
  border-bottom-color: rgba(212,184,106,0.22);
  box-shadow: 0 14px 34px rgba(0,0,0,0.24);
}
.cap-total-chip {
  background: linear-gradient(90deg, rgba(212,184,106,0.22), rgba(100,216,255,0.08));
  border-color: rgba(212,184,106,0.5);
}

@media (max-width: 900px) {
  .autopilot-bar::after { left: 0; }
  .ap-card,
  .azc-scan,
  .analysis-card,
  .signal-card { backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
  .analysis-text { max-width: 100%; line-height: 1.72; }
  #laneNarrative { max-width: 100%; }
}


/* AZC Decision Board — one direct read across Platform/Tester/OS inputs */
.decision-board-card {
  position: relative;
  overflow: hidden;
  border-color: rgba(76, 201, 240, 0.26) !important;
  background:
    linear-gradient(135deg, rgba(76, 201, 240, 0.10), transparent 32%),
    linear-gradient(180deg, rgba(201, 169, 97, 0.08), rgba(13, 18, 27, 0.86));
}

.decision-board-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

#decisionBoardStamp {
  font-family: 'JetBrains Mono', monospace;
  color: var(--azc-cyan);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.decision-board-summary {
  margin: 8px 0 12px;
  padding: 12px 14px;
  border: 1px solid rgba(76, 201, 240, 0.22);
  border-radius: 14px;
  background: rgba(3, 8, 18, 0.42);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  max-width: 92ch;
}

.decision-board-rows {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}

.decision-row {
  width: 100%;
  text-align: left;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 11px 12px;
  background: rgba(6, 12, 22, 0.58);
  color: var(--text);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 10px;
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.decision-row:hover {
  transform: translateY(-1px);
  border-color: rgba(76, 201, 240, 0.42);
  background: rgba(9, 18, 32, 0.78);
}

.decision-rank {
  grid-row: span 2;
  align-self: start;
  min-width: 86px;
  text-align: center;
  border-radius: 999px;
  padding: 5px 8px;
  font: 800 10px/1 'JetBrains Mono', monospace;
  letter-spacing: 0.06em;
  background: rgba(255,255,255,0.07);
}

.decision-ready .decision-rank { color: var(--bull); background: rgba(92,184,138,0.14); box-shadow: 0 0 20px rgba(92,184,138,0.16); }
.decision-position .decision-rank { color: var(--azc-cyan); background: rgba(76,201,240,0.14); }
.decision-near .decision-rank { color: var(--liq); background: rgba(201,169,97,0.15); }
.decision-manual .decision-rank,
.decision-spot .decision-rank { color: var(--gold); background: rgba(201,169,97,0.12); }
.decision-blocked .decision-rank { color: var(--bear); background: rgba(240,96,96,0.12); }

.decision-symbol {
  font-weight: 800;
  letter-spacing: 0.03em;
}

.decision-symbol em {
  color: var(--text-mute);
  font-style: normal;
  font-size: 10px;
  margin-left: 5px;
}

.decision-meta b,
.decision-meta small,
.decision-next {
  display: block;
}

.decision-meta b {
  color: var(--azc-cyan);
  font-size: 11px;
}

.decision-meta small,
.decision-next {
  color: var(--text-mute);
  font-size: 10px;
  line-height: 1.4;
}

.decision-next {
  grid-column: 2;
  color: var(--text-soft);
}

@media (max-width: 640px) {
  .decision-board-rows { grid-template-columns: 1fr; }
  .decision-row { grid-template-columns: 1fr; }
  .decision-rank { grid-row: auto; width: fit-content; }
  .decision-next { grid-column: 1; }
}
