/* Threat Radar styles
   Dark "radar screen" theme by default, with a light variant that switches on
   automatically when your device is set to light mode.
   All colours live in custom properties (variables) at the top, so changing
   the look means editing one block. */

:root {
  color-scheme: dark light;
  --bg: #08100c;
  --surface: #0e1813;
  --surface-2: #132019;
  --border: #1e3027;
  --border-strong: #2c4538;
  --text: #d7e6dd;
  --muted: #86a092;
  --accent: #3ddc84;
  --accent-soft: rgba(61, 220, 132, 0.14);
  --hot: #ffb547;
  --hot-soft: rgba(255, 181, 71, 0.14);
  --alert: #ff6b6b;
  --alert-soft: rgba(255, 107, 107, 0.14);
  --mine: #6cb6ff;
  --mine-soft: rgba(108, 182, 255, 0.14);
  --radius: 10px;
  --gutter: 16px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f3f6f4;
    --surface: #ffffff;
    --surface-2: #eef3f0;
    --border: #d5dfd9;
    --border-strong: #b5c5bc;
    --text: #13201a;
    --muted: #55695e;
    --accent: #0b7a43;
    --accent-soft: rgba(11, 122, 67, 0.1);
    --hot: #9a5800;
    --hot-soft: rgba(154, 88, 0, 0.1);
    --alert: #b42323;
    --alert-soft: rgba(180, 35, 35, 0.09);
    --mine: #1f5fa6;
    --mine-soft: rgba(31, 95, 166, 0.1);
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; } /* "hidden" must win over display: grid/flex below */
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--font);
  overflow-wrap: break-word;
}
a { color: var(--accent); text-underline-offset: 2px; }
h1, h2, h3 { line-height: 1.2; margin: 0; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); font-weight: 400; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.skip-link {
  position: absolute; left: var(--gutter); top: -48px; z-index: 10;
  background: var(--accent); color: var(--bg); padding: 8px 12px; border-radius: var(--radius);
  font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 12px; }

main, .masthead__inner, .footer {
  max-width: 1100px;
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

/* ---------- Masthead + radar ---------- */
.masthead { border-bottom: 1px solid var(--border); background: linear-gradient(180deg, var(--surface) 0%, var(--bg) 100%); }
.masthead__inner {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 20px 28px;
  align-items: center;
  padding-top: 28px;
  padding-bottom: 28px;
}
.radar { width: 148px; height: 148px; display: block; }
.radar__ring, .radar__axis { fill: none; stroke: var(--accent); stroke-opacity: 0.28; stroke-width: 1; }
.radar__core { fill: var(--accent); }
.radar__beam { fill: var(--accent); fill-opacity: 0.12; }
.radar__arm { stroke: var(--accent); stroke-width: 1.5; stroke-opacity: 0.9; }
.radar__sweep { transform-origin: 100px 100px; }
.blip { fill: var(--accent); }
.blip--hot { fill: var(--hot); }
.blip--ransom { fill: var(--alert); }
@media (prefers-reduced-motion: no-preference) {
  .radar__sweep { animation: sweep 4s linear infinite; }
  .blip { animation: ping 4s ease-out infinite; }
}
@keyframes sweep { to { transform: rotate(360deg); } }
@keyframes ping { 0%, 100% { opacity: 1; } 60% { opacity: 0.35; } }

.eyebrow {
  margin: 0 0 6px; color: var(--accent);
  font: 600 12px/1.3 var(--mono); letter-spacing: 0.08em; text-transform: uppercase;
}
h1 { font-size: clamp(32px, 6vw, 48px); letter-spacing: -0.02em; }
.lede { margin: 8px 0 10px; max-width: 46ch; color: var(--text); font-size: 17px; }
.lede em { font-style: normal; color: var(--hot); }
.freshness { margin: 0; color: var(--muted); font-size: 14px; }
.freshness strong { color: var(--text); font-weight: 600; }

/* ---------- Sections ---------- */
.band { padding: 28px 0 0; }
.band:last-child { padding-bottom: 40px; }
.section-title { font-size: 20px; margin-bottom: 14px; letter-spacing: -0.01em; }

/* ---------- Stat cards ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.stat dt { color: var(--muted); font-size: 13px; line-height: 1.35; }
.stat dd {
  margin: 4px 0 0;
  font: 600 clamp(26px, 4vw, 34px)/1.1 var(--mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.stat--hot dd { color: var(--hot); }
.stat--alert dd { color: var(--alert); }

/* ---------- Charts ---------- */
.charts { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 12px; }
.panel {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px 16px;
  min-width: 0;
}
.panel__title { font-weight: 600; font-size: 15px; margin-bottom: 10px; }
.chart-monthly svg { width: 100%; height: auto; display: block; overflow: visible; }
.bar { fill: var(--accent); fill-opacity: 0.75; }
.bar--current { fill: var(--hot); fill-opacity: 0.9; }
.bar-label, .bar-value { fill: var(--muted); font: 11px var(--mono); }
.bar-value { fill: var(--text); }
.baseline { stroke: var(--border-strong); stroke-width: 1; }

.vendor-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.vendor-bar {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(70px, 34%) 1fr 3.5ch; /* fixed count column keeps every bar track equally long */
  align-items: center;
  gap: 10px;
  background: none;
  border: 0;
  border-radius: 6px;
  padding: 3px 4px;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}
.vendor-bar:hover { background: var(--surface-2); }
.vendor-bar[aria-pressed="true"] { background: var(--accent-soft); }
.vendor-bar__name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vendor-bar__track { height: 10px; background: var(--surface-2); border-radius: 5px; overflow: hidden; }
.vendor-bar__fill { display: block; height: 100%; background: var(--accent); opacity: 0.75; border-radius: 5px; }
.vendor-bar__count { font: 12px var(--mono); color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }

/* ---------- Controls ---------- */
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
}
.field { display: grid; gap: 4px; min-width: 0; margin: 0; border: 0; padding: 0; }
.field--grow { flex: 1 1 220px; }
.field__label { font-size: 12px; color: var(--muted); padding: 0; }
input[type="search"], input[type="text"], select {
  width: 100%;
  min-height: 40px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
  font-size: 15px;
}
select { max-width: 220px; }
input[type="search"]::placeholder { color: var(--muted); opacity: 0.8; }

