/* Tia N. List — design system
   Light default; dark via [data-theme="dark"].
   Tokens: html-effectiveness palette + heat ramp for hot scoring. */

:root {
  --ivory: #FAF9F5;
  --slate: #141413;
  --clay: #D97757;
  --clay-d: #B85C3E;
  --oat: #E3DACC;
  --olive: #5F7147;
  --rust: #B04A3F;
  --gray-100: #F0EEE6;
  --gray-200: #E6E3DA;
  --gray-300: #D1CFC5;
  --gray-500: #87867F;
  --gray-700: #3D3D3A;
  --white: #FFFFFF;

  --heat-1: #5F7147;   /* deep olive — warm (AA on ivory) */
  --heat-2: #A84C31;   /* deep clay — hot (AA on ivory) */
  --heat-3: #B04A3F;   /* rust — hottest */

  --bg: var(--ivory);
  --fg: var(--slate);
  --card: var(--white);
  --border: var(--gray-300);
  --muted: var(--gray-500);
  --chip-bg: var(--gray-100);
  --chip-fg: var(--gray-700);
  --masthead-bg: rgba(250, 249, 245, 0.92);
  --link: var(--clay-d);

  --serif: ui-serif, Georgia, "Times New Roman", Times, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Monaco, Consolas, monospace;

  --maxw: 1080px;
  --radius-panel: 12px;
  --radius-row: 8px;
}

[data-theme="dark"] {
  --ivory: #161514;
  --slate: #EDEBE4;
  --clay: #E08A6A;
  --clay-d: #E08A6A;
  --oat: #37332A;
  --olive: #8FA36B;
  --rust: #D2695C;
  --gray-100: #262522;
  --gray-200: #2F2D29;
  --gray-300: #3A3833;
  --gray-500: #9A978E;
  --gray-700: #C9C6BC;
  --white: #201F1C;

  --heat-1: #8FA36B;
  --heat-2: #E08A6A;
  --heat-3: #D2695C;

  --bg: var(--ivory);
  --fg: var(--slate);
  --card: var(--white);
  --border: var(--gray-300);
  --muted: var(--gray-500);
  --chip-bg: var(--gray-100);
  --chip-fg: var(--gray-700);
  --masthead-bg: rgba(22, 21, 20, 0.92);
  --link: var(--clay);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 15.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

/* ---------- masthead ---------- */

.masthead {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--masthead-bg);
  backdrop-filter: blur(8px);
  border-bottom: 1.5px solid var(--border);
}

.masthead-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.wordmark {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--fg);
  white-space: nowrap;
}
.wordmark span { color: var(--clay); }
.wordmark:hover { text-decoration: none; }

.mainnav {
  display: flex;
  gap: 4px;
  margin-left: 8px;
}
.mainnav a {
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: 6px 12px;
  border-radius: 999px;
}
.mainnav a:hover { color: var(--fg); text-decoration: none; }
.mainnav a.active {
  color: var(--fg);
  background: var(--chip-bg);
  border: 1.5px solid var(--border);
  padding: 4.5px 10.5px;
}

.theme-toggle {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  color: var(--fg);
  cursor: pointer;
}
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

/* ---------- layout ---------- */

.page {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 40px 24px 96px;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin: 0 0 10px;
}

.page-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 36px;
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin: 0 0 12px;
}

.lead {
  font-size: 16.5px;
  color: var(--muted);
  max-width: 62ch;
  margin: 0 0 32px;
}

.about-body { max-width: 76ch; }
.about-body p { margin: 0 0 16px; }
.about-body p:last-child { margin-bottom: 0; }

/* ---------- hero (rank 1) ---------- */

