:root {
  --bg: #0b0f14;
  --surface: #141a22;
  --border: #2d333b;
  --accent: #f7931a;
  --text: #e8eaed;
  --muted: #8b949e;
  --green: #3fb950;
  --red: #f85149;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}
header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}
header h1 { color: var(--accent); font-size: 1.25rem; }
header .status { font-size: 0.85rem; color: var(--muted); }
header .header-right { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
nav.main-nav {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}
nav.main-nav a {
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  font-size: 0.82rem;
}
nav.main-nav a:hover { border-color: var(--accent); color: var(--accent); }
nav.main-nav a.active {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}
main { padding: 1.5rem 2rem; max-width: 1400px; margin: 0 auto; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
}
.card h2 {
  font-size: 0.9rem;
  color: var(--accent);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.row { display: flex; gap: 0.5rem; margin-bottom: 0.5rem; flex-wrap: wrap; align-items: center; }
label { font-size: 0.8rem; color: var(--muted); }
input, select {
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font-size: 0.85rem;
}
button {
  padding: 0.45rem 0.9rem;
  border: none;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  font-weight: 500;
}
.btn-primary { background: var(--accent); color: #000; }
.btn-green { background: var(--green); color: #000; }
.btn-red { background: var(--red); color: #fff; }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--text); }
table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
th, td { padding: 0.4rem 0.5rem; text-align: left; border-bottom: 1px solid var(--border); }
th { color: var(--muted); }
.buy { color: var(--green); }
.sell { color: var(--red); }
.alert { background: #3d1f1f; border: 1px solid var(--red); color: var(--red); padding: 0.5rem; border-radius: 6px; margin-bottom: 0.5rem; font-size: 0.85rem; }
.alert.info { background: #1a2a3d; border-color: var(--accent); color: var(--text); }
.alert.hidden { display: none; }
.stat { font-size: 1.1rem; font-weight: 600; }
.stat-label { font-size: 0.75rem; color: var(--muted); }
#chartCanvas { width: 100%; height: 400px; background: var(--bg); border-radius: 8px; }
.chart-controls { margin-bottom: 0.5rem; }
.wide { grid-column: 1 / -1; }
.log-box {
  max-height: 200px;
  overflow-y: auto;
  font-size: 0.75rem;
  font-family: monospace;
  color: var(--muted);
}
.toggle { display: flex; align-items: center; gap: 0.5rem; }
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.metric {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.45rem 0.55rem;
}
.metric-label { font-size: 0.7rem; color: var(--muted); margin-bottom: 0.15rem; }
.metric-value { font-size: 0.85rem; font-weight: 600; }
.metric-sub { font-size: 0.7rem; color: var(--muted); margin-top: 0.1rem; }
.metric.ok { border-color: var(--green); }
.metric.warn { border-color: #d29922; }
.metric.no { border-color: var(--border); }
.strategy-note {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.5rem;
  line-height: 1.4;
}
.strategy-detection {
  margin-top: 0.35rem;
  font-size: 0.7rem;
  line-height: 1.35;
}
.hint { font-size: 0.75rem; color: var(--muted); line-height: 1.4; }
.field-hint { display: block; font-size: 0.7rem; color: var(--muted); margin-top: 0.2rem; line-height: 1.3; }
.table-wrap { width: 100%; overflow-x: auto; margin-bottom: 0.5rem; }
.table-wrap table { min-width: 100%; }
.trades-table-hint { margin: 0 0 0.35rem; font-size: 0.75rem; }
.trades-table-scroll {
  max-height: calc(2.05rem * 5 + 2.1rem);
  overflow-y: auto;
  overflow-x: auto;
  margin-bottom: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
}
.trades-table-scroll table { margin: 0; }
.trades-table-scroll thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface);
  box-shadow: 0 1px 0 var(--border);
}
.inject-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}
.inject-form .field { display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; }
.inject-form .field label { font-size: 0.75rem; font-weight: 500; color: var(--text); }
.inject-form .field-action { display: flex; flex-direction: column; justify-content: flex-end; }
.inject-form .field-action button { width: 100%; }

.invest-books-by-symbol {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 0.5rem;
}
.invest-symbol-block.dash-panel {
  margin: 0;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}
.invest-symbol-block.dash-panel summary.invest-symbol-summary {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
  flex-direction: column;
  align-items: stretch;
  gap: 0.2rem;
  font-weight: inherit;
  font-size: inherit;
  list-style: none;
}
.invest-symbol-block.dash-panel[open] summary.invest-symbol-summary {
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}
.invest-symbol-summary-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.75rem;
  width: 100%;
}
.invest-symbol-summary-row .section-title { margin: 0; flex: 1; }
.invest-symbol-dep-count { margin-left: auto; font-size: 0.72rem; }
.invest-symbol-book-meta {
  margin: 0;
  padding-left: 1rem;
  font-size: 0.78rem;
}
.invest-symbol-block.dash-panel summary::before {
  align-self: flex-start;
  margin-top: 0.35rem;
}
.invest-symbol-body {
  padding-top: 0.15rem;
}
.subsection-title {
  font-size: 0.85rem;
  font-weight: 600;
  margin: 0.75rem 0 0.35rem;
}
th.num, td.num { text-align: right; white-space: nowrap; }
.tag { display: inline-block; padding: 0.1rem 0.4rem; border-radius: 4px; font-size: 0.7rem; background: var(--bg); border: 1px solid var(--border); }
.tag.bull { color: var(--green); border-color: var(--green); }
.tag.bear { color: var(--red); border-color: var(--red); }
.tag.bear.flat { color: var(--muted); border-color: var(--border); }
.tag.range { color: var(--muted); }
.tag.active { color: var(--green); border-color: var(--green); }
.tag.soon { color: var(--muted); }
.liq-panel { display: flex; flex-direction: column; gap: 0.5rem; }
.liq-panel .liq-metric { display: flex; justify-content: space-between; gap: 0.75rem; font-size: 0.85rem; }
.liq-panel .liq-metric .label { color: var(--muted); }
.liq-panel .liq-metric .value { font-weight: 600; text-align: right; }
.liq-panel .liq-note { font-size: 0.75rem; color: var(--muted); line-height: 1.4; margin-top: 0.25rem; }
.liq-risk-safe .value { color: var(--green); }
.liq-risk-caution .value { color: #d29922; }
.liq-risk-critical .value { color: var(--red); }
.liq-risk-info .value { color: var(--text); }
.strategy-hero {
  background: linear-gradient(135deg, #141a22 0%, #1a2330 100%);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}
.strategy-hero h2 {
  font-size: 1rem;
  color: var(--text);
  text-transform: none;
  letter-spacing: 0;
  margin-bottom: 0.35rem;
}
.strategy-hero p { font-size: 0.82rem; color: var(--muted); line-height: 1.45; }
.coming-soon {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--muted);
}
.coming-soon h3 { color: var(--text); margin-bottom: 0.5rem; }
.overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}
.overview-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.overview-card h3 { font-size: 0.95rem; color: var(--text); }
.overview-card p { font-size: 0.8rem; color: var(--muted); line-height: 1.45; flex: 1; }
.overview-card .meta { font-size: 0.75rem; color: var(--muted); }
.overview-card .actions { margin-top: 0.25rem; }
.overview-card .actions a {
  display: inline-block;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  border: 1px solid var(--accent);
  color: var(--accent);
  text-decoration: none;
  font-size: 0.8rem;
}
.overview-card .actions a.disabled {
  opacity: 0.5;
  pointer-events: none;
  border-color: var(--border);
  color: var(--muted);
}
.summary-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.summary-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
}
.summary-stat .label { font-size: 0.7rem; color: var(--muted); }
.summary-stat .value { font-size: 1rem; font-weight: 600; margin-top: 0.15rem; }
.summary-stat .value.entry-paused { color: #d29922; font-size: 0.85rem; font-weight: 500; }

/* —— Simplified dashboard —— */
body.dash { background: var(--bg); }
.dash-header {
  padding: 0.85rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.dash-header h1 { font-size: 1.1rem; color: var(--accent); }
.dash-header-meta { display: flex; align-items: center; gap: 0.75rem; }
.dash-link { color: var(--muted); font-size: 0.85rem; text-decoration: none; }
.dash-link:hover { color: var(--accent); }
.dash-user { font-size: 0.8rem; color: var(--muted); font-weight: 500; }
.dash-main { max-width: 720px; margin: 0 auto; padding: 1.25rem 1rem 2rem; }
.dash-tabs {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 1rem;
  padding: 0.15rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.dash-tab {
  flex: 1;
  padding: 0.45rem 0.75rem;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
}
.dash-tab:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }
.dash-tab.active {
  background: var(--bg);
  color: var(--accent);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}
.dash-view.hidden { display: none; }
.dash-research-intro { margin-bottom: 1rem; }
.dash-research-grid { display: flex; flex-direction: column; gap: 1rem; }
.dash-research-card h2 { margin: 0 0 0.35rem; font-size: 1.05rem; }
.dash-research-card .research-subtitle { margin: 0 0 0.75rem; color: var(--muted); font-size: 0.85rem; }
.dash-research-card .research-tags { margin-bottom: 0.75rem; }
.dash-research-card .research-rules {
  margin: 0 0 1rem;
  padding-left: 1.1rem;
  font-size: 0.85rem;
  color: var(--muted);
}
.dash-research-card .research-rules li { margin-bottom: 0.35rem; }
.research-metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  margin-bottom: 1rem;
}
@media (min-width: 520px) {
  .research-metrics { grid-template-columns: repeat(3, 1fr); }
}
.research-metric {
  padding: 0.5rem 0.65rem;
  background: var(--bg);
  border-radius: 6px;
  border: 1px solid var(--border);
}
.research-metric .label { font-size: 0.7rem; color: var(--muted); }
.research-metric .value { font-size: 0.95rem; font-weight: 600; margin-top: 0.1rem; }
.research-table-wrap { overflow-x: auto; margin-top: 0.5rem; }
.research-table { width: 100%; font-size: 0.8rem; border-collapse: collapse; }
.research-table th,
.research-table td { padding: 0.35rem 0.5rem; border-bottom: 1px solid var(--border); text-align: right; }
.research-table th:first-child,
.research-table td:first-child { text-align: left; }
.research-compare h3 { font-size: 0.9rem; margin: 1rem 0 0.5rem; }
.dash-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin-bottom: 1rem;
}
@media (min-width: 520px) {
  .dash-hero { grid-template-columns: repeat(3, 1fr); }
}
.dash-hero-summary { margin-bottom: 0.5rem; }
.dash-hero-by-asset {
  grid-template-columns: 1fr 1fr;
  margin-bottom: 0.75rem;
}
.dash-hero-by-asset.hidden { display: none; }
.dash-stat-compact .dash-stat-sub {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  margin-top: 0.15rem;
}
.dash-stat-compact .dash-stat-sub.buy { color: var(--green); }
.dash-stat-compact .dash-stat-sub.sell { color: var(--red); }
.dash-bot-control { margin-bottom: 0.75rem; }
.dash-bot-control-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.dash-bot-control-status { display: flex; flex-direction: column; gap: 0.25rem; }
.dash-bot-control-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.dash-asset-panels {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 0.75rem;
}
.dash-asset-panel {
  margin-bottom: 0;
}
.dash-asset-panel.dash-panel summary.dash-asset-panel-head {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
  flex-direction: column;
  align-items: stretch;
  gap: 0.25rem;
  font-weight: inherit;
  font-size: inherit;
}
.dash-asset-panel.dash-panel[open] summary.dash-asset-panel-head {
  margin-bottom: 0.65rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}
.dash-asset-panel-summary-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  width: 100%;
}
.dash-asset-panel-quick {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-left: auto;
}
.dash-asset-panel.dash-panel:not([open]) .dash-asset-panel-quick {
  display: inline-flex;
}
.dash-asset-panel.dash-panel[open] .dash-asset-panel-quick {
  display: none;
}
.dash-asset-panel-body {
  padding-top: 0.15rem;
}
.dash-asset-panel-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
}
.dash-asset-panel-meta { margin: 0.25rem 0 0; padding-left: 1rem; }
.dash-asset-panel.dash-panel summary::before {
  align-self: flex-start;
  margin-top: 0.35rem;
}
.dash-asset-panel-summary {
  margin: 0.35rem 0 0.5rem;
  font-size: 0.85rem;
}
.dash-o5-card-nested {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}
.dash-chart-card-nested {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}
.dash-chart-card-nested .chart-canvas-wrap canvas {
  width: 100%;
  max-height: 420px;
}
.dash-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem 0.85rem;
}
.dash-hero-compact {
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.dash-hero-compact .dash-stat-compact,
.dash-hero-compact .dash-stat-mini {
  padding: 0.45rem 0.55rem;
}
.dash-stat-mini .dash-stat-value { font-size: 0.95rem; }
.dash-stat-mini .dash-stat-label { font-size: 0.62rem; }
.dash-stat-mini .dash-stat-sub { font-size: 0.78rem; }
.dash-strategy-zone { margin-bottom: 0.65rem; }
.dash-strategy-zone-summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.dash-strategy-zone-body { padding-top: 0.35rem; }
.dash-sub-panel { margin-bottom: 0.5rem; }
.dash-coin-strip { padding: 0.65rem 0.75rem; }
.dash-coin-strip .dash-asset-panel-head { margin: 0; }
.status-reason-compact { margin: 0.25rem 0 0.35rem; font-size: 0.82rem; line-height: 1.35; }
.dash-sub-panel .dash-asset-panel-title { font-size: 1rem; margin: 0; }
.dash-panel-nested { margin-top: 0.75rem; border-top: 1px solid var(--border); padding-top: 0.5rem; }
.dash-bot-hint { margin: 0.25rem 0 0.5rem !important; }
.watchlist-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}
.watchlist-meta { margin: 0 !important; flex: 1; min-width: 12rem; }
.dash-watchlist-nested { margin-top: 0.75rem; }
.dash-short-alt-subsection {
  margin-top: 0.75rem;
  padding: 0.65rem 0.75rem 0.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
}
.dash-short-alt-heading { margin: 0 0 0.25rem; }
.dash-short-alt-lead { margin: 0 0 0.65rem; font-size: 0.85rem; }
.dash-short-alt-subsection .dash-coin-strip { margin-bottom: 0.5rem; }
.funds-panel-body .funds-panel-lead { margin-top: 0; }
.funds-inject-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 0.35rem 1rem;
  margin-bottom: 0.5rem;
}
.funds-symbol-hint { margin: 0.2rem 0 0 !important; font-size: 0.78rem; }
.funds-books-title { margin: 1rem 0 0.35rem; font-size: 0.95rem; }
.invest-symbol-block-compact .invest-symbol-book-meta { display: none; }
.invest-strategy-fold { margin-top: 0.5rem; font-size: 0.88rem; }
.invest-strategy-fold summary { cursor: pointer; color: var(--muted); }
.dash-long-invested { margin: 0.15rem 0 0.35rem; font-size: 0.82rem; }
.dash-recent-panel { margin-bottom: 0.65rem; }
.dash-stat-lg .dash-stat-value { font-size: 1.35rem; }
.dash-stat-label { display: block; font-size: 0.7rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.dash-stat-value { display: block; font-size: 1.05rem; font-weight: 600; margin-top: 0.2rem; }
.dash-status { margin-bottom: 0.75rem; }
.dash-status-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}
.status-badge {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  margin-right: 0.4rem;
}
.status-badge.hold { background: #2d333b; color: var(--muted); }
.status-badge.buy { background: #1a3d2a; color: var(--green); }
.status-badge.sell { background: #3d1f1f; color: var(--red); }
.status-reason {
  font-size: 0.95rem;
  line-height: 1.45;
  margin-bottom: 0.85rem;
  color: var(--text);
}
.status-note { font-size: 0.78rem; color: var(--muted); margin-top: 0.65rem; line-height: 1.4; }
.strategy-strip {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 0.75rem;
  padding: 0.65rem 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.strategy-eth-gates { margin-top: 0.35rem; color: var(--accent); }
.dash-trade-strategy {
  margin: 0 0 1rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(63, 185, 80, 0.06);
}
.dash-trade-strategy-eth { border-color: rgba(63, 185, 80, 0.35); }
.dash-trade-strategy .subsection-title { margin: 0 0 0.35rem; font-size: 0.95rem; }
.dash-trade-strategy-summary { margin: 0 0 0.5rem; font-size: 0.82rem; }
.dash-trade-strategy-rules {
  margin: 0;
  padding-left: 1.15rem;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--text);
}
.dash-trade-strategy-rules li { margin-bottom: 0.35rem; }
.dash-watchlist { margin-bottom: 0.75rem; }
.watchlist-summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.watchlist-summary::-webkit-details-marker { display: none; }
.watchlist-summary-hint { margin: 0; font-size: 0.85rem; }
.watchlist-benchmarks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  font-size: 0.82rem;
  margin-bottom: 0.65rem;
  color: var(--muted);
}
.watchlist-benchmarks .tag { margin-right: 0.25rem; }
.watchlist-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.watchlist-table th,
.watchlist-table td {
  text-align: left;
  padding: 0.35rem 0.4rem;
  border-bottom: 1px solid var(--border);
}
.watchlist-table th { color: var(--muted); font-weight: 500; }
.watchlist-table .beat-yes { color: var(--green); }
.watchlist-table .beat-no { color: var(--muted); }
.regime-lev-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin: 0.5rem 0 0.75rem;
}
.regime-lev-cell {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.45rem 0.5rem;
  text-align: center;
}
.regime-lev-cell .rl-regime { font-size: 0.65rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.regime-lev-cell .rl-val { font-size: 0.95rem; font-weight: 600; margin-top: 0.15rem; }
.regime-lev-cell.bull .rl-val { color: var(--green); }
.regime-lev-cell.range .rl-val { color: var(--accent); }
.regime-lev-cell.bear .rl-val { color: var(--muted); }
.regime-lev-cell.bear.flat .rl-val { font-size: 0.8rem; }
.dash-kv { display: flex; flex-direction: column; gap: 0.45rem; }
.dash-kv-row { display: flex; justify-content: space-between; gap: 1rem; font-size: 0.85rem; }
.dash-kv-label { color: var(--muted); flex-shrink: 0; }
.dash-kv-value { text-align: right; font-weight: 500; word-break: break-word; }
.dash-kv-value.entry-paused { color: #d29922; }
.dash-controls { display: flex; gap: 0.4rem; flex-shrink: 0; }
.btn-sm { padding: 0.35rem 0.7rem; font-size: 0.8rem; }
.pill {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border);
}
.pill.ok { color: var(--green); border-color: var(--green); }
.pill.off { color: var(--muted); }
.pill.warn { color: #d29922; border-color: #d29922; }
.dash-panel { margin-bottom: 0.65rem; }
.dash-panel summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.dash-panel summary::-webkit-details-marker { display: none; }
.dash-panel summary::before { content: '▸'; color: var(--accent); font-size: 0.75rem; }
.dash-panel[open] summary::before { content: '▾'; }
.dash-panel-body { margin-top: 0.85rem; padding-top: 0.85rem; border-top: 1px solid var(--border); }
.dash-form-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-bottom: 0.65rem; }
.dash-form-row label { min-width: 6rem; font-size: 0.8rem; color: var(--muted); }
.dash-recent { display: grid; gap: 0.75rem; margin-top: 1rem; }
@media (min-width: 640px) { .dash-recent { grid-template-columns: 1fr 1fr; } }
.invest-list { margin-top: 0.75rem; display: flex; flex-direction: column; gap: 0.35rem; }
.invest-row {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "main value"
    "actions actions";
  gap: 0.35rem 0.75rem;
  align-items: center;
  font-size: 0.8rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
}
.invest-row-main { grid-area: main; display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.invest-row-value { grid-area: value; text-align: right; white-space: nowrap; }
.invest-row-actions {
  grid-area: actions;
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}
.invest-row-actions .btn-sm { padding: 0.3rem 0.55rem; font-size: 0.72rem; }
.invest-row-title { font-weight: 500; }
.invest-row-meta { color: var(--muted); font-size: 0.75rem; }
.invest-strategy-pill {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--accent);
  margin-right: 0.35rem;
}
.dash-o5-card h2.section-title-inline {
  display: inline;
  font-size: 0.85rem;
  margin: 0 0.5rem 0 0;
  vertical-align: middle;
}
.dash-o5-card .dash-status-head { margin-bottom: 0.35rem; }
.buy-checklist-summary-wrap {
  margin-top: 0.45rem;
  padding-left: 1rem;
  width: 100%;
}
.buy-checklist-summary-wrap .buy-checklist-title {
  display: block;
  margin-bottom: 0.35rem;
}
.buy-checklist-compact {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
}
.buy-checklist-compact li {
  grid-template-columns: 1.1rem auto;
  gap: 0.3rem;
  align-items: center;
  padding: 0.15rem 0.35rem 0.15rem 0;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
}
.buy-checklist-compact .chk-label-compact {
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
}
.dash-asset-panel.dash-panel[open] .buy-checklist-summary-wrap {
  display: none;
}
.buy-checklist-wrap {
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}
.buy-checklist-title {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin: 0 0 0.5rem;
}
.buy-checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.buy-checklist li {
  display: grid;
  grid-template-columns: 1.1rem 1fr;
  gap: 0.35rem 0.55rem;
  font-size: 0.78rem;
  align-items: center;
}
.buy-checklist .chk-led {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  justify-self: center;
  flex-shrink: 0;
  box-shadow: 0 0 0.35rem currentColor, 0 0 0.65rem currentColor;
}
.buy-checklist li.met .chk-led {
  background: var(--green);
  color: var(--green);
}
.buy-checklist li.fail .chk-led {
  background: var(--red);
  color: var(--red);
}
.buy-checklist .chk-label { font-weight: 500; align-self: start; margin-top: 0.05rem; }
.buy-checklist li:has(.chk-detail) { align-items: start; }
.buy-checklist li:has(.chk-detail) .chk-led { margin-top: 0.35rem; }
.buy-checklist .chk-detail {
  grid-column: 2;
  color: var(--muted);
  font-size: 0.72rem;
  margin-top: -0.15rem;
}
.invest-editor {
  margin-top: 0.85rem;
  padding: 0.85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.15);
}
.invest-editor-actions { display: flex; gap: 0.5rem; margin-top: 0.5rem; }
.dash-main .card h2 { font-size: 0.8rem; margin-bottom: 0.5rem; }
.dash-main .log-box { max-height: 160px; }

.section-title {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 1.25rem 0 0.5rem;
}

/* Auth pages */
body.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.auth-shell { width: 100%; max-width: 420px; }
.auth-card { padding: 1.75rem; }
.auth-brand h1 { color: var(--accent); font-size: 1.5rem; margin-bottom: 0.35rem; }
.auth-brand p { color: var(--muted); font-size: 0.9rem; margin-bottom: 1.25rem; }
.auth-form { display: flex; flex-direction: column; gap: 0.85rem; }
.auth-field { display: flex; flex-direction: column; gap: 0.35rem; }
.auth-field label { font-size: 0.8rem; color: var(--muted); }
.auth-field input {
  width: 100%;
  padding: 0.7rem 0.75rem;
  font-size: 0.95rem;
}
.password-wrap { display: flex; gap: 0.5rem; align-items: center; }
.password-wrap input { flex: 1; }
.btn-icon { padding: 0.45rem 0.65rem; font-size: 0.75rem; white-space: nowrap; }
.auth-submit { width: 100%; padding: 0.75rem; font-size: 0.95rem; margin-top: 0.25rem; }
.auth-error {
  color: var(--red);
  background: rgba(248, 81, 73, 0.08);
  border: 1px solid rgba(248, 81, 73, 0.35);
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
}
.hidden { display: none !important; }

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 1000;
}
.modal {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem;
}
.modal h3 { margin-bottom: 0.5rem; color: var(--text); }
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1rem;
}
.user-cell { min-width: 220px; }
.user-actions { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.35rem; }