.segmented { display: flex; flex-wrap: wrap; gap: 0; }
.segmented legend { float: left; width: 100%; margin-bottom: 4px; }
.segmented label { position: relative; }
.segmented input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.segmented span {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 40px; min-width: 46px; padding: 0 10px;
  border: 1px solid var(--border-strong);
  margin-left: -1px;
  font: 13px var(--mono);
  color: var(--muted);
  background: var(--bg);
}
.segmented label:first-of-type span { border-radius: 8px 0 0 8px; margin-left: 0; }
.segmented label:last-of-type span { border-radius: 0 8px 8px 0; }
.segmented input:checked + span { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); position: relative; z-index: 1; }
.segmented input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; z-index: 2; }

.toggle { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; font-size: 14px; cursor: pointer; }
.toggle input { width: 18px; height: 18px; accent-color: var(--alert); margin: 0; }

.result-count { color: var(--muted); font-size: 14px; margin: 14px 2px 8px; }

/* ---------- Entries ---------- */
.entries { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.entry {
  width: 100%;
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 4px 16px;
  text-align: left;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  font: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.entry:hover { border-color: var(--border-strong); background: var(--surface-2); }
.entry__date { font: 13px/1.5 var(--mono); color: var(--muted); padding-top: 1px; white-space: nowrap; }
.entry__body { display: grid; gap: 2px; min-width: 0; }
.entry__top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.entry__cve { font: 600 14px var(--mono); color: var(--accent); }
.entry__name { font-weight: 600; font-size: 15px; line-height: 1.4; }
.entry__vendor { color: var(--muted); font-size: 14px; }

.badge {
  display: inline-block;
  font: 600 11px/1 var(--mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 6px;
  border-radius: 4px;
}
.badge--new { color: var(--hot); background: var(--hot-soft); }
.badge--ransom { color: var(--alert); background: var(--alert-soft); }
.badge--triage { color: var(--muted); background: var(--surface-2); }

.empty { text-align: center; padding: 32px 16px; color: var(--muted); }
.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 40px; padding: 0 16px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 8px;
  font: 600 14px var(--font);
  text-decoration: none;
  cursor: pointer;
}
.button:hover { background: var(--accent); color: var(--bg); }
.button--wide { width: 100%; margin-top: 12px; }

/* ---------- Detail dialog ---------- */
.detail {
  width: min(680px, calc(100% - 2 * var(--gutter)));
  max-height: calc(100% - 2 * var(--gutter));
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  padding: 8px 22px 22px;
}
.detail::backdrop { background: rgba(0, 0, 0, 0.6); }
.detail__close-row { display: flex; justify-content: flex-end; }
.icon-button {
  width: 40px; height: 40px; border-radius: 8px;
  background: none; border: 1px solid transparent; color: var(--muted);
  font-size: 18px; cursor: pointer;
}
.icon-button:hover { border-color: var(--border-strong); color: var(--text); }
.detail__cve { margin: 0; color: var(--accent); font-weight: 600; }
.detail__title { font-size: 22px; margin: 4px 0 8px; }
.detail__badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.detail__badges:empty { display: none; }
.detail__desc { margin: 0 0 14px; }
.detail__facts {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px;
  margin: 0 0 16px; padding: 14px; background: var(--surface-2); border-radius: var(--radius);
}
.detail__facts dt { font-size: 12px; color: var(--muted); }
.detail__facts dd { margin: 0; font-size: 15px; }
.detail__subhead { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin: 0 0 4px; }
.detail__action { margin: 0 0 14px; font-size: 15px; }
.detail__notes { margin: 0 0 16px; padding-left: 18px; font-size: 14px; }
.detail__notes a, .detail__notes li { overflow-wrap: anywhere; }
.detail__nvd { margin: 0; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); padding-top: 18px; padding-bottom: 32px; color: var(--muted); font-size: 13px; }
.footer p { margin: 0 0 6px; }

/* ---------- Section navigation (spec 002) ---------- */
.topnav {
  max-width: 1100px; margin: 0 auto; padding: 14px var(--gutter) 0;
  display: flex; justify-content: flex-end; gap: 6px;
}
.topnav__link {
  font: 600 13px var(--mono); letter-spacing: 0.04em; text-decoration: none;
  color: var(--muted); padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px;
}
.topnav__link:hover { color: var(--text); border-color: var(--border-strong); }
.topnav__link[aria-current="page"] { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.masthead__inner--text { grid-template-columns: minmax(0, 1fr); }
.masthead--compact .masthead__inner { padding-top: 10px; }

/* ---------- Homepage Sitrep teaser ---------- */
.teaser {
  display: grid; gap: 8px;
  background: var(--surface); color: var(--text); text-decoration: none;
  border: 1px solid var(--border); border-left: 4px solid var(--hot); border-radius: 0 var(--radius) var(--radius) 0;
  padding: 14px 16px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.teaser:hover { background: var(--surface-2); border-color: var(--border-strong); border-left-color: var(--hot); }
.teaser__top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.teaser__label { font: 600 12px var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--hot); }
.teaser__tldr {
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  font-size: 15px; line-height: 1.55;
}
.teaser__foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; font-size: 13px; }
.teaser__cta { color: var(--accent); font-weight: 600; }

/* ---------- Sitrep page ---------- */
.sitrep-layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: start;
  padding-top: 28px; padding-bottom: 40px;
}
.sitrep:focus { outline: none; }
.notice {
  margin: 0 0 16px; padding: 10px 14px; border-radius: var(--radius);
  background: var(--surface-2); border: 1px solid var(--border-strong); color: var(--text); font-size: 14px;
}
.tldr {
  background: var(--hot-soft); border-left: 4px solid var(--hot);
  border-radius: 0 var(--radius) var(--radius) 0; padding: 14px 16px;
}
.tldr__label, .action__label {
  margin: 0 0 4px; font: 600 12px var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--hot);
}
.tldr__text { margin: 0; font-size: 16px; line-height: 1.6; }
.section-title--emerging { color: var(--accent); }
.sitrep .band { padding-top: 26px; }

