/* Patch Sonar. Deliberately dark in every theme. */
:root {
  --bg: #0E1219;
  --surface: #151B25;
  --raise: #1C2431;
  --ink: #E6ECF5;
  --muted: #93A0B4;
  --line: #263042;
  --line-strong: #3A4860;
  --accent: #7FB2FF;
  --red: #FF6B5E;
  --amber: #F2B544;
  --green: #4FD18B;
  --on-accent: #0E1219;
  --f-display: "Archivo", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --f-body: "Public Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 16px; line-height: 1.55; }
img, svg { max-width: 100%; }
.wrap { max-width: 1200px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
a { color: var(--accent); }
a:focus-visible, button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--on-accent); padding: 8px 12px; border-radius: 8px; z-index: 10; }
.skip:focus { left: 16px; }

/* Masthead */
header.mast .wrap { padding-block: 28px 22px; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 14px 28px; }
.brand { display: flex; gap: 14px; align-items: center; text-decoration: none; color: var(--ink); }
.brand img { width: 54px; height: 54px; flex: none; }
.brand .name { margin: 0; font-family: var(--f-display); font-stretch: 118%; font-weight: 800; font-size: clamp(1.9rem, 4.6vw, 2.9rem); line-height: .95; letter-spacing: -.01em; text-transform: uppercase; }
.brand .tag { margin: 6px 0 0; color: var(--muted); font-size: .98rem; }
.asof { text-align: right; font-family: var(--f-mono); font-size: .76rem; color: var(--muted); line-height: 1.7; }
.asof strong { display: block; font-family: var(--f-display); font-stretch: 100%; font-size: 1.08rem; color: var(--ink); font-weight: 700; }

