/* Signal Desk — dashboard styles */
:root {
  --bg: #0C1624;
  --panel: #121F33;
  --raised: #182A42;
  --hover: #1D3150;
  --line: #22354F;
  --line-2: #2C4364;
  --ink: #E7EDF6;
  --ink-2: #9AABC3;
  --ink-3: #6A7D96;
  --long: #1FB394;
  --long-bg: rgba(31, 179, 148, .13);
  --short: #EE5A4C;
  --short-bg: rgba(238, 90, 76, .13);
  --neutral: #8C9AB0;
  --neutral-bg: rgba(140, 154, 176, .12);
  --accent: #7C9CFF;
  --warn: #E0A93B;
  --ema20: #6F8FF2;
  --ema50: #C8922A;
  --ema200: #B66CCB;
  --r-sm: 6px;
  --r: 10px;
  --font: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-cond: "IBM Plex Sans Condensed", "IBM Plex Sans", system-ui, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 400 14px/1.45 var(--font);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
code { font-size: 12.5px; background: var(--raised); padding: 1px 5px; border-radius: 4px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: #0C1624; padding: 6px 10px; border-radius: 6px; z-index: 99; }
.skip:focus { left: 8px; }

/* ---------- header ---------- */
.top {
  display: flex; align-items: center; gap: 24px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  position: sticky; top: 0; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; font: 600 18px/1 var(--font-cond); letter-spacing: .01em; color: var(--ink); white-space: nowrap; }
.brand svg { width: 26px; height: 26px; color: var(--long); }
.views { display: flex; gap: 2px; }
.view-btn { white-space: nowrap;
  background: none; border: 0; color: var(--ink-2);
  padding: 8px 12px; border-radius: var(--r-sm); font-weight: 500;
  display: inline-flex; align-items: center; gap: 6px;
}
.view-btn:hover { color: var(--ink); background: var(--panel); }
.view-btn.is-on { color: var(--ink); background: var(--raised); }
.count { background: var(--accent); color: #0C1624; font-size: 11px; font-weight: 600; border-radius: 9px; padding: 0 6px; line-height: 17px; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }

.seg { display: inline-flex; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 2px; }
.seg button { background: none; border: 0; color: var(--ink-2); padding: 5px 12px; border-radius: 6px; font-weight: 500; }
.seg button[aria-checked="true"] { background: var(--raised); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2); }

.status { display: inline-flex; align-items: center; gap: 8px; background: none; border: 0; color: var(--ink-2); font-size: 12.5px; padding: 6px 4px; }
.status:hover { color: var(--ink); }
.icon-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: none;
  border: 1px solid var(--line-2); color: var(--ink-2); cursor: pointer; }
.icon-btn:hover:not(:disabled) { color: var(--ink); background: var(--raised); }
.icon-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.icon-btn:disabled { cursor: default; opacity: .7; }
.icon-btn.spin svg { animation: sd-spin 1s linear infinite; }
@keyframes sd-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .icon-btn.spin svg { animation: none; } }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--neutral); flex: none; }
.dot.ok { background: var(--long); }
.dot.partial { background: var(--warn); }
.dot.down { background: var(--short); }
.dot.busy { background: var(--accent); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }

.demo-banner { background: rgba(224, 169, 59, .12); color: #F0CF8A; border-bottom: 1px solid rgba(224,169,59,.3); padding: 8px 24px; font-size: 13px; }

/* ---------- market strip ---------- */
.strip {
  display: grid;
  grid-template-columns: minmax(220px, 1.1fr) repeat(3, minmax(150px, .8fr)) minmax(260px, 1.5fr);
  gap: 1px; background: var(--line);
  border-bottom: 1px solid var(--line);
}
.stat { background: var(--bg); padding: 14px 20px; min-width: 0; }
.stat h3 { margin: 0 0 6px; font-size: 12.5px; font-weight: 500; color: var(--ink-2); }
.stat .big { font: 600 22px/1.15 var(--font-cond); letter-spacing: .005em; }
.stat .sub { font-size: 12.5px; color: var(--ink-2); margin-top: 3px; }
.up, .stat .sub.up { color: var(--long); }
.down, .stat .sub.down { color: var(--short); }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }

.fg { display: flex; align-items: center; gap: 14px; }
.fg svg { width: 92px; height: 52px; flex: none; }
.fg .big { font-size: 26px; }

.tide-bar { display: flex; gap: 2px; height: 10px; margin: 8px 0 7px; }
.tide-bar span { border-radius: 3px; min-width: 3px; }
.tide-legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--ink-2); flex-wrap: wrap; }
.tide-legend b { color: var(--ink); font-weight: 600; }
.key { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; vertical-align: 0; }

/* ---------- board ---------- */
.board {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(400px, 480px);
  align-items: start;
}
.list-pane { min-width: 0; border-right: 1px solid var(--line); min-height: calc(100vh - 160px); }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px 10px; flex-wrap: wrap; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  background: var(--panel); border: 1px solid var(--line); color: var(--ink-2);
  padding: 5px 11px; border-radius: 999px; font-size: 13px; font-weight: 500;
  display: inline-flex; gap: 6px; align-items: center;
}
.chip b { color: var(--ink); font-weight: 600; }
.chip[aria-checked="true"] { background: var(--raised); color: var(--ink); border-color: var(--line-2); }
.tools { display: flex; gap: 8px; }
.search { display: flex; align-items: center; gap: 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; }
.search svg { width: 15px; height: 15px; color: var(--ink-3); }
.search input { background: none; border: 0; outline: 0; padding: 6px 0; width: 140px; }
select, .field input {
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; color: var(--ink);
}

.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
th { text-align: left; font-size: 12px; font-weight: 500; color: var(--ink-3); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 9px 10px; border-bottom: 1px solid rgba(34, 53, 79, .6); white-space: nowrap; vertical-align: middle; }
.c-num { text-align: right; }
.c-rank { width: 34px; color: var(--ink-3); padding-left: 20px; }
.coins tbody tr { cursor: pointer; }
.coins tbody tr:hover { background: var(--panel); }
.coins tbody tr.is-sel { background: var(--raised); box-shadow: inset 3px 0 0 var(--accent); }
.coins tbody tr.is-sel .rail, .coins tbody tr.is-sel .conf-bar { background: var(--line-2); }
.coin { display: flex; align-items: center; gap: 10px; min-width: 150px; }
.coin img, .mono { width: 26px; height: 26px; border-radius: 50%; flex: none; background: var(--raised); }
.mono { display: grid; place-items: center; font-size: 10.5px; font-weight: 600; color: var(--ink-2); }
.coin .nm { font-weight: 600; line-height: 1.15; }
.coin .sy { font-size: 12px; color: var(--ink-3); text-transform: uppercase; }
.px { font-weight: 500; transition: color .6s; }
.px.flash-up { color: var(--long); transition: none; }
.px.flash-down { color: var(--short); transition: none; }
.spark { width: 92px; height: 28px; display: block; }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px 3px 7px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
}
.badge svg { width: 11px; height: 11px; }
.badge.long { background: var(--long-bg); color: var(--long); }
.badge.short { background: var(--short-bg); color: var(--short); }
.badge.neutral { background: var(--neutral-bg); color: var(--ink-2); }
.since { display: block; font-size: 11.5px; color: var(--ink-3); margin-top: 2px; padding-left: 2px; }