.story-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.story {
  display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px 14px 12px;
}
.story-list--emerging .story { border-color: var(--accent); background: linear-gradient(90deg, var(--accent-soft), var(--surface) 40%); }
.story__num {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--border-strong); font: 600 13px var(--mono); color: var(--muted);
}
.story__num--emerging { border-color: var(--accent); color: var(--accent); font-size: 12px; }
.story__body { display: grid; gap: 4px; min-width: 0; }
.story__title { margin: 0; font-size: 16px; line-height: 1.35; }
.story__desc { margin: 0; font-size: 15px; line-height: 1.55; }
.story__meta { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.story__source { font-weight: 600; }
.story__cves { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 0; }
.cve-chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 28px;
  padding: 3px 8px; border: 1px solid var(--border-strong); border-radius: 6px;
  font-size: 12px; color: var(--text); text-decoration: none; background: var(--bg);
}
.cve-chip:hover { border-color: var(--accent); }
.cve-chip--kev { border-color: var(--alert); background: var(--alert-soft); color: var(--alert); }
.cve-chip--kev:hover { border-color: var(--alert); filter: brightness(1.1); }
.cve-chip__tag { font: 700 10px var(--mono); letter-spacing: 0.06em; text-transform: uppercase; }

.action {
  margin-top: 26px; padding: 14px 16px;
  border-left: 4px solid var(--accent); background: var(--accent-soft); border-radius: 0 var(--radius) var(--radius) 0;
}
.action .action__label { color: var(--accent); }
.action--needed { border-left-color: var(--alert); background: var(--alert-soft); }
.action--needed .action__label { color: var(--alert); }
.action__text { margin: 0; font-size: 15px; }

