/* ============================================================================
   styles.css  —  How the whole site LOOKS (all three pages share this file)
   ============================================================================
   Design goals: calm, executive-ready, easy to scan.
     • One neutral palette with a single navy/blue accent
     • Red is reserved for things that need action (exploited, patch now)
     • Plenty of white space, light borders, no heavy shadows
     • Works in light and dark mode, on phones, and when printed

   File map:
     1. Design tokens        6. Top 5 CVE cards        11. Search page
     2. Dark mode            7. News & headlines       12. Archive page
     3. Base / reset         8. Tables & chart         13. States
     4. Top bar & layout     9. Badges & pills         14. Responsive
     5. Hero & KPIs         10. Method & footer        15. Print
   ============================================================================ */


/* ---------------------------------------------------------------------------
   1. DESIGN TOKENS: every color, size and spacing value lives here.
      Change one and the whole site follows.
   --------------------------------------------------------------------------- */
:root {
  /* Surfaces & text */
  --bg: #f6f7f9;              /* page background */
  --surface: #ffffff;         /* cards and panels */
  --surface-2: #f9fafb;       /* subtle inner backgrounds */
  --fg: #101828;              /* main text (near-black navy) */
  --fg-2: #344054;            /* secondary text */
  --muted: #667085;           /* labels, captions */
  --line: #eaecf0;            /* light dividers */
  --line-strong: #d0d5dd;     /* input borders */

  /* Brand */
  --brand: #1e3a8a;           /* navy: logo, headings accents */
  --accent: #2554d9;          /* links, focus rings, chart bars */
  --accent-soft: #eef2ff;

  /* Status colors (text) and their soft backgrounds */
  --critical: #b42318;  --critical-soft: #fef3f2;
  --warning:  #b54708;  --warning-soft:  #fffaeb;
  --success:  #067647;  --success-soft:  #ecfdf3;
  --neutral-soft: #f2f4f7;

  /* Type */
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, "Liberation Mono", monospace;
  --fs-xs: 0.75rem;     /* 12px: labels */
  --fs-sm: 0.8125rem;   /* 13px: captions, tables */
  --fs-md: 0.9375rem;   /* 15px: body */
  --fs-lg: 1.125rem;    /* 18px: card titles */
  --fs-xl: 1.375rem;    /* 22px: section titles */
  --fs-2xl: clamp(1.75rem, 1.3rem + 1.6vw, 2.375rem);  /* page title, grows with screen */

  /* Space & shape */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-pop: 0 12px 32px rgba(16, 24, 40, 0.14);
  --max: 1160px;        /* maximum content width */
  --topbar-h: 64px;
}


/* ---------------------------------------------------------------------------
   2. DARK MODE: same variable names, darker values. Nothing else changes.
   --------------------------------------------------------------------------- */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c111d;
    --surface: #161b26;
    --surface-2: #1b2130;
    --fg: #f5f5f6;
    --fg-2: #cecfd2;
    --muted: #94969c;
    --line: #232937;
    --line-strong: #333741;
    --brand: #a4bcfd;
    --accent: #84adff;
    --accent-soft: rgba(132, 173, 255, 0.12);
    --critical: #f97066;  --critical-soft: rgba(240, 68, 56, 0.14);
    --warning:  #fdb022;  --warning-soft:  rgba(247, 144, 9, 0.14);
    --success:  #47cd89;  --success-soft:  rgba(23, 178, 106, 0.14);
    --neutral-soft: #1f242f;
    --shadow: none;
    --shadow-pop: 0 12px 32px rgba(0, 0, 0, 0.5);
  }
}


/* ---------------------------------------------------------------------------
   3. BASE / RESET
   --------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--topbar-h) + 16px);   /* anchors land below the sticky top bar */
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: var(--fs-md);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { color: var(--fg); line-height: 1.25; letter-spacing: -0.01em; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.skip-link { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: var(--radius-sm); z-index: 50; }
.skip-link:focus { left: 8px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}


/* ---------------------------------------------------------------------------
   4. TOP BAR & PAGE LAYOUT
   The same top bar appears on every page: logo · page links · CVE search.
   --------------------------------------------------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(160%) blur(10px);       /* frosted-glass effect when scrolling */
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: var(--max); margin-inline: auto;
  min-height: var(--topbar-h);
  padding: var(--s2) clamp(16px, 4vw, 32px);
  display: flex; align-items: center; gap: var(--s5);
}

