:root {
  --brand: #4f46e5;
  --bg: #f7f7f8;
  --surface: #ffffff;
  --text: #18181b;
  --muted: #5b5b66;
  --border: #e2e2e6;
  --code-bg: #f1f1f4;
  --red: #b91c1c;    --red-bg: #fee2e2;
  --orange: #9a3412; --orange-bg: #ffedd5;
  --amber: #854d0e;  --amber-bg: #fef9c3;
  --green: #166534;  --green-bg: #dcfce7;
  --grey: #3f3f46;   --grey-bg: #e4e4e7;
  --link: var(--brand);
  --on-brand: #ffffff;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 10px;
  color-scheme: light dark;
}
/* Brands with colorScheme "light" set data-scheme="light" and opt out. */
@media (prefers-color-scheme: dark) {
  :root:not([data-scheme="light"]) {
    --bg: #0f0f12; --surface: #18181c; --text: #ececf1; --muted: #a1a1aa;
    --border: #2c2c33; --code-bg: #232329;
    --red: #fca5a5; --red-bg: #3b1212;
    --orange: #fdba74; --orange-bg: #3a1d0c;
    --amber: #fde047; --amber-bg: #332b07;
    --green: #86efac; --green-bg: #0d2e1a;
    --grey: #d4d4d8; --grey-bg: #2c2c33;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.55 var(--font);
}
a { color: var(--link); }
@media (prefers-color-scheme: dark) { :root:not([data-scheme="light"]) a { color: color-mix(in srgb, var(--link) 55%, white); } }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em; }
code { background: var(--code-bg); padding: .1em .35em; border-radius: 4px; }
pre { background: var(--code-bg); padding: 1rem; border-radius: var(--radius); overflow-x: auto; }
pre code { background: none; padding: 0; }

.wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

header.site { background: var(--surface); border-bottom: 1px solid var(--border); border-top: 4px solid var(--brand); }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding-top: .75rem; padding-bottom: .75rem; }
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--text); font-weight: 700; }
.brand small { font-weight: 400; color: var(--muted); }
nav a { margin-left: 1rem; text-decoration: none; color: var(--muted); }
nav a:first-child { margin-left: 0; }
nav a[aria-current="page"] { color: var(--text); font-weight: 600; border-bottom: 2px solid var(--brand); }

main { padding-top: 1.5rem; padding-bottom: 3rem; }
footer.site { border-top: 1px solid var(--border); padding: 1.5rem 0; font-size: .875rem; }

.hero h1 { font-size: clamp(1.6rem, 4vw, 2.3rem); line-height: 1.2; margin: .5rem 0; }
.lead { font-size: 1.1rem; max-width: 70ch; }
.fixed { color: var(--muted); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; margin: 1.25rem 0; }
.grid { display: grid; gap: .5rem; }
label { font-weight: 600; }
label .muted { font-weight: 400; }
textarea, input[type=file] { width: 100%; font: inherit; color: inherit; }
textarea { font-family: ui-monospace, Menlo, monospace; padding: .6rem; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); resize: vertical; }
.check { display: flex; gap: .5rem; align-items: flex-start; font-weight: 400; margin: .75rem 0; }
.actions { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
button, .button {
  font: inherit; font-weight: 600; border: 0; border-radius: 8px; padding: .6rem 1.1rem; cursor: pointer;
  background: var(--brand); color: var(--on-brand); text-decoration: none; display: inline-block;
}
button.secondary { background: transparent; color: var(--text); border: 1px solid var(--border); }
button:disabled { opacity: .55; cursor: progress; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 60%, transparent); outline-offset: 2px; }

.results-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: .5rem; }
.results-head h2 { margin: 0; }
.summary { display: flex; flex-wrap: wrap; gap: .4rem; }
.toolbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .75rem; margin: 1rem 0; }
.filters { border: 0; padding: 0; margin: 0; display: flex; gap: 1rem; flex-wrap: wrap; }
.filters label { font-weight: 400; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .925rem; }
th, td { text-align: left; padding: .55rem .6rem; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
td.domain { font-weight: 600; word-break: break-all; }
td.domain small { display: block; font-weight: 400; color: var(--muted); }
td.evidence { font-family: ui-monospace, Menlo, monospace; font-size: .8rem; color: var(--muted); max-width: 32rem; word-break: break-word; }
td.evidence div + div { margin-top: .2rem; }

.badge { display: inline-block; padding: .15rem .5rem; border-radius: 999px; font-size: .78rem; font-weight: 700; white-space: nowrap; }
.badge.vulnerable { color: var(--red); background: var(--red-bg); }
.badge.indicator, .badge.likely_vulnerable_distro { color: var(--orange); background: var(--orange-bg); }
.badge.php_version_hidden { color: var(--amber); background: var(--amber-bg); }
.badge.patched { color: var(--green); background: var(--green-bg); }
.badge.no_php_detected, .badge.error, .badge.skipped { color: var(--grey); background: var(--grey-bg); }

.legend dl { display: grid; grid-template-columns: max-content 1fr; gap: .6rem 1rem; margin: 0; }
.legend dd { margin: 0; }
@media (max-width: 640px) { .legend dl { grid-template-columns: 1fr; } .legend dd { margin-bottom: .5rem; } }

.prose { max-width: 78ch; }
.prose h2 { margin-top: 2.5rem; padding-top: .5rem; border-top: 1px solid var(--border); }
.prose h3 { margin-top: 1.75rem; }
.prose table { margin: 1rem 0; }
.prose li + li { margin-top: .35rem; }
.eyebrow { text-transform: uppercase; letter-spacing: .06em; font-size: .8rem; color: var(--muted); margin: 0; }
.callout { border-radius: var(--radius); padding: 1rem 1.25rem; margin: 1.25rem 0; border-left: 5px solid; }
.callout p { margin: .4rem 0; }
.callout.critical { background: var(--red-bg); border-color: var(--red); }
.callout.warn { background: var(--amber-bg); border-color: var(--amber); }
.toc { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .75rem 1.25rem; }
.toc ol { margin: 0; padding-left: 1.2rem; columns: 2; }
@media (max-width: 640px) { .toc ol { columns: 1; } }
.refs a { word-break: break-word; }
:target { scroll-margin-top: 1rem; }
tr:target { background: var(--amber-bg); }