.hero {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-panel);
  background: var(--card);
  padding: 28px 30px;
  margin-bottom: 28px;
  position: relative;
}
.hero .rank-flag {
  position: absolute;
  top: -12px;
  left: 24px;
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: var(--slate);
  color: var(--bg);
  padding: 4px 12px;
  border-radius: 999px;
}
.hero h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 28px;
  line-height: 1.18;
  letter-spacing: -0.01em;
  margin: 10px 0 10px;
}
.hero h2 a { color: var(--fg); }
.hero .snippet { color: var(--gray-700); max-width: 72ch; margin: 0 0 16px; }
.hero .snippet {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- story cards ---------- */

.story-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.story-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-panel);
  background: var(--card);
  padding: 20px 22px;
}

.story-card .topline {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
}
.rank {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
}

.heat {
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 3px 9px;
  border-radius: 999px;
  color: var(--bg);
}
/* hero chip carries classes "chip heat h3": .chip (later in the file) would
   override the heat color — pin the foreground here so dark heat backgrounds
   keep near-white text (WCAG AA) on the hero and every card. */
.chip.heat { color: var(--bg); }
.heat.h1 { background: var(--heat-1); }
.heat.h2 { background: var(--heat-2); }
.heat.h3 { background: var(--heat-3); }
.heat.none { background: var(--gray-500); }

.story-card h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 20px;
  line-height: 1.25;
  letter-spacing: -0.005em;
  margin: 0 0 8px;
}
.story-card h3 a { color: var(--fg); }

.story-card .snippet {
  font-size: 14px;
  color: var(--gray-700);
  margin: 0 0 14px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  min-width: 0;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.chip {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--chip-fg);
  background: var(--chip-bg);
  border: 1.5px solid var(--border);
  border-radius: 999px;
  padding: 3px 9px;
  white-space: nowrap;
  overflow-wrap: anywhere;
  max-width: 100%;
}
.chip.cve { color: var(--rust); border-color: currentColor; }
.chip.reddit { color: var(--olive); border-color: currentColor; }
.chip.desk { color: var(--clay); border-color: currentColor; }
.chip.more { color: var(--muted); border-style: dashed; }

.reltime { margin-left: auto; color: var(--muted); font-size: 12.5px; white-space: nowrap; }

/* ---------- story page ---------- */

.story-head { margin-bottom: 24px; }
.story-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 34px;
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin: 8px 0 14px;
}

.hotmeter {
  margin: 0 0 18px;
  max-width: 420px;
}
.hotmeter .bar {
  height: 6px;
  border-radius: 999px;
  background: var(--chip-bg);
  border: 1px solid var(--border);
  overflow: hidden;
}
.hotmeter .fill { height: 100%; border-radius: 999px; }
.hotmeter .lbl {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
}

.story-snippet {
  font-size: 16px;
  color: var(--gray-700);
  border-left: 3px solid var(--clay);
  padding: 2px 0 2px 16px;
  margin: 0 0 28px;
  max-width: 76ch;
}

/* ---------- timeline ---------- */

.timeline { list-style: none; margin: 0; padding: 0; position: relative; }

.timeline::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--border);
}

.tl-item { position: relative; padding: 0 0 22px 36px; }
.tl-item:last-child { padding-bottom: 0; }

.tl-dot {
  position: absolute;
  left: 0;
  top: 3px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--card);
  border: 2.5px solid var(--border);
}
.tl-item.original .tl-dot { border-color: var(--olive); background: var(--olive); }

.tl-kind {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 3px;
}
.tl-item.original .tl-kind { color: var(--olive); }

.tl-title { font-size: 15px; font-weight: 600; margin: 0 0 2px; }
.tl-source { font-size: 13px; color: var(--muted); margin: 0 0 8px; }
.tl-source a { font-family: var(--mono); font-size: 12px; }

.tl-body {
  font-size: 14.5px;
  color: var(--gray-700);
  background: var(--chip-bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-row);
  padding: 12px 16px;
  margin-top: 6px;
}
.tl-body p { margin: 0 0 8px; }
.tl-body p:last-child { margin-bottom: 0; }

/* ---------- daily digest ---------- */