/* Logo: shield icon + name */
.brand { display: flex; align-items: center; gap: var(--s3); color: var(--fg); text-decoration: none; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 32px; height: 32px; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-weight: 700; font-size: var(--fs-md); letter-spacing: -0.01em; }

/* Page links */
.topnav { display: flex; gap: var(--s1); }
.topnav a {
  color: var(--fg-2); font-size: var(--fs-sm); font-weight: 500;
  padding: 6px 12px; border-radius: var(--radius-sm);
}
.topnav a:hover { background: var(--neutral-soft); text-decoration: none; }
.topnav a[aria-current="page"] { color: var(--fg); background: var(--neutral-soft); }   /* the page you're on */

/* Compact CVE search box on the right of the top bar */
.top-search { margin-left: auto; position: relative; width: min(100%, 280px); }
.top-search input {
  width: 100%;
  font: inherit; font-size: var(--fs-sm);
  padding: 8px 12px 8px 34px;                    /* room on the left for the magnifier icon */
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--fg);
}
.top-search input::placeholder { color: var(--muted); }
.top-search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--muted); pointer-events: none; }

/* The centered content column */
.page { max-width: var(--max); margin-inline: auto; padding: 0 clamp(16px, 4vw, 32px) var(--s8); }


/* ---------------------------------------------------------------------------
   5. HERO (page heading) & KPI TILES
   --------------------------------------------------------------------------- */
.hero { padding: var(--s7) 0 var(--s5); }
.eyebrow {
  margin: 0 0 var(--s2);
  font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted);
  display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center;
}
.eyebrow .live { display: inline-flex; align-items: center; gap: 6px; color: var(--critical); }
.eyebrow .live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
h1 { font-size: var(--fs-2xl); font-weight: 700; letter-spacing: -0.025em; margin: 0 0 var(--s3); }
.lede { font-size: var(--fs-md); color: var(--fg-2); max-width: 70ch; margin: 0; }

/* "Bottom line" callout: the one thing to read if you read nothing else */
.bottom-line {
  margin-top: var(--s5);
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  border-radius: var(--radius);
  padding: var(--s4) var(--s5);
  box-shadow: var(--shadow);
}
.bottom-line .label { font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--brand); margin: 0 0 var(--s1); }
.bottom-line .label.is-stale { color: var(--warning); }
.bottom-line p { margin: 0; font-size: 1.0625rem; line-height: 1.55; max-width: 85ch; min-height: 1.6em; }

/* KPI row: auto-fit grid = 4 across on desktop, 2 on tablet, 1 on phone */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.5rem), 1fr)); gap: var(--s3); margin: var(--s5) 0 0; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s4) var(--s5); box-shadow: var(--shadow); }
.kpi-label { font-size: var(--fs-sm); color: var(--muted); font-weight: 500; }
.kpi-num { font-size: 2rem; font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.2; margin: var(--s1) 0; min-height: 1.2em; }
.kpi-note { font-size: var(--fs-xs); color: var(--muted); }

/* "On this page" links under the hero (home page only) */
.onpage { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s4); margin: var(--s6) 0 0; padding-bottom: var(--s3); border-bottom: 1px solid var(--line); font-size: var(--fs-sm); }
.onpage span { color: var(--muted); font-weight: 500; }
.onpage a { color: var(--fg-2); }

/* Sections */
.section { margin-top: var(--s7); }
.section-head { margin-bottom: var(--s4); }
.section-head h2, .section > h2 { font-size: var(--fs-xl); font-weight: 650; margin: 0; }
.sub { font-size: var(--fs-sm); color: var(--muted); margin: var(--s1) 0 0; max-width: 80ch; }

/* Generic panel (white box) */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s5); box-shadow: var(--shadow); }
.panel + .panel { margin-top: var(--s4); }
.panel h3 { font-size: var(--fs-md); font-weight: 600; margin: 0; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; margin-bottom: var(--s3); }


/* ---------------------------------------------------------------------------
   6. TOP 5 CVE CARDS
   Layout of one card:
     [rank]  CVE-ID · Vendor · Category                     [Patch now]
             Title
             Product line
             ┌ CVSS ┬ Exploited ┬ CISA KEV ┬ Access ┐   ← "facts" strip
             Why it matters      |  What to do          ← two columns
             Fixed in … · Sources … · Rapid7 …           ← footer
   --------------------------------------------------------------------------- */