.archive { position: sticky; top: 16px; }
.archive__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.archive__item {
  display: grid; gap: 2px; padding: 10px 12px; text-decoration: none; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.archive__item:hover { border-color: var(--border-strong); background: var(--surface-2); }
.archive__item[aria-current="page"] { border-color: var(--accent); background: var(--accent-soft); }
.archive__date { font: 600 14px var(--mono); }
.archive__item[aria-current="page"] .archive__date { color: var(--accent); }
.archive__meta { font-size: 12px; color: var(--muted); }
.archive__tldr {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  font-size: 13px; color: var(--muted); line-height: 1.45;
}

/* ---------- Homepage teasers side by side (spec 003) ---------- */
.teasers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.teasers > [hidden] { display: none; }
.teasers > .teaser:only-of-type, .teasers > .teaser:not([hidden]):only-child { grid-column: 1 / -1; }
.teaser--bw { border-left-color: var(--alert); }
.teaser--bw:hover { border-left-color: var(--alert); }
.teaser--bw .teaser__label { color: var(--alert); }
.badge--clear { color: var(--accent); background: var(--accent-soft); }

/* ---------- Breach Wire page ---------- */
.eyebrow--alert { color: var(--alert); }
.stats--compact dd { font-size: clamp(24px, 3.4vw, 30px); }
.sweden {
  display: flex; align-items: center; gap: 10px; margin: 12px 0 0; padding: 12px 16px;
  border-radius: var(--radius); font-weight: 600; font-size: 15px;
}
.sweden__flag { font-size: 20px; }
.sweden--clear { background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent); }
.sweden--hit { background: var(--alert-soft); color: var(--alert); border: 1px solid var(--alert); }
.sitrep .charts { margin-top: 12px; }
.region + .region { margin-top: 12px; }
.region__name { margin: 0 0 4px; font-size: 14px; }
.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.bar-row {
  display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(40px, 1fr) 3.5ch; align-items: center; gap: 10px;
  font-size: 14px; padding: 2px 0;
}
.bar-row__label { overflow-wrap: anywhere; line-height: 1.3; }
.bar-row .vendor-bar__fill { background: var(--alert); }

.ledger { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ledger__card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; display: grid; gap: 4px; align-content: start; }
.ledger__top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; margin: 0; }
.ledger__name { font-weight: 700; font-size: 16px; }
.ledger__profile { margin: 0; font-size: 14px; line-height: 1.5; }
.ledger__meta { margin: 0; font-size: 13px; color: var(--muted); }
.ledger__meta strong { color: var(--text); font-weight: 600; }

.quality { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 0 0 12px; }
.quality__fact { display: grid; gap: 2px; }
.quality__fact dt { font-size: 13px; color: var(--muted); }
.quality__fact dd { margin: 0; font: 600 22px var(--mono); }
.quality__fact .muted { font-size: 12px; }
.quality__line { margin: 0 0 8px; font-size: 14px; }
.health { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; }
.health__ok { color: var(--accent); }
.health__fail { color: var(--alert); }
.notice--warn { margin-top: 10px; border-color: var(--hot); color: var(--hot); }

