@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
  --bg: #0B0F16;
  --card: #121826;
  --border: #233047;
  --gold: #F0B429;
  --green: #3DDC97;
  --red: #FF5C6C;
  --text: #E8EDF6;
  --text-dim: #8A97AC;
  --text-faint: #57647A;
  --font-head: 'Space Grotesk', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body { padding: 16px; max-width: 720px; margin: 0 auto; }

h1, h2, h3 { font-family: var(--font-head); font-weight: 600; margin: 0 0 4px; }

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

.brand {
  font-family: var(--font-head);
  font-weight: 700;
  letter-spacing: 0.08em;
  font-size: 15px;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 24px;
}
.brand b { color: var(--gold); }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 16px;
}

.section-title {
  font-family: var(--font-head);
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 32px 0 12px;
}
.section-title:first-of-type { margin-top: 8px; }

/* ---- Hero ---- */
.hero-track-label {
  font-family: var(--font-head);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.hero-track-label.real { color: var(--gold); }
.hero-track-label .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; }

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.stat {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
}
.stat .label { font-size: 11px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px; }
.stat .value { font-family: var(--font-mono); font-size: 22px; font-weight: 600; }
.pos { color: var(--green); }
.neg { color: var(--red); }
.neutral { color: var(--text); }

.hero-block { margin-bottom: 20px; }
.hero-block:last-child { margin-bottom: 0; }

/* ---- Equity curve ---- */
.chart-legend { display: flex; gap: 18px; font-size: 12px; color: var(--text-dim); margin-bottom: 10px; }
.chart-legend span { display: flex; align-items: center; gap: 6px; }
.chart-legend .sw { width: 12px; height: 3px; border-radius: 2px; display: inline-block; }
svg.curve { width: 100%; height: 180px; display: block; }
.no-data { color: var(--text-faint); font-size: 13px; padding: 24px 0; text-align: center; }

/* ---- Risk rails ---- */
.rail-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.rail {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
}
.rail .mark { color: var(--green); font-size: 16px; line-height: 1.4; }
.rail .txt { font-family: var(--font-head); font-size: 14px; font-weight: 500; line-height: 1.4; }

/* ---- Strategy table ---- */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-family: var(--font-head); font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-faint); font-weight: 500; padding: 8px 6px; border-bottom: 1px solid var(--border); }
td { padding: 9px 6px; border-bottom: 1px solid var(--border); }
tr.off td { color: var(--text-faint); }
tr.off td.name { text-decoration: line-through; text-decoration-color: var(--text-faint); }
.badge { font-family: var(--font-head); font-size: 10px; font-weight: 600; letter-spacing: 0.05em; padding: 3px 8px; border-radius: 20px; display: inline-block; }
.badge.on { background: rgba(61,220,151,0.15); color: var(--green); }
.badge.off { background: rgba(87,100,122,0.2); color: var(--text-faint); }
.strategy-note { font-size: 12px; color: var(--text-dim); margin-top: 12px; line-height: 1.5; font-style: italic; }

.candidates-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.candidate { display: flex; justify-content: space-between; align-items: center; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; font-size: 12px; }
.candidate .sym { font-family: var(--font-head); font-weight: 600; }
.candidate .dir-buy { color: var(--green); }
.candidate .dir-sell { color: var(--red); }

/* ---- Alerts feed ---- */
.alerts-list { display: flex; flex-direction: column; gap: 8px; max-height: 420px; overflow-y: auto; }
.alert-item { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; font-size: 12px; }
.alert-item.smc { border-color: var(--gold); }
.alert-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.alert-top .sym { font-family: var(--font-head); font-weight: 600; }
.alert-strategy { color: var(--text-faint); font-size: 11px; }
.alert-smc-badge { font-family: var(--font-head); font-size: 9px; font-weight: 700; letter-spacing: 0.05em; background: rgba(240,180,41,0.15); color: var(--gold); padding: 2px 6px; border-radius: 10px; margin-left: 6px; }
.alert-status { font-family: var(--font-head); font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.alert-status.executed, .alert-status.simulated { color: var(--green); }
.alert-status.rejected, .alert-status.execution_failed { color: var(--text-faint); }
.alert-conf { color: var(--text-dim); font-size: 11px; }
.alert-time { color: var(--text-faint); font-size: 10px; }

/* ---- Trust section ---- */
.trust-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.trust-list li { display: flex; gap: 10px; font-size: 13px; line-height: 1.5; color: var(--text-dim); }
.trust-list li b { color: var(--text); font-family: var(--font-head); font-weight: 600; }
.ledger-fact { margin-top: 14px; font-size: 12px; color: var(--text-faint); }

/* ---- Footer ---- */
footer { margin: 32px 0 8px; padding-top: 16px; border-top: 1px solid var(--border); font-size: 11px; color: var(--text-faint); line-height: 1.6; text-align: center; }
.refresh-note { text-align: center; font-size: 10px; color: var(--text-faint); margin-top: 10px; }

@media (min-width: 640px) {
  body { padding: 32px 16px; }
  .rail-grid { grid-template-columns: 1fr 1fr; }
  .stat .value { font-size: 26px; }
}
