:root {
  color-scheme: dark;
  --bg: #0e1116;
  --card: #161b22;
  --line: #303943;
  --text: #e6edf3;
  --muted: #a4b1bd;
  --up: #54d4a0;
  --down: #ff818a;
  --accent: #a7c6ff;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 system-ui, sans-serif; }
.banner { padding: 8px 12px; background: #213553; color: #ecf3ff; text-align: center; font-size: 13px; }
header { border-bottom: 1px solid var(--line); }
.header-inner {
  max-width: 1120px; margin: auto; padding: 12px 20px;
  display: flex; align-items: baseline; gap: 8px 24px; flex-wrap: wrap;
}
header strong { font-size: 18px; }
nav { display: flex; flex-wrap: wrap; gap: 2px 4px; }
nav a { color: var(--muted); padding: 5px 8px; border-radius: 6px; text-decoration: none; }
nav a:hover, nav a[aria-current] { background: #26354b; color: #fff; }
a { color: var(--accent); }
main { max-width: 1120px; padding: 22px 20px; margin: auto; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 16px; margin-bottom: 16px;
}
h1 { font-size: 25px; margin: 0 0 16px; }
h2 { font-size: 16px; margin: 0 0 12px; }
.card:has(> table), .table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { color: var(--muted); font-weight: 500; }
.pos { color: var(--up); }
.neg { color: var(--down); }
.mut { color: var(--muted); font-size: 13px; }
.big, .quote { font-size: 26px; font-weight: 650; font-variant-numeric: tabular-nums; }
.row { display: flex; flex-wrap: wrap; gap: 12px; }
.row > * { flex: 1; min-width: 140px; }
input, select, button { font: inherit; border-radius: 6px; padding: 7px 11px; border: 1px solid var(--line); }
input, select { background: var(--bg); color: var(--text); width: 100%; }
button { background: #294270; color: #fff; cursor: pointer; }
button.gray, button[data-symbol] { background: #222c3b; }
button[aria-pressed="true"] { background: #294270; border-color: #77a7ff; }
form > button { margin-top: 12px; }
.pill { background: var(--bg); border-radius: 20px; padding: 2px 9px; }
dl { display: grid; grid-template-columns: max-content 1fr; gap: 10px 18px; margin-bottom: 0; }
dt { color: var(--muted); }
dd { margin: 0; }
.events { margin: 0; padding: 0; list-style: none; }
.events li { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.events time { color: var(--muted); }
.chart-toolbar, .legend { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.chart-toolbar { margin-bottom: 12px; }
.quote { min-height: 1.5em; }
canvas { display: block; width: 100%; height: clamp(255px, 49vh, 470px); margin: 12px 0; }
.legend { justify-content: flex-start; gap: 12px; font-size: 13px; }
#demo-toast:empty { display: none; }
#demo-toast {
  position: fixed; bottom: 16px; right: 16px; max-width: calc(100vw - 32px);
  background: #253550; border: 1px solid #537298; padding: 12px 16px; border-radius: 8px;
}
@media (max-width: 540px) {
  .header-inner, main { padding-inline: 12px; }
  main { padding-top: 16px; }
  .header-inner { gap: 5px; }
  nav a { padding: 4px 6px; font-size: 13px; }
  .card { padding: 12px; }
}