.digest-head { margin-bottom: 28px; }
.digest-date {
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.digest-entry {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-row);
  background: var(--card);
  padding: 18px 22px;
  margin-bottom: 14px;
}
.digest-entry h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 21px;
  margin: 0 0 8px;
}
.digest-entry p { margin: 0 0 10px; color: var(--gray-700); }
.digest-entry .meta { border-top: none; padding-top: 0; }

.digest-analysis {
  font-size: 15.5px;
  color: var(--gray-700);
  border-left: 3px solid var(--clay);
  padding: 2px 0 2px 16px;
  margin: 0 0 32px;
  max-width: 76ch;
}
.digest-analysis p { margin: 0 0 12px; }
.digest-analysis p:last-child { margin-bottom: 0; }
.digest-analysis strong { color: var(--fg); }

.digest-stories {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 76ch;
}
.digest-stories li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
}
.digest-stories li:last-child { border-bottom: none; }
.digest-stories a {
  font-family: var(--serif);
  font-size: 16.5px;
  color: var(--fg);
}
.digest-stories a:hover { color: var(--link); }

/* ---------- feeds page ---------- */

.feed-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.feed-card {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-panel);
  background: var(--card);
  padding: 20px 22px;
}
.feed-card h3 { font-family: var(--serif); font-weight: 500; font-size: 19px; margin: 0 0 6px; }
.feed-card p { font-size: 13.5px; color: var(--gray-700); margin: 0 0 12px; }
.feed-card .url {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--link);
  word-break: break-all;
}

/* ---------- filters (all stories) ---------- */

.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  margin: 0 0 28px;
  padding: 12px 0;
  border-top: 1.5px solid var(--border);
  border-bottom: 1.5px solid var(--border);
}
.filters label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.filters select,
.filters input {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--fg);
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: 999px;
  padding: 5px 12px;
}
.filters select:hover,
.filters input:hover { border-color: var(--gray-500); }
.filters select:focus,
.filters input:focus { outline: none; border-color: var(--clay); }
.filters .f-search { flex: 1 1 180px; }
.filters input { width: 100%; }
.f-count {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gray-500);
  background: var(--gray-100);
  border: 1.5px solid var(--border);
  border-radius: 999px;
  padding: 4px 11px;
  margin-left: auto;
}
.no-results {
  font-family: var(--serif);
  font-size: 17px;
  color: var(--muted);
  padding: 32px 0;
}

/* ---------- pagination ---------- */

.pager {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin: 28px 0 0;
}
.pager .page {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--fg);
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: 999px;
  padding: 5px 13px;
  min-width: 30px;
  text-align: center;
}
.pager a.page:hover { border-color: var(--gray-500); text-decoration: none; }
.pager .page.current { background: var(--slate); color: var(--bg); border-color: var(--slate); }
.pager .page.disabled { color: var(--gray-500); }
.pager .page.gap { border: none; background: none; padding: 5px 4px; cursor: default; color: var(--muted); }

.covered-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
}
a.chip.covered { text-decoration: none; }
a.chip.covered:hover { border-color: var(--clay); color: var(--link); }
.covered-list .chip { white-space: normal; }

.story-analysis { margin: 0 0 28px; }
.story-analysis .tl-body { background: transparent; }