/* Dashboard multi-panel chart */
.dash-chart-card { margin-bottom: 1rem; }
.dash-chart-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.dash-chart-head h2 { margin: 0; font-size: 1rem; }
.chart-zoom-tabs { display: flex; gap: 0.25rem; flex-wrap: wrap; }
.chart-zoom-tabs .btn-sm.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.chart-nav-sep {
  display: inline-block;
  width: 1px;
  height: 1.2rem;
  background: var(--border);
  margin: 0 0.15rem;
  vertical-align: middle;
}
.chart-view-hint { margin: 0 0 0.35rem; font-size: 0.72rem; }
.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  font-size: 0.7rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}
.chart-legend-item { display: inline-flex; align-items: center; gap: 0.25rem; }
.chart-legend-item .swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
}
.chart-legend-item .swatch.bull { background: rgba(63, 185, 80, 0.5); }
.chart-legend-item .swatch.range { background: rgba(139, 148, 158, 0.4); }
.chart-legend-item .swatch.bear { background: rgba(248, 81, 73, 0.4); }
.chart-legend-item .swatch.zone { background: rgba(88, 166, 255, 0.35); }
.chart-legend-item .swatch.buy { background: #3fb950; clip-path: polygon(50% 0%, 0% 100%, 100% 100%); height: 8px; width: 10px; }
.chart-legend-item .swatch.sell-win { background: #3fb950; clip-path: polygon(50% 100%, 0% 0%, 100% 0%); height: 8px; width: 10px; }
.chart-legend-item .swatch.sell-loss { background: #f85149; clip-path: polygon(50% 100%, 0% 0%, 100% 0%); height: 8px; width: 10px; }
.chart-legend-meta { margin-left: auto; color: var(--muted); }
.chart-trade-summary { margin: 0 0 0.5rem; font-size: 0.8rem; }
.chart-canvas-wrap { position: relative; width: 100%; }
#dashboardChartCanvas {
  width: 100%;
  height: 520px;
  background: var(--bg);
  border-radius: 8px;
  display: block;
}
.chart-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.85rem;
  color: var(--muted);
  z-index: 1;
}
