:root {
  --bg: #0a0d13;
  --bg-elevated: #10141c;
  --surface: #141924;
  --surface-2: #1a2030;
  --border: #262d3d;
  --border-soft: #1d2430;
  --text: #e7eaf1;
  --text-dim: #8b93a7;
  --text-faint: #5b6377;
  --accent: #4c8dff;
  --accent-dim: #1e2d4d;
  --long: #22c55e;
  --long-dim: #12291d;
  --short: #ef4444;
  --short-dim: #2e1616;
  --warn: #eab308;
  --warn-dim: #2e2712;
  /* Momentum Lab -- deliberately distinct from --accent so the second sleeve
     never gets visually confused with the Gold Protocol while sharing this
     same design system. */
  --mom-accent: #f0a83c;
  --mom-accent-dim: #3a2a12;
  --mom-sma20: #a78bfa;
  --mom-sma50: #2dd4bf;
  /* Gold Protocol's own chart -- price reuses --accent (blue, already the
     Gold Desk identity colour) and SMA20 reuses --warn (gold/amber, a fitting
     pun); SMA50/200 get two new tokens, distinct from Momentum Lab's set. */
  --gld-sma50: #f472b6;
  --gld-sma200: #64748b;
  /* Meridian Strategy -- violet identity, distinct from Gold Desk (blue) and
     the retired Momentum Lab (amber). */
  --mer-accent: #8b5cf6;
  --mer-spx: #22d3ee;
  --mer-ndx: #fb923c;
  --mer-mom: #4ade80;
  --mono: 'SF Mono', 'JetBrains Mono', ui-monospace, 'Cascadia Code', Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Roboto, Helvetica, Arial, sans-serif;
  --radius: 10px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }

/* ---------- Login page ---------- */
.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 20% 20%, rgba(76,141,255,0.08), transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(234,179,8,0.06), transparent 40%),
    var(--bg);
}
.login-card {
  width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 32px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.login-card h1 {
  font-size: 15px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 0 0 4px;
  font-weight: 600;
}
.login-card .subtitle {
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 28px;
  color: var(--text);
}
.field { margin-bottom: 16px; display: flex; flex-direction: column; }
.field label {
  display: block;
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  /* Keeps inputs lined up in a row even when one label wraps to two lines
     and its neighbours don't (e.g. "Direction" vs "Spread (pts, off live ticket)"). */
  min-height: 28px;
}
input[type=text], input[type=password], input[type=number], input[type=date], select, textarea {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
}
input[type=text], input[type=password], input[type=number], input[type=date], select {
  height: 40px;
}
select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--text-dim) 50%),
    linear-gradient(135deg, var(--text-dim) 50%, transparent 50%);
  background-position: calc(100% - 18px) calc(50% - 3px), calc(100% - 13px) calc(50% - 3px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
}
button, .btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.02em;
}
button:hover, .btn:hover { filter: brightness(1.1); }
button.secondary, .btn.secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}
.error-banner {
  background: var(--short-dim);
  border: 1px solid var(--short);
  color: #ffb4b4;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 16px;
}
.login-footnote {
  margin-top: 20px;
  font-size: 11px;
  color: var(--text-faint);
  line-height: 1.5;
}

/* ---------- App shell ---------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 0;
}
.brand {
  padding: 0 20px 20px;
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 12px;
}
.brand .title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.brand .subtitle {
  font-size: 11px;
  color: var(--text-faint);
  margin-top: 2px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  border-left: 3px solid transparent;
}
.nav-item:hover { background: var(--surface); color: var(--text); }
.nav-item.active {
  background: var(--surface);
  color: var(--text);
  border-left-color: var(--accent);
}
.nav-spacer { flex: 1; }
.nav-footer { padding: 12px 20px; font-size: 11px; color: var(--text-faint); }

.main {
  flex: 1;
  padding: 24px 28px 60px;
  overflow-x: hidden;
  max-width: 100%;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.topbar h2 { font-size: 18px; margin: 0; font-weight: 700; }
.topbar .clock { font-family: var(--mono); font-size: 12px; color: var(--text-dim); }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 700px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .app-shell { flex-direction: column; }
  .sidebar { width: 100%; flex-direction: row; overflow-x: auto; padding: 10px; }
  .brand { display: none; }
  .nav-footer, .nav-spacer { display: none; }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.card h3 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin: 0 0 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stat-value { font-family: var(--mono); font-size: 26px; font-weight: 600; }
.stat-label { font-size: 11px; color: var(--text-faint); margin-top: 4px; }
.stat-change { font-family: var(--mono); font-size: 13px; margin-top: 6px; }
.up { color: var(--long); }
.down { color: var(--short); }
.flat { color: var(--text-dim); }

.pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.pill.long { background: var(--long-dim); color: var(--long); }
.pill.short { background: var(--short-dim); color: var(--short); }
.pill.stand-down { background: var(--warn-dim); color: var(--warn); }
.pill.pass { background: var(--long-dim); color: var(--long); }
.pill.fail { background: var(--short-dim); color: var(--short); }
.pill.neutral { background: var(--surface-2); color: var(--text-dim); }

table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border-soft); white-space: nowrap; }
th { color: var(--text-faint); font-weight: 600; text-transform: uppercase; font-size: 10.5px; letter-spacing: 0.04em; }
tr:last-child td { border-bottom: none; }
.table-scroll { overflow-x: auto; }

.kv { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px dashed var(--border-soft); font-size: 13px; }
.kv:last-child { border-bottom: none; }
.kv .k { color: var(--text-dim); }
.kv .v { font-family: var(--mono); font-weight: 600; }

.tabs { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid var(--border-soft); }
.tab-btn {
  background: none; border: none; color: var(--text-dim); padding: 8px 14px;
  font-size: 12.5px; font-weight: 600; border-bottom: 2px solid transparent; border-radius: 0;
}
.tab-btn.active { color: var(--text); border-bottom-color: var(--accent); }

.news-item { padding: 10px 0; border-bottom: 1px solid var(--border-soft); }
.news-item:last-child { border-bottom: none; }
.news-item .src { font-size: 10.5px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.04em; }
.news-item .headline { font-size: 13px; margin-top: 2px; }
.news-item .headline a { color: var(--text); text-decoration: none; }
.news-item .headline a:hover { color: var(--accent); }
.tag-geo { color: var(--short); }
.tag-macro { color: var(--accent); }

.badge-source { font-size: 10px; color: var(--text-faint); font-family: var(--mono); }

.muted { color: var(--text-faint); font-size: 12px; }
.section-gap { margin-top: 20px; }
.flex-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

.loading-dot::after {
  content: '';
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--warn);
  margin-left: 6px;
  animation: pulse 1.2s infinite ease-in-out;
}
@keyframes pulse { 0%,100% { opacity: 0.3; } 50% { opacity: 1; } }

.gate-banner {
  padding: 14px 16px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.gate-banner.pass { background: var(--long-dim); color: var(--long); border: 1px solid var(--long); }
.gate-banner.fail { background: var(--short-dim); color: var(--short); border: 1px solid var(--short); }

.callout {
  background: var(--accent-dim);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 14px;
}
.callout strong { color: var(--text); }

.cmc-guide {
  background: var(--surface-2);
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 16px;
}
.cmc-guide h4 {
  margin: 0 0 10px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
}
.cmc-guide .grid { gap: 10px; }
.cmc-guide .cmc-field {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
}
.cmc-guide .cmc-field .k {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-faint);
  margin-bottom: 3px;
}
.cmc-guide .cmc-field .v {
  display: block;
  font-family: var(--mono);
  font-size: 17px;
  font-weight: 700;
}
.cmc-guide .cmc-field .pts {
  display: block;
  font-size: 10.5px;
  color: var(--text-faint);
  margin-top: 2px;
}

.stop-basis-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12px;
  padding: 8px 10px;
  background: var(--surface-2);
  border-radius: 6px;
}
.stop-basis-label { color: var(--text-faint); text-transform: uppercase; font-size: 10.5px; letter-spacing: 0.04em; }
.stop-basis-item {
  font-family: var(--mono);
  color: var(--text-faint);
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid transparent;
}
.stop-basis-item.active { color: var(--text); background: var(--accent-dim); border-color: var(--accent); font-weight: 600; }

.edit-details { margin-top: 12px; }
.edit-details summary {
  cursor: pointer;
  font-size: 11px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  list-style: none;
}
.edit-details summary::-webkit-details-marker { display: none; }
.edit-details summary::before { content: '\270E  '; }
.edit-form {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border-soft);
}
.edit-form .field { margin-bottom: 10px; }
.manual-badge {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--warn);
  border: 1px solid var(--warn);
  border-radius: 4px;
  padding: 1px 5px;
  margin-left: 6px;
}
.manual-badge.auto-badge {
  color: var(--accent);
  border-color: var(--accent);
}
#cal-start, #cal-end { width: auto; display: inline-block; }

.journal-box {
  font-family: var(--mono);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 11.5px;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 160px;
  overflow-y: auto;
}

/* ================= Momentum Lab ================= */
/* A separate sleeve gets a separate visual accent (amber, not the Gold
   Protocol's blue) on the same shell/tokens -- distinct at a glance, never
   a different design system. */

