* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #09090b; --bg2: #0f0f12; --card: #131316; --card2: #18181b;
  --border: #27272a; --border2: #3f3f46;
  --text: #e4e4e7; --text2: #a1a1aa; --muted: #71717a;
  --green: #22c55e; --red: #ef4444; --blue: #3b82f6; --purple: #8b5cf6;
  --amber: #f59e0b; --amber-dim: #78520b; --cyan: #06b6d4; --gold: #eab308;
  --font: 'JetBrains Mono', monospace;
}
body { background: var(--bg); color: var(--text); font-family: var(--font); font-size: 13px; line-height: 1.5; }

/* Header */
header { display: flex; align-items: center; justify-content: space-between; padding: 8px 20px; background: var(--card); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 50; }
.header-left { display: flex; align-items: center; gap: 16px; }
header h1 { font-size: 15px; color: var(--purple); white-space: nowrap; }
header small { color: var(--muted); font-weight: 400; }
.logo-icon { color: var(--cyan); font-size: 14px; }
.nav-tabs { display: flex; gap: 2px; }
.nav-tab { background: none; border: none; color: var(--muted); font-family: var(--font); font-size: 11px; padding: 4px 12px; border-radius: 5px; cursor: pointer; }
.nav-tab:hover { background: var(--bg2); color: var(--text); }
.nav-tab.active { background: var(--purple); color: #fff; font-weight: 600; }
.header-pills { display: flex; gap: 5px; flex-wrap: wrap; }
.pill { padding: 2px 8px; border-radius: 8px; background: var(--bg2); border: 1px solid var(--border); font-size: 10px; white-space: nowrap; }
.pill.ok { border-color: var(--green); color: var(--green); }
.pill.bad { border-color: var(--red); color: var(--red); }
.pill.warn { border-color: var(--amber); color: var(--amber); }
.mode-btn { cursor: pointer; font-weight: 700; text-transform: uppercase; }
.mode-btn:hover { opacity: 0.8; }

/* Wide Layout */
.wide-layout { display: grid; grid-template-columns: 60% 40%; gap: 12px; padding: 12px 20px; }
@media (max-width: 1200px) { .wide-layout { grid-template-columns: 1fr; } }

/* Cards */
.card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; }
.card h2 { font-size: 10px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--muted); margin-bottom: 8px; font-weight: 600; }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.card-header h2 { margin-bottom: 0; }
.card-badge { background: var(--bg2); border: 1px solid var(--border); padding: 1px 7px; border-radius: 8px; font-size: 10px; font-weight: 700; color: var(--text2); }
.empty { color: var(--muted); font-style: italic; padding: 8px 0; font-size: 11px; }
.text-green { color: var(--green); } .text-red { color: var(--red); } .text-amber { color: var(--amber); } .text-cyan { color: var(--cyan); } .text-muted { color: var(--muted); }

/* Badges */
.badge { display: inline-block; padding: 1px 6px; border-radius: 4px; font-size: 9px; font-weight: 600; }
.badge-long { background: rgba(34,197,94,0.12); color: var(--green); }
.badge-short { background: rgba(239,68,68,0.12); color: var(--red); }
.badge-trail, .badge-trail_partial { background: rgba(34,197,94,0.1); color: var(--green); }
.badge-sl_be { background: rgba(59,130,246,0.1); color: var(--blue); }
.badge-smart_reversal { background: rgba(6,182,212,0.1); color: var(--cyan); }
.badge-manual_close, .badge-dead_trade, .badge-max_hold, .badge-timeout_neg, .badge-early_exit, .badge-td_bad_entry, .badge-td_dead, .badge-td_stale { background: rgba(113,113,122,0.1); color: var(--muted); }
.badge-tier-s { background: rgba(234,179,8,0.15); color: var(--gold); font-weight: 800; }
.badge-tier-a { background: rgba(34,197,94,0.1); color: var(--green); }
.badge-tier-b { background: rgba(59,130,246,0.1); color: var(--blue); }
.badge-tier-c { background: rgba(113,113,122,0.1); color: var(--muted); }

/* Phase badges */
.badge-phase-init { background: rgba(113,113,122,0.15); color: var(--muted); }
.badge-phase-be { background: rgba(59,130,246,0.15); color: var(--blue); }
.badge-phase-lock { background: rgba(139,92,246,0.15); color: var(--purple); }
.badge-phase-trail { background: rgba(34,197,94,0.15); color: var(--green); }

/* ═══ POSITION CARDS ═══ */
.pos-card { background: var(--bg2); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin-bottom: 8px; border-left: 3px solid var(--border); }
.pos-card.pos-profit { border-left-color: var(--green); }
.pos-card.pos-negative { border-left-color: var(--red); }
.pos-top { display: flex; justify-content: space-between; align-items: flex-start; }
.pos-info { flex: 1; }
.pos-header { display: flex; align-items: center; gap: 6px; margin-bottom: 2px; }
.pos-sym { font-weight: 800; font-size: 16px; }
.pos-sub { font-size: 10px; color: var(--muted); display: flex; gap: 10px; }
.pos-pnl-area { text-align: right; min-width: 90px; }
.pos-pnl { font-size: 22px; font-weight: 800; line-height: 1.1; }
.pos-pnl-usd { font-size: 12px; font-weight: 600; margin-top: 2px; }