.cards { display: grid; gap: var(--s4); }
.cve-card {
  display: grid; grid-template-columns: 40px 1fr; gap: var(--s4);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: var(--s5); box-shadow: var(--shadow);
}
.rank {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--neutral-soft); color: var(--fg-2);
  font-weight: 650; font-variant-numeric: tabular-nums;
}
.card-body { min-width: 0; }
.card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s3); }
.card-meta { font-size: var(--fs-sm); color: var(--muted); display: flex; flex-wrap: wrap; gap: 0 var(--s2); }
.card-meta .cve-id { font-family: var(--mono); font-size: 0.78rem; color: var(--fg-2); }
.cve-card h3 { font-size: var(--fs-lg); font-weight: 650; margin: var(--s1) 0 2px; }
.product { font-size: var(--fs-sm); color: var(--muted); }

/* The facts strip: four equal boxes separated by thin lines */
.facts {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: var(--s4) 0; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.fact { padding: var(--s2) var(--s3); min-width: 0; }
.fact + .fact { border-left: 1px solid var(--line); }
.fact-label { font-size: var(--fs-xs); color: var(--muted); font-weight: 500; }
.fact-value { font-size: var(--fs-sm); font-weight: 600; color: var(--fg); overflow-wrap: anywhere; }
.fact-value.is-bad { color: var(--critical); }
.fact-value.is-warn { color: var(--warning); }

/* Why / What to do */
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s5); }
.col-label { font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); margin: 0 0 var(--s1); }
.cols p { margin: 0; font-size: var(--fs-md); color: var(--fg-2); }
.cols .col-label { font-size: var(--fs-xs); color: var(--muted); margin-bottom: var(--s1); }   /* more specific than ".cols p" */

.card-foot { margin-top: var(--s4); padding-top: var(--s3); border-top: 1px solid var(--line); font-size: var(--fs-sm); color: var(--muted); display: grid; gap: var(--s1); }
.card-foot strong { color: var(--fg-2); font-weight: 600; }

/* ---- Live ranking extras ---- */
.status-line { font-size: var(--fs-xs); color: var(--muted); margin: var(--s2) 0 0; }
.status-line.is-fallback { color: var(--warning); font-weight: 600; }
.pills { display: flex; gap: var(--s2); flex-wrap: wrap; justify-content: flex-end; }
.score-pill { font-variant-numeric: tabular-nums; }
.analyst-pill { margin-top: var(--s2); }
.facts-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }

/* "Why this rank": a <details> box; rows of label | bar | points | reason */
.why-rank { margin-top: var(--s4); border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
.why-rank summary { cursor: pointer; padding: var(--s2) var(--s3); font-size: var(--fs-sm); font-weight: 600; color: var(--fg-2); }
.why-rank[open] summary { border-bottom: 1px solid var(--line); }
.score-rows { display: grid; gap: 6px; padding: var(--s3); }
.score-row { display: grid; grid-template-columns: 11rem 7rem 3rem 1fr; gap: var(--s3); align-items: center; font-size: var(--fs-sm); }
.score-label { color: var(--fg-2); font-weight: 500; }
.score-track { height: 6px; border-radius: 999px; background: var(--neutral-soft); overflow: hidden; }
.score-fill { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.score-pts { font-variant-numeric: tabular-nums; color: var(--fg); font-weight: 600; text-align: right; }
.score-detail { color: var(--muted); }
.score-how { display: inline-block; font-size: var(--fs-xs); padding: 0 var(--s3) var(--s3); }
.in-news { margin-top: var(--s3); font-size: var(--fs-sm); display: grid; gap: 2px; }
.in-news .sources { flex-direction: column; gap: 2px; }
.runners-up { margin-top: var(--s4); }
.news-src { color: var(--muted); font-size: var(--fs-xs); }
.scoring-table td { vertical-align: top; }
#scoring > .sub { margin-bottom: var(--s4); }

.foot-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px var(--s3); }
.news-row .pill { margin-bottom: var(--s2); }

/* A row of source links: "Sources: A · B · C" */
.sources { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 2px var(--s3); font-size: var(--fs-sm); }
.sources a::after { content: " ↗"; font-size: 0.85em; color: var(--muted); }


/* ---------------------------------------------------------------------------
   7. THREAT NEWS & LATEST HEADLINES
   --------------------------------------------------------------------------- */
/* News: an editorial list. Date on the left, story on the right. */
.news-list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.news-row { display: grid; grid-template-columns: 110px 1fr; gap: var(--s4); padding: var(--s4) var(--s5); }
.news-row + .news-row { border-top: 1px solid var(--line); }
.news-date { font-size: var(--fs-sm); color: var(--muted); font-variant-numeric: tabular-nums; padding-top: 2px; }
.news-date .cat { display: block; font-size: var(--fs-xs); }
.news-row h3 { font-size: var(--fs-md); font-weight: 600; margin: 0 0 var(--s1); }
.news-row p { margin: 0 0 var(--s1); font-size: var(--fs-sm); color: var(--fg-2); }
.news-row .do { color: var(--fg); }
.news-row .do b { font-weight: 600; }

/* Headlines: two side-by-side lists */
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr)); gap: var(--s4); }
.two-col .panel + .panel { margin-top: 0; }
.headline-list { list-style: none; margin: 0; padding: 0; min-height: 120px; counter-reset: h; }
.headline-list li { padding: var(--s2) 0 var(--s2) 28px; position: relative; counter-increment: h; }
.headline-list li + li { border-top: 1px solid var(--line); }
.headline-list li::before { content: counter(h); position: absolute; left: 0; top: var(--s2); width: 20px; text-align: right; font-size: var(--fs-xs); color: var(--muted); font-variant-numeric: tabular-nums; padding-top: 2px; }
.headline-list a { color: var(--fg); font-weight: 500; font-size: var(--fs-sm); }
.headline-meta { display: block; font-size: var(--fs-xs); color: var(--muted); }
.headline-meta a { color: var(--muted); font-weight: 400; font-size: var(--fs-xs); }


