:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #16191d;
  --muted: #5b6470;
  --line: #dde1e6;
  --line-strong: #c4cad2;
  --accent: #1f5fbf;
  --accent-ink: #ffffff;
  --met: #1b7a3d;
  --not-met: #b42318;
  --ask: #a15c00;
  --screening: #3d5a80;
  --not-checked: #8a929c;
  --radius: 6px;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, system-ui, sans-serif;
}
h2 { font-size: 15px; margin: 0 0 12px; }
h3 { font-size: 14px; margin: 20px 0 8px; }
button { font: inherit; cursor: pointer; }
.muted { color: var(--muted); font-weight: 400; }
.hint { color: var(--muted); font-size: 12.5px; margin: 8px 0 0; }
.mono { font-family: var(--mono); font-size: 12px; }

/* header */
.top {
  display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap;
  padding: 12px 24px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand strong { font-size: 16px; }
.mark { width: 14px; height: 14px; background: var(--accent); border-radius: 3px; display: inline-block; }
.status { display: flex; gap: 28px; margin: 0; }
.status dt { font-size: 11.5px; color: var(--muted); }
.status dd { margin: 0; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.ok { color: var(--met); }
.warn { color: var(--ask); }
.big-zero { color: var(--met); font-size: 15px; }

/* tabs */
.tabs { display: flex; gap: 4px; padding: 0 24px; background: var(--surface); border-bottom: 1px solid var(--line); }
.tabs button { border: 0; background: none; padding: 10px 12px; color: var(--muted); border-bottom: 2px solid transparent; }
.tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }

/* layout */
main { padding: 20px 24px 48px; max-width: 1440px; margin: 0 auto; }
.layout { display: grid; grid-template-columns: 340px 1fr; gap: 20px; align-items: start; }
.col { display: grid; gap: 20px; min-width: 0; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; min-width: 0; }
.row-between { display: flex; justify-content: space-between; align-items: center; }
@media (max-width: 900px) { .layout { grid-template-columns: 1fr; } .status { flex-wrap: wrap; gap: 12px; } }

/* form controls */
.field { display: grid; gap: 4px; font-size: 12.5px; color: var(--muted); margin-bottom: 12px; }
select, input[type="text"], input[type="email"] {
  font: inherit; color: var(--text); padding: 7px 8px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface);
}
input[type="file"] { font-size: 12.5px; }
button.primary { width: 100%; margin-top: 16px; padding: 10px; border: 0; border-radius: var(--radius); background: var(--accent); color: var(--accent-ink); font-weight: 600; }
button.primary:disabled { opacity: .55; cursor: default; }
button.small, button.choice { padding: 4px 10px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); color: var(--text); font-size: 12.5px; }
button.choice[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* record */
.kv { display: grid; grid-template-columns: 96px 1fr; gap: 4px 8px; margin: 4px 0 8px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.record-section { margin-top: 12px; }
.record-section h3 { margin: 0 0 6px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.record-section ul { margin: 0; padding-left: 16px; }
details summary { cursor: pointer; color: var(--accent); font-size: 12.5px; }
.note { white-space: pre-wrap; font-size: 12.5px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; margin-top: 6px; }

/* tables */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.clickable { cursor: pointer; }
tr.clickable:hover { background: #f1f4f8; }
tr.selected { background: #eaf1fb; }
.table-wrap { overflow-x: auto; }

/* status marks: a small square, no pills */
.st { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; white-space: nowrap; }
.st::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: currentColor; }
.st-met { color: var(--met); }
.st-not_met { color: var(--not-met); }
.st-ask { color: var(--ask); }
.st-screening { color: var(--screening); }
.st-not_checked { color: var(--not-checked); }
.v-likely { color: var(--met); }
.v-questions { color: var(--ask); }
.v-not_eligible { color: var(--not-met); }

/* detail */
.detail-head { display: flex; justify-content: space-between; gap: 16px; align-items: start; margin-bottom: 8px; }
.detail-head h2 { margin-bottom: 4px; }
.verdict { font-size: 15px; font-weight: 700; white-space: nowrap; }
.crit-text { max-width: 420px; }
.rule { color: var(--muted); max-width: 300px; }
.evidence { font-size: 12.5px; max-width: 320px; }
.src { display: block; color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.question { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.question .choices { display: flex; gap: 6px; flex-shrink: 0; }
.share { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line-strong); }
.share label.check { display: flex; gap: 8px; align-items: start; margin: 10px 0; }
pre.payload { font-family: var(--mono); font-size: 11.5px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; max-height: 320px; overflow: auto; }
.share-actions { display: flex; gap: 12px; align-items: center; margin-top: 10px; }
.share-actions button.primary { width: auto; margin: 0; padding: 8px 16px; }
.notice { padding: 10px 12px; border: 1px solid var(--line-strong); border-left: 3px solid var(--met); border-radius: var(--radius); background: var(--surface); margin-top: 10px; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; margin: 4px 0 12px; }
.legend .st { font-weight: 500; }