/* Progress Bar */
.pb-wrap { position: relative; margin: 10px 0 4px; }
.pb-bar { height: 8px; background: var(--bg); border-radius: 4px; position: relative; overflow: visible; }
.pb-zone { position: absolute; height: 100%; border-radius: 3px; transition: width 300ms ease, left 300ms ease; }
.pb-loss { background: var(--red); opacity: 0.35; }
.pb-partial { background: var(--purple); opacity: 0.15; border: 1px dashed rgba(139,92,246,0.3); height: calc(100% - 2px); }
.pb-partial.pb-partial-active { background: var(--purple); opacity: 0.4; border: none; height: 100%; }
.pb-profit { background: var(--green); opacity: 0.5; }
.pb-future { background: var(--border); opacity: 0.3; }
.pb-marker { position: absolute; top: -3px; transform: translateX(-50%); font-size: 9px; line-height: 1; z-index: 2; cursor: default; }
.pb-entry { color: var(--text2); font-size: 9px; }
.pb-sl { color: var(--red); }
.pb-partial-mark { color: var(--purple); font-size: 9px; font-weight: 700; top: -10px; }
.pb-current { font-size: 12px; top: -6px; }
.pb-peak { color: var(--gold); }
.pb-tp { color: var(--purple); font-size: 9px; }
.pb-sr { color: var(--gold); font-size: 9px; font-weight: 700; top: -10px; animation: srPulse 1.5s ease-in-out infinite; }
.pb-sr-ready { color: #ff6600; }
@keyframes srPulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }
.badge-sr-ready { background: #ff6600; color: #fff; }
.pb-labels { display: flex; justify-content: space-between; font-size: 9px; color: var(--muted); margin-top: 2px; }
.timeout-wrap { margin-top: 4px; display: flex; align-items: center; gap: 6px; }
.timeout-bar { flex: 1; height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; }
.timeout-fill { height: 100%; border-radius: 2px; transition: width 1s linear, background 0.5s; }
.timeout-label { font-size: 9px; color: var(--muted); white-space: nowrap; min-width: 42px; text-align: right; }
.pos-bottom { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; font-size: 10px; color: var(--muted); }
.pos-close-btn { background: var(--red); color: #fff; border: none; padding: 3px 10px; border-radius: 4px; font-family: var(--font); font-size: 9px; font-weight: 700; cursor: pointer; opacity: 0.7; }
.pos-close-btn:hover { opacity: 1; }

/* ═══ CRASH PROTECTION ═══ */
.crash-cat { font-size: 9px; text-transform: uppercase; letter-spacing: 1px; color: var(--cyan); margin-top: 8px; margin-bottom: 2px; padding-bottom: 2px; border-bottom: 1px solid var(--border); }
.crash-cat:first-child { margin-top: 0; }
.crash-row { display: flex; align-items: center; gap: 8px; padding: 3px 0; font-size: 11px; border-bottom: 1px solid #151518; }
.crash-row:last-child { border-bottom: none; }
.crash-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.crash-dot.ok { background: var(--green); }
.crash-dot.warn { background: var(--amber); }
.crash-dot.block { background: var(--red); animation: pulse 2s infinite; }
.crash-dot.off { background: var(--muted); opacity: 0.3; }
.crash-name { width: 90px; color: var(--text2); }
.crash-val { flex: 1; color: var(--muted); font-size: 10px; }
.crash-summary { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--border); font-size: 10px; display: flex; gap: 16px; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }

/* ═══ RISK PANEL ═══ */
.risk-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.risk-stat { padding: 6px; background: var(--bg2); border-radius: 5px; }
.risk-label { font-size: 9px; color: var(--muted); text-transform: uppercase; }
.risk-value { font-size: 14px; font-weight: 700; }
.cb-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 11px; }
.cb-label { width: 40px; color: var(--muted); }
.cb-bar { flex: 1; height: 4px; background: var(--bg); border-radius: 2px; overflow: hidden; }
.cb-fill { height: 100%; border-radius: 2px; transition: width 300ms; }
.cb-pct { width: 30px; text-align: right; font-size: 10px; }

/* ═══ SIGNALS ═══ */
.log-area { max-height: 200px; overflow-y: auto; }
.log-entry.log-fill { background: rgba(6,182,212,0.08); border-left: 3px solid var(--cyan); padding-left: 6px; font-weight: 600; }
.log-time { color: var(--muted); min-width: 45px; font-size: 9px; }
.sig-filters { display: flex; gap: 3px; margin-bottom: 6px; }

/* Symbols */
.sym-grid { display: flex; flex-wrap: wrap; gap: 4px; }
.sym-chip { padding: 3px 8px; border-radius: 5px; background: var(--bg2); border: 1px solid var(--border); font-size: 10px; font-weight: 600; }
.sym-chip.has-pos { border-color: var(--purple); background: rgba(139,92,246,0.08); }
.cat-dot { display: inline-block; width: 5px; height: 5px; border-radius: 50%; margin-right: 3px; }
.cat-large { background: var(--blue); } .cat-mid { background: var(--purple); } .cat-small { background: var(--amber); }

/* ═══ TRADE TABLE ═══ */
.trade-toolbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.trade-filters { display: flex; gap: 3px; align-items: center; }
.tf-btn { background: var(--bg2); border: 1px solid var(--border); color: var(--muted); padding: 2px 10px; border-radius: 4px; font-family: var(--font); font-size: 10px; cursor: pointer; }
.tf-btn:hover { color: var(--text); }
.tf-btn:disabled { opacity: 0.3; }
.tf-active { background: var(--purple); color: #fff; border-color: var(--purple); font-weight: 600; }
.tf-select { background: var(--bg2); border: 1px solid var(--border); color: var(--text); padding: 2px 6px; border-radius: 4px; font-family: var(--font); font-size: 10px; }
.trade-stats { display: flex; gap: 12px; flex-wrap: wrap; font-size: 11px; padding: 6px 0; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.trade-table { width: 100%; border-collapse: collapse; font-size: 10px; }
.trade-table th { text-align: left; padding: 4px 6px; color: var(--muted); font-size: 9px; text-transform: uppercase; border-bottom: 1px solid var(--border); font-weight: 600; position: sticky; top: 0; background: var(--card); }
.trade-table td { padding: 3px 6px; border-bottom: 1px solid #151518; }
.trade-table tr:hover { background: var(--bg2); }
.trade-pnl { font-weight: 700; }
.scrollable { max-height: 70vh; overflow-y: auto; min-height: 200px; }
.pagination { display: flex; align-items: center; gap: 3px; justify-content: center; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
.pg-btn { background: var(--bg2); border: 1px solid var(--border); color: var(--text); padding: 2px 8px; border-radius: 3px; font-family: var(--font); font-size: 10px; cursor: pointer; }
.pg-btn:disabled { opacity: 0.3; }
.pg-info { font-size: 10px; color: var(--muted); padding: 0 6px; }

/* Config */
.cfg-search { width: 100%; padding: 8px 12px; background: var(--bg); border: 1px solid var(--border); border-radius: 6px; color: var(--text); font-family: var(--font); font-size: 12px; margin-bottom: 12px; }
.cfg-search:focus { outline: none; border-color: var(--purple); }
.cfg-group { margin-bottom: 12px; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.cfg-group-header { padding: 8px 12px; background: var(--bg2); font-size: 11px; font-weight: 700; color: var(--purple); border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; }
.cfg-group-header small { color: var(--muted); font-weight: 400; }
.cfg-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; border-bottom: 1px solid #18181b; gap: 12px; border-left: 3px solid transparent; }
.cfg-row:last-child { border-bottom: none; }
.cfg-row:hover { background: rgba(139,92,246,0.03); }
.cfg-row.cfg-modified { border-left-color: var(--amber); }
.cfg-info { flex: 1; min-width: 0; }
.cfg-label { font-size: 12px; font-weight: 600; }
.cfg-key { font-size: 9px; color: var(--muted); }
.cfg-desc { font-size: 10px; color: var(--text2); margin-top: 2px; }
.cfg-input-group { display: flex; align-items: center; gap: 5px; }
.cfg-input { width: 140px; padding: 4px 8px; background: var(--bg); border: 1px solid var(--border); border-radius: 4px; color: var(--text); font-family: var(--font); font-size: 11px; text-align: right; }
.cfg-input:focus { outline: none; border-color: var(--purple); }
.cfg-default { font-size: 9px; color: var(--muted); margin-top: 2px; text-align: right; }
.cfg-check { width: 16px; height: 16px; accent-color: var(--purple); }
.cfg-save-btn { padding: 4px 10px; background: var(--purple); color: #fff; border: none; border-radius: 4px; font-size: 10px; font-family: var(--font); cursor: pointer; font-weight: 600; }
.cfg-reset-btn { padding: 3px 8px; background: none; color: var(--amber); border: 1px solid var(--amber); border-radius: 4px; font-size: 9px; font-family: var(--font); cursor: pointer; }
.cfg-saved { animation: cfgFlash 1s ease; }
@keyframes cfgFlash { 0% { border-color: var(--green); } 100% { border-color: transparent; } }

/* Scrollbar */
::-webkit-scrollbar { width: 5px; } ::-webkit-scrollbar-track { background: var(--bg); } ::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }

/* ═══ RESPONSIVE BREAKPOINTS ═══ */
/* Tablet: 768-1200px */
@media (max-width: 1200px) and (min-width: 769px) {
  .wide-layout { grid-template-columns: 50% 50%; gap: 10px; }
  .header-pills { gap: 4px; }
  .trade-table { font-size: 10px; }
}

/* Mobile: < 768px */
@media (max-width: 768px) {
  .wide-layout { grid-template-columns: 1fr; }
  header { flex-direction: column; padding: 6px 10px; }
  .header-left { width: 100%; }
  .header-pills { width: 100%; justify-content: center; gap: 3px; flex-wrap: wrap; }
  .pill { font-size: 9px; padding: 2px 6px; }
  .card { padding: 8px 10px; }
  .trade-table { font-size: 9px; }
  .trade-table th, .trade-table td { padding: 2px 3px; }
  .pos-card { padding: 8px; }
  .log-entry { font-size: 10px; padding: 3px 6px; }
  .cfg-row { flex-direction: column; }
  .cfg-input-group { width: 100%; }
  .scrollable { max-height: 300px; }
}

/* ═══ EQUITY CHART ═══ */
#equity-chart { width: 100%; height: 200px; border-radius: 4px; overflow: hidden; }
.equity-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.equity-header h2 { margin: 0; }
.equity-stat { font-size: 11px; }
.equity-stat .positive { color: var(--green); }
.equity-stat .negative { color: var(--red); }

/* ═══ ANALYTICS TAB ═══ */
#page-analytics { padding: 10px 20px; }
.analytics-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 768px) { .analytics-grid { grid-template-columns: 1fr; } }
.analytics-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.analytics-table th { text-align: left; padding: 4px 8px; border-bottom: 1px solid var(--border); color: var(--muted); font-size: 9px; text-transform: uppercase; }
.analytics-table td { padding: 4px 8px; border-bottom: 1px solid var(--border); }
.analytics-table tr:hover { background: rgba(255,255,255,0.02); }
.hour-bar { display: inline-block; height: 16px; min-width: 2px; border-radius: 2px; }
.hour-cell { display: flex; align-items: center; gap: 4px; }

/* ═══ CLOSE ALL BUTTON ═══ */
#h-closeall { background: rgba(239,68,68,0.2); color: var(--red); border: 1px solid rgba(239,68,68,0.3); font-weight: 700; animation: pulse 2s infinite; cursor: pointer; }
#h-closeall:hover { background: rgba(239,68,68,0.4); }
#h-pause { cursor: pointer; }
#h-pause.active { background: rgba(251,191,36,0.2); color: var(--amber); border: 1px solid rgba(251,191,36,0.3); }

/* ═══ CIRCUIT BREAKER ALERT ═══ */
.cb-alert { background: rgba(239,68,68,0.15); border: 1px solid var(--red); border-radius: 4px; padding: 6px 10px; margin-bottom: 8px; font-size: 11px; color: var(--red); animation: pulse 1.5s infinite; }

/* ═══ EXPORT BUTTON ═══ */
.export-btn { background: rgba(139,92,246,0.15); color: var(--purple); border: 1px solid rgba(139,92,246,0.2); padding: 3px 8px; border-radius: 4px; font-size: 9px; cursor: pointer; font-family: inherit; }
.export-btn:hover { background: rgba(139,92,246,0.3); }

/* ═══ WATCHLIST TABLE ═══ */
.sym-table { width: 100%; border-collapse: collapse; font-size: 10px; }
.sym-table th { text-align: left; padding: 2px 6px; color: var(--muted); font-size: 9px; text-transform: uppercase; border-bottom: 1px solid var(--border); }
.sym-table td { padding: 2px 6px; border-bottom: 1px solid var(--border); }
.sym-table tr:hover { background: rgba(255,255,255,0.02); }
.sym-table .has-pos { background: rgba(139,92,246,0.08); }

/* ═══ TRADE MODAL ═══ */
#trade-modal { backdrop-filter: blur(4px); }
#trade-modal h3 { font-size: 14px; color: var(--text); }
#trade-modal strong { color: var(--text); }

/* ═══ DAILY SUMMARY CARD ═══ */
#daily-summary-card {
  background: linear-gradient(135deg, var(--card), rgba(139,92,246,0.05));
  border: 1px solid rgba(139,92,246,0.15);
  padding: 8px 14px;
  border-radius: 6px;
}

/* ═══ AMOLED DARK THEME ═══ */
:root.amoled {
  --bg: #000;
  --bg2: #050505;
  --card: #0a0a0a;
  --border: #111;
  --border2: #1a1a1a;
}

/* ═══ THEME TOGGLE (optional) ═══ */
.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 9px;
  cursor: pointer;
  font-family: inherit;
}
.theme-toggle:hover { color: var(--text); border-color: var(--text2); }

/* ═══ INDICATOR WARNING COLORS IN WATCHLIST ═══ */
.sym-table .rsi-extreme { font-weight: 700; }
.sym-table .ob-strong { font-weight: 600; }

/* ═══ FILTER STATUS DOTS ═══ */
.crash-dot.active { background: var(--green); }
.crash-dot.off { background: var(--muted); opacity: 0.4; }

/* ═══ IMPROVED SCROLLBAR FOR ANALYTICS ═══ */
#page-analytics .scrollable { max-height: 300px; overflow-y: auto; }
#page-analytics .scrollable::-webkit-scrollbar { width: 4px; }
#page-analytics .scrollable::-webkit-scrollbar-track { background: var(--bg); }
#page-analytics .scrollable::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 4px; }

/* ═══ TRADE HISTORY POLISH ═══ */
.badge-sr { background: rgba(139,92,246,0.15); color: var(--purple); }
.badge-giveback { background: rgba(59,130,246,0.15); color: var(--cyan); }
.badge-flip { background: rgba(139,92,246,0.2); color: var(--purple); font-weight: 700; }
.badge-trail { background: rgba(34,197,94,0.15); color: var(--green); }
.badge-tp { background: rgba(34,197,94,0.2); color: var(--green); font-weight: 700; }
.badge-mom { background: rgba(251,191,36,0.15); color: var(--amber); }
.badge-dead { background: rgba(239,68,68,0.15); color: var(--red); }
.badge-timeout { background: rgba(161,161,170,0.15); color: var(--muted); }
.badge-open { background: rgba(59,130,246,0.25); color: var(--cyan); font-weight: 700; animation: srPulse 1.5s ease-in-out infinite; }
.badge-breakeven { background: rgba(161,161,170,0.15); color: var(--muted); }
.trade-open-row { background: rgba(59,130,246,0.06) !important; }
.trade-detail-row td { padding: 6px 10px !important; background: var(--bg2); font-size: 9px; }
.trade-detail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 4px 12px; }
.trade-detail-grid .td-item { display: flex; justify-content: space-between; }
.trade-detail-grid .td-label { color: var(--muted); }
.trade-detail-grid .td-val { font-weight: 600; }
.expand-btn { background: none; border: 1px solid var(--border); color: var(--muted); width: 18px; height: 18px; border-radius: 3px; cursor: pointer; font-size: 11px; line-height: 16px; text-align: center; }
.expand-btn:hover { background: var(--border); color: var(--text); }
.trade-table tr:hover { background: rgba(139,92,246,0.06); }
.trade-table td { border-bottom: 1px solid var(--border); }
.trade-table th[onclick] { user-select: none; }
.trade-table th[onclick]:hover { color: var(--text); }

/* ═══ SIGNALS POLISH V6.5 ═══ */
.log-entry { padding: 4px 6px; border-bottom: 1px solid var(--border); font-size: 10px; display: flex; gap: 5px; align-items: center; flex-wrap: wrap; animation: sigFadeIn 0.3s ease-out; }
.log-entry.log-ok { border-left: 3px solid var(--green); padding-left: 6px; }
@keyframes sigFadeIn { from { opacity: 0; transform: translateY(-6px); background: rgba(139,92,246,0.15); } to { opacity: 1; transform: translateY(0); background: transparent; } }
.sig-conf { color: var(--muted); font-size: 9px; }
.text-amber { color: var(--amber); }
.text-cyan { color: var(--cyan); }
/* V6.5: signals panel — overrides .log-area max-height (200px → 500px) */
#sig-list { max-height: 500px; overflow-y: auto; scroll-behavior: smooth; }
.sig-count { background: var(--bg2); color: var(--amber); font-size: 9px; padding: 1px 5px; border-radius: 8px; font-weight: 700; margin-left: auto; }

/* V6.5 Risk-adjusted metrics grid */
.metric-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 6px; margin-top: 8px; }
.metric-card { background: var(--bg2); border: 1px solid var(--border); border-radius: 4px; padding: 6px 8px; text-align: center; }
.metric-label { font-size: 9px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.metric-value { font-size: 14px; font-weight: 700; margin-top: 2px; }

/* V6.5 Number flash animation (Bloomberg style) */
@keyframes flashUp { 0% { background: rgba(34,197,94,0.4); } 100% { background: transparent; } }
@keyframes flashDown { 0% { background: rgba(239,68,68,0.4); } 100% { background: transparent; } }
.flash-up { animation: flashUp 0.6s ease-out; }
.flash-down { animation: flashDown 0.6s ease-out; }

/* V6.5 Color-blind shape redundancy: arrows in PnL display */
.text-green::before, .text-red::before { display: none; }
.pnl-up::before { content: '▲ '; }
.pnl-down::before { content: '▼ '; }

/* ═══ V5 POLISH ═══ */
.text-purple { color: var(--purple); }
.badge-btc-crash { background: rgba(239,68,68,0.25); color: var(--red); font-weight: 700; }

/* ═══ ANALYTICS SECTIONS ═══ */
.analytics-section { margin-bottom: 16px; }
.analytics-section h3 { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--purple); margin-bottom: 6px; font-weight: 600; }
.hour-bar-wrap { display: flex; align-items: flex-end; gap: 2px; height: 60px; margin-top: 4px; }
.hour-bar { flex: 1; min-width: 0; border-radius: 2px 2px 0 0; position: relative; cursor: default; }
.hour-bar-label { font-size: 8px; color: var(--muted); text-align: center; margin-top: 2px; }

/* ═══ LOADING STATE ═══ */
.loading-spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--border); border-top-color: var(--purple); border-radius: 50%; animation: spin 0.8s linear infinite; vertical-align: middle; margin-right: 6px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══ AUTH SCREEN ═══ */
#auth-screen {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 9999;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
}
#auth-screen.hidden { display: none; }
.auth-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 16px;
  padding: 40px 36px; text-align: center; width: 340px; max-width: 90vw;
  box-shadow: 0 0 60px rgba(139,92,246,0.08);
}
.auth-logo { font-size: 48px; color: var(--cyan); margin-bottom: 8px; line-height: 1; }
.auth-card h1 { font-size: 22px; color: var(--purple); margin-bottom: 2px; }
.auth-card h1 small { color: var(--muted); font-weight: 400; font-size: 13px; }
.auth-card p { color: var(--muted); font-size: 11px; margin-bottom: 24px; }
.auth-input {
  width: 100%; padding: 12px 14px; background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); font-family: var(--font); font-size: 13px;
  text-align: center; letter-spacing: 1px; transition: border-color 0.2s;
}
.auth-input:focus { outline: none; border-color: var(--purple); box-shadow: 0 0 0 3px rgba(139,92,246,0.15); }
.auth-input.shake { animation: authShake 0.4s ease; }
@keyframes authShake { 0%,100% { transform: translateX(0); } 20%,60% { transform: translateX(-8px); } 40%,80% { transform: translateX(8px); } }
.auth-error { color: var(--red); font-size: 11px; min-height: 18px; margin: 8px 0; }
.auth-btn {
  width: 100%; padding: 10px; background: var(--purple); color: #fff; border: none;
  border-radius: 8px; font-family: var(--font); font-size: 13px; font-weight: 700;
  cursor: pointer; transition: opacity 0.2s;
}
.auth-btn:hover { opacity: 0.85; }
.auth-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.auth-hint { margin-top: 16px; font-size: 9px; color: var(--muted); opacity: 0.5; }

