:root {
  --bg: #f7f7f5; --fg: #1d1d1f; --muted: #6b6b70; --line: #dcdcd8; --card: #fff;
  --fresh: #2e7d32; --stale: #b26a00; --refuted: #c62828; --unknown: #6b6b70; --violation: #c62828;
  --accent: #1f5fbf;
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--fg); background: var(--bg); }
header { display: flex; gap: 16px; align-items: center; padding: 8px 16px; background: #fff; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.brand { font-weight: 600; }
header select { margin-left: 4px; max-width: 320px; }
nav { display: flex; gap: 4px; margin-left: auto; }
nav a { padding: 6px 10px; border-radius: 6px; color: var(--fg); text-decoration: none; }
nav a.active { background: #e8eefb; color: var(--accent); }
.banner { padding: 8px 16px; }
.banner.demo { background: #fff4d6; border-bottom: 1px solid #ecd9a0; }
.banner.error { background: #fde7e7; border-bottom: 1px solid #f2b8b8; }
main { padding: 16px; }
.page { display: none; }
.page.active { display: block; }
h2 { margin: 0 0 12px; font-size: 18px; }
h3 { margin: 18px 0 8px; font-size: 15px; }
h4 { margin: 12px 0 6px; font-size: 13px; color: var(--muted); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.card .num { font-size: 22px; font-weight: 600; }
.card .lbl { color: var(--muted); font-size: 12px; }
.muted { color: var(--muted); }
.mono, pre, code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
pre { background: #fbfbfa; border: 1px solid var(--line); border-radius: 6px; padding: 8px; overflow: auto; max-height: 360px; margin: 6px 0; white-space: pre; }
pre .hl { background: #fff2b3; display: inline-block; width: 100%; }
table { border-collapse: collapse; width: 100%; background: #fff; }
th, td { text-align: left; padding: 5px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; font-size: 12px; color: var(--muted); }
ul.warn { margin: 6px 0; padding-left: 20px; }
ul.warn li { margin: 2px 0; }
.badge { display: inline-block; padding: 1px 7px; border-radius: 10px; font-size: 12px; border: 1px solid currentColor; white-space: nowrap; }
.b-fresh { color: var(--fresh); } .b-stale { color: var(--stale); } .b-refuted { color: var(--refuted); }
.b-unknown { color: var(--unknown); } .b-violation, .b-violated, .b-failed { color: var(--violation); }
.b-passed { color: var(--fresh); } .b-passed_incomplete { color: var(--stale); }
.b-direct { color: var(--refuted); } .b-potential { color: var(--stale); } .b-none { color: var(--fresh); }
.b-not_run, .b-other_version, .b-skipped { color: var(--unknown); }
.b-confirmed { color: var(--fresh); } .b-outdated { color: var(--stale); } .b-rejected { color: var(--refuted); }
.b-static { color: #455a64; } .b-manual { color: #1f5fbf; } .b-ai { color: #7b1fa2; }
button { padding: 5px 10px; border: 1px solid var(--line); background: #fff; border-radius: 6px; cursor: pointer; font: inherit; }
button:hover { background: #f0f0ee; }
button.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
input[type=text], input[type=search], textarea, select { font: inherit; padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; }
a.link, .link { color: var(--accent); cursor: pointer; text-decoration: underline; }
.map-toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.search { position: relative; }
.search input { width: 340px; }
.dropdown { position: absolute; z-index: 20; background: #fff; border: 1px solid var(--line); border-radius: 6px; width: 520px; max-height: 360px; overflow: auto; box-shadow: 0 4px 16px rgba(0,0,0,.08); }
.dropdown div { padding: 6px 8px; cursor: pointer; border-bottom: 1px solid #f0f0ee; }
.dropdown div:hover { background: #f3f6fd; }
.map-body { display: flex; gap: 10px; height: calc(100vh - 190px); min-height: 420px; }
.filters { width: 220px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; overflow: auto; font-size: 13px; }
.filters label { display: block; }
#cy { flex: 1; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.legend div { margin: 3px 0; display: flex; align-items: center; gap: 6px; }
.legend .sw { width: 26px; height: 0; border-top: 2px solid #888; display: inline-block; }
.legend .sh { width: 16px; height: 12px; display: inline-block; border: 2px solid #888; }
.note { margin-top: 6px; color: var(--muted); font-size: 12px; }
#drawer { position: fixed; top: 0; right: 0; width: min(620px, 96vw); height: 100vh; background: #fff; border-left: 1px solid var(--line); box-shadow: -6px 0 20px rgba(0,0,0,.08); overflow: auto; padding: 16px 18px; z-index: 50; }
#drawer-close { position: absolute; top: 10px; right: 10px; }
.kv { display: grid; grid-template-columns: 170px 1fr; gap: 4px 10px; margin: 8px 0; }
.kv > div:nth-child(odd) { color: var(--muted); }
.path { margin: 3px 0; padding: 4px 8px; background: #f6f8fc; border-left: 3px solid var(--accent); border-radius: 4px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 8px 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 900px) { .grid2 { grid-template-columns: 1fr; } .filters { display: none; } }
form.confirm { background: #f8f8f6; border: 1px solid var(--line); border-radius: 8px; padding: 10px; margin-top: 10px; }
form.confirm textarea { width: 100%; min-height: 50px; }