/* ---------------------------------------------------------------------------
   8. TABLES & CHART
   --------------------------------------------------------------------------- */
.table-scroll { max-height: 480px; overflow: auto; margin: 0 calc(var(--s5) * -1) calc(var(--s5) * -1); border-top: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 10px var(--s4); vertical-align: top; }
th:first-child, td:first-child { padding-left: var(--s5); }
th:last-child, td:last-child { padding-right: var(--s5); }
th {
  position: sticky; top: 0; z-index: 1;
  background: var(--surface-2); color: var(--muted);
  font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  white-space: nowrap; border-bottom: 1px solid var(--line);
}
td { border-bottom: 1px solid var(--line); color: var(--fg-2); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--surface-2); }
td.mono { font-family: var(--mono); font-size: 0.78rem; white-space: nowrap; color: var(--fg); }
td strong { color: var(--fg); font-weight: 600; }

/* Filter box above the KEV table */
.filter {
  font: inherit; font-size: var(--fs-sm);
  width: min(100%, 20rem); padding: 8px 12px; margin: 0 0 var(--s4);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--fg);
}

.chart { min-height: 190px; margin-top: var(--s2); }
.chart svg { display: block; width: 100%; height: auto; }
.chart .bar { fill: var(--accent); transition: opacity 0.15s; }
.chart .bar:hover { opacity: 0.7; }
.chart .grid { stroke: var(--line); }
.chart .axis-line { stroke: var(--line-strong); }
.chart text { fill: var(--muted); font-size: 12px; font-family: var(--font); }

.tooltip {
  position: fixed; z-index: 30; pointer-events: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-pop); padding: 6px 10px; font-size: var(--fs-sm); white-space: nowrap;
}
.tooltip .date { color: var(--muted); font-size: var(--fs-xs); }


/* ---------------------------------------------------------------------------
   9. BADGES & PILLS: small rounded status labels
   --------------------------------------------------------------------------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--fs-xs); font-weight: 600; white-space: nowrap;
  padding: 3px 10px; border-radius: 999px;
  background: var(--neutral-soft); color: var(--fg-2);
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.critical { background: var(--critical-soft); color: var(--critical); }
.pill.warning  { background: var(--warning-soft);  color: var(--warning); }
.pill.success  { background: var(--success-soft);  color: var(--success); }
.pill.info     { background: var(--accent-soft);   color: var(--accent); }
.pill.plain::before { display: none; }

/* Rapid7 "✓ In Rapid7" badge next to links */
.r7-badge { font-size: var(--fs-xs); font-weight: 600; margin-left: 6px; white-space: nowrap; }
.r7-badge.ok { color: var(--success); }
.r7-badge.warn { color: var(--warning); }
.r7-note { display: block; font-size: var(--fs-xs); color: var(--muted); margin-top: 2px; }

/* Archive tags reuse the pill look */
.tag { display: inline-flex; align-items: center; font-size: var(--fs-xs); font-weight: 600; padding: 2px 10px; border-radius: 999px; white-space: nowrap; }
.tag.retro { background: var(--neutral-soft); color: var(--fg-2); }
.tag.auto  { background: var(--success-soft); color: var(--success); }
.tag.live  { background: var(--critical-soft); color: var(--critical); }