/* ═══════════════════════════════════════════════════════════
   POLISH V6.8 — additive refinements, keeps the existing look
   ═══════════════════════════════════════════════════════════ */

/* Tabular numerals everywhere — numbers no longer jitter in columns */
body { font-variant-numeric: tabular-nums; }

/* Smooth default transitions site-wide */
.card, .pos-card, .sym-chip, .nav-tab, .pill, .tf-btn, .pg-btn,
.log-entry, .cfg-row, .trade-table tr, .sym-table tr, .cfg-save-btn,
.cfg-reset-btn, .pos-close-btn, .expand-btn, .export-btn, .theme-toggle,
.cfg-input, .cfg-search, .auth-input, .auth-btn {
  transition: background 160ms ease, border-color 160ms ease,
              color 160ms ease, box-shadow 200ms ease, transform 160ms ease;
}

/* Layout columns (were unstyled — HTML referenced them but no rule) */
.col-left, .col-right { min-width: 0; }
.col-left > .card:last-child, .col-right > .card:last-child { margin-bottom: 0; }

/* Card polish — subtle depth + header divider */
.card {
  box-shadow: 0 1px 0 rgba(255,255,255,0.02) inset,
              0 1px 20px -12px rgba(0,0,0,0.8);
}
.card:hover { border-color: var(--border2); }
.card-header {
  padding-bottom: 6px;
  border-bottom: 1px solid #1b1b1e;
  margin-bottom: 10px;
}

