/* CISA KEV tracker pages: the tracker (/data/tools/cisa-kev-tracker/), its CVE and vendor pages and the write-up.
   Loaded only on those pages, after hub.css, and built on hub.css tokens, so the light and dark designs follow the
   hub's switch. Badge colours keep 4.5:1 or more against their own background in both designs. */
:root{--kb-rw-bg:#fde9e1;--kb-rw:#8a2a00;--kb-soon-bg:#fff4d6;--kb-soon:#6b4600;--kb-late-bg:#f1f1f1;--kb-late:#454545;--kb-new-bg:#e3f0ff;--kb-new:#0b4a8f;--kev-ok:#1b6b3a;--kev-ok-bg:#eaf6ee;--kev-stale:#9a3b00}
.site-s-dark{--kb-rw-bg:#3d1d12;--kb-rw:#ffb59c;--kb-soon-bg:#3a2a0c;--kb-soon:#ffd591;--kb-late-bg:#2a2a2b;--kb-late:#d6d6d6;--kb-new-bg:#13263d;--kb-new:#9cc8ff;--kev-ok:#7fd49a;--kev-ok-bg:#14271b;--kev-stale:#ffb27a}

/* The tracker uses the full content width (the hub's 1170px) like the reference tables; prose keeps a reading measure. */
.kev-tool{max-width:none}
.kev-tool .lede,.kev-tool .kev-section>p,.kev-tool .kev-how,.kev-tool .faq,.kev-tool .sources,.kev-tool .embed,.kev-tool .kev-notice,.kev-tool .byline{max-width:var(--measure)}

/* Sync status: a notice panel. Green dot and border while every source is current, the stale colour when one is not. */
.kev-sync{display:flex;gap:12px;align-items:flex-start;border:1px solid var(--c-sep2);border-left:4px solid var(--kev-ok);border-radius:6px;background:var(--kev-ok-bg);padding:12px 16px;margin:0 0 22px;font-size:.9em;line-height:1.5}
.kev-sync.is-stale{border-left-color:var(--kev-stale);background:var(--kb-soon-bg)}
.kev-sync-dot{flex:none;position:relative;width:10px;height:10px;margin-top:6px;border-radius:50%;background:var(--kev-ok)}
.kev-sync-dot::after{content:"";position:absolute;inset:0;border-radius:50%;background:var(--kev-ok);animation:kev-pulse 2.4s ease-out infinite}
.kev-sync.is-stale .kev-sync-dot,.kev-sync.is-stale .kev-sync-dot::after{background:var(--kev-stale)}
@keyframes kev-pulse{0%{transform:scale(1);opacity:.6}80%,100%{transform:scale(2.6);opacity:0}}
@media (prefers-reduced-motion:reduce){.kev-sync-dot::after{animation:none;display:none}}
.kev-sync-body{min-width:0}
.kev-sync-kicker{font-size:.78em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--kev-ok)}
.kev-sync.is-stale .kev-sync-kicker{color:var(--kev-stale)}
.kev-sync p{margin:0}
.kev-sync strong{color:var(--c-headings)}
.kev-sync p>span{white-space:normal}
.kev-sync p>span::before{content:"\00b7";margin:0 .45em;color:var(--c-faint)}
.kev-src-status{list-style:none;margin:6px 0 0;padding:0;display:flex;flex-wrap:wrap;gap:4px 16px;font-size:.92em;color:var(--c-sub)}
.kev-src-status li::before{content:"";display:inline-block;width:8px;height:8px;border-radius:50%;margin-right:6px;background:var(--kev-ok)}
.kev-src-status li.stale::before{background:var(--kev-stale)}
.kev-src-status li.stale{color:var(--kev-stale);font-weight:600}

.kev-stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:12px;margin:0 0 28px}
/* Headline cards, one tone each: catalogue neutral, new entries blue, due soon amber, ransomware red. A zero count
   drops back to neutral so the page does not raise an alarm about nothing. */
.kev-stat{--tone:var(--c-headings);--tone-bg:var(--c-soft);display:block;position:relative;border:1px solid var(--c-sep2);border-top:4px solid var(--tone);border-radius:6px;background:var(--tone-bg);padding:12px 16px 14px;text-decoration:none;color:var(--c-text);transition:transform .15s,box-shadow .15s}
.kev-stat-new{--tone:var(--kb-new);--tone-bg:var(--kb-new-bg)}
.kev-stat-soon{--tone:var(--kb-soon);--tone-bg:var(--kb-soon-bg)}
.kev-stat-rw{--tone:var(--kb-rw);--tone-bg:var(--kb-rw-bg)}
.kev-stat.is-zero{--tone:var(--c-sub);--tone-bg:var(--c-soft)}
a.kev-stat:hover,a.kev-stat:focus-visible{transform:translateY(-2px);box-shadow:0 6px 18px rgba(0,0,0,.12)}
@media (prefers-reduced-motion:reduce){a.kev-stat:hover,a.kev-stat:focus-visible{transform:none}}
.kev-stat-tag{display:block;font-style:normal;font-size:.72em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--tone);margin:0 0 4px}
.kev-stat b{display:block;font-size:1.9em;line-height:1.1;color:var(--tone);font-variant-numeric:tabular-nums}
.kev-stat-total b{color:var(--c-headings)}
.kev-stat span{font-size:.86em;color:var(--c-text)}