.mom-callout {
  background: var(--mom-accent-dim);
  border-left: 3px solid var(--mom-accent);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 0;
}
.mom-callout strong { color: var(--text); }

.mom-info-details { margin-bottom: 14px; }
.mom-info-details summary {
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  color: var(--mom-accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  list-style: none;
  padding: 4px 0;
}
.mom-info-details summary::-webkit-details-marker { display: none; }
.mom-info-details summary::before { content: '\25B8  '; }
.mom-info-details[open] summary::before { content: '\25BE  '; }
.mom-info-details .mom-callout { margin-top: 8px; }

.mom-status-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  font-size: 12px;
  color: var(--text-faint);
}
.mom-status-row .badge-source { font-size: 10px; }

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

.mom-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: 16px 18px;
}
.mom-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2px;
}
.mom-card-head h4 {
  margin: 0;
  font-size: 14px;
  color: var(--text);
}
.mom-card-head .asset-class {
  font-size: 10.5px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.mom-ric {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-faint);
}

.pill.long-mom { background: var(--long-dim); color: var(--long); }
.pill.short-mom { background: var(--short-dim); color: var(--short); }
.pill.flat-mom { background: var(--surface-2); color: var(--text-dim); }

.mom-chart-wrap {
  position: relative;
  margin: 10px 0 8px;
  height: 130px;
}
.mom-chart-svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
  cursor: crosshair;
}
.mom-grid-line { stroke: var(--border-soft); stroke-width: 1; vector-effect: non-scaling-stroke; }
.mom-area { fill: var(--mom-accent); opacity: 0.10; stroke: none; }
.mom-line { fill: none; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
.mom-line-price { stroke: var(--mom-accent); stroke-width: 2; }
.mom-line-sma20 { stroke: var(--mom-sma20); stroke-width: 1.3; opacity: 0.85; }
.mom-line-sma50 { stroke: var(--mom-sma50); stroke-width: 1.3; opacity: 0.85; }
.mom-dot { fill: var(--mom-accent); }
.mom-crosshair { stroke: var(--text-faint); stroke-width: 1; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }

.mom-tooltip {
  position: absolute;
  top: 4px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 9px;
  font-size: 10.5px;
  line-height: 1.5;
  color: var(--text-dim);
  pointer-events: none;
  white-space: nowrap;
  z-index: 2;
}
.mom-tooltip b { color: var(--text); font-family: var(--mono); }

.mom-legend {
  display: flex;
  gap: 14px;
  font-size: 10.5px;
  color: var(--text-faint);
  margin-bottom: 2px;
}
.mom-legend span { display: inline-flex; align-items: center; gap: 5px; }
.mom-legend i { width: 9px; height: 2px; display: inline-block; border-radius: 1px; }
.mom-legend i.price { background: var(--mom-accent); }
.mom-legend i.sma20 { background: var(--mom-sma20); }
.mom-legend i.sma50 { background: var(--mom-sma50); }

.mom-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-soft);
}
.mom-stat .k { font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-faint); }
.mom-stat .v { font-size: 13px; font-family: var(--mono); margin-top: 2px; }
.mom-stat .v.up { color: var(--long); }
.mom-stat .v.down { color: var(--short); }

.mom-returns {
  display: flex;
  gap: 12px;
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-dim);
  font-family: var(--mono);
}
.mom-returns span.up { color: var(--long); }
.mom-returns span.down { color: var(--short); }

/* ---- Momentum Lab summary table (above the per-asset chart cards) ---- */
.mom-summary-caption {
  font-size: 11.5px;
  color: var(--text-faint);
  margin: -6px 0 16px;
}
table.mom-summary td.num, table.mom-summary th.num { text-align: right; font-family: var(--mono); }
table.mom-summary td.asset-name { font-weight: 600; }
table.mom-summary td .mom-ric { display: block; margin-top: 1px; }

.mom-table-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--mom-accent);
  font-weight: 700;
  margin: 0 0 8px;
}
.mom-backtest-note {
  font-size: 11px;
  color: var(--text-faint);
  margin: -8px 0 16px;
}
.mom-risk-flag {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  background: var(--warn-dim);
  border-left: 3px solid var(--warn);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 10px;
}
.mom-risk-icon { flex-shrink: 0; color: var(--warn); }