/* ---------------------------------------------------------------------------
   10. METHOD SECTION & FOOTER
   --------------------------------------------------------------------------- */
.method { columns: 2 22rem; column-gap: var(--s7); font-size: var(--fs-sm); color: var(--fg-2); }
.method h4 { font-size: var(--fs-md); margin: 0 0 var(--s1); break-after: avoid; }
.method ul { margin: 0 0 var(--s4); padding-left: 1.1em; }
.method p { margin: 0 0 var(--s4); }
.method > *:first-child { margin-top: 0; }

.site-footer {
  max-width: var(--max); margin: var(--s7) auto 0; padding: var(--s5) clamp(16px, 4vw, 32px) var(--s6);
  border-top: 1px solid var(--line); color: var(--muted); font-size: var(--fs-sm);
  display: flex; flex-wrap: wrap; gap: var(--s2) var(--s5); justify-content: space-between;
}
.site-footer p { margin: 0; }
.site-footer a { color: var(--fg-2); }


/* ---------------------------------------------------------------------------
   11. SEARCH PAGE (search.html)
   --------------------------------------------------------------------------- */
.big-search { display: flex; gap: var(--s2); margin-top: var(--s5); max-width: 640px; }
.big-search input {
  flex: 1; min-width: 0;
  font: inherit; font-size: 1.0625rem; font-family: var(--mono);
  padding: 12px 16px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--fg); box-shadow: var(--shadow);
}
.big-search button, .btn {
  font: inherit; font-weight: 600; font-size: var(--fs-md);
  padding: 12px 20px; border: 0; border-radius: var(--radius-sm);
  background: var(--brand); color: #fff; cursor: pointer;
}
@media (prefers-color-scheme: dark) { .big-search button, .btn { color: #0c111d; } }
.big-search button:hover, .btn:hover { filter: brightness(1.1); }
.examples { font-size: var(--fs-sm); color: var(--muted); margin-top: var(--s3); display: flex; flex-wrap: wrap; gap: var(--s1) var(--s3); }
.examples a { font-family: var(--mono); font-size: 0.8rem; }

/* Summary card: the "one answer" built from all sources */
.result-summary { margin-top: var(--s6); }
.result-summary .cve-title { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3); }
.result-summary h2 { font-family: var(--mono); font-size: var(--fs-xl); font-weight: 650; margin: 0; letter-spacing: 0; }
.result-summary .headline { font-size: var(--fs-lg); font-weight: 600; margin: var(--s2) 0 var(--s1); }
.result-summary .desc { color: var(--fg-2); margin: 0; max-width: 90ch; }
.summary-facts { grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.5rem), 1fr)); }
.summary-facts .fact + .fact { border-left: 0; }
.summary-facts .fact { border-left: 1px solid var(--line); margin-left: -1px; }

/* Coverage row: one chip per source, colored by status */
.coverage { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; margin-top: var(--s4); font-size: var(--fs-sm); color: var(--muted); }
.radar-note { margin-top: var(--s4); padding: var(--s3) var(--s4); border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--fg); font-size: var(--fs-sm); }

/* One card per source, two per row on desktop */
.source-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 30rem), 1fr)); gap: var(--s4); margin-top: var(--s4); }
.source-grid .panel + .panel { margin-top: 0; }
.source-card { display: flex; flex-direction: column; min-height: 220px; }
#src-qualys { grid-column: 1 / -1; min-height: 0; }   /* research write-ups: full width, last */
.source-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s3); }
.source-name { display: flex; align-items: center; gap: var(--s2); font-weight: 650; font-size: var(--fs-md); }
.source-name small { font-weight: 400; color: var(--muted); font-size: var(--fs-xs); }
.source-body { flex: 1; font-size: var(--fs-sm); color: var(--fg-2); }
.source-foot { margin-top: var(--s4); padding-top: var(--s3); border-top: 1px solid var(--line); font-size: var(--fs-sm); display: flex; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; }
.source-foot .muted { color: var(--muted); }

/* Key/value list inside source cards */
.kv { display: grid; grid-template-columns: minmax(7.5rem, max-content) 1fr; gap: 6px var(--s4); margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--fg); overflow-wrap: anywhere; }
.kv code { font-family: var(--mono); font-size: 0.75rem; color: var(--fg-2); }
.plain-list { margin: var(--s2) 0 0; padding-left: 1.1em; }
.plain-list li { margin: 2px 0; }

