:root {
  --fg: #1d2330; --muted: #6a7282; --line: #dde1e8; --bg: #f5f6f8; --card: #fff;
  --accent: #1f5fae; --present: #1e7b34; --partial: #b26a00; --missing: #b3261e; --na: #6a7282;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--fg); background: var(--bg); }
a { color: var(--accent); }
.topbar { display: flex; align-items: center; gap: 16px; padding: 10px 24px; background: #17324f; color: #fff; }
.topbar .brand { color: #fff; font-weight: 600; text-decoration: none; }
.topbar .tag { font-size: 12px; opacity: .8; }
main { max-width: 1200px; margin: 0 auto; padding: 20px 24px 60px; }
h1 { font-size: 22px; margin: 4px 0 12px; }
h2 { font-size: 17px; margin: 0 0 10px; }
h3 { font-size: 15px; margin: 0 0 6px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 16px; margin-bottom: 16px; }
.grid { display: grid; grid-template-columns: minmax(340px, 5fr) 7fr; gap: 16px; align-items: start; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
label { display: block; font-weight: 600; font-size: 13px; margin: 8px 0 3px; }
input[type=text], textarea, select { width: 100%; padding: 6px 8px; border: 1px solid #c4cad4; border-radius: 4px; font: inherit; }
textarea { min-height: 70px; resize: vertical; }
button { font: inherit; padding: 6px 14px; border-radius: 4px; border: 1px solid var(--accent); background: var(--accent); color: #fff; cursor: pointer; }
button.secondary { background: #fff; color: var(--accent); }
button.danger { background: #fff; color: var(--missing); border-color: var(--missing); padding: 3px 10px; font-size: 13px; }
button:disabled { opacity: .55; cursor: default; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.spread { justify-content: space-between; }
.actions { margin-top: 12px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 600; }
td.num { text-align: right; white-space: nowrap; }
.errors:empty { display: none; }
.errors { max-width: 1200px; margin: 12px auto 0; padding: 0 24px; }
.error { background: #fdecea; border: 1px solid #f1b8b3; color: #7a1a13; border-radius: 6px; padding: 10px 12px; margin-bottom: 8px; display: flex; justify-content: space-between; gap: 12px; }
.error pre { margin: 6px 0 0; white-space: pre-wrap; font-size: 12px; }
.error button { background: none; border: none; color: #7a1a13; padding: 0 4px; font-size: 18px; line-height: 1; }
.banner { background: #fff7e0; border: 1px solid #e8cf86; border-left: 5px solid #d9a400; border-radius: 6px; padding: 10px 14px; margin-bottom: 14px; }
.banner strong { display: block; margin-bottom: 2px; }
.empty { border: 1px dashed #c4cad4; border-radius: 6px; padding: 18px; text-align: center; color: var(--muted); background: #fafbfc; }
.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 10px; border: 1px solid; white-space: nowrap; }
.st-present { color: var(--present); border-color: var(--present); background: #e8f5ec; }
.st-partial { color: var(--partial); border-color: var(--partial); background: #fff3e0; }
.st-missing { color: var(--missing); border-color: var(--missing); background: #fdecea; }
.st-not_applicable { color: var(--na); border-color: #b9bfc9; background: #f1f2f4; }
.conf-high { color: var(--present); border-color: var(--present); }
.conf-medium { color: var(--partial); border-color: var(--partial); }
.conf-low { color: var(--na); border-color: #b9bfc9; }
.summary { display: flex; gap: 10px; flex-wrap: wrap; margin: 6px 0 12px; }
.summary .badge { font-size: 13px; padding: 3px 10px; }
.directive { border-top: 1px solid var(--line); padding: 10px 0; }
.directive:first-of-type { border-top: none; }
.group { margin-top: 14px; }
.group > summary { cursor: pointer; font-weight: 600; padding: 6px 0; }
.group > summary .counts { font-weight: 400; margin-left: 8px; }
.checklist td.status { width: 120px; }
.checklist th:nth-child(3), .checklist td:nth-child(3) { width: 34%; }
.evidence { list-style: none; margin: 0; padding: 0; }
.evidence li { margin: 2px 0; }
.notes { margin: 4px 0 0; padding-left: 18px; color: var(--muted); font-size: 13px; }
.warn { background: #eef4fb; border: 1px solid #bdd3ee; border-radius: 6px; padding: 8px 12px; margin: 6px 0; font-size: 14px; }
.pending-files td { padding: 4px 6px; }
.project-list td:first-child a { font-weight: 600; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
details.signals summary { cursor: pointer; }
/* upload: one file per request; oversized rows are never sent */
.pending-files tr.too-large td { color: var(--missing); }
.upload-progress:empty { display: none; }
/* notes and questions: one chat under the analysis, filed on a target */
.chat { margin-top: 18px; border-top: 2px solid var(--line); padding-top: 12px; }
.chat h3 { margin-bottom: 8px; }
.chat-group { margin: 8px 0 12px; border-left: 3px solid var(--line); padding-left: 10px; font-size: 13px; }
.chat-group.earlier { border-left-color: #e8cf86; }
.chat-group-title { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.chat-group-title .kind { text-transform: uppercase; font-size: 11px; letter-spacing: .03em; }
.chat-group-title .target-link { font-weight: 600; }
.chat-list { list-style: none; margin: 4px 0 0; padding: 0; }
.comment { border-top: 1px solid var(--line); padding: 6px 0; }
.comment:first-child { border-top: none; }
.comment .body { white-space: pre-wrap; }
.comment .answer { margin-top: 6px; padding: 6px 10px; border-radius: 4px; background: #eef4fb; border: 1px solid #bdd3ee; }
.comment .answer-text { white-space: pre-wrap; }
.comment .answer.pending { background: #fff7e0; border-color: #e8cf86; color: var(--partial); }
.comment .answer.failed { background: #fdecea; border-color: #f1b8b3; color: #7a1a13; }
.chat-form { margin-top: 10px; border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; background: #fafbfc; }
.chat-form textarea { min-height: 56px; font-size: 13px; }
.chat-form .row { margin-top: 6px; }
.chat-form .about { margin: 0; }
.chat-form select { width: auto; max-width: 300px; flex: 1 1 160px; font-size: 13px; padding: 4px 6px; }
.chat-form button { padding: 4px 12px; font-size: 13px; }
/* a recommendation's name is a link into the chat; a small count shows it has comments */
button.target-link { background: none; border: none; padding: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; text-decoration: underline dotted var(--muted); text-underline-offset: 3px; }
button.target-link:hover { color: var(--accent); text-decoration-style: solid; }
button.count { background: var(--accent); color: #fff; border: none; border-radius: 10px; padding: 0 7px; font-size: 11px; font-weight: 600; line-height: 18px; margin-left: 6px; vertical-align: 1px; }
button.count.pending { background: var(--partial); }
button.count[hidden] { display: none; }
.spinner { display: inline-block; width: 10px; height: 10px; border: 2px solid #e8cf86; border-top-color: var(--partial); border-radius: 50%; animation: spin 1s linear infinite; vertical-align: -1px; }
@keyframes spin { to { transform: rotate(360deg); } }
ul.unmatched li { margin-bottom: 6px; }
/* chosen directives / standards (project card and analysis top) and the edit form's checkbox list */
ul.chosen { margin: 4px 0 10px; padding-left: 20px; }
ul.chosen li { margin: 2px 0; }
.chosen-block { margin-bottom: 14px; }
.checks { display: grid; gap: 4px; margin: 2px 0 4px; }
label.check { font-weight: 400; margin: 0; display: flex; gap: 6px; align-items: baseline; }
label.check input { margin: 0; }
/* component analysis: first thing in the card until a directive is chosen */
.components-head { margin-top: 4px; }
.components-pending { margin: 6px 0 10px; padding: 8px 10px; border-radius: 4px; }
.answer.failed { padding: 8px 10px; border-radius: 4px; }
.warn.out-of-date { background: #fff7e0; border-color: #e8cf86; }
table.components { font-size: 14px; margin-bottom: 8px; table-layout: fixed; }
table.components td, table.components th { overflow-wrap: anywhere; }
table.components th:nth-child(1), table.components td:nth-child(1) { width: 19%; }
table.components th:nth-child(2), table.components td:nth-child(2) { width: 14%; }
table.components th:nth-child(3), table.components td:nth-child(3) { width: 14%; }
table.components th:nth-child(4), table.components td:nth-child(4) { width: 108px; }
table.components th:nth-child(6), table.components td:nth-child(6) { width: 16%; }
table.components .badge { white-space: normal; font-size: 11px; }
.grid { grid-template-columns: minmax(320px, 4fr) 8fr; }
.grid > * { min-width: 0; }
table.components .flags { color: var(--partial); }
.badge.st-count { color: var(--fg); border-color: #b9bfc9; background: #f1f2f4; }
.st-ce-verified { color: var(--present); border-color: var(--present); background: #e8f5ec; }
.st-ce-stated_in_docs { color: var(--accent); border-color: var(--accent); background: #eef4fb; }
.st-ce-likely_not_verified { color: var(--partial); border-color: var(--partial); background: #fff3e0; }
.st-ce-unknown { color: var(--missing); border-color: var(--missing); background: #fdecea; }
.st-ce-not_applicable { color: var(--na); border-color: #b9bfc9; background: #f1f2f4; }
/* directive work stays folded away until a directive is chosen */
details.preliminary { margin-top: 18px; border-top: 2px solid var(--line); padding-top: 10px; }
details.preliminary > summary { cursor: pointer; font-weight: 600; padding: 6px 0; }
details.preliminary > summary .small { font-weight: 400; }
details.preliminary > .directive-block { margin-top: 10px; }
.directive-block { margin-top: 14px; }
