:root {
  --bg: #0d1117;
  --card: #161b22;
  --border: #30363d;
  --text: #e6edf3;
  --muted: #8b949e;
  --accent: #58a6ff;
  --pos: #3fb950;
  --neg: #f85149;
  --strat: #58a6ff;
  --bench: #d29922;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
}

.topbar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--card);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand { font-size: 1.15rem; font-weight: 700; letter-spacing: 0.02em; }
.asof { color: var(--muted); font-size: 0.8rem; }

main {
  max-width: 1000px;
  margin: 0 auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}
.metric {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.9rem 1rem;
}
.metric .label { color: var(--muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; }
.metric .value { font-size: 1.35rem; font-weight: 700; margin-top: 0.15rem; }
.metric .sub { color: var(--muted); font-size: 0.7rem; margin-top: 0.1rem; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.1rem 1.25rem 1.25rem;
}
.card h2 { font-size: 1rem; font-weight: 600; margin-bottom: 0.85rem; color: var(--text); }

.chart-wrap { position: relative; height: 380px; }
@media (max-width: 640px) { .chart-wrap { height: 300px; } }
.curve-img { width: 100%; height: auto; border-radius: 6px; display: block; }

.table-wrap { overflow-x: auto; }
table.monthly { border-collapse: collapse; width: 100%; font-size: 0.85rem; white-space: nowrap; }
table.monthly th, table.monthly td {
  padding: 0.4rem 0.55rem;
  text-align: right;
  border-bottom: 1px solid var(--border);
}
table.monthly thead th { position: sticky; top: 0; background: var(--card); color: var(--muted); font-weight: 600; }
table.monthly .strategy { text-align: left; font-weight: 600; }
table.monthly td.strategy { border-right: 1px solid var(--border); }
table.monthly .year { text-align: left; color: var(--muted); font-weight: 600; }
table.monthly .cum { font-weight: 700; border-left: 1px solid var(--border); }
.pos { color: var(--pos); }
.neg { color: var(--neg); }

.foot { text-align: center; color: var(--muted); font-size: 0.75rem; padding: 1.5rem 0; }