.empty-state { margin-top: var(--s6); text-align: center; color: var(--muted); padding: var(--s7) var(--s5); border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.empty-state h2 { font-size: var(--fs-lg); margin: 0 0 var(--s2); color: var(--fg); }


/* ---------------------------------------------------------------------------
   12. ARCHIVE PAGE (archive.html)
   --------------------------------------------------------------------------- */
.week-list { display: grid; gap: var(--s4); }
.week-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); }
.week-head h3 { font-size: var(--fs-lg); margin: 0 var(--s2) 0 0; }
.week .sub { margin-bottom: var(--s4); }

.vendor-bars { display: grid; gap: 10px; min-height: 120px; }
.vbar { display: grid; grid-template-columns: minmax(7rem, 11rem) 1fr 2.5ch; gap: var(--s3); align-items: center; font-size: var(--fs-sm); }
.vbar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--fg-2); }
.vbar-track { background: var(--neutral-soft); border-radius: 999px; height: 8px; overflow: hidden; }
.vbar-fill { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.vbar-value { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }

.week-nav { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s5); }
.week-nav a { font-size: var(--fs-sm); padding: 4px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--fg-2); }
.week-nav a:hover { border-color: var(--line-strong); text-decoration: none; }

.cta-link { display: inline-block; margin-top: var(--s4); font-weight: 600; font-size: var(--fs-sm); }


/* ---------------------------------------------------------------------------
   13. STATES: loading skeletons and errors
   --------------------------------------------------------------------------- */
.skeleton {
  color: transparent !important;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--neutral-soft) 25%, var(--line) 50%, var(--neutral-soft) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite linear;
  min-width: 4ch;
}
.skeleton * { visibility: hidden; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.error-line { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 100px; color: var(--muted); font-size: var(--fs-sm); }
.error-line::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--critical); }


/* ---------------------------------------------------------------------------
   14. RESPONSIVE
   --------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .topbar-inner { flex-wrap: wrap; gap: var(--s2) var(--s4); }
  .top-search { order: 3; width: 100%; margin-left: 0; }   /* search drops to its own row */
}
@media (max-width: 720px) {
  .hide-narrow { display: none; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts .fact:nth-child(odd) { border-left: 0; }   /* left column of the 2-column grid */
  .score-row { grid-template-columns: 1fr 3rem; gap: 2px var(--s3); }
  .score-track, .score-detail { grid-column: 1 / -1; }   /* bar and reason get their own lines */
  .score-track { order: 3; }
  .score-detail { order: 4; margin-bottom: 4px; }
  .facts .fact:nth-child(n+3) { border-top: 1px solid var(--line); }
  .cols { grid-template-columns: 1fr; gap: var(--s3); }
  .news-row { grid-template-columns: 1fr; gap: var(--s1); }
  .news-date .cat { display: inline; margin-left: var(--s2); }
}
@media (max-width: 560px) {
  .cve-card { grid-template-columns: 1fr; gap: var(--s2); }
  .rank { width: 32px; height: 32px; font-size: var(--fs-sm); }
  .card-top { flex-direction: column-reverse; }   /* show "Patch now" above the CVE line */
  .kv { grid-template-columns: 1fr; gap: 0; }
  .kv dd { margin-bottom: var(--s2); }
  .big-search { flex-direction: column; }
  .panel { padding: var(--s4); }
  .table-scroll { margin: 0 calc(var(--s4) * -1) calc(var(--s4) * -1); }
  th:first-child, td:first-child { padding-left: var(--s4); }
}


/* ---------------------------------------------------------------------------
   15. PRINT: clean output if someone prints the page or saves it as a PDF
   --------------------------------------------------------------------------- */
@media print {
  :root { --bg: #fff; --surface: #fff; --surface-2: #fff; }
  .topbar, .onpage, .skip-link, .filter, #headlines, .tooltip, .big-search, .examples { display: none !important; }
  body { font-size: 11pt; }
  .page { max-width: none; padding: 0; }
  .hero { padding-top: 0; }
  .panel, .cve-card, .kpi, .news-list, .bottom-line { box-shadow: none; break-inside: avoid; }
  .table-scroll { max-height: none; overflow: visible; }
  a { color: inherit; }
  .sources a::after { content: " (" attr(href) ")"; font-size: 8pt; color: #555; }   /* print the URLs of sources */
}