.kev-ransom__lede { margin: -6px 0 10px; font-size: 14px; }
.kev-ransom { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.kev-ransom__item {
  display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 12px; text-decoration: none; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px;
}
.kev-ransom__item:hover { border-color: var(--alert); background: var(--surface-2); }
.kev-ransom__date { font: 13px var(--mono); color: var(--muted); white-space: nowrap; }
.kev-ransom__body { display: grid; gap: 2px; min-width: 0; }
.kev-ransom__name { font-size: 14px; }
.method { margin: 26px 0 0; font-size: 13px; color: var(--muted); line-height: 1.6; }
.archive-chart { margin: 0 0 10px; }
.archive-chart svg { display: block; height: 90px; }
.archive__meta--alert { color: var(--alert); font-weight: 600; }

/* ---------- My stack (spec 004): blue always means "yours" ---------- */
.badge--mine { color: var(--mine); background: var(--mine-soft); }
.entry--mine { border-left: 3px solid var(--mine); }
.blip-ring { fill: none; stroke: var(--mine); stroke-width: 1.5; }
.radar--mine-only .blip:not(.blip--mine) { fill: var(--muted); fill-opacity: 0.35; }

.button--mine { background: var(--mine-soft); color: var(--mine); border-color: var(--mine); }
.button--mine:hover { background: var(--mine); color: var(--bg); }
.button--quiet { background: transparent; color: var(--text); border-color: var(--border-strong); font-weight: 500; }
.button--quiet:hover { background: var(--surface-2); color: var(--text); }
.button--danger { color: var(--alert); border-color: var(--alert); }
.button--danger:hover { background: var(--alert-soft); color: var(--alert); }
.button--armed, .button--armed:hover { background: var(--alert); color: var(--bg); border-color: var(--alert); }
.button:disabled { opacity: 0.45; cursor: not-allowed; }
.button:disabled:hover { background: transparent; color: inherit; }
.link-button {
  background: none; border: 0; padding: 2px 0; font: inherit; font-weight: 600; color: var(--mine);
  text-decoration: underline; text-underline-offset: 2px; cursor: pointer;
}
.count-pill {
  display: inline-block; min-width: 22px; margin-left: 8px; padding: 2px 7px; border-radius: 999px;
  background: var(--bg); font: 600 12px var(--mono); text-align: center;
}
.stack-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.toggle--mine input { accent-color: var(--mine); }

.stack-prompt { margin: 0 0 12px; font-size: 14px; color: var(--muted); }
.stack-strip {
  display: grid; gap: 6px; margin: 0 0 12px; padding: 12px 16px;
  background: var(--mine-soft); border-left: 4px solid var(--mine);
}
.stack-strip__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.stack-strip__label { margin: 0; font: 600 12px var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--mine); overflow-wrap: anywhere; }
.stack-strip__desc { margin: 0; font-size: 14px; overflow-wrap: anywhere; }
.stack-strip__stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 4px 0 0; }
.stack-strip__stats dt { font-size: 12px; color: var(--muted); line-height: 1.35; }
.stack-strip__stats dd { margin: 2px 0 0; font: 600 22px var(--mono); font-variant-numeric: tabular-nums; }
.stack-strip__stats dd.is-hot { color: var(--hot); }
.stack-strip__stats > [hidden] { display: none; }