/* the conviction rail — signature element */
.rail-head { display: flex; justify-content: space-between; width: 150px; }
.rail-cell { display: flex; align-items: center; gap: 10px; }
.rail { position: relative; width: 150px; height: 8px; background: var(--raised); border-radius: 4px; flex: none; }
.rail::after { content: ""; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--ink-3); }
.rail i { position: absolute; top: 0; bottom: 0; border-radius: 4px; }
.rail i.long { background: var(--long); left: 50%; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.rail i.short { background: var(--short); right: 50%; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.rail .thr { position: absolute; top: 1px; bottom: 1px; width: 1px; background: rgba(231, 237, 246, .16); }
.score { font-weight: 600; width: 34px; text-align: right; }

.conf { display: inline-flex; align-items: center; gap: 7px; }
.conf-bar { width: 38px; height: 4px; background: var(--raised); border-radius: 2px; overflow: hidden; }
.conf-bar i { display: block; height: 100%; background: var(--ink-2); border-radius: 2px; }

.empty { padding: 48px 24px; text-align: center; color: var(--ink-2); }

/* ---------- detail panel ---------- */
.detail {
  position: sticky; top: 61px;
  max-height: calc(100vh - 61px); overflow-y: auto;
  padding: 18px 22px 40px;
  scrollbar-width: thin; scrollbar-color: var(--line-2) transparent;
}
.detail:focus { outline: none; }
.d-head { display: flex; align-items: flex-start; gap: 12px; }
.d-head img, .d-head .mono { width: 40px; height: 40px; }
.d-head .mono { font-size: 13px; }
.d-title h2 { margin: 0; font: 600 20px/1.15 var(--font-cond); }
.d-title .meta { color: var(--ink-3); font-size: 12.5px; margin-top: 2px; }
.d-close { margin-left: auto; background: none; border: 0; color: var(--ink-2); padding: 4px; display: none; }
.d-close svg { width: 22px; height: 22px; }
.d-price { display: flex; align-items: baseline; gap: 12px; margin: 14px 0 4px; flex-wrap: wrap; }
.d-price .big { font: 600 30px/1 var(--font-cond); }
.d-verdict {
  margin: 16px 0 4px; padding: 14px 16px; border-radius: var(--r);
  background: var(--panel); border: 1px solid var(--line);
}
.d-verdict.long { border-color: rgba(31,179,148,.45); }
.d-verdict.short { border-color: rgba(238,90,76,.45); }
.verdict-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.verdict-top .badge { font-size: 14px; padding: 5px 12px 5px 9px; }
.verdict-top .score-big { font: 600 22px/1 var(--font-cond); }
.verdict-text { color: var(--ink-2); margin: 10px 0 12px; font-size: 13.5px; }
.rail.big { width: 100%; height: 12px; border-radius: 6px; }
.rail.big::after { top: -4px; bottom: -4px; }
.rail-scale { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--ink-3); margin-top: 6px; }
.pillars { display: grid; grid-template-columns: repeat(auto-fit, minmax(64px, 1fr)); gap: 6px; margin-top: 14px; }
.pillar { font-size: 11.5px; color: var(--ink-2); min-width: 0; white-space: nowrap; }
.pillar b { display: block; font-size: 15px; color: var(--ink); font-weight: 600; margin-top: 1px; }
.pillar .rail { width: 100%; height: 5px; margin-top: 6px; }
.pillar .rail::after { top: -2px; bottom: -2px; }

.sec { margin-top: 26px; }
.sec > h3 { font: 600 15px/1.2 var(--font-cond); margin: 0 0 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sec > h3 small { font: 400 12px var(--font); color: var(--ink-3); }

.chart-legend { display: flex; gap: 12px; font-size: 12px; color: var(--ink-2); margin-bottom: 6px; flex-wrap: wrap; }
.chart-legend label { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.chart-legend input { accent-color: var(--accent); margin: 0; }
.swatch { width: 14px; height: 2px; border-radius: 1px; display: inline-block; }
.chart { height: 300px; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; position: relative; }
.bigpic { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 4px 0 10px; font-size: 13px; color: var(--ink-2); }
.bigpic .bp { display: inline-flex; align-items: center; gap: 6px; }
.mkt { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 6px; border-radius: 5px; margin-right: 6px;
  color: var(--ink-2); border: 1px solid var(--line-2); vertical-align: 1px; }
.mkt.fut { color: #F2B84B; border-color: rgba(242,184,75,.45); background: rgba(242,184,75,.08); }
/* replay of a past futures setup */
.replay-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 0 0 8px;
  padding: 8px 12px; border-radius: 8px; background: rgba(124,156,255,.1); border: 1px solid rgba(124,156,255,.35); font-size: 13px; }
/* calculator */
.calc-tabs { margin-bottom: 6px; }
.calc-tabs button[aria-selected="true"], .calc-tabs button[aria-checked="true"] { background: var(--raised); color: var(--ink); }
.calc-warn { grid-column: 1 / -1; margin: 4px 0 0; }
.calc .size-out { grid-template-columns: 1fr; gap: 0; }
.calc .size-out > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.calc .size-out > div b { text-align: right; }
/* notifications */
.notif-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 18px 0 12px; }
.notif-bar .nf { display: flex; gap: 8px; flex-wrap: wrap; }
.notif-bar select { background: var(--panel); color: var(--ink); border: 1px solid var(--line-2); border-radius: 8px; padding: 7px 10px; font: inherit; font-size: 13px; }
.nstats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.ns-head { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.ns-head b { font-size: 14px; }
.ns-head .faint { font-size: 12.5px; }
.nstat { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 3px; }
.nstat span { font-size: 12.5px; color: var(--ink-2); }
.nstat b { font: 600 22px/1.2 var(--font-cond); }
.nstat small { color: var(--ink-3); font-size: 12px; }
.ns-panel { grid-column: span 2; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 7px; }
.ns-panel h4 { margin: 0 0 2px; font-size: 12.5px; font-weight: 500; color: var(--ink-2); }
.ns-bar { display: grid; grid-template-columns: 104px 1fr 74px; align-items: center; gap: 10px; font-size: 13px; }
.ns-lbl { color: var(--ink-2); }
.ns-track { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.ns-track i { display: block; height: 100%; border-radius: 4px; }
.ns-track i.up { background: var(--long); }
.ns-track i.down { background: var(--short); }
.ns-val { text-align: right; font-variant-numeric: tabular-nums; }
.ns-row { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--ink-2); }
.ns-row b { color: var(--ink); font-variant-numeric: tabular-nums; }
@media (max-width: 760px) {
  .nstats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ns-bar { grid-template-columns: 96px 1fr 64px; }
}
.nstats .hint { grid-column: 1 / -1; margin: 0; }
.timeline li.flog { cursor: pointer; }
.timeline li .outcome { font-size: 13px; white-space: nowrap; }
.timeline li .sent { font-size: 11px; color: #F2B84B; border: 1px solid rgba(242,184,75,.45); border-radius: 5px; padding: 1px 5px; }
.timeline li.more { justify-content: center; }
.ctx { display: inline-flex; align-items: center; gap: 12px; padding-left: 12px; margin-left: 2px; border-left: 1px solid var(--line-2); font-size: 12.5px; }
.ctx .cx { display: inline-flex; align-items: baseline; gap: 5px; white-space: nowrap; }
.ctx .cx b { color: var(--ink-3); font-weight: 600; font-size: 11.5px; }
.replay-bar .ctx { margin-left: 10px; }
.chart-expand { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; background: none; border: 1px solid var(--line-2);
  border-radius: 6px; color: var(--ink-2); font: 500 12px/1 var(--font); padding: 5px 8px; cursor: pointer; }
.chart-expand:hover { color: var(--ink); background: var(--raised); }
.chart-expand:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.chart-bigbar { display: none; }
.chart-box.is-big { position: fixed; inset: 0; z-index: 200; background: var(--bg); padding: 14px 18px 18px; display: flex; flex-direction: column; gap: 8px; }
.chart-box.is-big .chart-bigbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.chart-box.is-big .chart-bigbar .name { font: 600 18px/1.2 var(--font-cond); }
.chart-box.is-big .chart-bigbar .sp { flex: 1; }
.chart-box.is-big .chart-expand { display: none; }
.chart-box.is-big .chart { flex: 1; height: auto; min-height: 0; }
body.chart-open { overflow: hidden; }
/* The detail panel is sticky (its own stacking layer), so lift the whole panel above the top bar. */
body.chart-open .detail { z-index: 300; }
.chart .loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--ink-3); font-size: 13px; }

.plan { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.plan-note { padding: 10px 14px; font-size: 13px; color: var(--ink-2); background: var(--panel); border-bottom: 1px solid var(--line); }
.plan table td { padding: 9px 14px; }
.plan table tr:last-child td { border-bottom: 0; }
.plan .lv { color: var(--ink-2); }
.plan .lv i { display: inline-block; width: 3px; height: 14px; border-radius: 2px; vertical-align: -2px; margin-right: 8px; }
.plan .pr { font-weight: 600; text-align: right; }
.plan .pc { text-align: right; width: 76px; }
.plan .rr { text-align: right; width: 44px; color: var(--ink-3); }
.key-note { font-size: 12.5px; color: var(--ink-2); margin: 8px 2px 0; }

.sizer { margin-top: 12px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sizer .field { margin: 0; }
.sizer .field input { width: 100%; }
.size-out { margin-top: 10px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 16px; font-size: 13px; }
.size-out div { display: flex; justify-content: space-between; border-bottom: 1px dashed var(--line); padding: 4px 0; }
.size-out span { color: var(--ink-2); }

.factors { list-style: none; margin: 0; padding: 0; }
.factor-group { margin-bottom: 14px; }
.factor-group h4 { margin: 0 0 6px; font-size: 13px; font-weight: 600; display: flex; justify-content: space-between; }
.factor-group h4 span { color: var(--ink-3); font-weight: 400; }
.factors li { display: grid; grid-template-columns: 1fr 64px 36px; gap: 10px; align-items: center; padding: 5px 0; font-size: 13px; color: var(--ink-2); border-bottom: 1px solid rgba(34,53,79,.5); }
.factors li .pts { text-align: right; font-weight: 600; color: var(--ink); font-size: 12.5px; }
.mini { position: relative; height: 4px; background: var(--raised); border-radius: 2px; }
.mini::after { content: ""; position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1px; background: var(--ink-3); }
.mini i { position: absolute; top: 0; bottom: 0; border-radius: 2px; }
.mini i.long { left: 50%; background: var(--long); }
.mini i.short { right: 50%; background: var(--short); }

.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.kv div { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid rgba(34,53,79,.6); font-size: 13px; }
.kv span { color: var(--ink-2); }
.kv b { font-weight: 500; text-align: right; }
.supply { margin-top: 10px; }
.supply-bar { height: 8px; background: var(--raised); border-radius: 4px; overflow: hidden; margin: 6px 0 4px; }
.supply-bar i { display: block; height: 100%; background: var(--ink-2); border-radius: 4px; }
.desc { color: var(--ink-2); font-size: 13px; margin: 12px 0 0; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.tags span, .tags a { font-size: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px; color: var(--ink-2); text-decoration: none; }
.tags a:hover { color: var(--ink); }

.bt { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; font-size: 13px; color: var(--ink-2); }
.bt strong { color: var(--ink); }
.bt-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 8px; }
.bt-row div { font-size: 12px; }
.bt-row b { display: block; font: 600 18px/1.2 var(--font-cond); color: var(--ink); }

.news { list-style: none; margin: 0; padding: 0; }
.news li { padding: 9px 0; border-bottom: 1px solid rgba(34,53,79,.6); display: grid; grid-template-columns: 14px 1fr; gap: 8px; }
.news a, .news .t { color: var(--ink); text-decoration: none; font-size: 13.5px; line-height: 1.35; }
.news a:hover { text-decoration: underline; }
.news .m { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.tone { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; }
.tone.pos { background: var(--long); }
.tone.neg { background: var(--short); }
.tone.neu { background: var(--line-2); }

/* ---------- pages ---------- */
.page { max-width: 1100px; margin: 0 auto; padding: 28px 24px 60px; }
.page-head h1 { font: 600 26px/1.15 var(--font-cond); margin: 0 0 6px; }
.page-head p { color: var(--ink-2); margin: 0 0 22px; max-width: 68ch; }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 22px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; }
.tile span { font-size: 12.5px; color: var(--ink-2); }
.tile b { display: block; font: 600 26px/1.2 var(--font-cond); margin-top: 4px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; }
.card h2 { font: 600 16px/1.2 var(--font-cond); margin: 0 0 14px; }
.hint { color: var(--ink-3); font-size: 12.5px; margin: 10px 0 0; }
.alert-setup, .settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 26px; }
.card.wide { grid-column: 1 / -1; }
.toggle { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.toggle input { width: 18px; height: 18px; accent-color: var(--accent); }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; font-size: 12.5px; color: var(--ink-2); }
.field input { font-size: 14px; }
.btn { background: var(--raised); border: 1px solid var(--line-2); border-radius: 8px; padding: 8px 14px; font-weight: 500; }
.btn:hover { background: var(--hover); }
.btn.primary { background: var(--accent); color: #0C1624; border-color: var(--accent); font-weight: 600; }
.channels { list-style: none; padding: 0; margin: 0 0 14px; }
.channels li { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.on { color: var(--long); }
.off { color: var(--ink-3); }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 120px 1fr auto; gap: 14px; align-items: center; padding: 12px 4px; border-bottom: 1px solid var(--line); cursor: pointer; }
.timeline li:hover { background: var(--panel); }
.timeline .when { color: var(--ink-3); font-size: 12.5px; }
.timeline .what { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.timeline .arrow { color: var(--ink-3); }

.journal td { font-size: 13px; }
.st { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--neutral-bg); color: var(--ink-2); }
.st.win { background: var(--long-bg); color: var(--long); }
.st.loss { background: var(--short-bg); color: var(--short); }
.st.open { background: rgba(124,156,255,.14); color: var(--accent); }

.health td { font-size: 13px; white-space: normal; }
.w-list { margin: 0; padding: 0; list-style: none; }
.w-list li { display: grid; grid-template-columns: 110px 1fr 44px; gap: 10px; align-items: center; padding: 6px 0; font-size: 13px; }
.w-list .wbar { height: 6px; background: var(--raised); border-radius: 3px; overflow: hidden; }
.w-list .wbar i { display: block; height: 100%; background: var(--accent); }

/* ---------- auto-trader ---------- */
.mode-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); display: inline-block; }
.mode-dot.live { background: var(--long); }
.mode-dot.paper { background: var(--accent); }
.mode-dot.paused, .mode-dot.error { background: var(--warn); }
.bot-head { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-bottom: 14px; }
.bot-head .state { display: flex; flex-direction: column; gap: 4px; margin-right: auto; }
.bot-head .state b { font: 600 18px/1.2 var(--font-cond); display: flex; align-items: center; gap: 10px; }
.bot-head .state span { color: var(--ink-2); font-size: 13px; }
.pill { font: 600 12px/1 var(--font); padding: 5px 9px; border-radius: 999px; background: var(--raised); color: var(--ink-2); }
.pill.live { background: var(--long-bg); color: var(--long); }
.pill.paper { background: rgba(124,156,255,.14); color: var(--accent); }
.pill.warn { background: rgba(224,169,59,.14); color: var(--warn); }
.pill.err { background: var(--short-bg); color: var(--short); }
.bot-controls { display: flex; gap: 8px; flex-wrap: wrap; }
.btn.danger { border-color: rgba(238,90,76,.5); color: var(--short); }
.btn.danger.arm { background: var(--short); color: #0C1624; }
.btn.small { padding: 4px 10px; font-size: 12.5px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.bot-msg { width: 100%; font-size: 13px; color: var(--ink-2); margin: 0; }
.bot-msg.err { color: var(--short); }
.sec-title { font: 600 17px/1.2 var(--font-cond); margin: 26px 0 10px; }
.bot-bottom { margin-top: 26px; }
.activity { list-style: none; margin: 0; padding: 0; max-height: 320px; overflow-y: auto; }
.activity li { display: grid; grid-template-columns: 92px 1fr; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--ink-2); }
.activity li span { color: var(--ink-3); font-size: 12px; }
.rules { list-style: none; margin: 0; padding: 0; }
.rules li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.rules li span { color: var(--ink-2); }
.setup-steps { margin: 6px 0 0; padding-left: 20px; color: var(--ink-2); font-size: 13.5px; }
.setup-steps li { margin: 4px 0; }

/* ---------- system settings ---------- */
.sys-card { margin-bottom: 14px; }
.sys-head h2 { margin-bottom: 4px; }
.sys-head .hint { margin: 0 0 8px; }
/* settings: side menu + one section at a time */
.set-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 28px; align-items: start; }
.set-nav { position: sticky; top: 80px; display: flex; flex-direction: column; gap: 18px; }
.set-nav-sec { display: flex; flex-direction: column; gap: 2px; }
.set-nav-title { font-size: 12px; font-weight: 600; color: var(--ink-3); padding: 0 12px 4px; }
.set-nav-btn { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; text-align: left;
  background: none; border: 0; border-radius: 8px; padding: 8px 12px; color: var(--ink-2); font: 500 14px/1.25 var(--font); cursor: pointer; }
.set-nav-btn:hover { background: var(--raised); color: var(--ink); }
.set-nav-btn.is-on { background: var(--raised); color: var(--ink); box-shadow: inset 3px 0 0 var(--accent); }
.set-nav-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.set-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.set-dot.saved { background: none; border: 1.5px solid var(--ink-3); }
.set-main { min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.set-pane-head h2 { font: 600 20px/1.2 var(--font-cond); margin: 0 0 4px; }
.set-pane-head p { margin: 0; color: var(--ink-2); font-size: 13.5px; max-width: 70ch; }
.set-pane:not(.is-on) { display: none; }
.warn-line { color: var(--warn); font-size: 13.5px; }
#sysSettings { display: contents; }
.sys-group { padding-top: 8px; padding-bottom: 8px; }
.sys-field { display: grid; grid-template-columns: minmax(180px, 260px) minmax(0, 1fr); gap: 6px 22px; padding: 9px 0; border-bottom: 1px solid rgba(34,53,79,.6); align-items: start; }
.sys-field:last-child { border-bottom: 0; }
.sys-field .lbl { font-size: 13.5px; font-weight: 500; padding-top: 6px; }
.sys-field .lbl .changed { display: inline-block; margin-left: 6px; font-size: 11px; font-weight: 600; color: var(--accent); }
.sys-field .ctl { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.sys-field .row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sys-field input[type=number], .sys-field input[type=text], .sys-field select {
  background: var(--bg); border: 1px solid var(--line-2); border-radius: 8px; padding: 6px 10px; color: var(--ink); font-size: 14px;
}
.sys-field input[type=number] { width: 120px; }
.sys-field input[type=text] { width: min(420px, 100%); }
.sys-field input.dirty, .sys-field select.dirty { border-color: var(--accent); }
.sys-field .unit { color: var(--ink-2); font-size: 13px; }
.sys-field .help { color: var(--ink-3); font-size: 12.5px; }
.sys-field .reset { align-self: flex-start; text-align: left; background: none; border: 0; color: var(--ink-3); font-size: 12px; text-decoration: underline; padding: 0; }
.sys-field .reset:hover { color: var(--ink); }
.sys-field .err { color: var(--short); font-size: 12.5px; }
.check-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--bg); border: 1px solid var(--line-2); border-radius: 999px; padding: 4px 11px 4px 8px; font-size: 13px; cursor: pointer; }
.check-chip input { accent-color: var(--accent); margin: 0; }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; padding-top: 4px; font-size: 13.5px; }
.switch input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }
.locked-card { margin-bottom: 14px; }
.confirm-live { margin-top: 6px; padding: 10px 12px; border: 1px solid rgba(238,90,76,.5); border-radius: 8px; background: var(--short-bg); font-size: 13px; color: var(--ink); display: flex; flex-direction: column; gap: 8px; max-width: 520px; }
.confirm-live input { background: var(--bg); border: 1px solid var(--line-2); border-radius: 8px; padding: 6px 10px; color: var(--ink); width: 240px; }
.locked-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 22px; margin: 0; padding: 0; list-style: none; }
.locked-list li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.locked-list li span { color: var(--ink-2); }
.savebar { position: sticky; bottom: 14px; z-index: 30; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--raised); border: 1px solid var(--line-2); border-radius: 12px; padding: 10px 14px; margin: 0; box-shadow: 0 12px 30px rgba(0,0,0,.35); }
.savebar #saveCount { font-weight: 600; }
.savebar-msg { flex: 1; color: var(--ink-2); font-size: 13px; min-width: 120px; }
.savebar-msg.err { color: var(--short); }
.save-ok { color: var(--long); font-size: 13px; margin: 8px 0 0; }

