:root {
  --canvas: #F3F5F8; --surface: #FFFFFF; --ink: #0F1B2D; --muted: #5B6878; --rule: #DCE1E8;
  --link: var(--brand, #0B3D91); --red: #B42318; --amber: #B54708; --green: #067647;
  --red-wash: #FEF3F2; --amber-wash: #FFFAEB; --green-wash: #ECFDF3; --wash: #F7F9FB;
  /* older names used by the findings pages */
  --bg: var(--canvas); --accent: var(--link); --crit: var(--red); --high: var(--amber); --ok: var(--green);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #0E141B; --surface: #161E27; --ink: #E6EBF1; --muted: #9AA6B4; --rule: #283340;
    --link: #8AB4F8; --red: #F97066; --amber: #FDB022; --green: #47CD89;
    --red-wash: #2A1614; --amber-wash: #2A2112; --green-wash: #10251A; --wash: #121A22;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { font-size: 15px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  line-height: 1.5; font-variant-numeric: tabular-nums;
}
a { color: var(--accent); }
a:focus-visible, button:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

header.top { background: var(--surface); border-bottom: 1px solid var(--rule);
  border-top: 4px solid var(--brand, #0B3D91); }
header.top .wrap { display: flex; align-items: center; gap: 24px; min-height: 56px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.brand img { height: 28px; width: auto; display: block; }
.brand .org { font-weight: 700; font-size: 1.13rem; letter-spacing: -0.01em; }
.brand .product { color: var(--muted); padding-left: 12px; border-left: 1px solid var(--rule); }
nav.main { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
nav.main a { padding: 6px 10px; text-decoration: none; color: var(--muted); border-radius: 4px; }
nav.main a[aria-current="page"] { color: var(--ink); background: var(--wash); font-weight: 600; }
nav.main a:hover { color: var(--ink); }

button, .button {
  font: inherit; font-weight: 600; padding: 7px 14px; border-radius: 4px; cursor: pointer;
  background: var(--brand, #0B3D91); color: #FFFFFF; border: 1px solid var(--brand, #0B3D91);
}
button.quiet { background: transparent; color: var(--link); border-color: var(--rule); }

main { padding: 24px 0 48px; }
.status-line { font-size: 1.2rem; line-height: 1.4; margin: 0 0 4px; max-width: 70ch; }
.status-line strong.bad { color: var(--crit); }
.sub { color: var(--muted); margin: 0 0 20px; font-size: 0.93rem; }
.flash { background: var(--surface); border: 1px solid var(--rule); border-left: 4px solid var(--accent);
  padding: 10px 14px; margin: 0 0 20px; }

.filters { display: flex; gap: 20px; flex-wrap: wrap; margin: 0 0 12px; font-size: 0.93rem; }
.filters span { color: var(--muted); margin-right: 4px; }
.filters a { text-decoration: none; padding: 2px 6px; border-radius: 3px; }
.filters a[aria-current="true"] { background: var(--ink); color: var(--surface); }

.table-scroll { overflow-x: auto; background: var(--surface); border: 1px solid var(--rule); }
table.list { width: 100%; border-collapse: collapse; min-width: 860px; }
table.list th { text-align: left; font-size: 0.8rem; font-weight: 600; color: var(--muted);
  padding: 10px 12px; border-bottom: 1px solid var(--rule); background: var(--wash); }
table.list td { padding: 12px; border-bottom: 1px solid var(--rule); vertical-align: top; font-size: 0.93rem; }
table.list tr:last-child td { border-bottom: 0; }

/* The severity spine: the left edge of every row says how bad it is. */
td.spine { width: 10px; padding: 0 !important; }
tr.lv-high td.spine { background: var(--high); width: 4px; }
tr.lv-critical td.spine { background: var(--crit); width: 6px; }
tr.kev td.spine {
  width: 10px;
  background: repeating-linear-gradient(135deg, var(--crit) 0 4px, transparent 4px 7px);
}
.vid { font-weight: 600; text-decoration: none; }
.sum { color: var(--muted); margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden; max-width: 52ch; }
.sev { font-weight: 600; }
.sev.CRITICAL { color: var(--crit); }
.sev.HIGH { color: var(--high); }
.flag { display: inline-block; background: var(--crit); color: var(--surface); font-size: 0.78rem;
  font-weight: 700; padding: 0 6px; border-radius: 2px; margin-bottom: 2px; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.empty { background: var(--surface); border: 1px solid var(--rule); padding: 32px; }

.detail { background: var(--surface); border: 1px solid var(--rule); padding: 24px; max-width: 860px; }
.detail.kev { border-left: 10px solid var(--crit); }
.detail h1 { font-size: 1.47rem; margin: 0 0 4px; line-height: 1.25; }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 20px; margin: 20px 0; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; }
form.status { display: grid; gap: 10px; max-width: 520px; margin-top: 24px; padding-top: 20px;
  border-top: 1px solid var(--rule); }
select, textarea { font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--rule); border-radius: 4px; padding: 7px 9px; }
textarea { min-height: 80px; resize: vertical; }
label { font-weight: 600; font-size: 0.93rem; }
.history { margin-top: 24px; }
.history ul { list-style: none; padding: 0; margin: 0; }
.history li { padding: 8px 0; border-top: 1px solid var(--rule); font-size: 0.93rem; }

.state-ok { color: var(--ok); }
.state-bad { color: var(--crit); }
.state-idle { color: var(--muted); }
h2 { font-size: 1.13rem; margin: 28px 0 10px; }

@media (max-width: 640px) {
  .status-line { font-size: 1.07rem; }
  header.top .wrap { gap: 8px; padding-top: 8px; padding-bottom: 8px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- Executive overview ---------- */
.posture { display: grid; grid-template-columns: minmax(180px, 240px) 1fr; background: var(--surface);
  border: 1px solid var(--rule); margin: 0 0 16px; }
.posture .state { padding: 22px 24px; display: flex; flex-direction: column; justify-content: center; gap: 2px; }
.posture .state .word { font-size: 1.6rem; font-weight: 700; line-height: 1.15; letter-spacing: -0.015em; }
.posture .state .label { font-size: 0.87rem; color: var(--muted); }
.posture.red .state { background: var(--red-wash); border-left: 8px solid var(--red); }
.posture.red .state .word { color: var(--red); }
.posture.amber .state { background: var(--amber-wash); border-left: 8px solid var(--amber); }
.posture.amber .state .word { color: var(--amber); }
.posture.green .state { background: var(--green-wash); border-left: 8px solid var(--green); }
.posture.green .state .word { color: var(--green); }
.posture .story { padding: 22px 24px; }
.posture .story h1 { font-size: 1.33rem; line-height: 1.35; margin: 0 0 6px; font-weight: 600; max-width: 60ch; }
.posture .story p { margin: 0; color: var(--muted); }

.metrics { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--surface);
  border: 1px solid var(--rule); margin: 0 0 16px; }
.metric { padding: 16px 20px; border-left: 1px solid var(--rule); }
.metric:first-child { border-left: 0; }
.metric .value { font-size: 1.87rem; font-weight: 600; line-height: 1.1; letter-spacing: -0.02em; }
.metric .value.bad { color: var(--red); }
.metric .name { font-size: 0.93rem; margin-top: 4px; }
.metric .change { font-size: 0.82rem; color: var(--muted); margin-top: 2px; }
.metric .change.worse { color: var(--red); }
.metric .change.better { color: var(--green); }

.panel { background: var(--surface); border: 1px solid var(--rule); padding: 20px 24px; margin: 0 0 16px; }
.panel h2 { margin: 0 0 4px; font-size: 1.07rem; }
.panel .note { color: var(--muted); font-size: 0.87rem; margin: 0 0 12px; }
.legend { display: flex; gap: 20px; font-size: 0.87rem; margin: 0 0 8px; }
.legend i { display: inline-block; width: 14px; height: 3px; vertical-align: middle; margin-right: 6px; }
.legend .l-exploited i { background: var(--red); }
.legend .l-urgent i { background: var(--link); }
svg.trend { width: 100%; height: auto; display: block; }
svg.trend .grid { stroke: var(--rule); stroke-width: 1; }
svg.trend .axis { fill: var(--muted); font-size: 11px; font-family: inherit; }
svg.trend .s-exploited { stroke: var(--red); fill: none; stroke-width: 2.5; }
svg.trend .s-urgent { stroke: var(--link); fill: none; stroke-width: 2; }
svg.trend .d-exploited { fill: var(--red); }
svg.trend .d-urgent { fill: var(--link); }

.columns { display: grid; grid-template-columns: 3fr 2fr; gap: 16px; }
.columns .panel { margin: 0; }
ol.actions { margin: 8px 0 0; padding-left: 22px; }
ol.actions li { padding: 8px 0; border-top: 1px solid var(--rule); }
ol.actions li:first-child { border-top: 0; }
ol.actions .what { font-weight: 600; }
ol.actions .why { color: var(--muted); font-size: 0.9rem; }
ul.plain { list-style: none; margin: 8px 0 0; padding: 0; }
ul.plain li { padding: 8px 0; border-top: 1px solid var(--rule); font-size: 0.93rem; }
ul.plain li:first-child { border-top: 0; }
.print-hint { color: var(--muted); font-size: 0.85rem; margin-top: 20px; }

@media (max-width: 820px) {
  .posture { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .metric:nth-child(3) { border-left: 0; }
  .metric:nth-child(n+3) { border-top: 1px solid var(--rule); }
  .columns { grid-template-columns: 1fr; }
  .brand .product { display: none; }
}
@media print {
  :root { color-scheme: light; }
  body { background: #FFFFFF; }
  nav.main, header.top form, .print-hint, .flash { display: none !important; }
  .panel, .metrics, .posture { break-inside: avoid; }
}