/* Pill — consistent sizing + live status pulse */
.pill { transition: all 160ms ease; padding: 3px 9px; line-height: 1.4; }
.pill.ok::before, .pill.bad::before, .pill.warn::before {
  content: ''; display: inline-block;
  width: 5px; height: 5px; border-radius: 50%;
  background: currentColor; margin-right: 5px;
  box-shadow: 0 0 6px currentColor;
  vertical-align: middle;
}
.pill.warn { animation: pillPulse 2.2s ease-in-out infinite; }
@keyframes pillPulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(245,158,11,0.0); }
  50%     { box-shadow: 0 0 0 3px rgba(245,158,11,0.12); }
}

/* Close-all button — move inline styles into CSS so hover works */
.close-all-btn {
  background: rgba(239,68,68,0.18) !important;
  color: var(--red) !important;
  border: 1px solid rgba(239,68,68,0.35) !important;
  font-weight: 700 !important;
  font-size: 10px !important;
  padding: 3px 10px !important;
  border-radius: 8px !important;
  letter-spacing: 0.5px;
  cursor: pointer;
  animation: pulse 2.4s ease-in-out infinite;
}
.close-all-btn:hover {
  background: var(--red) !important;
  color: #fff !important;
  border-color: var(--red) !important;
  box-shadow: 0 0 16px rgba(239,68,68,0.4);
  animation: none;
}

/* Circuit breaker flash (was injected at runtime) */
@keyframes cbFlash {
  0%,100% { background: rgba(239,68,68,0.2); box-shadow: 0 0 0 0 rgba(239,68,68,0); }
  50%     { background: rgba(239,68,68,0.5); box-shadow: 0 0 14px rgba(239,68,68,0.45); }
}
.cb-flash { animation: cbFlash 1.2s ease-in-out infinite !important; }

/* Nav tabs — underline indicator */
.nav-tab { position: relative; }
.nav-tab.active {
  background: var(--purple);
  box-shadow: 0 2px 16px -6px rgba(139,92,246,0.6);
}

/* Card headers on hover subtly highlight the divider */
.card:hover .card-header { border-bottom-color: #27272a; }

/* Position card — lift on hover */
.pos-card:hover {
  background: var(--card2);
  border-color: var(--border2);
}
.pos-card.pos-profit:hover {
  box-shadow: inset 2px 0 0 var(--green), 0 4px 24px -12px rgba(34,197,94,0.2);
}
.pos-card.pos-negative:hover {
  box-shadow: inset 2px 0 0 var(--red), 0 4px 24px -12px rgba(239,68,68,0.2);
}

/* Symbol chips — hover glow */
.sym-chip:hover {
  border-color: var(--border2);
  color: var(--text);
  transform: translateY(-1px);
}
.sym-chip.has-pos {
  box-shadow: 0 0 12px -4px rgba(139,92,246,0.4);
}

/* Log entries — lift on hover + tighter rhythm */
.log-entry { line-height: 1.45; }
.log-entry:hover { background: rgba(255,255,255,0.018); }
.log-entry.log-ok:hover { background: rgba(34,197,94,0.05); }
.log-entry.log-fill:hover { background: rgba(6,182,212,0.1); }

/* Trade table — sortable header indicator + row lift */
.trade-table th[onclick] {
  cursor: pointer;
  padding-right: 14px;
  position: relative;
}
.trade-table th[onclick]::after {
  content: '⇅';
  position: absolute;
  right: 4px;
  opacity: 0.25;
  font-size: 9px;
}
.trade-table th[onclick]:hover::after { opacity: 0.7; color: var(--purple); }
.trade-table tr { transition: background 120ms ease; }
.trade-pnl.text-green { text-shadow: 0 0 12px rgba(34,197,94,0.15); }
.trade-pnl.text-red   { text-shadow: 0 0 12px rgba(239,68,68,0.15); }

/* Buttons — general polish */
.tf-btn:hover:not(:disabled) {
  border-color: var(--purple);
  color: var(--text);
}
.pg-btn:hover:not(:disabled) {
  background: rgba(139,92,246,0.1);
  border-color: var(--purple);
  color: var(--text);
}

/* Inputs — purple focus ring consistent everywhere */
.cfg-input:focus, .cfg-search:focus, .auth-input:focus, .tf-select:focus {
  box-shadow: 0 0 0 3px rgba(139,92,246,0.15);
}

/* Focus-visible — keyboard accessibility */
:focus-visible {
  outline: 2px solid var(--purple);
  outline-offset: 2px;
  border-radius: 3px;
}
button:focus-visible, .pill:focus-visible { outline-offset: 3px; }

/* Empty state — subtle breathing */
.empty {
  text-align: center;
  padding: 16px 8px;
  opacity: 0.7;
  font-size: 10.5px;
  letter-spacing: 0.3px;
}

/* Scrollbar — thicker, purple accent on hover */
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border2);
  border-radius: 4px;
  transition: background 0.2s;
}
::-webkit-scrollbar-thumb:hover { background: var(--purple); }
* { scrollbar-width: thin; scrollbar-color: var(--border2) transparent; }

/* Card-badge — slightly larger + better alignment */
.card-badge {
  font-size: 10px;
  padding: 2px 8px;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
}

/* Risk stat — add depth */
.risk-stat {
  border: 1px solid var(--border);
  transition: border-color 160ms ease;
}
.risk-stat:hover { border-color: var(--border2); }
.risk-value { font-variant-numeric: tabular-nums; }

/* Gate stats panel inherits .card but could use a hint */
#gate-stats-panel { font-size: 10.5px; }
#gate-stats-panel > div { padding: 3px 0; border-bottom: 1px solid #18181b; }
#gate-stats-panel > div:last-child { border-bottom: none; }

/* Crash row — tighter with subtle hover */
.crash-row { padding: 4px 0; transition: background 120ms ease; }
.crash-row:hover { background: rgba(255,255,255,0.015); padding-left: 4px; }

/* Config rows — purple left-border on hover (not just modified) */
.cfg-row { transition: background 120ms ease, border-left-color 200ms ease; }
.cfg-row:hover { border-left-color: rgba(139,92,246,0.3); }
.cfg-row.cfg-modified { background: rgba(245,158,11,0.03); }

/* Auth card — purple glow aura */
.auth-card {
  box-shadow:
    0 0 80px -20px rgba(139,92,246,0.25),
    0 20px 60px -30px rgba(0,0,0,0.6),
    inset 0 1px 0 rgba(255,255,255,0.03);
}
.auth-logo {
  animation: authLogo 4s ease-in-out infinite;
}
@keyframes authLogo {
  0%,100% { filter: drop-shadow(0 0 20px rgba(6,182,212,0.35)); }
  50%     { filter: drop-shadow(0 0 32px rgba(6,182,212,0.6)); }
}

/* Mode button — subtle gradient when live */
#h-mode.ok {
  background: linear-gradient(135deg, rgba(34,197,94,0.15), rgba(34,197,94,0.05));
}
#h-mode.warn {
  background: linear-gradient(135deg, rgba(245,158,11,0.18), rgba(245,158,11,0.05));
}