/* ================= Meridian Strategy ================= */
/* Third sleeve, own accent (violet) -- distinct from Gold Desk's blue and
   Momentum Lab's amber (Momentum Lab's own tab/nav entry is retired but its
   engine/tables are left in place, unused, rather than deleted). */

.mer-callout {
  background: rgba(139, 92, 246, 0.12);
  border-left: 3px solid var(--mer-accent);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 0;
}
.mer-callout strong { color: var(--text); }

.mer-info-details { margin-bottom: 14px; }
.mer-info-details summary {
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  color: var(--mer-accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  list-style: none;
  padding: 4px 0;
}
.mer-info-details summary::-webkit-details-marker { display: none; }
.mer-info-details summary::before { content: '\25B8  '; }
.mer-info-details[open] summary::before { content: '\25BE  '; }
.mer-info-details .mer-callout { margin-top: 8px; }

.mer-risk-card { border-color: var(--warn); }
.mer-skew-table td.num, .mer-skew-table th.num { text-align: right; font-family: var(--mono); }
.mer-skew-caption { font-size: 11.5px; color: var(--text-faint); margin: 8px 0 0; }

.mer-scenario-picker {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--border-soft);
}
.mer-scenario-picker label { font-size: 12px; color: var(--text-dim); }
.mer-scenario-picker select {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 12.5px;
}
.mer-scenario-note { font-size: 11.5px; color: var(--text-faint); }

.mer-kpi-cards, #mer-kpi-cards { transition: box-shadow 0.15s; }
#mer-kpi-cards.mer-scenario-active {
  box-shadow: 0 0 0 1px rgba(234, 179, 8, 0.4);
  border-radius: var(--radius);
}
#mer-kpi-cards.mer-scenario-active .card { border-color: rgba(234, 179, 8, 0.35); }

.mer-spark { margin-top: 8px; height: 28px; }
.mer-sparkline-svg { width: 100%; height: 100%; display: block; overflow: visible; }
.mer-kpi-spark-caption { font-size: 11px; color: var(--text-faint); margin: -12px 0 20px; }

.mer-updates-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.mer-badge-updates {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: rgba(139, 92, 246, 0.14);
  color: var(--mer-accent);
  border: 1px solid rgba(139, 92, 246, 0.3);
  white-space: nowrap;
}
.mer-badge-updates::before { content: '\21BB'; font-size: 12px; }

.mer-card-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.mer-card-head-row h3 { margin: 0; }

.mer-compare-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin: 20px 0 20px;
}
.mer-compare-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.mer-source-tag { font-size: 10.5px; color: var(--text-faint); font-family: var(--mono); white-space: nowrap; }
.mer-compare-table th.num, .mer-compare-table td.num { text-align: right; font-family: var(--mono); }
.mer-compare-table td:first-child { color: var(--text-dim); white-space: nowrap; }
.mer-compare-caption { font-size: 11px; color: var(--text-faint); margin: 10px 0 0; }

.mer-asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 14px;
}
.mer-asset-card {
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  padding: 12px 14px;
}
.mer-asset-card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 2px;
}
.mer-asset-card-head h4 { margin: 0; font-size: 13px; color: var(--text); }
.mer-asset-ric { font-family: var(--mono); font-size: 10.5px; color: var(--text-faint); }

.mer-subhead {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--mer-accent);
  font-weight: 700;
  margin: 0 0 8px;
}
.mer-howtotrade-caption { font-size: 11.5px; color: var(--text-faint); margin: 10px 0 0; }

.mer-chart-wrap {
  position: relative;
  margin: 10px 0 8px;
}
.mer-chart-svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
  cursor: crosshair;
}
.mer-grid-line { stroke: var(--border-soft); stroke-width: 1; vector-effect: non-scaling-stroke; }
.mer-line { fill: none; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; stroke-width: 1.8; }
.mer-line-strategy { stroke: var(--mer-accent); stroke-width: 2.2; }
.mer-line-spx { stroke: var(--mer-spx); }
.mer-line-ndx { stroke: var(--mer-ndx); }
.mer-line-mom { stroke: var(--mer-mom); }

.mer-tooltip {
  position: absolute;
  top: 4px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 9px;
  font-size: 10.5px;
  line-height: 1.5;
  color: var(--text-dim);
  pointer-events: none;
  white-space: nowrap;
  z-index: 2;
}
.mer-tooltip b { color: var(--text); font-family: var(--mono); }

.mer-legend {
  display: flex;
  gap: 14px;
  font-size: 10.5px;
  color: var(--text-faint);
  margin-bottom: 2px;
  flex-wrap: wrap;
}
.mer-legend span { display: inline-flex; align-items: center; gap: 5px; }
.mer-legend i { width: 9px; height: 9px; display: inline-block; border-radius: 2px; }
.mer-swatch-strategy { background: var(--mer-accent); }
.mer-swatch-spx { background: var(--mer-spx); }
.mer-swatch-ndx { background: var(--mer-ndx); }
.mer-swatch-mom { background: var(--mer-mom); }

/* ================= Gold Protocol chart (Dashboard tab) ================= */
/* Same interaction pattern as Momentum Lab's chart (price+SMA overlay, hover
   crosshair/tooltip), independently implemented -- own colour tokens, own
   render function, plus horizontal reference lines for the Level Map's 5
   levels, which Momentum Lab's chart has no equivalent of. */

.gld-chart-wrap {
  position: relative;
  margin: 10px 0 8px;
  height: 220px;
}
.gld-chart-svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
  cursor: crosshair;
}
.gld-grid-line { stroke: var(--border-soft); stroke-width: 1; vector-effect: non-scaling-stroke; }
/* Solid, not dashed -- when several of these sit within a few pixels of each
   other (routine for yesterday's H/L vs. the overnight H/L), overlapping
   dashed lines create a muddy interleaved blur; solid thin lines in distinct
   colors stay tellable apart at any spacing. Round Number is the one
   deliberately-dimmer exception, since it's a psychological marker rather
   than a real traded level. */