/* New this week: an alert panel in the "new" blue, with the count as a badge. Neutral when the week had none. */
.kev-alert{border:1px solid var(--c-sep2);border-left:4px solid var(--kb-new);border-radius:6px;background:var(--kb-new-bg);padding:4px 18px 10px}
.kev-alert.is-empty{border-left-color:var(--c-sep2);background:var(--c-soft)}
.kev-alert-head{display:flex;align-items:center;flex-wrap:wrap;gap:6px 12px;margin:14px 0 4px}
.kev-alert-head h2{margin:0}
.kev-alert-count{display:inline-block;font-size:.8em;font-weight:700;line-height:1;padding:6px 10px;border-radius:999px;background:var(--kb-new);color:var(--c-bg)}
.kev-alert.is-empty .kev-alert-count{background:var(--c-sub)}
.kev-alert>p{color:var(--c-text)}
.kev-alert .kev-wrap{background:var(--c-bg)}

.kev-section{margin:0 0 34px}
.kev-section h3{font-size:1.02em;margin:18px 0 6px}
.kev-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch;border:1px solid var(--c-sep2);margin:10px 0}
/* The full catalogue: one table per year. content-visibility skips layout for years far from the screen (the page
   holds 1,766 rows); the fixed layout sizes columns from the header row, so every year's columns line up. */