/* Daily summary card — polish the existing gradient */
#daily-summary-card {
  box-shadow: 0 0 40px -20px rgba(139,92,246,0.25);
}

/* Header — subtle bottom glow */
header {
  box-shadow: 0 1px 0 var(--border), 0 8px 24px -16px rgba(0,0,0,0.6);
}

/* Mobile header — stack pills cleanly instead of chaotic wrap */
@media (max-width: 768px) {
  .header-pills { gap: 5px; padding-top: 4px; }
  .pill { font-size: 9.5px; padding: 2px 7px; }
  .close-all-btn { font-size: 9.5px !important; padding: 2px 8px !important; }
  .card-header { padding-bottom: 4px; }
  .scrollable { max-height: 280px; }
  .auth-card { padding: 32px 28px 28px; }
}

/* Tablet header compaction */
@media (max-width: 1200px) and (min-width: 769px) {
  .wide-layout { padding: 10px 14px; gap: 10px; }
  .card { padding: 10px 12px; }
}

/* ═══════════════════════════════════════════════════════════
   V6.11 POSITION CARD — enriched metrics + smooth price + trail
   ═══════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════
   V6.11c POSITION CARDS — cockpit instrument design
   Full-width, rounded, neon indicators, capture gauge
   ═══════════════════════════════════════════════════════════ */

/* Section wrapper — full width above grid */
.pos-section {
  padding: 12px 20px 8px;
}
.pos-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.pos-section-header h2 {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--muted);
  font-weight: 600;
  margin: 0;
}
.pos-count-badge {
  background: var(--bg2);
  border: 1px solid var(--border);
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text2);
}
.pos-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ── Position card — 2-row: main (3 cols) + progress bar ── */
.pc {
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--border);
  transition: border-color 250ms ease, box-shadow 300ms ease;
}
.pc:hover { border-color: var(--border2); }
.pc-main {
  display: flex;
  align-items: stretch;
}

/* Profit/loss neon glow */
.pc.pc-green {
  border-left: 4px solid var(--green);
  box-shadow: inset 4px 0 20px -10px rgba(34,197,94,0.15), 0 2px 12px -6px rgba(34,197,94,0.08);
}
.pc.pc-red {
  border-left: 4px solid var(--red);
  box-shadow: inset 4px 0 20px -10px rgba(239,68,68,0.15), 0 2px 12px -6px rgba(239,68,68,0.08);
}
.pc.pc-green:hover { box-shadow: inset 4px 0 24px -8px rgba(34,197,94,0.25), 0 4px 20px -8px rgba(34,197,94,0.12); }
.pc.pc-red:hover   { box-shadow: inset 4px 0 24px -8px rgba(239,68,68,0.25), 0 4px 20px -8px rgba(239,68,68,0.12); }

/* ── Left: identity ── */
.pc-id {
  padding: 14px 16px;
  min-width: 160px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  border-right: 1px solid rgba(255,255,255,0.04);
}
.pc-sym-row { display: flex; align-items: center; gap: 8px; }
.pc-sym { font-weight: 800; font-size: 18px; color: var(--text); letter-spacing: 0.5px; }
.pc-side {
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.5px;
}
.pc-side-long  { background: rgba(34,197,94,0.18); color: var(--green); }
.pc-side-short { background: rgba(239,68,68,0.18); color: var(--red); }

.pc-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.pc-tag {
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.3px;
  border: 1px solid transparent;
}
.pc-strat-dev { background: rgba(139,92,246,0.15); color: var(--purple); border-color: rgba(139,92,246,0.25); }
.pc-strat-inv { background: rgba(6,182,212,0.15); color: var(--cyan); border-color: rgba(6,182,212,0.25); }
.pc-strat-mom { background: rgba(245,158,11,0.15); color: var(--amber); border-color: rgba(245,158,11,0.25); }
.pc-strat-rec { background: rgba(113,113,122,0.15); color: var(--muted); border-color: rgba(113,113,122,0.25); }
.pc-tier-s { background: rgba(234,179,8,0.2); color: var(--gold); font-weight: 800; }
.pc-tier-a { background: rgba(34,197,94,0.12); color: var(--green); }
.pc-tier-b { background: rgba(59,130,246,0.12); color: var(--blue); }
.pc-tier-c { background: rgba(113,113,122,0.1); color: var(--muted); }

/* V7: SR armed badge (primary exit) */
.pc-sr-armed {
  background: rgba(234,179,8,0.2);
  color: var(--gold);
  border-color: rgba(234,179,8,0.4);
  position: relative;
  padding-left: 14px;
  font-weight: 800;
  box-shadow: 0 0 8px rgba(234,179,8,0.2);
}
.pc-sr-armed::before {
  content: '';
  position: absolute; left: 4px; top: 50%; transform: translateY(-50%);
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 6px var(--gold);
  animation: srArmedPulse 1s ease-in-out infinite;
}
@keyframes srArmedPulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 6px var(--gold); }
  50% { opacity: 0.5; box-shadow: 0 0 2px var(--gold); }
}

/* Legacy trail badge (kept for backward compat) */
.pc-trail-on {
  background: rgba(34,197,94,0.15);
  color: var(--green);
  border-color: rgba(34,197,94,0.3);
}
.pc-trail-off { background: rgba(113,113,122,0.1); color: var(--muted); }

.pc-meta {
  display: flex;
  gap: 10px;
  font-size: 9.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ── Center: prices + gauges ── */
.pc-center {
  flex: 1;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 24px;
  border-right: 1px solid rgba(255,255,255,0.04);
}
.pc-prices { display: flex; flex-direction: column; gap: 2px; min-width: 90px; }
.pc-live-row { display: flex; align-items: center; gap: 6px; }
.pc-live-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
  animation: liveDotPulse 1.2s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes liveDotPulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 8px var(--cyan); }
  50% { opacity: 0.5; box-shadow: 0 0 3px var(--cyan); }
}
.pc-live-price {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  transition: color 150ms ease;
}
.pc-price-flash { animation: pcPriceFlash 0.25s ease-out; }
@keyframes pcPriceFlash {
  0% { color: var(--cyan); text-shadow: 0 0 8px rgba(6,182,212,0.5); }
  100% { color: var(--text); text-shadow: none; }
}
.pc-entry-price { font-size: 10px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Gauges */
.pc-gauges {
  display: flex;
  gap: 16px;
  flex: 1;
  flex-wrap: wrap;
}
.pc-gauge { display: flex; flex-direction: column; gap: 2px; min-width: 50px; }
.pc-gauge-label {
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--muted);
  line-height: 1;
}
.pc-gauge-val {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  transition: color 150ms ease;
}
.pc-gauge-muted { color: var(--muted); font-weight: 400; font-size: 10px; }

/* Capture progress bar */
.pc-gauge-bar {
  width: 60px;
  height: 5px;
  background: rgba(255,255,255,0.06);
  border-radius: 3px;
  overflow: hidden;
}
.pc-gauge-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 400ms ease, background 300ms ease;
}
.pc-fill-green { background: var(--green); box-shadow: 0 0 6px rgba(34,197,94,0.4); }
.pc-fill-amber { background: var(--amber); }
.pc-fill-red   { background: var(--red); }

/* ── Progress bar (full-width below 3 columns) ── */
.pcb {
  padding: 8px 16px 10px;
  border-top: 1px solid rgba(255,255,255,0.04);
}
.pcb-track {
  position: relative;
  height: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  overflow: visible;
}
.pcb-zone {
  position: absolute;
  height: 100%;
  border-radius: 2px;
  transition: left 400ms ease, width 400ms ease;
}
.pcb-fill-profit {
  background: linear-gradient(90deg, rgba(34,197,94,0.15), rgba(34,197,94,0.5));
  box-shadow: 0 0 6px rgba(34,197,94,0.15);
}
.pcb-fill-loss {
  background: linear-gradient(90deg, rgba(239,68,68,0.5), rgba(239,68,68,0.15));
  box-shadow: 0 0 6px rgba(239,68,68,0.15);
}
/* Dots instead of text markers */
.pcb-dot {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  transition: left 400ms ease;
  cursor: default;
}
.pcb-dot-entry {
  width: 6px; height: 6px;
  background: var(--text2);
  border: 1px solid var(--muted);
}
.pcb-dot-current {
  width: 10px; height: 10px;
  background: var(--text);
  border: 2px solid var(--card);
  box-shadow: 0 0 8px rgba(255,255,255,0.4);
  z-index: 3;
}
.pcb-dot-peak {
  width: 7px; height: 7px;
  background: var(--green);
  box-shadow: 0 0 6px rgba(34,197,94,0.5);
  z-index: 2;
}
.pcb-dot-sl {
  width: 8px; height: 4px;
  border-radius: 1px;
  background: var(--red);
  box-shadow: 0 0 6px rgba(239,68,68,0.4);
  z-index: 2;
}
.pcb-dot-tp {
  width: 6px; height: 6px;
  background: var(--cyan);
  transform: translate(-50%, -50%) rotate(45deg);
  border-radius: 1px;
  z-index: 2;
}
/* Labels below the bar */
.pcb-labels {
  position: relative;
  height: 14px;
  margin-top: 2px;
}
.pcb-labels span {
  position: absolute;
  transform: translateX(-50%);
  font-size: 8px;
  color: var(--muted);
  letter-spacing: 0.3px;
  transition: left 400ms ease;
}
.pcb-lbl-cur  { color: var(--text2); font-weight: 700; }
.pcb-lbl-peak { color: var(--green); }
.pcb-lbl-sl   { color: var(--red); }