.scorebreakdown {
  margin: 0 0 18px;
  font-size: 13px;
}
.scorebreakdown summary {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}
.scorefactors {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 18px;
  margin: 10px 0 0;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-row);
  background: var(--card);
}
.scorefactors > div { display: flex; justify-content: space-between; gap: 10px; }
.scorefactors dt {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.scorefactors dd { margin: 0; color: var(--fg); }
.scorefactors dd span { color: var(--muted); font-size: 11.5px; }
.scorefactors .tot { border-top: 1px solid var(--border); padding-top: 6px; grid-column: 1 / -1; }
.scorefactors .tot dt { color: var(--fg); }

/* ---------- CTI matrix ---------- */

.matrix {
  overflow-x: auto;
  min-width: 0;
  max-width: 100%;
  position: relative;
}
.matrix-row {
  display: flex;
  gap: 6px;
  align-items: flex-start;
  min-width: 1320px;
}
.matrix-col {
  flex: 0 0 82px;
  max-width: 82px;
}
/* sticky first tactic column: always know which tactic you're reading
   while the matrix scrolls sideways */
.matrix-col:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--bg);
  box-shadow: 2px 0 0 rgba(0, 0, 0, 0.06);
}
.matrix-tactic {
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin: 0 0 6px;
  line-height: 1.3;
}
.matrix-tactic .m-count { color: var(--gray-500); }
.m-cell {
  font-family: var(--mono);
  font-size: 9.5px;
  padding: 4px 2px;
  margin-bottom: 3px;
  border-radius: 4px;
  text-align: center;
  border: 1.5px solid var(--border);
  background: var(--chip-bg);
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.m-cell a { color: var(--fg); text-decoration: none; }
.m-cell em { font-style: normal; color: var(--muted); margin-left: 2px; }
.m-cell.none { opacity: 0.45; }
.m-cell.case { background: var(--oat); border-color: var(--heat-1); color: var(--slate); }
.m-cell.case a { color: var(--slate); }
.m-cell.detection { background: var(--olive); border-color: var(--olive); color: var(--bg); }
.m-cell.detection a { color: var(--bg); }

.cti-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 0 0 8px;
}
.cti-grid > div {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-row);
  background: var(--card);
  padding: 12px 14px;
}
.cti-grid h3 { margin-bottom: 8px; }
.cti-grid p { margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.cti-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 13.5px;
}
/* fixed layout: the table can never exceed its container — long case titles
   wrap inside cells instead of widening the page (the 2026-08-11 spill) */
.table-scroll { overflow-x: auto; min-width: 0; max-width: 100%; }
.cti-table .chip {
  white-space: normal;
  overflow-wrap: anywhere;
  display: inline-block;
  max-width: 320px;
}
.cti-table .mono { word-break: break-all; }
.cti-table th, .cti-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.cti-table th {
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.mono { font-family: var(--mono); font-size: 12px; }

/* ---------- Sigma detections ---------- */

.code-block {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 14px 16px;
  overflow-x: auto;
  font-size: 12.5px;
  line-height: 1.55;
  max-height: 480px;
}
.raw-link {
  font-size: 12px;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.det-badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--bg);
  background: var(--olive);
  border-radius: 4px;
  padding: 2px 7px;
}
.det-badge.none {
  background: transparent;
  color: var(--muted);
  border: 1px dashed var(--border);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 10px;
}
.home-more { margin: 28px 0 0; font-size: 14px; }

/* quiet-state banner: shown when fewer than 2 stories clear the hot bar */
.quiet-banner {
  margin: 0 0 24px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-panel);
  background: var(--gray-100);
  color: var(--gray-700);
  font-size: 14px;
}
.quiet-banner a { color: var(--link); }

/* ---------- IOC feeds ---------- */

.ioc-downloads { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0 0 24px; }
.ioc-note { font-family: var(--mono); font-size: 11px; color: var(--muted); margin-left: 8px; }
.chip.status { text-transform: uppercase; }
.chip.status.active { color: var(--olive); border-color: currentColor; }
.chip.status.expired { color: var(--gray-500); border-color: currentColor; }
.chip.status.revoked { color: var(--rust); border-color: currentColor; }
.ioc-raw { font-size: 14px; }

/* ---------- footer ---------- */

.footer {
  border-top: 1.5px solid var(--border);
  background: var(--card);
}
.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.footnote { font-size: 13px; color: var(--muted); margin: 0; }
.feedlinks { display: flex; gap: 16px; margin-left: auto; }
.feedlinks a {
  font-size: 13px;
  color: var(--fg);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.rss {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--clay-d);
  border: 1.5px solid currentColor;
  border-radius: 4px;
  padding: 1px 5px;
}

/* ---------- source badge ---------- */

