:root {
  --bg: #0d1117;
  --panel: #161b22;
  --border: #30363d;
  --text: #e6edf3;
  --muted: #8b949e;
  --accent: #58a6ff;
  --green: #3fb950;
  --red: #f85149;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
}
header { padding: 20px 24px 4px; max-width: 1080px; margin: 0 auto; }
h1 { font-size: 22px; margin: 0 0 6px; }
.note { color: var(--muted); font-size: 13px; margin: 0 0 8px; }
main { max-width: 1080px; margin: 0 auto; padding: 12px 24px 40px; }
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}
label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.row { display: flex; gap: 8px; }
select, input {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px;
  font-size: 14px;
  width: 100%;
}
button {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 10px 22px;
  font-size: 15px;
  cursor: pointer;
}
button:disabled { opacity: 0.5; cursor: wait; }
.status { color: var(--muted); font-size: 13px; min-height: 18px; }
.status.error { color: var(--red); }
.hidden { display: none !important; }
.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.metric {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
}
.metric .k { font-size: 12px; color: var(--muted); }
.metric .v { font-size: 18px; font-weight: 600; margin-top: 4px; }
.pos { color: var(--green); }
.neg { color: var(--red); }
canvas { width: 100%; height: auto; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; }
.tablewrap { overflow-x: auto; max-height: 480px; overflow-y: auto; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { border-bottom: 1px solid var(--border); padding: 6px 8px; text-align: right; white-space: nowrap; }
th { color: var(--muted); text-align: right; position: sticky; top: 0; background: var(--panel); }
td.side, th:nth-child(3) { text-align: center; }
.liq { color: var(--red); font-weight: 700; }
