[hidden] { display: none !important; }
:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --border: #dde1e7;
  --text: #1c2430;
  --muted: #667085;
  --accent: #2563eb;
  --accent-soft: #e0eaff;
  --pass: #15803d;
  --pass-soft: #dcfce7;
  --fail: #b91c1c;
  --fail-soft: #fee2e2;
  --warn: #b45309;
  --mono: ui-monospace, "SF Mono", "Noto Sans Mono CJK JP", monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1216; --surface: #161a20; --surface-2: #1d222a; --border: #2a313b; --text: #e6e9ee; --muted: #98a2b3;
    --accent: #6ea8fe; --accent-soft: #1d2b45; --pass: #4ade80; --pass-soft: #12301f; --fail: #f87171; --fail-soft: #3a1717; --warn: #fbbf24;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1216; --surface: #161a20; --surface-2: #1d222a; --border: #2a313b; --text: #e6e9ee; --muted: #98a2b3;
  --accent: #6ea8fe; --accent-soft: #1d2b45; --pass: #4ade80; --pass-soft: #12301f; --fail: #f87171; --fail-soft: #3a1717; --warn: #fbbf24;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.6 "Noto Sans JP", "Hiragino Sans", "Yu Gothic UI", system-ui, sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
header.top { display: flex; align-items: center; gap: 16px; padding: 12px 24px; border-bottom: 1px solid var(--border); background: var(--surface); position: sticky; top: 0; z-index: 10; }
header.top .brand { font-weight: 700; }
header.top nav { display: flex; gap: 16px; font-size: 13px; }
header.top .sp { flex: 1; }
main { max-width: 1440px; margin: 0 auto; padding: 24px; }
h1 { font-size: 24px; margin: 0 0 6px; }
h2 { font-size: 18px; margin: 32px 0 12px; }
h3 { font-size: 15px; margin: 20px 0 8px; }
.lead { color: var(--muted); max-width: 900px; margin: 0 0 16px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 14px 16px; }
.card .name { font-weight: 700; }
.card .note { color: var(--muted); font-size: 12px; min-height: 18px; }
.card .big { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; }
.card .kv { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; font-size: 13px; margin-top: 8px; font-variant-numeric: tabular-nums; }
.card .kv span:nth-child(odd) { color: var(--muted); }
.tbl-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { padding: 7px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
th { background: var(--surface-2); font-weight: 600; white-space: nowrap; position: sticky; top: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr:last-child td { border-bottom: none; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.chip.pass { background: var(--pass-soft); color: var(--pass); }
.chip.fail { background: var(--fail-soft); color: var(--fail); }
.chip.none { background: var(--surface-2); color: var(--muted); }
.chip.cat { background: var(--accent-soft); color: var(--accent); font-weight: 500; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: 12px; }
.bar { height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; min-width: 80px; }
.bar > i { display: block; height: 100%; background: var(--accent); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
select, button { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 4px 10px; }
button { cursor: pointer; }
button.on { background: var(--accent); color: #fff; border-color: var(--accent); }

/* run page */
.run { display: grid; grid-template-columns: minmax(0, 1fr) 440px; gap: 16px; align-items: start; }
.stage { background: #000; border-radius: 8px; overflow: hidden; position: relative; aspect-ratio: 16 / 9; }
.stage video, .stage img { width: 100%; height: 100%; display: block; object-fit: contain; }
.stage svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.side { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 64px; max-height: calc(100vh - 80px); }
.steps { overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; flex: 1; min-height: 200px; }
.step { padding: 8px 12px; border-bottom: 1px solid var(--border); cursor: pointer; }
.step:hover { background: var(--surface-2); }
.step.cur { background: var(--accent-soft); }
.step .h { display: flex; gap: 8px; align-items: baseline; }
.step .n { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 22px; }
.step .act { font-family: var(--mono); font-size: 12px; }
.step .t { margin-left: auto; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.step .th { color: var(--muted); font-size: 12px; margin-top: 2px; white-space: pre-wrap; }
.step .err { color: var(--fail); font-size: 12px; }
.caption { margin-top: 8px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; min-height: 64px; white-space: pre-wrap; font-size: 13px; }
.kvtable td:first-child { color: var(--muted); white-space: nowrap; width: 84px; }
pre { background: var(--surface-2); border-radius: 6px; padding: 10px; overflow: auto; font-size: 12px; max-height: 260px; }

/* perception */
.shot { position: relative; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; background: #000; }
.shot img { width: 100%; display: block; }
.shot svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.pgrid { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 16px; align-items: start; margin-bottom: 28px; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }
@media (max-width: 1100px) {
  .run, .pgrid { grid-template-columns: 1fr; }
  .side { position: static; max-height: none; }
  main { padding: 16px; }
}
