:root {
  --bg: #f6f7f9; --panel: #ffffff; --text: #1b1f24; --muted: #5d6673; --line: #dfe3e8; --link: #1d5fd1;
  --crit: #a3111f; --high: #d4380d; --med: #b26a00; --low: #5b6f86; --info: #8a94a3;
  --ok: #1f7a3a; --bad: #b42318; --accent: #0f2a4a;
  --radius: 10px; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1216; --panel: #171b21; --text: #e6e9ee; --muted: #9aa4b2; --line: #2a3039; --link: #7fb0ff;
    --crit: #ff6b7a; --high: #ff8a5c; --med: #f2b84b; --low: #9fb2c8; --info: #7d8796;
    --ok: #4cc27a; --bad: #ff6b6b; --accent: #0b1c31;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.45; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
header { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; padding: 12px 20px; background: var(--accent); color: #fff; }
header .brand { color: #fff; font-weight: 700; font-size: 17px; letter-spacing: .2px; }
header .tag { color: #b8c7da; font-size: 13px; }
nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; flex: 1; }
nav a { color: #d7e2f0; padding: 4px 2px; }
nav a.on { color: #fff; border-bottom: 2px solid #7fb0ff; }
nav .signout { margin-left: auto; display: flex; align-items: center; gap: 8px; }
nav .who { color: #b8c7da; font-size: 13px; }
main { max-width: 1180px; margin: 0 auto; padding: 20px 16px 48px; }
h1 { font-size: 24px; margin: 6px 0 14px; }
h1 small, h2 small { color: var(--muted); font-weight: 400; font-size: 14px; margin-left: 6px; }
h2 { font-size: 17px; margin: 26px 0 10px; }
section { margin-bottom: 8px; }
button, .button { font: inherit; background: var(--link); color: #fff; border: 0; border-radius: 8px; padding: 7px 14px; cursor: pointer; display: inline-block; }
nav button { background: transparent; border: 1px solid #5d7ea6; padding: 3px 10px; font-size: 13px; }
.button:hover, button:hover { text-decoration: none; filter: brightness(1.08); }
.inline { display: inline; }
.buttons { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.signin { max-width: 420px; margin: 12vh auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; text-align: center; }
.error { color: var(--bad); }
.saved { color: var(--ok); }
.summary { display: flex; gap: 18px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.summary h1 { margin: 0 0 8px; }
.meta { color: var(--muted); font-size: 13px; margin: 8px 0 0; }
.grade { width: 78px; height: 78px; border-radius: 16px; display: grid; place-items: center; align-content: center; color: #fff; font-weight: 800; flex: none; }
.grade span { font-size: 34px; line-height: 1; }
.grade small { font-size: 11px; font-weight: 500; opacity: .9; }
.grade.small { width: 44px; height: 44px; border-radius: 10px; font-size: 22px; }
.g-A { background: var(--ok); } .g-B { background: #4a8f2a; } .g-C { background: var(--med); } .g-D { background: var(--high); } .g-F { background: var(--crit); }
.counts { display: flex; flex-wrap: wrap; gap: 8px; }
.counts a:hover { text-decoration: none; }
.count { display: inline-flex; align-items: baseline; gap: 4px; font-weight: 700; font-size: 18px; padding: 4px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); }
.count small { font-weight: 500; font-size: 12px; color: var(--muted); }
.count.zero { opacity: .45; }
.sev-critical { color: var(--crit); } .sev-high { color: var(--high); } .sev-medium { color: var(--med); } .sev-low { color: var(--low); } .sev-info { color: var(--info); }
.sev { font-weight: 700; font-size: 13px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; margin-top: 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; min-width: 0; }
.card-head { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.card h2 { margin: 0; font-size: 16px; }
.card .url { font-size: 13px; color: var(--muted); }
.card .count { font-size: 15px; padding: 2px 8px; }
.hosts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.host { font-size: 12px; padding: 2px 8px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); }
.host.ok { border-color: var(--ok); color: var(--ok); }
.host.stale { border-color: var(--bad); color: var(--bad); }
/* Tables: one real table (head and body share columns) in a wrapper that scrolls sideways when narrow. */
.table-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; }
table.list th, table.list td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 14px; }
table.list th { font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); font-weight: 600; white-space: nowrap; }
table.list tbody tr:last-child td { border-bottom: 0; }
table.list td.empty { color: var(--muted); }
/* Short columns keep to one line and take only the room they need; the main column takes the rest. */
.c-sev, .c-id, .c-site, .c-status, .c-time, .c-num, .c-kind, .c-result { white-space: nowrap; width: 1%; }
.c-num { text-align: right !important; }
.c-check { white-space: nowrap; }
.c-main { min-width: 16rem; overflow-wrap: anywhere; }
.c-result { text-align: center !important; font-weight: 700; }
.sub { color: var(--muted); font-size: 12px; white-space: normal; }
tr.fail td.c-result { color: var(--bad); }
tr.pass td.c-result { color: var(--ok); }
.total { font-size: 15px; font-weight: 600; margin: 4px 0 8px; }
.total .meta { font-weight: 400; }
.card .total { margin: 0 0 8px; }
.chip { display: inline-block; background: var(--panel); border: 1px solid var(--line); border-radius: 99px; padding: 3px 12px; font-size: 13px; }
.more { font-size: 13px; font-weight: 400; margin-left: 8px; }
details { margin-top: 8px; }
details > summary { cursor: pointer; color: var(--muted); font-size: 14px; padding: 6px 2px; }
details[open] > summary { margin-bottom: 6px; }
.vgroup { margin-bottom: 18px; }
.vgroup h2 { margin-bottom: 2px; }
.ev-title { color: var(--text); }
.ev-change { color: var(--muted); font-size: 13px; margin-top: 2px; }
a.status:hover { text-decoration: none; filter: brightness(1.15); }
.st-verified { white-space: nowrap; }
.status { font-size: 12px; padding: 2px 8px; border-radius: 99px; background: var(--bg); border: 1px solid var(--line); white-space: nowrap; }
.st-open { border-color: var(--bad); color: var(--bad); }
.st-fixed-needs-deploy, .st-partly, .st-external { border-color: var(--med); color: var(--med); }
.st-fixed, .st-verified, .st-closed { border-color: var(--ok); color: var(--ok); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
select, textarea { font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; max-width: 100%; }
textarea { width: 100%; }
.update { display: grid; gap: 10px; max-width: 640px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.update label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.update button { justify-self: start; }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
dl.facts dt { color: var(--muted); font-size: 13px; }
dl.facts dd { margin: 0; overflow-wrap: anywhere; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
pre.evidence { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; font-size: 13px; }
ul.events { list-style: none; padding: 0; margin: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
ul.events li { padding: 7px 12px; border-bottom: 1px solid var(--line); font-size: 14px; }
ul.events li:last-child { border-bottom: 0; }
.when, .actor { color: var(--muted); font-size: 12px; }
.crumbs { margin: 0; font-size: 13px; }
.idline { color: var(--muted); margin-top: -6px; }
@media (max-width: 600px) {
  /* Phones: the columns a finding's own page repeats give way to the finding itself. */
  .c-site, .c-time { display: none; }
  .c-main { min-width: 11rem; }
  .summary { flex-direction: column; align-items: flex-start; }
  nav .signout { margin-left: 0; }
  dl.facts { grid-template-columns: 1fr; }
}