/* ── Right: PnL + status panel ── */
.pc-right {
  padding: 10px 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
  min-width: 140px;
}
.pc .pc-pnl {
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  transition: color 150ms ease;
}
.pc .pc-usd {
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.pc-close {
  margin-top: 6px;
  background: none;
  border: 1px solid var(--border2);
  color: var(--muted);
  padding: 3px 14px;
  border-radius: 8px;
  font-family: var(--font);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 200ms ease;
}
.pc-close:hover { color: var(--red); border-color: var(--red); background: rgba(239,68,68,0.1); }

/* ── Countdown bars (DEAD + TIMEOUT) — visible in right panel ── */
.pc-countdown {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  margin-top: 4px;
  padding: 4px 0;
}
.pc-cd-label {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--muted);
  text-transform: uppercase;
  min-width: 44px;
}
.pc-cd-bar {
  flex: 1;
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
  overflow: hidden;
  min-width: 40px;
}
.pc-cd-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 500ms linear, background 300ms ease;
}
.pc-cd-time {
  font-size: 10px;
  font-weight: 700;
  color: var(--text2);
  font-variant-numeric: tabular-nums;
  min-width: 36px;
  text-align: right;
}

/* DEAD countdown specific — red glow when urgent */
.pc-countdown-dead .pc-cd-label { color: var(--red); }
.pc-countdown-dead .pc-cd-bar { background: rgba(239,68,68,0.12); }
.pc-countdown-dead .pc-cd-time { color: var(--red); }

/* Legacy compat */
.pc-timeout-fill { height: 100%; border-radius: 3px; transition: width 500ms linear, background 300ms ease; }
.pc-timeout-label { font-size: 10px; font-weight: 700; color: var(--text2); font-variant-numeric: tabular-nums; min-width: 36px; text-align: right; }

/* ── Status indicators (TRAIL / TP / SR / DEAD) — bigger, clearer ── */
.pc-indicators {
  display: flex;
  gap: 5px;
  margin-top: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.pc-ind {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.6px;
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  transition: all 200ms ease;
  border: 1px solid transparent;
}
.pc-ind-off {
  background: rgba(255,255,255,0.03);
  color: var(--muted);
  opacity: 0.4;
}
.pc-ind-on {
  background: rgba(34,197,94,0.15);
  color: var(--green);
  border-color: rgba(34,197,94,0.4);
  box-shadow: 0 0 8px rgba(34,197,94,0.25);
}
.pc-ind-warm {
  background: rgba(6,182,212,0.15);
  color: var(--cyan);
}
.pc-ind-hot {
  background: rgba(234,179,8,0.2);
  color: var(--gold);
  box-shadow: 0 0 8px rgba(234,179,8,0.3);
  animation: srPulse 1.5s ease-in-out infinite;
}
.pc-ind-warn {
  background: rgba(239,68,68,0.15);
  color: var(--red);
  animation: pulse 1.5s ease-in-out infinite;
}
.pc-ind-dim {
  background: rgba(245,158,11,0.1);
  color: var(--amber);
  opacity: 0.7;
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .pc-main { flex-direction: column; }
  .pc-id { border-right: none; border-bottom: 1px solid rgba(255,255,255,0.04); flex-direction: row; align-items: center; }
  .pc-center { border-right: none; border-bottom: 1px solid rgba(255,255,255,0.04); }
  .pc-right { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 16px; }
  .pc .pc-pnl { font-size: 22px; }
  .pos-section { padding: 8px 12px; }
}

/* Live price flash — brief highlight on change */
.pos-price-flash {
  animation: priceFlash 0.3s ease-out;
}
@keyframes priceFlash {
  0% { background: rgba(139,92,246,0.4); border-radius: 3px; }
  100% { background: transparent; }
}

/* Trail ACTIVE badge — pulsing green dot */
.badge-trail-active {
  background: rgba(34,197,94,0.15);
  color: var(--green);
  position: relative;
  padding-left: 14px !important;
}
.badge-trail-active::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 50%;
  transform: translateY(-50%);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
  animation: trailPulse 1.5s ease-in-out infinite;
}
@keyframes trailPulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 6px var(--green); }
  50% { opacity: 0.4; box-shadow: 0 0 2px var(--green); }
}

/* PnL smooth number transitions */
.pos-pnl, .pos-pnl-usd {
  transition: color 150ms ease;
}

/* V6.11b: Position card — tighter padding, smaller margin, smooth transitions */
.pos-card {
  padding: 10px 12px 8px;
  margin-bottom: 6px;
  transition: border-left-color 300ms ease, background 200ms ease;
}
.pos-sym { font-size: 15px; }
.pos-pnl { font-size: 20px; }
.pos-pnl-usd { font-size: 11px; }
.pos-sub { font-size: 9.5px; }
.pos-bottom { margin-top: 4px; }

/* ═══════════════════════════════════════════════════════════
   V6.11c COCKPIT THEME — Signaux + Trade History
   Rounded cards, neon accents, consistent with position cards
   ═══════════════════════════════════════════════════════════ */

/* ═══ V6.11c INLINE SIGNALS + TOOLTIP ═══ */

/* Single-line signal row */
.sl {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  font-size: 10.5px;
  border-radius: 6px;
  margin-bottom: 2px;
  border-left: 3px solid transparent;
  background: rgba(255,255,255,0.01);
  position: relative;
  transition: background 100ms ease;
  animation: sigFadeIn 0.2s ease-out;
  cursor: default;
}
.sl:hover { background: rgba(255,255,255,0.04); z-index: 10; }

/* Outcome left borders */
.sl-fill   { border-left-color: var(--cyan); background: rgba(6,182,212,0.03); }
.sl-ok     { border-left-color: var(--green); background: rgba(34,197,94,0.025); }
.sl-gate   { border-left-color: var(--amber); }
.sl-bad    { border-left-color: var(--red); }
.sl-fill:hover { background: rgba(6,182,212,0.07); }
.sl-ok:hover   { background: rgba(34,197,94,0.06); }

/* Time */
.sl-t { color: var(--muted); font-size: 9px; min-width: 48px; font-variant-numeric: tabular-nums; }

/* Symbol */
.sl-sym { font-weight: 800; color: var(--text); min-width: 42px; font-size: 11px; }

/* Side — single letter pill */
.sl-sd {
  width: 16px; height: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 4px;
  font-size: 9px; font-weight: 800;
}
.sl-sd-long  { background: rgba(34,197,94,0.2); color: var(--green); }
.sl-sd-short { background: rgba(239,68,68,0.2); color: var(--red); }

