:root {
  --bg: #f6f7f9; --panel: #ffffff; --ink: #16202a; --muted: #5c6b7a; --line: #dfe4ea;
  --accent: #0f6fde; --accent-ink: #ffffff; --ok: #1a7f4b; --warn: #b26a00; --bad: #b3261e; --chip: #eef2f7;
  --radius: 10px; --font: system-ui, -apple-system, "Segoe UI", Roboto, Inter, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1419; --panel: #171d25; --ink: #e8edf2; --muted: #9aa8b6; --line: #2a3340;
    --accent: #5aa2ff; --accent-ink: #0b1220; --ok: #4fc784; --warn: #f0b24a; --bad: #ff7a70; --chip: #202a36;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1419; --panel: #171d25; --ink: #e8edf2; --muted: #9aa8b6; --line: #2a3340;
  --accent: #5aa2ff; --accent-ink: #0b1220; --ok: #4fc784; --warn: #f0b24a; --bad: #ff7a70; --chip: #202a36;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font); }
a { color: var(--accent); }
main { max-width: 1100px; margin: 0 auto; padding: 24px 16px 64px; }
header.top { display: flex; align-items: center; gap: 16px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--panel); position: sticky; top: 0; z-index: 5; flex-wrap: wrap; }
header.top .brand { font-weight: 700; letter-spacing: .2px; }
header.top .brand small { color: var(--muted); font-weight: 400; margin-left: 6px; }
header.top nav a { margin-right: 12px; text-decoration: none; color: var(--ink); }
header.top nav a.active { color: var(--accent); font-weight: 600; }
header.top .spacer { flex: 1; }
header.top .who { color: var(--muted); font-size: 13px; }
h1 { font-size: 24px; margin: 0 0 6px; }
h2 { font-size: 18px; margin: 24px 0 8px; }
p.lead { color: var(--muted); margin: 0 0 16px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 12px 0; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; }
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
input, select, textarea { width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); font: inherit; }
textarea.code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12.5px; min-height: 320px; }
.field { flex: 1 1 160px; min-width: 140px; }
button, .btn { padding: 9px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font: inherit; cursor: pointer; text-decoration: none; display: inline-block; }
button.primary, .btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
button.small { padding: 5px 9px; font-size: 13px; }
button:disabled { opacity: .55; cursor: default; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 12.5px; text-transform: uppercase; letter-spacing: .3px; }
tr.flagged td { background: color-mix(in srgb, var(--warn) 9%, transparent); }
tr.bad td { background: color-mix(in srgb, var(--bad) 9%, transparent); }
.chip { display: inline-block; padding: 2px 8px; border-radius: 999px; background: var(--chip); font-size: 12px; margin: 1px 4px 1px 0; white-space: nowrap; }
.chip.ok { color: var(--ok); } .chip.warn { color: var(--warn); } .chip.bad { color: var(--bad); }
.status { font-weight: 600; }
.status.matched, .status.confirmed { color: var(--ok); }
.status.ambiguous { color: var(--warn); }
.status.not_found, .status.error, .status.excluded { color: var(--bad); }
.muted { color: var(--muted); }
.notice { padding: 10px 12px; border-radius: 8px; background: var(--chip); margin: 10px 0; }
.notice.bad { color: var(--bad); }
.notice.ok { color: var(--ok); }
.cands { margin: 6px 0 0; padding: 0; list-style: none; }
.cands li { padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; margin: 4px 0; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.cands li .score { font-weight: 700; min-width: 36px; }
.hero { padding: 40px 0 10px; }
.hero h1 { font-size: 34px; line-height: 1.15; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 760px) { .grid2 { grid-template-columns: 1fr; } header.top nav { order: 3; width: 100%; } }
code { background: var(--chip); padding: 1px 5px; border-radius: 4px; font-size: 13px; }
.right { text-align: right; }
.actions { white-space: nowrap; }
details summary { cursor: pointer; color: var(--accent); }