.kev-chunk{content-visibility:auto;contain-intrinsic-size:auto 1600px}
.kev-table-all{table-layout:fixed;min-width:980px}
.kev-table-all th:nth-child(1){width:150px}.kev-table-all th:nth-child(2){width:190px}.kev-table-all th:nth-child(3),.kev-table-all th:nth-child(4){width:108px}
.kev-table-all th:nth-child(5){width:96px}.kev-table-all th:nth-child(6){width:96px}.kev-table-all th:nth-child(7){width:70px}.kev-table-all th:nth-child(8){width:132px}
.kev-table-all td,.kev-table-all th{overflow:hidden;text-overflow:ellipsis}
.kev-table-all caption{font-weight:600;color:var(--c-headings)}
.kev-table{border-collapse:collapse;width:100%;font-size:.84em;line-height:1.35;font-variant-numeric:tabular-nums}
.kev-table caption{text-align:left;padding:6px 9px;font-size:.92em;color:var(--c-sub);caption-side:top}
.kev-table th,.kev-table td{padding:5px 8px;border-bottom:1px solid var(--c-sep);text-align:left;vertical-align:top;white-space:nowrap}
.kev-table td:nth-child(2){white-space:normal;min-width:150px;max-width:240px}
.kev-table thead th{position:sticky;top:0;z-index:2;background:var(--c-bg);border-bottom:2px solid var(--c-sep2);font-weight:600;color:var(--c-headings)}
.kev-table tbody th{position:sticky;left:0;z-index:1;background:var(--c-bg);font-weight:600}
.kev-table tbody tr:hover td,.kev-table tbody tr:hover th{background:var(--c-soft)}
.kev-table a{color:var(--c-accent-text)}
.kev-table .kp{display:block;color:var(--c-sub);font-size:.9em}
.kev-sort{all:unset;cursor:pointer;display:inline-flex;gap:4px;align-items:center}
.kev-sort:focus-visible{outline:2px solid var(--focus,#161616);outline-offset:2px}
th[aria-sort] .kev-sort::after{content:"\2193";font-size:.85em}
th[aria-sort=ascending] .kev-sort::after{content:"\2191"}
.kb{display:inline-block;font-size:.78em;font-weight:600;border-radius:3px;padding:0 5px;line-height:1.55}
.kb-rw{background:var(--kb-rw-bg);color:var(--kb-rw)}
.kb-soon{background:var(--kb-soon-bg);color:var(--kb-soon)}
.kb-late{background:var(--kb-late-bg);color:var(--kb-late)}
.kb-new{background:var(--kb-new-bg);color:var(--kb-new)}

.kev-filters{border:1px solid var(--c-sep2);border-radius:4px;padding:12px 14px 4px;margin:12px 0;background:var(--c-soft)}
.kf-row{display:flex;flex-wrap:wrap;gap:10px 14px;margin:0 0 10px}
.kev-filters label{display:flex;flex-direction:column;gap:3px;font-size:.86em;font-weight:600;color:var(--c-headings);min-width:0}
.kev-filters .kf-wide{flex:1 1 260px}
.kev-filters input,.kev-filters select{font:inherit;font-size:16px;font-weight:400;color:var(--c-text);background:var(--c-bg);border:1px solid #8a8a8a;border-radius:4px;padding:6px 8px;min-width:0;max-width:100%}
.kev-filters select[name=vendor]{max-width:240px}
.kf-actions{align-items:center}
.kf-more{margin:0 0 6px}
.kf-more>summary{cursor:pointer;font-size:.86em;font-weight:600;color:var(--c-accent-text);margin:0 0 8px}
.kf-count{flex:1 1 220px;margin:0;font-size:.9em;color:var(--c-sub)}
.kev-filters button{font:inherit;font-size:.86em;font-weight:600;border:1px solid var(--c-main);color:var(--c-accent-text);background:var(--c-bg);border-radius:3px;padding:6px 12px;cursor:pointer}
.kev-filters button:hover,.kev-filters button:focus-visible{background:var(--c-main);color:#fff}

.kev-how{padding-left:1.3em}
.kev-how li{margin:0 0 8px}
.kev-changes{padding-left:1.2em;font-size:.92em}
.kev-changes li{margin:0 0 6px}
.kev-downloads{padding-left:1.2em}
.kev-vendor-links{columns:3 180px;padding-left:1.1em;font-size:.94em}
.kev-notice{font-size:.85em;margin-top:28px}

.kev-h1-sub{display:block;font-size:.55em;font-weight:500;color:var(--c-sub);margin-top:6px;line-height:1.3}
.kev-facts dl{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:0;margin:0 0 26px;border:1px solid var(--c-sep2)}
.kev-facts dl>div{padding:10px 12px;border-bottom:1px solid var(--c-sep);border-right:1px solid var(--c-sep)}
.kev-facts dt{font-size:.8em;text-transform:uppercase;letter-spacing:.03em;color:var(--c-sub);margin:0 0 2px}
.kev-facts dd{margin:0;font-weight:600;color:var(--c-headings)}
.kev-facts .kp,.kev-links .kp,.kev-extra .kp{display:block;font-weight:400;font-size:.86em;color:var(--c-sub)}
.kev-label{font-size:.8em;text-transform:uppercase;letter-spacing:.03em;color:var(--c-sub);margin:14px 0 4px}
.kev-verbatim{margin:0;padding:8px 14px;border-left:3px solid var(--c-sep2);background:var(--c-soft)}
.kev-verbatim p{margin:0;overflow-wrap:anywhere}
.kev-links{padding-left:1.1em}
.kev-links li{margin:0 0 6px;overflow-wrap:anywhere}
.kev-links a{color:var(--c-accent-text)}
.kev-extra{display:grid;grid-template-columns:minmax(120px,max-content) 1fr;gap:6px 14px;margin:0}
.kev-extra dt{font-weight:600;color:var(--c-headings)}
.kev-extra dd{margin:0;overflow-wrap:anywhere}
.kev-extra code{font-size:.9em;overflow-wrap:anywhere}
.kev-check{border-left:3px solid var(--kb-soon);padding:6px 12px;background:var(--kb-soon-bg);color:var(--kb-soon)}
.kev-prov,.kev-bod,.kev-products{border-collapse:collapse;width:100%;font-size:.86em;line-height:1.45}
.kev-prov caption,.kev-bod caption,.kev-products caption{text-align:left;padding:6px 0;color:var(--c-sub)}
.kev-prov th,.kev-prov td,.kev-bod th,.kev-bod td,.kev-products th,.kev-products td{padding:6px 9px;border:1px solid var(--c-sep2);text-align:left;vertical-align:top}
.kev-prov thead th,.kev-bod thead th,.kev-products thead th{background:rgba(var(--c-rgba),.05);color:var(--c-headings)}
.kev-prov td{overflow-wrap:anywhere}
.kev-back{margin-top:24px}
.asset-kev .body .tablewrap{overflow-x:auto}
@media (max-width:640px){
  .kev-sync p>span{display:block}
  .kev-sync p>span::before{content:none}
  .kev-extra{grid-template-columns:1fr}
  .kev-filters select[name=vendor]{max-width:100%}
  .kev-filters .kf-row>label{flex:1 1 140px}
}
@media print{
  .kev-filters,.embed{display:none}
  .kev-chunk{content-visibility:visible}
}

/* Links inside text on the KEV pages are underlined, so they do not rely on colour alone (WCAG 1.4.1). */
.kev-tool p a,.kev-tool li a,.asset-kev p a,.asset-kev li a,.kev-cve p a,.kev-cve li a,.kev-vendor p a,.kev-vendor li a,
.kev-tool .cite a,.asset-kev .cite a,.kev-sync a,.kev-prov a,.kev-extra a,.site-footer p a,.footer-copy a{text-decoration:underline;text-underline-offset:2px}
.kev-tool .kev-stat,.kev-tool .button,.asset-kev .button{text-decoration:none}
/* Footer link row: 24px targets (WCAG 2.5.8). Scoped to the KEV pages here; pending item for hub.css. */
.footer-widget-links a{display:inline-block;min-height:24px;line-height:24px}
.footer-widget-links.is-inline li{margin:0 6px 4px 0}
.kev-table abbr{text-decoration:none;cursor:help}