/* Strategy — tiny pill */
.sl-st {
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

/* Confidence */
.sl-c {
  color: var(--text2);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  min-width: 18px;
}
/* V7.0: Pipeline visualization */
.sl-pipe { display: inline-flex; align-items: center; gap: 1px; font-size: 9px; color: var(--muted); margin: 0 4px; }
.sl-pipe .sl-sd { font-weight: 800; margin: 0 1px; }
.pl-done { color: var(--green); font-size: 8px; }
.pl-active { color: var(--cyan); font-size: 9px; animation: srPulse 1s ease-in-out infinite; }
.pl-fail { color: var(--red); font-size: 9px; font-weight: 700; }
.pl-skip { color: var(--border); font-size: 8px; }
.sl-result { font-size: 9px; font-weight: 600; padding: 1px 4px; border-radius: 3px; min-width: 36px; text-align: center; }
.sl-res-open { background: rgba(34,197,94,0.2); color: var(--green); }
.sl-res-fail { background: rgba(239,68,68,0.15); color: var(--red); }
.sl-res-flip { background: rgba(139,92,246,0.2); color: var(--purple); font-weight: 700; }
.sl-res-pending { background: rgba(59,130,246,0.2); color: var(--cyan); animation: srPulse 1.5s ease-in-out infinite; }
.sl-res-gate { background: rgba(251,191,36,0.15); color: var(--amber); }
.sl-ctx {
  color: var(--purple);
  font-size: 8px;
  font-weight: 600;
  min-width: 14px;
  text-align: right;
}

/* Status — right-aligned pill */
.sl-status {
  margin-left: auto;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 5px;
  letter-spacing: 0.2px;
  white-space: nowrap;
}
.sl-status-ok   { color: var(--green); background: rgba(34,197,94,0.12); }
.sl-status-fill { color: var(--cyan); background: rgba(6,182,212,0.15); }
.sl-status-gate { color: var(--amber); background: rgba(245,158,11,0.1); }
.sl-status-bad  { color: var(--red); background: rgba(239,68,68,0.1); }

/* ── Tooltip — appears on hover below the row ── */
.sl-tip {
  display: none;
  position: absolute;
  left: 8px; right: 8px;
  top: calc(100% + 2px);
  background: var(--card2);
  border: 1px solid var(--border2);
  border-radius: 10px;
  padding: 8px 12px;
  box-shadow: 0 8px 24px -8px rgba(0,0,0,0.6);
  z-index: 100;
  font-size: 10px;
}
.sl:hover .sl-tip { display: block; }

.sl-tip-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  color: var(--text2);
  font-variant-numeric: tabular-nums;
}
.sl-tip-metrics span {
  white-space: nowrap;
}
.sl-tip-reason {
  margin-top: 4px;
  color: var(--muted);
  font-style: italic;
  font-size: 9.5px;
  line-height: 1.4;
}
.sl-gate .sl-tip-reason { color: var(--amber); }
.sl-bad .sl-tip-reason { color: var(--red); }
.sl-fill .sl-tip-reason { color: var(--cyan); font-style: normal; font-weight: 600; }

/* Hide old 2-row classes */
.sigs-row { display: none; }
.sigs-r1, .sigs-r2 { display: none; }

/* ═══ Rejection heatmap chart ═══ */
.rej-chart {
  margin-top: 8px;
  padding: 8px 0;
  border-top: 1px solid rgba(255,255,255,0.05);
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.rej-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 9.5px;
  font-variant-numeric: tabular-nums;
  cursor: default;
  padding: 2px 4px;
  border-radius: 4px;
  transition: background 100ms ease;
}
.rej-row:hover { background: rgba(255,255,255,0.03); }

.rej-name {
  min-width: 80px;
  max-width: 100px;
  color: var(--text2);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 9px;
  letter-spacing: 0.2px;
}
.rej-track {
  flex: 1;
  height: 8px;
  background: rgba(255,255,255,0.04);
  border-radius: 4px;
  overflow: hidden;
  min-width: 40px;
}
.rej-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 300ms ease;
}
.rej-bar-gate {
  background: linear-gradient(90deg, var(--amber), rgba(245,158,11,0.4));
}
.rej-bar-filter {
  background: linear-gradient(90deg, var(--red), rgba(239,68,68,0.4));
}
.rej-count {
  min-width: 24px;
  text-align: right;
  font-weight: 700;
  color: var(--text);
  font-size: 10px;
}
.rej-pct {
  min-width: 28px;
  text-align: right;
  color: var(--muted);
  font-size: 9px;
}

/* ── Card cockpit upgrade — all cards get rounded + depth ── */
.card {
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 12px -6px rgba(0,0,0,0.5);
}
.card h2 {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.8px;
}

/* ── Signals section cockpit ── */
#sig-list {
  max-height: 600px;
  padding: 4px 6px;
}
.sig-filters {
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  margin-bottom: 8px;
}

/* Signal rows cockpit — rounded, neon left border */
.sigs-row {
  border-radius: 10px;
  margin-bottom: 4px;
  padding: 8px 12px 9px;
  border: 1px solid rgba(255,255,255,0.04);
  border-left: 3px solid transparent;
  background: rgba(255,255,255,0.015);
  transition: all 150ms ease;
}
.sigs-row:hover {
  background: rgba(255,255,255,0.035);
  border-color: rgba(255,255,255,0.08);
  box-shadow: 0 2px 8px -4px rgba(0,0,0,0.3);
}
.sigs-row:last-child { border-bottom: none; margin-bottom: 0; }

/* Neon outcome borders */
.sigs-row.sigs-fill {
  border-left-color: var(--cyan);
  background: linear-gradient(90deg, rgba(6,182,212,0.06) 0%, transparent 30%);
  box-shadow: inset 3px 0 12px -6px rgba(6,182,212,0.2);
}
.sigs-row.sigs-ok {
  border-left-color: var(--green);
  background: linear-gradient(90deg, rgba(34,197,94,0.05) 0%, transparent 30%);
  box-shadow: inset 3px 0 12px -6px rgba(34,197,94,0.15);
}
.sigs-row.sigs-gate {
  border-left-color: var(--amber);
}
.sigs-row.sigs-filter, .sigs-row.sigs-risk {
  border-left-color: var(--red);
}
.sigs-row.sigs-ai {
  border-left-color: var(--purple);
}

/* Signal status badges — rounded pills */
.sigs-stat {
  border-radius: 8px;
  padding: 2px 10px;
  font-size: 9.5px;
}

/* Signal symbol — bigger */
.sigs-sym { font-size: 13px; font-weight: 800; }

/* Signal strategy pills — already styled, just ensure rounded */
.sigs-strat { border-radius: 6px; }

/* Signal reason — better visibility on hover */
.sigs-row:hover .sigs-reason {
  white-space: normal;
  opacity: 1;
  color: var(--text2);
}

/* Filter buttons — cockpit pills */
.trade-filters .tf-btn, .sig-filters .tf-btn {
  border-radius: 8px;
  padding: 4px 12px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.tf-active {
  box-shadow: 0 0 8px rgba(139,92,246,0.3);
}
.tf-select {
  border-radius: 8px;
  padding: 4px 8px;
}

/* ── Trade History cockpit ── */
.trade-stats {
  border-radius: 10px;
  background: rgba(255,255,255,0.02);
  padding: 10px 14px;
  border: 1px solid rgba(255,255,255,0.04);
  margin-bottom: 10px;
}

.trade-table {
  border-collapse: separate;
  border-spacing: 0 3px;
}
.trade-table thead th {
  background: rgba(255,255,255,0.03);
  padding: 8px 8px;
  font-size: 9px;
  letter-spacing: 1px;
  border: none;
}
.trade-table thead th:first-child { border-radius: 8px 0 0 8px; }
.trade-table thead th:last-child { border-radius: 0 8px 8px 0; }

.trade-table tbody tr {
  background: rgba(255,255,255,0.015);
  transition: all 150ms ease;
}
.trade-table tbody tr:hover {
  background: rgba(255,255,255,0.04);
  box-shadow: 0 2px 8px -4px rgba(0,0,0,0.3);
}
.trade-table tbody td {
  padding: 7px 8px;
  border: none;
  vertical-align: middle;
}
.trade-table tbody td:first-child { border-radius: 8px 0 0 8px; }
.trade-table tbody td:last-child { border-radius: 0 8px 8px 0; }

/* Trade PnL glow */
.trade-pnl.text-green {
  text-shadow: 0 0 8px rgba(34,197,94,0.2);
}
.trade-pnl.text-red {
  text-shadow: 0 0 8px rgba(239,68,68,0.2);
}

/* Open trade row — neon cyan */
.trade-open-row {
  background: rgba(6,182,212,0.06) !important;
  box-shadow: inset 3px 0 12px -6px rgba(6,182,212,0.2);
}
.trade-open-row td:first-child {
  border-left: 3px solid var(--cyan);
}

/* Exit badges — rounded cockpit pills */
.badge { border-radius: 6px; }
.badge-trail, .badge-trail_partial, .badge-tp {
  box-shadow: 0 0 6px rgba(34,197,94,0.15);
}
.badge-dead, .badge-timeout {
  opacity: 0.8;
}
.badge-open {
  box-shadow: 0 0 8px rgba(6,182,212,0.3);
}
.badge-sr {
  box-shadow: 0 0 6px rgba(139,92,246,0.2);
}

/* Expand button cockpit */
.expand-btn {
  border-radius: 6px;
  width: 22px;
  height: 22px;
  font-size: 12px;
}

/* Pagination cockpit */
.pagination {
  border-top: 1px solid rgba(255,255,255,0.06);
  padding-top: 12px;
}
.pg-btn {
  border-radius: 8px;
  padding: 5px 12px;
}

/* Trade detail row cockpit */
.trade-detail-row td {
  background: rgba(255,255,255,0.025) !important;
  border-radius: 0 0 8px 8px !important;
}

/* Stats bar numbers cockpit — bigger, bolder */
.trade-stats strong {
  font-size: 12px;
}

/* Scrollbar cockpit — match the rounded theme */
.scrollable { border-radius: 10px; }
#sig-list { border-radius: 10px; }

/* ── Risk + Crash panels cockpit ── */
.risk-stat {
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.04);
}
.crash-dot {
  box-shadow: 0 0 6px currentColor;
}