.gld-level-line { stroke-width: 1; vector-effect: non-scaling-stroke; opacity: 0.9; }
.gld-level-line-ydayhigh { stroke: var(--long); }
.gld-level-line-ydaylow { stroke: var(--short); }
.gld-level-line-onhigh { stroke: #38bdf8; }
.gld-level-line-onlow { stroke: #a78bfa; }
.gld-level-line-round { stroke: #94a3b8; stroke-dasharray: 1 3; opacity: 0.5; }
.gld-area { fill: var(--accent); opacity: 0.08; stroke: none; }
.gld-line { fill: none; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
.gld-line-price { stroke: var(--accent); stroke-width: 2; }
.gld-line-sma20 { stroke: var(--warn); stroke-width: 1.2; opacity: 0.85; }
.gld-line-sma50 { stroke: var(--gld-sma50); stroke-width: 1.2; opacity: 0.85; }
.gld-line-sma200 { stroke: var(--gld-sma200); stroke-width: 1.4; opacity: 0.8; }
.gld-dot { fill: var(--accent); }
.gld-crosshair { stroke: var(--text-faint); stroke-width: 1; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }

.gld-tooltip {
  position: absolute;
  top: 4px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 9px;
  font-size: 10.5px;
  line-height: 1.5;
  color: var(--text-dim);
  pointer-events: none;
  white-space: nowrap;
  z-index: 2;
}
.gld-tooltip b { color: var(--text); font-family: var(--mono); }
.gld-tooltip-section { margin-top: 3px; }
.gld-tooltip-divider { border-top: 1px solid var(--border-soft); margin: 5px 0; }
.gld-tooltip-level { font-family: var(--mono); font-weight: 600; }
.gld-tooltip-level-ydayhigh { color: var(--long); }
.gld-tooltip-level-ydaylow { color: var(--short); }
.gld-tooltip-level-onhigh { color: #38bdf8; }
.gld-tooltip-level-onlow { color: #a78bfa; }
.gld-tooltip-level-round { color: #94a3b8; }

.gld-legend {
  display: flex;
  gap: 14px;
  font-size: 10.5px;
  color: var(--text-faint);
  margin-bottom: 2px;
  flex-wrap: wrap;
}
.gld-legend span { display: inline-flex; align-items: center; gap: 5px; }
.gld-legend i { width: 9px; height: 2px; display: inline-block; border-radius: 1px; }
.gld-legend i.price { background: var(--accent); }
.gld-legend i.sma20 { background: var(--warn); }
.gld-legend i.sma50 { background: var(--gld-sma50); }
.gld-legend i.sma200 { background: var(--gld-sma200); }
.gld-legend i.level { background: var(--text-faint); }

/* ================= Gold Day Trade (Strategy B -- Range Fade, paper test) =================
   Entirely separate sleeve from Gold Protocol/Meridian/Momentum -- own colour
   language: orange = sell, blue = buy, matching the CMC ticket screenshots
   this was modelled on. Reuses the gld-chart-* classes for the chart shell
   (legend/tooltip/crosshair), since the 5-min chart follows the exact same
   interaction pattern as the Gold Protocol's own daily chart. */
.dt-status-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 12.5px;
  margin-bottom: 4px;
}
.dt-status-item { color: var(--text-dim); }
.dt-status-item b { color: var(--text); font-family: var(--mono); }

.dt-level-line { stroke-width: 1; vector-effect: non-scaling-stroke; opacity: 0.9; }
.dt-level-line-sellentry { stroke: #f97316; }
.dt-level-line-sellprotective { stroke: #ef4444; stroke-dasharray: 2 3; }
.dt-level-line-buyentry { stroke: #38bdf8; }
.dt-level-line-buyprotective { stroke: #2563eb; stroke-dasharray: 2 3; }
.dt-swatch-sellentry, .dt-swatch-sellprotective, .dt-swatch-buyentry, .dt-swatch-buyprotective {
  width: 9px; height: 2px; display: inline-block; border-radius: 1px;
}
.dt-swatch-sellentry { background: #f97316; }
.dt-swatch-sellprotective { background: #ef4444; }
.dt-swatch-buyentry { background: #38bdf8; }
.dt-swatch-buyprotective { background: #2563eb; }
.dt-tooltip-level { font-family: var(--mono); font-weight: 600; }
.dt-tooltip-level-sellentry { color: #f97316; }
.dt-tooltip-level-sellprotective { color: #ef4444; }
.dt-tooltip-level-buyentry { color: #38bdf8; }
.dt-tooltip-level-buyprotective { color: #2563eb; }

.dt-ticket-panel {
  border-radius: var(--radius);
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
}
.dt-sell-panel { border-color: rgba(249, 115, 22, 0.4); background: linear-gradient(180deg, rgba(249, 115, 22, 0.07), var(--surface) 60px); }
.dt-buy-panel { border-color: rgba(56, 189, 248, 0.4); background: linear-gradient(180deg, rgba(56, 189, 248, 0.07), var(--surface) 60px); }
.dt-ticket-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.dt-ticket-badge {
  display: inline-flex;
  padding: 3px 12px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
}
.dt-sell-panel .dt-ticket-badge { background: #f97316; color: #1a0f04; }
.dt-buy-panel .dt-ticket-badge { background: #38bdf8; color: #04141a; }
.dt-ticket-title { font-size: 13px; color: var(--text-dim); font-weight: 600; }

.dt-waiting { font-size: 12.5px; color: var(--text-dim); line-height: 1.6; margin: 0; }
.dt-confirmed-banner {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 6px 10px;
  border-radius: 6px;
  margin-bottom: 12px;
  background: var(--long-dim);
  color: var(--long);
  text-align: center;
}
.dt-ticket-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}
.dt-ticket-field {
  background: var(--surface-2);
  border-radius: 6px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.dt-ticket-field .k { font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-faint); }
.dt-ticket-field .v { font-family: var(--mono); font-size: 16px; font-weight: 700; }
.dt-ticket-field .v.up { color: var(--long); }
.dt-ticket-field .v.down { color: var(--short); }
.dt-ticket-field .pts { font-size: 10.5px; color: var(--text-faint); }
.dt-ticket-summary { border-top: 1px dashed var(--border-soft); padding-top: 8px; }
.dt-one-attempt { font-size: 11px; color: var(--text-faint); margin: 10px 0 0; font-style: italic; }

/* Historical signal markers + click-to-populate (backtest replay) */
.dt-chart-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 4px; }
.dt-backtest-note { font-size: 12px; color: var(--text-dim); text-align: right; }
.dt-backtest-note b { color: var(--text); font-family: var(--mono); }
.dt-sample-warn { color: var(--text-faint); font-style: italic; }

.dt-marker { cursor: pointer; }
.dt-marker-sell.dt-marker-win { fill: #f97316; }
.dt-marker-sell.dt-marker-loss { fill: #f97316; opacity: 0.35; }
.dt-marker-sell.dt-marker-open { fill: none; stroke: #f97316; stroke-width: 1; stroke-dasharray: 1.4 1; }
.dt-marker-buy.dt-marker-win { fill: #38bdf8; }
.dt-marker-buy.dt-marker-loss { fill: #38bdf8; opacity: 0.35; }
.dt-marker-buy.dt-marker-open { fill: none; stroke: #38bdf8; stroke-width: 1; stroke-dasharray: 1.4 1; }
.dt-marker:hover { stroke: var(--text); stroke-width: 0.6; opacity: 1; }
.dt-marker-hint { font-size: 11px; color: var(--text-faint); margin: 6px 0 0; text-align: center; }

.dt-historical-banner { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; background: var(--surface-2); color: var(--text); }
.dt-outcome-tag { font-size: 10px; padding: 2px 8px; border-radius: 10px; text-transform: none; letter-spacing: normal; font-weight: 700; }
.dt-outcome-win { background: var(--long-dim); color: var(--long); }
.dt-outcome-loss { background: var(--short-dim); color: var(--short); }
.dt-outcome-open { background: var(--surface); color: var(--text-faint); border: 1px dashed var(--border-soft); }
.dt-back-to-live {
  width: 100%;
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid var(--border-soft);
  background: var(--surface-2);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.dt-back-to-live:hover { background: var(--surface-3, var(--surface-2)); }

/* Chart toolbar: line/candle toggle + zoom, chart mode itself (candlesticks) */
.dt-chart-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.dt-chart-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dt-chart-mode-toggle { display: inline-flex; border: 1px solid var(--border-soft); border-radius: 6px; overflow: hidden; }
.dt-toggle-btn { background: var(--surface-2); color: var(--text-dim); border: none; padding: 4px 10px; font-size: 11px; font-weight: 600; cursor: pointer; }
.dt-toggle-btn.active { background: var(--accent); color: #fff; }
.dt-zoom-group { display: inline-flex; align-items: center; gap: 6px; }
.dt-zoom-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border-soft);
  border-radius: 4px;
  width: 24px;
  height: 24px;
  padding: 0;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
}
.dt-zoom-btn:hover { border-color: var(--text-faint); }
.dt-zoom-reset { width: auto; padding: 0 10px; font-size: 10.5px; font-weight: 600; }
.dt-zoom-label { font-size: 10.5px; color: var(--text-faint); font-family: var(--mono); min-width: 62px; text-align: center; }

.dt-candle-wick { stroke-width: 1; vector-effect: non-scaling-stroke; }
.dt-candle-wick.dt-candle-up { stroke: var(--long); }
.dt-candle-wick.dt-candle-down { stroke: var(--short); }
.dt-candle-body.dt-candle-up { fill: var(--long); }
.dt-candle-body.dt-candle-down { fill: var(--short); }

/* v3 flow overlays: session VWAP curve + volume-profile POC */
.dt-vwap-line { fill: none; stroke: #2dd4bf; stroke-width: 1.4; vector-effect: non-scaling-stroke; stroke-dasharray: 4 2; opacity: 0.9; }
.dt-poc-line { stroke: #94a3b8; stroke-width: 1; vector-effect: non-scaling-stroke; stroke-dasharray: 6 3; opacity: 0.7; }
.dt-swatch-vwap, .dt-swatch-poc { width: 9px; height: 2px; display: inline-block; border-radius: 1px; }
.dt-swatch-vwap { background: #2dd4bf; }
.dt-swatch-poc { background: #94a3b8; }

/* v3 confluence panel */
.dt-flow-side { border: 1px solid var(--border-soft); border-radius: 8px; padding: 12px 14px; background: var(--surface-2); }
.dt-flow-sell { border-color: rgba(249, 115, 22, 0.35); }
.dt-flow-buy { border-color: rgba(56, 189, 248, 0.35); }
.dt-flow-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.dt-flow-dir { font-size: 11px; font-weight: 800; letter-spacing: 0.05em; color: var(--text-dim); }
.dt-flow-sell .dt-flow-dir { color: #f97316; }
.dt-flow-buy .dt-flow-dir { color: #38bdf8; }
.dt-flow-score { font-family: var(--mono); font-size: 22px; font-weight: 800; }
.dt-flow-score small { font-size: 11px; color: var(--text-faint); font-weight: 600; }
.dt-score-high { color: var(--long); }
.dt-score-mid { color: var(--warn, #fbbf24); }
.dt-score-low { color: var(--text-faint); }
.dt-score-invalid { color: var(--short); font-size: 13px; letter-spacing: 0.05em; }
.dt-flow-bar { height: 4px; border-radius: 2px; background: var(--surface); overflow: hidden; margin-bottom: 10px; }
.dt-flow-bar i { display: block; height: 100%; border-radius: 2px; }
.dt-flow-bar i.dt-score-high { background: var(--long); }
.dt-flow-bar i.dt-score-mid { background: var(--warn, #fbbf24); }
.dt-flow-bar i.dt-score-low { background: var(--text-faint); }
.dt-flow-factor { display: grid; grid-template-columns: 16px 1fr auto; gap: 2px 8px; padding: 5px 0; border-bottom: 1px dashed var(--border-soft); font-size: 12px; color: var(--text-faint); }
.dt-flow-factor:last-child { border-bottom: none; }
.dt-flow-factor.met { color: var(--text); }
.dt-flow-tick { font-weight: 700; color: var(--text-faint); }
.dt-flow-factor.met .dt-flow-tick { color: var(--long); }
.dt-flow-pts { font-family: var(--mono); font-size: 11px; }
.dt-flow-detail { grid-column: 2 / 4; font-size: 10.5px; color: var(--text-faint); }
.dt-flow-invalid { font-size: 12.5px; color: var(--short); line-height: 1.6; margin: 0; }
.dt-blackout-live { color: var(--short); font-weight: 700; }
.dt-session-in { color: var(--long); font-weight: 700; }
.dt-session-out { color: var(--text-faint); }
.dt-flow-split { font-size: 10.5px; color: var(--text-faint); font-family: var(--mono); margin-bottom: 8px; }
.dt-flow-split b { color: var(--text); }
.dt-banner-score { font-family: var(--mono); font-weight: 800; text-transform: none; letter-spacing: normal; }

/* Pixel-space chart (v3.1): drawn 1:1, never stretched, so wicks stay 1px
   crisp at any interval x history combination and axis text is legible. */
.dt-px-wrap { height: auto; }
.dt-px-svg { display: block; width: 100%; height: auto; }
.dt-px-grid { stroke: var(--border-soft); stroke-width: 1; opacity: 0.55; }
.dt-axis-text { fill: var(--text-faint); font-size: 10px; font-family: var(--mono); }
.dt-select-label { font-size: 11px; color: var(--text-faint); display: inline-flex; align-items: center; gap: 6px; }
.dt-chart-select {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border-soft);
  border-radius: 4px;
  padding: 3px 6px;
  font-size: 11.5px;
  cursor: pointer;
}
.dt-chart-select:hover { border-color: var(--text-faint); }

/* Hover readout: a fixed panel below the chart, never a cursor-following
   box over the plot -- previously it visually buried the small markers. */
.dt-chart-info {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-top: 10px;
  padding: 11px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--text-dim);
  min-height: 38px;
}
/* Explicit per-field spacing rather than relying on flex `gap` alone --
   gap silently no-ops on older engines and the fields then run together
   into one unreadable string of digits. */
.dt-chart-info > span { margin-right: 18px; }
.dt-chart-info > span:last-child { margin-right: 0; }
.dt-chart-info-placeholder { color: var(--text-faint); font-style: italic; }
.dt-chart-info-time { font-family: var(--mono); font-weight: 700; color: var(--text); }
.dt-chart-info-ohlc { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.dt-chart-info-divider { width: 1px; align-self: stretch; background: var(--border-soft); margin-right: 18px; }
.dt-chart-info .dt-tooltip-level { white-space: nowrap; }

/* ---------------- Strategy C: Overnight Range Break ---------------- */
/* Deliberately its own visual identity (teal) so it is never mistaken for
   the Range Fade panels (orange/blue) sitting on the same tab. */
#orb-card { border-left: 3px solid rgba(45, 212, 191, 0.65); }
.orb-tag {
  font-size: 10px; letter-spacing: 0.08em; font-weight: 700;
  padding: 2px 7px; border-radius: 999px; vertical-align: middle; margin-left: 8px;
  background: rgba(45, 212, 191, 0.16); color: #2dd4bf; border: 1px solid rgba(45, 212, 191, 0.35);
}
.orb-state-row {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
  padding: 11px 14px; border-radius: var(--radius); margin-bottom: 16px;
  background: var(--surface-2); border: 1px solid var(--border-soft);
}
.orb-state-badge {
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 3px 10px; border-radius: 999px; white-space: nowrap;
}
.orb-state-armed .orb-state-badge { background: rgba(45, 212, 191, 0.18); color: #2dd4bf; }
.orb-state-broken .orb-state-badge { background: rgba(250, 204, 21, 0.18); color: var(--warn); }
.orb-state-idle .orb-state-badge { background: var(--surface); color: var(--text-faint); border: 1px solid var(--border-soft); }
.orb-state-armed { border-color: rgba(45, 212, 191, 0.35); }
.orb-state-broken { border-color: rgba(250, 204, 21, 0.35); }
.orb-state-text { font-size: 13px; color: var(--text-dim); flex: 1 1 240px; }
.orb-session-tag { font-family: var(--mono); font-size: 11px; color: var(--text-faint); }

.orb-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.orb-block {
  padding: 14px 16px; border-radius: var(--radius);
  background: var(--surface-2); border: 1px solid var(--border-soft);
}
.orb-block-title { font-size: 12px; font-weight: 600; letter-spacing: 0.03em; color: var(--text); margin-bottom: 10px; }
.orb-note-inline { margin-top: 10px; font-size: 12px; line-height: 1.5; color: var(--text-dim); }
.orb-warn { margin-top: 10px; font-size: 12px; color: var(--warn); }

.orb-signals { display: grid; gap: 14px; margin-top: 16px; }
.orb-signal { padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--border-soft); }
.orb-signal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.orb-signal-title { font-size: 13px; color: var(--text-dim); }
.orb-ticket { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 2px 22px; }
.orb-reject {
  font-size: 12.5px; line-height: 1.55; color: var(--text-dim);
  padding: 10px 12px; border-radius: 6px;
  background: rgba(148, 163, 184, 0.08); border-left: 2px solid var(--text-faint);
}
.orb-slip {
  grid-column: 1 / -1; margin-top: 10px; padding: 9px 12px; border-radius: 6px;
  font-size: 12px; line-height: 1.5; color: var(--text-dim);
  background: rgba(250, 204, 21, 0.07); border-left: 2px solid var(--warn);
}
.orb-slip b { color: var(--text); font-family: var(--mono); }

.orb-stats { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border-soft); }
.orb-stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(86px, 1fr)); gap: 12px 10px; margin-bottom: 12px; }
.orb-stat { display: flex; flex-direction: column; gap: 3px; }
.orb-stat-v { font-family: var(--mono); font-size: 19px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.orb-stat-k { font-size: 11px; color: var(--text-faint); }
.orb-disclose { font-size: 12px; line-height: 1.6; color: var(--text-faint); }
.orb-disclose b { color: var(--text-dim); font-family: var(--mono); }
@media (max-width: 640px) {
  .orb-grid { grid-template-columns: 1fr; }
  .orb-ticket { grid-template-columns: 1fr; }
}

.orb-legs-note { font-size: 12.5px; line-height: 1.55; color: var(--text-dim); margin-bottom: 12px; }
.orb-legs-note b { color: var(--text); }
.orb-legs { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.orb-leg { padding: 12px 14px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border-soft); }
.orb-leg-tight { border-left: 2px solid rgba(45, 212, 191, 0.6); }
.orb-leg-wide { border-left: 2px solid rgba(56, 189, 248, 0.6); }
.orb-leg-head { font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: 9px; }
.orb-leg-sub { display: block; font-size: 11px; font-weight: 400; color: var(--text-faint); margin-top: 2px; }
.orb-leg .orb-slip { margin-top: 9px; }

.orb-steps { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 10px; }
.orb-steps li { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; line-height: 1.55; color: var(--text-dim); }
.orb-steps b { color: var(--text); font-family: var(--mono); }
.orb-step { flex: 0 0 auto; width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; font-family: var(--mono); background: rgba(45, 212, 191, 0.16); color: #2dd4bf; margin-top: 1px; }

.orb-step-txt { flex: 1 1 auto; }

.orb-tickets { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; margin-top: 16px; }
.orb-tk { padding: 12px 14px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border-soft); }
.orb-tk-h { font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: 9px; }
.orb-tk-n { margin-top: 9px; font-size: 11.5px; line-height: 1.55; color: var(--text-faint); }
.orb-tk-n b { color: var(--text-dim); }

.orb-stats-acc > summary {
  cursor: pointer; list-style: none; font-size: 12px; font-weight: 600; color: var(--text);
  padding: 4px 0; display: flex; align-items: center; gap: 8px;
}
.orb-stats-acc > summary::-webkit-details-marker { display: none; }
.orb-stats-acc > summary::before {
  content: '\25B8'; color: var(--text-faint); font-size: 11px; transition: transform 0.15s ease;
}
.orb-stats-acc[open] > summary::before { transform: rotate(90deg); }
.orb-stats-acc > summary:hover { color: #2dd4bf; }
.orb-stats-inner { padding-top: 14px; }

.orb-hist { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border-soft); }
.orb-hist-rows { display: grid; gap: 1px; margin-bottom: 10px; max-height: 260px; overflow-y: auto; }
.orb-hist-row { display: grid; grid-template-columns: 1fr auto auto auto; gap: 12px; align-items: center;
  padding: 6px 8px; border-radius: 5px; font-size: 12px; font-family: var(--mono); }
.orb-hist-row:nth-child(odd) { background: var(--surface-2); }
.orb-hist-when { color: var(--text-faint); }
.orb-hist-dir { font-size: 10px; font-weight: 700; letter-spacing: 0.05em; padding: 2px 7px; border-radius: 999px; }
.orb-hist-dir.dt-dir-buy { background: rgba(56, 189, 248, 0.16); color: #38bdf8; }
.orb-hist-dir.dt-dir-sell { background: rgba(249, 115, 22, 0.16); color: #f97316; }
.orb-hist-px { color: var(--text-dim); font-variant-numeric: tabular-nums; }
.orb-hist-r { min-width: 58px; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }

/* Trade ticket -- deliberately quiet, matching .dt-ticket-panel: thin borders,
   mono values, colour as a hairline accent rather than a filled block. */
.orb-action {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
  padding: 11px 14px; background: var(--surface-2);
  border: 1px solid var(--border-soft); border-bottom: none;
  border-radius: var(--radius) var(--radius) 0 0;
}
.orb-action-dir {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.07em; padding: 3px 9px; border-radius: 3px;
}
.orb-action-sell .orb-action-dir { background: rgba(249, 115, 22, 0.16); color: #f97316; }
.orb-action-buy .orb-action-dir { background: rgba(56, 189, 248, 0.16); color: #38bdf8; }
.orb-action-size { font-family: var(--mono); font-size: 14px; font-weight: 600; color: var(--text); }
.orb-action-size small { font-size: 11px; font-weight: 400; color: var(--text-faint); }
.orb-action-meta { margin-left: auto; font-size: 11.5px; color: var(--text-faint); font-family: var(--mono); }

.orb-ladder {
  border: 1px solid var(--border-soft); border-radius: 0 0 var(--radius) var(--radius);
  background: var(--surface); overflow: hidden;
}
.orb-rung {
  display: grid; grid-template-columns: 108px 1fr auto; align-items: center; gap: 14px;
  padding: 9px 14px; border-top: 1px solid var(--border-soft);
  border-left: 2px solid transparent;
}
.orb-rung:first-child { border-top: none; }
.orb-rung-lab { font-size: 9.5px; font-weight: 600; letter-spacing: 0.09em; color: var(--text-faint); }
.orb-rung-px {
  font-family: var(--mono); font-size: 15px; font-weight: 600; color: var(--text);
  font-variant-numeric: tabular-nums;
}
.orb-rung-note { font-size: 11px; color: var(--text-faint); text-align: right; font-family: var(--mono); }
.orb-rung-stop { border-left-color: rgba(239, 68, 68, 0.55); }
.orb-rung-stop .orb-rung-lab { color: #ef4444; }
.orb-rung-entry { border-left-color: var(--border); background: var(--surface-2); }
.orb-rung-entry .orb-rung-lab { color: var(--text-dim); }
.orb-rung-half { border-left-color: rgba(45, 212, 191, 0.55); }
.orb-rung-half .orb-rung-lab { color: #2dd4bf; }
.orb-rung-target { border-left-color: rgba(34, 197, 94, 0.55); }
.orb-rung-target .orb-rung-lab { color: #22c55e; }
.orb-tickets { margin-top: 14px; }
@media (max-width: 560px) {
  .orb-rung { grid-template-columns: 92px 1fr; }
  .orb-rung-note { grid-column: 2 / -1; text-align: left; }
  .orb-action-meta { margin-left: 0; flex-basis: 100%; }
}

.orb-proj { margin-top: 18px; }
.orb-proj-side { margin-top: 12px; }
.orb-proj-trig { font-size: 12px; color: var(--text-dim); margin-bottom: 8px; }
.orb-proj-trig b { font-family: var(--mono); color: var(--text); }
.orb-proj .orb-ladder { opacity: 0.93; }
.orb-blocked { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: var(--radius);
  background: var(--surface-2); border: 1px dashed var(--border-soft); font-size: 12.5px; color: var(--text-faint); }
.orb-blocked-dir { font-size: 13px; font-weight: 700; letter-spacing: 0.05em; color: var(--text-dim); }
.orb-blocked b { color: var(--text-dim); }

/* Strength pill -- reuses the app's existing score colours, no new language. */
.orb-edge { font-family: var(--mono); font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 3px; }
.orb-edge.dt-score-high { background: rgba(34, 197, 94, 0.14); color: #22c55e; }
.orb-edge.dt-score-mid { background: rgba(250, 204, 21, 0.14); color: var(--warn); }
.orb-edge.dt-score-low { background: rgba(239, 68, 68, 0.14); color: #ef4444; }
.orb-edge-note { margin-top: 8px; font-size: 11px; line-height: 1.5; color: var(--text-faint); }
.orb-edge-note.orb-edge-bad { color: #ef4444; opacity: 0.85; }
.orb-proj-grid { align-items: start; }
.orb-proj-side { margin-top: 0; padding: 14px; border-radius: var(--radius); border: 1px solid var(--border-soft); }
.orb-proj-strong { background: var(--surface-2); }
.orb-proj-weak { background: transparent; opacity: 0.72; }
.orb-proj-weak:hover { opacity: 1; }

/* Side-by-side tickets have half the width: the per-rung note drops under the
   price instead of being squeezed into a third column and clipped. */
.orb-proj-side .orb-rung { grid-template-columns: 88px 1fr; row-gap: 2px; padding: 8px 12px; }
.orb-proj-side .orb-rung-note { grid-column: 2 / -1; text-align: left; }
.orb-proj-side .orb-rung-px { font-size: 14px; }
.orb-proj-side .orb-action { padding: 9px 12px; gap: 8px; }
.orb-proj-side .orb-action-meta { margin-left: 0; flex-basis: 100%; }

/* Each ticket states plainly what it is and what triggers it. */
.orb-side-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; margin-bottom: 10px; }
.orb-side-word { font-size: 15px; font-weight: 800; letter-spacing: 0.05em; }
.orb-side-sell .orb-side-word { color: #f97316; }
.orb-side-buy .orb-side-word { color: #38bdf8; }
.orb-side-if { font-size: 12px; color: var(--text-dim); }
.orb-side-if b { color: var(--text); font-family: var(--mono); }
.orb-side-fired { margin-left: auto; font-size: 9.5px; font-weight: 700; letter-spacing: 0.08em;
  padding: 2px 7px; border-radius: 3px; background: rgba(250, 204, 21, 0.16); color: var(--warn); }
.orb-side-wait { margin-left: auto; font-size: 9.5px; font-weight: 600; letter-spacing: 0.08em; color: var(--text-faint); }

/* Direction column: header, ladder, then the two order tickets stacked inside
   ONE bordered group, so BUY and SELL read as two parallel units side by side. */
.orb-proj-grid { gap: 18px; }
.orb-proj-side { display: flex; flex-direction: column; gap: 12px; padding: 16px; }
.orb-proj-side .orb-action { border-radius: var(--radius) var(--radius) 0 0; }
.orb-proj-side .orb-ladder { margin-bottom: 2px; }
.orb-proj-side .orb-tk { background: var(--surface); }
.orb-proj-side .orb-edge-note { margin-top: 0; }
.orb-proj-strong { box-shadow: inset 2px 0 0 rgba(45, 212, 191, 0.5); }
.orb-proj-weak { box-shadow: inset 2px 0 0 rgba(148, 163, 184, 0.25); }
@media (max-width: 860px) { .orb-proj-grid { grid-template-columns: 1fr; } }

/* Secondary alert -- visually subordinate to the two main tickets on purpose. */
.orb-alert { margin-top: 18px; padding: 14px 16px; border-radius: var(--radius); border: 1px dashed var(--border-soft); background: var(--surface-2); }
.orb-alert-dead { opacity: 0.6; }
.orb-alert-head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 8px; }
.orb-alert-tag { font-size: 9.5px; font-weight: 700; letter-spacing: 0.09em; padding: 2px 7px; border-radius: 3px;
  background: rgba(250, 204, 21, 0.14); color: var(--warn); }
.orb-alert-title { font-size: 12.5px; color: var(--text-dim); flex: 1 1 260px; }
.orb-alert-note { font-size: 11.5px; line-height: 1.55; color: var(--text-faint); margin-bottom: 10px; }
.orb-edge small { font-size: 9px; font-weight: 500; opacity: 0.7; }

/* Marker shapes inherit the existing direction/outcome colours. */
.dt-marker { cursor: pointer; }
.dt-marker-active { stroke: var(--text); stroke-width: 2; }
.dt-src-orb, .dt-src-alert { stroke-width: 1.5; }

/* Clicked-trade card: lives in the readout strip BELOW the plot, never over it. */
.dt-trade-card { display: flex; flex-direction: column; gap: 7px; width: 100%; }
.dt-trade-head { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.dt-trade-src { font-size: 12px; font-weight: 600; color: var(--text); }
.dt-trade-when { font-family: var(--mono); font-size: 11px; color: var(--text-faint); }
.dt-trade-res { margin-left: auto; font-family: var(--mono); font-size: 12px; font-weight: 700; }
.dt-trade-vals { display: flex; flex-wrap: wrap; gap: 6px 18px; font-family: var(--mono); font-size: 12px; color: var(--text); }
.dt-trade-vals em { font-style: normal; font-family: var(--sans); font-size: 10.5px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--text-faint); margin-right: 5px; }
.dt-badge-sell { background: rgba(249, 115, 22, 0.16); color: #f97316; }
.dt-badge-buy { background: rgba(56, 189, 248, 0.16); color: #38bdf8; }
.dt-trade-orb { border-left: 2px solid rgba(45, 212, 191, 0.6); padding-left: 10px; }
.dt-trade-alert { border-left: 2px solid rgba(250, 204, 21, 0.6); padding-left: 10px; }
.dt-trade-fade { border-left: 2px solid rgba(148, 163, 184, 0.4); padding-left: 10px; }
.dt-marker-hint b { color: var(--text-dim); }

/* Overnight volatility read -- context only, so it stays quiet. */
.orb-vol { font-family: var(--mono); font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 3px; }
.orb-vol-quiet { background: rgba(34, 197, 94, 0.14); color: #22c55e; }
.orb-vol-normal { background: var(--surface); color: var(--text-dim); border: 1px solid var(--border-soft); }
.orb-vol-busy { background: rgba(250, 204, 21, 0.14); color: var(--warn); }
.orb-vol-wild { background: rgba(239, 68, 68, 0.14); color: #ef4444; }
.orb-vol-note { margin-top: 8px; font-size: 11px; line-height: 1.5; color: var(--text-faint); }

/* Outcome of a fired signal -- a dead trade must read as dead. */
.orb-status { margin-left: auto; flex: 0 0 auto; white-space: nowrap; font-size: 9.5px; font-weight: 700;
  letter-spacing: 0.04em; padding: 3px 8px; border-radius: 3px; text-transform: uppercase; line-height: 1.4; }
.orb-status-dead { background: rgba(239, 68, 68, 0.16); color: #ef4444; }
.orb-status-won { background: rgba(34, 197, 94, 0.16); color: #22c55e; }
.orb-status-flat { background: rgba(148, 163, 184, 0.16); color: var(--text-dim); }
.orb-status-live { background: rgba(45, 212, 191, 0.16); color: #2dd4bf; }
.orb-done { font-size: 12px; line-height: 1.6; color: var(--text-faint); padding: 12px 14px;
  border-radius: var(--radius); background: var(--surface-2); border: 1px dashed var(--border-soft); }
.orb-done b { color: var(--text-dim); font-family: var(--mono); }

/* The answer, before the evidence. */
.orb-verdict { padding: 14px 16px; border-radius: var(--radius); margin-bottom: 16px; border: 1px solid var(--border-soft); }
.orb-verdict-head { font-size: 13px; font-weight: 700; letter-spacing: 0.04em; margin-bottom: 5px; }
.orb-verdict-body { font-size: 12.5px; line-height: 1.6; color: var(--text-dim); }
.orb-verdict-body b { color: var(--text); font-family: var(--mono); }
.orb-verdict-act { background: rgba(34, 197, 94, 0.08); border-color: rgba(34, 197, 94, 0.45); }
.orb-verdict-act .orb-verdict-head { color: #22c55e; }
.orb-verdict-wait { background: rgba(45, 212, 191, 0.07); border-color: rgba(45, 212, 191, 0.35); }
.orb-verdict-wait .orb-verdict-head { color: #2dd4bf; }
.orb-verdict-none { background: var(--surface-2); }
.orb-verdict-none .orb-verdict-head { color: var(--text-faint); }

.orb-reentry { font-size: 11.5px; line-height: 1.55; color: var(--text-faint); margin-bottom: 8px; }
.orb-reentry b { color: var(--text-dim); font-family: var(--mono); }