.src-badge {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 30;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.02em;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.16);
  transition: border-color 0.15s ease, color 0.15s ease;
}
.src-badge:hover {
  border-color: var(--clay);
  color: var(--clay);
  text-decoration: none;
}
.src-badge-icon { width: 14px; height: 14px; fill: currentColor; }

/* ---------- responsive ---------- */

@media (max-width: 820px) {
  .story-grid, .feed-grid { grid-template-columns: 1fr; }
  .page { padding: 28px 16px 80px; }
  .page-title { font-size: 30px; }
  .story-title { font-size: 28px; }
  .masthead-inner { padding: 12px 16px; gap: 12px; flex-wrap: wrap; }
  .mainnav { margin-left: 0; flex-wrap: wrap; }
  .mainnav a { padding: 5px 9px; font-size: 11px; }
  .feedlinks { flex-wrap: wrap; margin-left: 0; }
  .cti-grid { grid-template-columns: 1fr 1fr; }
  .src-badge { padding: 7px; }
  .src-badge-text { display: none; }
}

/* narrow screens: data tables scroll horizontally with readable columns
   instead of squeezing to unreadable widths (the covered table's Cases
   column collapsed to 20px at 390px without this) */
@media (max-width: 640px) {
  .cti-table { min-width: 600px; }
  .cti-grid .chip { white-space: normal; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* ---------- prose refinements (2026-08-11 audit) ---------- */

.tl-body hr, .digest-body hr, .analysis-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 10px 0 4px;
}
.m-cell { font-size: 10.5px; }
.matrix-hint {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0 0 8px;
}
.filters select:focus-visible, .filters input:focus-visible,
.mainnav a:focus-visible, .wordmark:focus-visible {
  outline: 2px solid var(--clay);
  outline-offset: 2px;
}

/* ---------- KEV catalog section (/kev/) ---------- */

.chip.active { background: var(--slate); color: var(--bg); border-color: var(--slate); }
button.chip { cursor: pointer; }
button.chip:hover { border-color: var(--gray-500); }

/* subtle "in KEV, enrichment on site" badge on story cards */
.chip.kev {
  color: var(--rust);
  border-color: currentColor;
  text-transform: uppercase;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .05em;
}

.kev-stats {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin: 0 0 22px;
}
.kev-stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-panel);
  padding: 14px 18px;
  flex: 1;
  min-width: 130px;
}
.kev-stat-value { display: block; font-size: 26px; font-weight: 600; }
.kev-stat-label { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }

.sev-crit { color: var(--rust); }
.sev-high { color: var(--clay-d); }
.sev-med { color: var(--olive); }
.sev-low { color: var(--muted); }

.kev-table { border-collapse: collapse; width: 100%; min-width: 760px; }
.kev-table th, .kev-table td {
  text-align: left;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  vertical-align: top;
}
.kev-table th {
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.kev-table th:hover { color: var(--fg); }
.kev-table th.sorted { color: var(--link); }
.kev-table th.sorted::after { content: ' \25B2'; font-size: 10px; }
.kev-table th.sorted.desc::after { content: ' \25BC'; }
.kev-table td { color: var(--gray-700); }
.kev-table tr:hover td { background: var(--chip-bg); }
.kev-table a { color: var(--link); }
.kev-table .mono { font-family: var(--mono); font-size: 12px; word-break: break-all; }
.kev-table .cve-id { color: var(--rust); text-decoration: none; }
.kev-table .cve-id:hover { text-decoration: underline; }
.kev-qc-row td { background: var(--chip-bg); padding-top: 4px; padding-bottom: 4px; }
.kev-qc-cell .chip { font-size: 10px; }

.kev-hero { margin: 0 0 22px; }
.kev-hero-id {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 26px;
  font-weight: 600;
}
.kev-hero-id code { font-family: var(--mono); font-size: 24px; }
.kev-hero-meta { color: var(--muted); font-size: 13.5px; margin: 8px 0 10px; }
.kev-hero-badges { display: flex; flex-wrap: wrap; gap: 6px; }

.cvss-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 600;
  color: var(--bg);
  background: var(--gray-500);
}
.cvss-badge.sev-crit { background: var(--rust); }
.cvss-badge.sev-high { background: var(--clay-d); }
.cvss-badge.sev-med { background: var(--olive); }
.cvss-badge.sev-low { background: var(--gray-500); }