/* Reduced motion — disable non-essential animations */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ═══════════════════════════════════════════════════════════
   V6.9 SIGNAL CARDS — 2-row layout with full data visibility
   ═══════════════════════════════════════════════════════════ */
#sig-list { padding: 2px 4px 4px; }

.sigs-row {
  padding: 6px 8px 7px;
  border-left: 2px solid transparent;
  border-bottom: 1px solid rgba(255,255,255,0.035);
  background: transparent;
  animation: sigFadeIn 0.25s ease-out;
  transition: background 120ms ease;
}
.sigs-row:hover { background: rgba(255,255,255,0.02); }
.sigs-row:last-child { border-bottom: none; }

/* Outcome tint */
.sigs-row.sigs-fill   { border-left-color: var(--cyan); background: rgba(6,182,212,0.045); }
.sigs-row.sigs-ok     { border-left-color: var(--green); background: rgba(34,197,94,0.035); }
.sigs-row.sigs-gate   { border-left-color: var(--amber); }
.sigs-row.sigs-filter { border-left-color: var(--red); }
.sigs-row.sigs-ai     { border-left-color: #7c3aed; }
.sigs-row.sigs-risk   { border-left-color: #ea580c; }
.sigs-row.sigs-fill:hover   { background: rgba(6,182,212,0.09); }
.sigs-row.sigs-ok:hover     { background: rgba(34,197,94,0.07); }

/* Row 1 — header */
.sigs-r1 {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  flex-wrap: wrap;
  line-height: 1.35;
}
.sigs-time {
  color: var(--muted);
  font-size: 9.5px;
  min-width: 52px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.3px;
}
.sigs-sym {
  font-weight: 800;
  color: var(--text);
  font-size: 12px;
  letter-spacing: 0.3px;
  min-width: 38px;
}
.sigs-side {
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.sigs-side-long  { background: rgba(34,197,94,0.16); color: var(--green); }
.sigs-side-short { background: rgba(239,68,68,0.16); color: var(--red); }

.sigs-strat {
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.3px;
  border: 1px solid transparent;
}
.sigs-vwdev    { background: rgba(139,92,246,0.15); color: var(--purple); border-color: rgba(139,92,246,0.3); }
.sigs-vwinv    { background: rgba(6,182,212,0.15);  color: var(--cyan);   border-color: rgba(6,182,212,0.3); }
.sigs-mom      { background: rgba(245,158,11,0.15); color: var(--amber);  border-color: rgba(245,158,11,0.3); }
.sigs-phantom  { background: rgba(113,113,122,0.15); color: var(--muted); border-color: rgba(113,113,122,0.3); }
.sigs-recovered{ background: rgba(59,130,246,0.15); color: var(--blue);   border-color: rgba(59,130,246,0.3); }
.sigs-other    { background: rgba(113,113,122,0.12); color: var(--text2); }

.sigs-cat {
  width: 16px; height: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0;
}
.sigs-cat.cat-large { background: rgba(59,130,246,0.18); color: var(--blue); }
.sigs-cat.cat-mid   { background: rgba(139,92,246,0.18); color: var(--purple); }
.sigs-cat.cat-small { background: rgba(245,158,11,0.18); color: var(--amber); }

.sigs-stat {
  margin-left: auto;
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.3px;
  padding: 1px 6px;
  border-radius: 3px;
}
.sigs-stat-ok   { color: var(--green); background: rgba(34,197,94,0.1); }
.sigs-stat-gate { color: var(--amber); background: rgba(245,158,11,0.1); }
.sigs-stat-bad  { color: var(--red);   background: rgba(239,68,68,0.1); }
.sigs-row.sigs-fill .sigs-stat-ok { color: var(--cyan); background: rgba(6,182,212,0.15); }

/* Row 2 — metadata + reason */
.sigs-r2 {
  margin-top: 4px;
  padding-left: 60px; /* indent under time column */
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.sigs-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 8px;
  font-size: 9.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.sigs-meta .m {
  white-space: nowrap;
  opacity: 0.9;
}
.sigs-meta .m b {
  color: var(--text2);
  font-weight: 600;
}
.sigs-meta .sigs-price {
  color: var(--text2);
}
.sigs-meta .m.reg-ranging  { color: var(--muted); font-weight: 700; letter-spacing: 0.4px; }
.sigs-meta .m.reg-trending { color: var(--green); font-weight: 700; letter-spacing: 0.4px; }
.sigs-meta .m.reg-volatile { color: var(--amber); font-weight: 700; letter-spacing: 0.4px; }

.sigs-reason {
  font-size: 9.5px;
  color: var(--text2);
  font-style: italic;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 0.75;
}
.sigs-row.sigs-gate   .sigs-reason { color: var(--amber); opacity: 0.85; }
.sigs-row.sigs-filter .sigs-reason { color: var(--red);   opacity: 0.85; }
.sigs-row.sigs-ai     .sigs-reason { color: #a78bfa;       opacity: 0.9; }
.sigs-row.sigs-fill   .sigs-reason { color: var(--cyan);   opacity: 0.95; font-style: normal; font-weight: 600; }

/* On hover: show full reason (no ellipsis) */
.sigs-row:hover .sigs-reason { white-space: normal; overflow: visible; }

/* Tighter on mobile */
@media (max-width: 768px) {
  .sigs-r2 { padding-left: 0; }
  .sigs-time { min-width: 46px; }
  .sigs-meta { font-size: 9px; gap: 2px 6px; }
}

/* ═══ SYMBOL PIPELINE VIEW — chip grid with stepper ═══ */
.pipe-grid { display: flex; flex-wrap: wrap; gap: 6px; }

.pipe-chip {
  background: var(--bg2); border: 1px solid var(--border); border-radius: 8px;
  padding: 6px 10px 7px; min-width: 140px; flex: 0 0 auto;
  position: relative; transition: border-color 0.2s, background 0.2s, transform 0.15s;
}
.pipe-chip:hover { border-color: var(--border2); transform: translateY(-1px); }
.pipe-chip.chip-open { border-color: var(--purple); background: rgba(139,92,246,0.06); }
.pipe-chip.chip-exec { border-color: var(--blue); background: rgba(59,130,246,0.06); }
.pipe-chip.chip-rejected { border-color: rgba(239,68,68,0.3); }

/* Row 1: symbol + pnl */
.pipe-chip-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 5px; }
.pipe-chip-sym { font-size: 11px; font-weight: 700; }
.pipe-chip-info { font-size: 9px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Row 2: stepper — 5 connected dots */
.pipe-stepper { display: flex; align-items: center; gap: 0; }
.pipe-step {
  width: 8px; height: 8px; border-radius: 50%; background: var(--border);
  position: relative; flex-shrink: 0; z-index: 1;
  transition: background 0.3s, box-shadow 0.3s;
}
.pipe-step.s-done { background: var(--green); }
.pipe-step.s-active { background: var(--purple); box-shadow: 0 0 8px rgba(139,92,246,0.6); }
.pipe-step.s-active.s-exec { background: var(--blue); box-shadow: 0 0 8px rgba(59,130,246,0.6); animation: stepPulse 1.5s ease-in-out infinite; }
.pipe-step.s-fail { background: var(--red); box-shadow: 0 0 6px rgba(239,68,68,0.4); }
.pipe-step.s-closed { background: var(--muted); }

/* Connector lines between dots */
.pipe-conn { flex: 1; height: 2px; background: var(--border); min-width: 6px; transition: background 0.3s; }
.pipe-conn.c-done { background: var(--green); }
.pipe-conn.c-active { background: linear-gradient(90deg, var(--green), var(--purple)); }
.pipe-conn.c-fail { background: linear-gradient(90deg, var(--green), var(--red)); }

@keyframes stepPulse { 0%,100% { box-shadow: 0 0 8px rgba(59,130,246,0.6); } 50% { box-shadow: 0 0 14px rgba(59,130,246,0.9); } }

/* Step labels on hover */
.pipe-step[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: #1a1a1e; color: var(--text); border: 1px solid var(--border2);
  padding: 4px 8px; border-radius: 5px; font-size: 9px; white-space: nowrap;
  z-index: 30; pointer-events: none; box-shadow: 0 6px 16px rgba(0,0,0,0.6);
  line-height: 1.4;
}
/* Arrow under tooltip */
.pipe-step[data-tip]:hover::before {
  content: ''; position: absolute; bottom: calc(100% + 2px); left: 50%; transform: translateX(-50%);
  border: 4px solid transparent; border-top-color: var(--border2); z-index: 31;
}

/* Row 3: stage label (tiny) */
.pipe-chip-stage { font-size: 8px; letter-spacing: 0.5px; margin-top: 3px; text-align: center; color: var(--muted); text-transform: uppercase; }
