:root {
  --bg: #0b0f14;
  --panel: #121820;
  --border: #233040;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #22d3ee;
  --good: #22c55e;
  --bad: #ef4444;
  --warn: #f59e0b;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
  position: sticky; top: 0; z-index: 10;
}
h1 { margin: 0; font-size: 18px; font-weight: 600; }
h1 .sub { color: var(--muted); font-weight: 400; margin-left: 10px; font-size: 13px; }
.meta { display: flex; gap: 12px; align-items: center; }
#lastrun { color: var(--muted); font-size: 13px; }
button {
  background: var(--accent);
  color: #042028;
  border: none;
  padding: 7px 14px;
  border-radius: 5px;
  font-weight: 600;
  cursor: pointer;
  font-size: 13px;
}
button:disabled { opacity: 0.5; cursor: not-allowed; }
#progress {
  padding: 10px 24px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}
.bar { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.fill { height: 100%; background: var(--accent); width: 0%; transition: width 0.3s; }
.ptext { color: var(--muted); font-size: 12px; margin-top: 6px; }
main { padding: 0 24px 24px; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-top: 16px;
}
th, td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 500; cursor: pointer; user-select: none; }
th:hover { color: var(--accent); }
th.num, td.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.row { cursor: pointer; }
tr.row:hover { background: var(--panel); }
tr.row.no-narr { opacity: 0.6; }
.ticker { font-weight: 600; color: var(--accent); }
.score-cell { font-weight: 600; }
.pos { color: var(--good); }
.neg { color: var(--bad); }
.empty { padding: 40px; text-align: center; color: var(--muted); }
.hidden { display: none !important; }
footer { padding: 20px 24px; color: var(--muted); font-size: 12px; border-top: 1px solid var(--border); }
.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
}
.modal-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  width: min(900px, 95vw);
  max-height: 90vh;
  display: flex; flex-direction: column;
}
.modal-card header { background: transparent; border-bottom: 1px solid var(--border); }
.modal-card header button {
  background: transparent; color: var(--muted); font-size: 24px;
  padding: 0 8px; line-height: 1;
}
#mbody {
  padding: 18px 24px;
  overflow-y: auto;
  line-height: 1.55;
}
#mbody h1, #mbody h2, #mbody h3 { color: var(--accent); border-bottom: 1px solid var(--border); padding-bottom: 4px; }
#mbody ul, #mbody ol { padding-left: 22px; }
#mbody code { background: #0b1220; padding: 1px 5px; border-radius: 3px; }
#mbody table { font-size: 12px; }