.kev-status { font-size: 10px; text-transform: uppercase; letter-spacing: .04em; }
.chip.kev-status { border-color: currentColor; color: var(--gray-700); }
.chip.kev-status.three { color: var(--rust); }
.chip.kev-status.poc { color: var(--clay-d); }
.chip.kev-status.kev { color: var(--olive); }
.chip.kev-status.src { color: var(--muted); font-size: 9.5px; }

.cand-name {
  display: inline-block;
  max-width: 260px;
  white-space: normal;
  overflow-wrap: break-word;
}

.kev-subnav {
  display: flex;
  gap: 22px;
  margin: 0 0 26px;
  border-bottom: 1.5px solid var(--border);
}
.kev-subnav a {
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--muted);
  text-decoration: none;
  padding: 0 2px 10px;
  margin-bottom: -1.5px;
  border-bottom: 2.5px solid transparent;
}
.kev-subnav a:hover { color: var(--fg); }
.kev-subnav a.active { color: var(--fg); border-bottom-color: var(--clay); }

.kev-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: start;
}
.kev-col { display: flex; flex-direction: column; gap: 18px; min-width: 0; }

.kev-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-panel);
  padding: 16px 18px;
  margin-bottom: 18px;
}
.kev-panel:last-child { margin-bottom: 0; }
.kev-panel-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  margin: 0 0 12px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.kev-panel-sub { font-size: 11px; text-transform: none; letter-spacing: 0; font-weight: 400; }

.kev-row {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
  min-width: 0;
}
.kev-row:last-child { border-bottom: none; }
.kev-label { color: var(--muted); font-size: 12.5px; padding-top: 1px; }
.kev-value { min-width: 0; overflow-wrap: anywhere; }
.kev-sources a { font-family: var(--mono); font-size: 12px; }
.kev-disclaimer { display: block; color: var(--muted); font-size: 11.5px; margin-top: 4px; }

.kev-collapse { margin-top: 4px; }
.kev-collapse summary { cursor: pointer; color: var(--muted); font-size: 12.5px; }
.kev-collapse summary:hover { color: var(--fg); }
.kev-desc { font-size: 13px; color: var(--gray-700); margin: 8px 0 0; }

.kev-callout {
  background: var(--chip-bg);
  border: 1px solid var(--border);
  border-left: 3px solid var(--rust);
  border-radius: var(--radius-row);
  padding: 14px 16px;
}
.kev-callout-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin: 0 0 8px;
}
.kev-callout p { margin: 0; font-size: 14.5px; line-height: 1.55; }

.kev-qc { padding: 4px 0; font-size: 12.5px; }
.kev-qc-error { color: var(--rust); }
.kev-qc-warn { color: var(--clay-d); }
.kev-qc-info { color: var(--gray-700); }

.kev-sample {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.45;
  background: var(--chip-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-row);
  padding: 12px;
  overflow-x: auto;
  max-height: 420px;
  overflow-y: auto;
  color: var(--gray-700);
}
.kev-footnote { color: var(--muted); font-size: 12px; margin: 0; }
.kev-feed-link { margin: 12px 0 0; font-size: 13px; }

@media (max-width: 720px) {
  .kev-detail-grid { grid-template-columns: 1fr; }
  .kev-row { grid-template-columns: 120px 1fr; }
}

/* enriched CVE chips (kev-linked): filled rust so they stand out from the
   inert outline chips; hover dims slightly (theme-safe via filter) */
.chip.cve.linked {
  background: var(--rust);
  border-color: var(--rust);
  color: var(--bg);
  text-decoration: none;
}
.chip.cve.linked:hover {
  filter: brightness(0.92);
  border-color: var(--rust);
}