/* ---------- footer, toasts, login ---------- */
.foot { border-top: 1px solid var(--line); padding: 18px 24px 28px; color: var(--ink-3); font-size: 12px; }
.foot p { margin: 0 0 4px; max-width: 110ch; }
.toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 10px; z-index: 50; }
.toast {
  background: var(--raised); border: 1px solid var(--line-2); border-radius: var(--r); padding: 12px 14px;
  width: 320px; box-shadow: 0 12px 32px rgba(0, 0, 0, .35); cursor: pointer;
  animation: toastIn .25s ease-out;
}
.toast .t1 { display: flex; gap: 8px; align-items: center; font-weight: 600; }
.toast .t2 { color: var(--ink-2); font-size: 12.5px; margin-top: 4px; }
@keyframes toastIn { from { transform: translateY(8px); opacity: 0; } }
.login { position: fixed; inset: 0; background: var(--bg); display: grid; place-items: center; z-index: 100; }
.login-card { width: min(340px, 90vw); background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 26px; display: flex; flex-direction: column; gap: 14px; }
.login-card .brand { margin-bottom: 6px; }
.err { color: var(--short); font-size: 13px; margin: 0; min-height: 1em; }

/* ---------- responsive ---------- */
@media (max-width: 1280px) {
  .c-rsi, .c-fund { display: none; }
  .strip { grid-template-columns: minmax(200px, 1fr) repeat(3, minmax(130px, .8fr)) minmax(230px, 1.3fr); }
}
@media (max-width: 1080px) {
  .board { grid-template-columns: 1fr; }
  .list-pane { border-right: 0; }
  .detail {
    position: fixed; inset: 0; top: 0; max-height: none; z-index: 40; background: var(--bg);
    transform: translateY(100%); transition: transform .28s ease; visibility: hidden;
  }
  .detail.open { transform: none; visibility: visible; }
  .d-close { display: block; }
  .strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .strip .stat:last-child { grid-column: span 2; }
}
@media (max-width: 900px) {
  .set-layout { grid-template-columns: 1fr; gap: 16px; }
  .set-nav { position: static; flex-direction: row; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
  .set-nav-sec { flex-direction: row; gap: 6px; }
  .set-nav-title { display: none; }
  .set-nav-btn { width: auto; white-space: nowrap; border: 1px solid var(--line-2); border-radius: 999px; padding: 6px 12px; }
  .set-nav-btn.is-on { box-shadow: none; border-color: var(--accent); }
}
@media (max-width: 760px) {
  .top { flex-wrap: wrap; gap: 10px 14px; padding: 10px 14px; }
  .views { order: 3; width: 100%; overflow-x: auto; }
  .top-right { gap: 8px; }
  .status #statusText { display: none; }
  .strip { grid-template-columns: 1fr 1fr; }
  .strip .stat { padding: 12px 14px; }
  .strip .stat:last-child { grid-column: 1 / -1; }
  .fg { gap: 8px; }
  .fg svg { width: 64px; height: 38px; }
  .c-spark, .c-conf, .c-rank, .c-chg, .c-rail, .since { display: none; }
  .c-sig { text-align: right; }
  .toolbar { padding: 12px 14px 8px; }
  .search input { width: 100px; }
  td, th { padding: 9px 6px; }
  .coin { min-width: 0; }
  .coin .nm { max-width: 90px; overflow: hidden; text-overflow: ellipsis; }
  .detail { padding: 14px 16px 60px; }
  .pillars { grid-template-columns: repeat(2, 1fr); }
  .tiles { grid-template-columns: 1fr 1fr; }
  .bot-head { align-items: flex-start; }
  .sys-field { grid-template-columns: 1fr; gap: 6px; }
  .sys-field .lbl { padding-top: 0; }
  .activity li { grid-template-columns: 1fr; gap: 2px; }
  .alert-setup, .settings-grid { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; }
  .timeline li { grid-template-columns: 1fr; gap: 4px; }
  .page { padding: 20px 14px 40px; }
  .toast { width: calc(100vw - 36px); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