/* The picker dialog */
.picker { width: min(720px, calc(100% - 2 * var(--gutter))); padding: 14px 22px 18px; }
.picker__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.picker__title { font-size: 22px; }
.picker__intro { margin: 2px 0 14px; color: var(--muted); font-size: 14px; }
.preset-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 12px; }
.preset-bar__select { flex: 1 1 200px; }
.preset-bar__select select { max-width: none; }
.preset-bar__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.preset-form {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 10px; margin-top: 10px; padding: 10px;
  border: 1px dashed var(--border-strong); border-radius: 8px;
}
.form-error { flex-basis: 100%; margin: 0; color: var(--alert); font-size: 13px; }
.picker__selected { margin: 14px 0 10px; font-size: 14px; overflow-wrap: anywhere; }
.stale { margin: 0 0 12px; padding: 10px 12px; border: 1px solid var(--hot); background: var(--hot-soft); border-radius: 8px; font-size: 13px; }
.stale__intro { margin: 0 0 6px; }
.stale__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.stale__list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; overflow-wrap: anywhere; }
.picker__count { margin: 8px 2px 6px; font-size: 13px; color: var(--muted); min-height: 1.3em; }
.pick-list {
  list-style: none; margin: 0; padding: 0; max-height: min(46vh, 440px); overflow: auto;
  border: 1px solid var(--border); border-radius: 8px; overscroll-behavior: contain;
}
.pick { border-bottom: 1px solid var(--border); }
.pick:last-child { border-bottom: 0; }
.pick--on > .pick__row { background: var(--mine-soft); }
.pick__row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 0 8px 0 10px; }
.pick__vendor, .pick__product { display: flex; align-items: center; gap: 10px; min-width: 0; cursor: pointer; }
.pick__vendor { min-height: 44px; }
.pick__product { min-height: 36px; font-size: 14px; }
.pick__vendor input, .pick__product input { flex: 0 0 auto; width: 18px; height: 18px; margin: 0; accent-color: var(--mine); }
.pick__name { min-width: 0; overflow-wrap: anywhere; }
.pick__count { margin-left: auto; padding-left: 8px; font: 12px var(--mono); color: var(--muted); font-variant-numeric: tabular-nums; }
.pick__expand {
  min-height: 34px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: 8px;
  background: var(--bg); color: var(--muted); font: 12px var(--mono); white-space: nowrap; cursor: pointer;
}
.pick__expand:hover { color: var(--text); border-color: var(--mine); }
.pick__products { padding: 0 10px 8px 38px; }
.pick__plist { list-style: none; margin: 0; padding: 0; }
.pick__note { margin: 2px 0 4px; font-size: 12px; color: var(--muted); }
.pick-list__empty { padding: 16px; color: var(--muted); text-align: center; }
.picker__device { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border); }
.toggle--remember input { accent-color: var(--mine); }
.picker__hint { margin: 0 0 10px; font-size: 13px; color: var(--muted); }
.picker__hint--warn { color: var(--hot); }
.picker__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.share-field { margin-top: 10px; }
.picker__status { min-height: 1.4em; margin: 8px 0 0; font-size: 13px; color: var(--accent); }
.picker__status--error { color: var(--alert); }
.picker__foot { display: flex; justify-content: flex-end; margin-top: 12px; }

/* Share-link offer */
.share-offer { display: grid; gap: 6px; padding: 14px 16px; border: 1px solid var(--mine); border-radius: var(--radius); background: var(--mine-soft); }
.share-offer__title { font-size: 17px; }
.share-offer__title:focus { outline: none; }
.share-offer p { margin: 0; overflow-wrap: anywhere; }
.share-offer__note { font-size: 14px; color: var(--muted); }
.share-offer__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }

/* Sitrep and Ransomware pages */
.stack-line { margin: 8px 0 0; font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.stack-line strong { color: var(--mine); }
.stack-line a { color: var(--mine); font-weight: 600; }
.cve-chip--mine { box-shadow: 0 0 0 2px var(--mine); }
.cve-chip__tag--mine { color: var(--mine); background: var(--surface); padding: 2px 5px; border-radius: 3px; }
.story__mentions { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 0; }
.kev-ransom__sub { margin: 14px 0 8px; font-size: 14px; }
.kev-ransom__sub:first-child { margin-top: 0; }
.kev-ransom__item--mine { border-left: 3px solid var(--mine); }
.kev-ransom__top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }

/* ---------- Smaller screens ---------- */
@media (max-width: 860px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .charts { grid-template-columns: minmax(0, 1fr); }
  .sitrep-layout { grid-template-columns: minmax(0, 1fr); }
  .archive { position: static; }
  .teasers { grid-template-columns: minmax(0, 1fr); }
  .ledger { grid-template-columns: minmax(0, 1fr); }
  .quality { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .masthead__inner { grid-template-columns: 1fr; padding-top: 20px; padding-bottom: 20px; }
  .radar { width: 108px; height: 108px; }
  .entry { grid-template-columns: 1fr; }
  .controls { flex-direction: column; align-items: stretch; }
  .field--grow { flex: 0 0 auto; } /* in a column, flex-basis would set the height, not the width */
  select { max-width: none; }
  .segmented { flex-wrap: nowrap; }
  .segmented label { flex: 1; }
  .segmented span { width: 100%; min-width: 0; }
  .detail { padding: 6px 16px 18px; }
  .detail__facts { grid-template-columns: minmax(0, 1fr); }
  .stack-strip__stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stack-controls .button--mine { width: 100%; }
  .picker { padding: 10px 14px 14px; }
  .preset-bar { flex-direction: column; align-items: stretch; }
  .preset-bar__select { flex: 0 0 auto; }
  .preset-form .field--grow { flex: 1 1 100%; }
  .pick__products { padding-left: 28px; }
  .pick__expand-noun { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .pick-list { max-height: 52vh; }
}