/* Status board */
.board { border-block: 1px solid var(--line); background: var(--surface); }
.board .wrap { padding-block: 18px; display: grid; gap: 14px; }
.board-head { display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: baseline; justify-content: space-between; }
.board-head h2 { margin: 0; font-family: var(--f-display); font-stretch: 112%; font-size: .95rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .8rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; display: inline-block; }
.dot.patch { background: var(--red); box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 25%, transparent); }
.dot.new { background: var(--accent); }
.dot.soon { background: var(--amber); }
.dot.clear { background: var(--green); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.tile { text-align: left; cursor: pointer; font: inherit; color: var(--ink); background: var(--raise); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: grid; gap: 6px; }
.tile:hover { border-color: var(--line-strong); }
.tile[aria-pressed="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--raise)); }
.tname { font-family: var(--f-display); font-weight: 700; font-size: 1rem; line-height: 1.2; }
.tstat { display: flex; align-items: center; gap: 7px; font-size: .8rem; font-weight: 600; }
.tstat.patch { color: var(--red); } .tstat.new { color: var(--accent); } .tstat.soon { color: var(--amber); } .tstat.clear { color: var(--green); }
.tcount { font-family: var(--f-mono); font-size: .7rem; color: var(--muted); }

/* Layout */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 32px; padding-block: 26px 56px; }
@media (max-width: 960px) { .layout { grid-template-columns: minmax(0, 1fr); } }
.listhead { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 14px; }
.listhead h2 { margin: 0; font-family: var(--f-display); font-weight: 750; font-size: 1.4rem; }
.linkbtn { font: inherit; font-size: .85rem; color: var(--accent); background: none; border: 0; cursor: pointer; padding: 0; }
.list { display: grid; gap: 16px; }
.loading, .error { color: var(--muted); }

/* Entries */
.entry { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 20px 22px; display: grid; gap: 12px; min-width: 0; }
.entry.patch { border-color: color-mix(in srgb, var(--red) 40%, var(--line)); }
.etop { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.pill { display: inline-flex; align-items: center; gap: 7px; font-family: var(--f-display); font-stretch: 110%; font-weight: 800; font-size: .72rem; letter-spacing: .09em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; }
.pill.patch { background: color-mix(in srgb, var(--red) 18%, transparent); color: var(--red); }
.pill.new { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.pill.soon { background: color-mix(in srgb, var(--amber) 16%, transparent); color: var(--amber); }
.pill.clear { background: color-mix(in srgb, var(--green) 16%, transparent); color: var(--green); }
.product { font-family: var(--f-display); font-stretch: 112%; font-weight: 700; font-size: .82rem; letter-spacing: .06em; text-transform: uppercase; }
.cat { font-size: .8rem; color: var(--muted); margin-left: auto; }
.entry h3 { margin: 0; font-family: var(--f-display); font-weight: 750; font-size: clamp(1.2rem, 2.4vw, 1.45rem); line-height: 1.2; letter-spacing: -.005em; text-wrap: balance; }
dl.facts { margin: 0; display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 8px 16px; font-size: .95rem; }
dl.facts dt { font-size: .74rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding-top: 3px; }
dl.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 560px) { dl.facts { grid-template-columns: minmax(0, 1fr); gap: 2px; } dl.facts dd { margin-bottom: 8px; } }
.vers { display: flex; flex-wrap: wrap; gap: 6px; }
.ver { font-family: var(--f-mono); font-size: .78rem; background: var(--raise); border: 1px solid var(--line); border-radius: 6px; padding: 1px 7px; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 14px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: .8rem; color: var(--muted); }
.meta .cve { font-family: var(--f-mono); color: var(--ink); }
.meta a { text-decoration: none; border-bottom: 1px solid currentColor; }
.ransom { color: var(--red); font-weight: 600; }

/* Older CISA listings */
.older { margin-top: 12px; display: grid; gap: 8px; }
.older summary { cursor: pointer; font-family: var(--f-display); font-weight: 750; font-size: 1.15rem; padding: 12px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.older summary:hover { border-color: var(--line-strong); }
.older summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.older[open] summary { margin-bottom: 4px; }
.older p { margin: 0; font-size: .88rem; }
.olist { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); overflow: hidden; }
.olist li { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto auto; gap: 4px 14px; align-items: baseline; padding: 10px 16px; border-top: 1px solid var(--line); font-size: .88rem; }
.olist li:first-child { border-top: 0; }
.olist .cve { font-family: var(--f-mono); font-size: .78rem; }
.olist .oname { min-width: 0; overflow-wrap: anywhere; }
.olist .odate { font-family: var(--f-mono); font-size: .74rem; color: var(--muted); white-space: nowrap; }
.olist a { font-size: .8rem; text-decoration: none; white-space: nowrap; }
@media (max-width: 640px) { .olist li { grid-template-columns: minmax(0, 1fr) auto; } .olist .oname { grid-column: 1 / -1; grid-row: 2; } }
.muted { color: var(--muted); }

/* Sidebar */
aside { display: grid; gap: 18px; align-content: start; }
.box { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 20px; display: grid; gap: 10px; }
.label { font-family: var(--f-mono); font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.box h4 { margin: 0; font-family: var(--f-display); font-weight: 750; font-size: 1.2rem; line-height: 1.2; }
.box p { margin: 0; font-size: .9rem; color: var(--muted); }
.soonchip { justify-self: start; font-family: var(--f-mono); font-size: .72rem; color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line)); border-radius: 999px; padding: 2px 10px; }
.sponsor { border: 1.5px dashed var(--line); border-radius: 14px; padding: 20px; display: grid; gap: 6px; text-align: center; color: var(--muted); }
.sponsor b { font-family: var(--f-display); color: var(--ink); font-size: 1.05rem; }
.sponsor .addr { font-family: var(--f-mono); font-size: .82rem; color: var(--ink); user-select: all; }

/* Footer */
footer { border-top: 1px solid var(--line); }
footer .wrap { padding-block: 22px 34px; font-size: .84rem; color: var(--muted); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; }
footer nav { display: flex; gap: 16px; flex-wrap: wrap; }

/* Legal and text pages */
.doc { max-width: 720px; margin: 0 auto; padding-block: 32px 64px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.doc h1 { font-family: var(--f-display); font-weight: 800; font-size: clamp(1.8rem, 4vw, 2.4rem); line-height: 1.1; margin: 0 0 6px; }
.doc h2 { font-family: var(--f-display); font-weight: 750; font-size: 1.2rem; margin: 32px 0 8px; }
.doc p, .doc li { color: var(--ink); max-width: 68ch; }
.doc .eff { font-family: var(--f-mono); font-size: .8rem; color: var(--muted); margin-bottom: 24px; }
.doc .callout { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.back { display: inline-block; margin-bottom: 20px; font-size: .9rem; }

@media (max-width: 600px) { .asof { text-align: left; } .cat { margin-left: 0; width: 100%; } }
@media (prefers-reduced-motion: no-preference) {
  .entry { animation: rise .3s ease-out both; }
  @keyframes rise { from { transform: translateY(5px); } to { transform: none; } }
}
