:root {
  --bg: #f4f6f8; --card: #ffffff; --ink: #14202b; --muted: #5b6b79; --line: #dfe5ea;
  --accent: #0f5f8c; --water: #2f86c9; --cam: #e07a1f;
  --clear: #2e7d4f; --caution: #b7791f; --close: #c2511a; --danger: #b00020;
  --radius: 12px;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0e1418; --card: #151d23; --ink: #e6edf2; --muted: #93a4b1; --line: #26323b; --accent: #5fb2e6; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.top { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 56px; gap: 12px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--accent); font-size: 18px; }
nav a { color: var(--muted); text-decoration: none; margin-left: 16px; font-size: 14px; }
nav a:hover { color: var(--ink); }
.hero { padding: 28px 0 8px; }
.hero h1 { font-size: clamp(24px, 3.4vw, 34px); line-height: 1.2; margin: 0 0 10px; }
.hero p { max-width: 820px; color: var(--muted); margin: 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin: 20px 0; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
h2 { font-size: 20px; margin: 0; }
h3 { font-size: 16px; margin: 0 0 6px; }
h3.sub { margin-top: 18px; }
.muted { color: var(--muted); font-size: 14px; }
.note { color: var(--muted); font-size: 14px; margin-top: 0; }
.live-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 20px; }
@media (max-width: 820px) { .live-grid { grid-template-columns: 1fr; } nav a { margin-left: 10px; } }
figure { margin: 0; }
figure img { width: 100%; height: auto; border-radius: 8px; display: block; background: #222; aspect-ratio: 4 / 3; object-fit: cover; }
figure.wide img { aspect-ratio: auto; background: transparent; }
figcaption { font-size: 13px; color: var(--muted); margin-top: 6px; }
.alert-badge { display: inline-block; padding: 8px 14px; border-radius: 999px; font-weight: 700; color: #fff; background: var(--clear); letter-spacing: .02em; }
.alert-badge.caution { background: var(--caution); }
.alert-badge.close_crossing { background: var(--close); }
.alert-badge.danger { background: var(--danger); }
.summary { font-size: 15px; margin: 12px 0; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 14px; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; }
.issue { font-size: 13px; border-left: 3px solid var(--caution); padding: 4px 8px; margin-top: 10px; background: color-mix(in srgb, var(--caution) 10%, transparent); }
.pending { margin-top: 14px; border: 1px solid var(--close); border-radius: 10px; padding: 12px; }
.pending label { font-size: 13px; color: var(--muted); display: block; margin-bottom: 4px; }
.pending input { width: 100%; padding: 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: inherit; }
.row { display: flex; gap: 8px; margin-top: 8px; }
button { font: inherit; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); cursor: pointer; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.player { display: flex; align-items: center; gap: 12px; margin: 8px 0 14px; }
.player input[type=range] { flex: 1; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; white-space: nowrap; }
.chart { width: 100%; height: 200px; margin-top: 8px; }
.chart.tall { height: 260px; margin-top: 16px; }
.chart svg { width: 100%; height: 100%; display: block; }
.chart text { fill: var(--muted); font-size: 11px; }
.trace { font-size: 13px; padding-left: 20px; margin: 10px 0 0; max-height: 340px; overflow: auto; }
.trace li { margin-bottom: 6px; }
.trace .tool { font-family: ui-monospace, Menlo, monospace; color: var(--accent); }
.trace .blocked { color: var(--danger); }
.trace-box summary { cursor: pointer; color: var(--accent); margin-top: 12px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.stat b { display: block; font-size: 26px; line-height: 1.1; }
.stat span { font-size: 13px; color: var(--muted); }
.fails li { margin-bottom: 6px; }
.steps li { margin-bottom: 8px; }
footer { padding: 10px 16px 40px; }
