:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --panel: #ffffff;
  --text: #172033;
  --muted: #607089;
  --line: #dce3ee;
  --accent: #2563eb;
  --accent-soft: #e8f0ff;
  --shadow: 0 10px 30px rgba(23, 32, 51, 0.08);
  --ui-zoom: 1;
  --indicator-red: #dc2626;
  --indicator-orange: #ea580c;
  --indicator-yellow: #ca8a04;
  --indicator-green: #16a34a;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d1117;
  --panel: #151b23;
  --text: #e6edf3;
  --muted: #8b949e;
  --line: #30363d;
  --accent: #58a6ff;
  --accent-soft: #102a44;
  --shadow: none;
  --indicator-red: #ef4444;
  --indicator-orange: #f97316;
  --indicator-yellow: #eab308;
  --indicator-green: #22c55e;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-weight: 400;
  zoom: var(--ui-zoom);
}

.app-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 32px clamp(20px, 4vw, 56px) 20px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
}

.header-actions .status {
  margin-left: auto;
}

.zoom-control {
  display: inline-flex;
  gap: 6px;
}

.zoom-control button {
  min-width: 34px;
  padding-inline: 8px;
}

button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 11px;
  cursor: pointer;
}

button:hover {
  border-color: var(--accent);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.05;
}

.disclaimer {
  max-width: 760px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
  white-space: nowrap;
}

.disclaimer a {
  color: var(--accent);
  font-weight: 800;
  text-decoration: none;
}

.disclaimer a:hover {
  text-decoration: underline;
}

.status {
  color: var(--muted);
  font-size: 14px;
  text-align: right;
}

main {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 24px clamp(20px, 4vw, 56px) 48px;
}

.filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr)) minmax(260px, 1.7fr);
  gap: 14px;
  align-items: end;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

select,
input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
  padding: 9px 11px;
}

select:focus,
input:focus {
  outline: 3px solid var(--accent-soft);
  border-color: var(--accent);
}

.summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0;
}

.summary > div {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.summary span {
  display: block;
  font-size: 28px;
  font-weight: 800;
}

.summary small {
  color: var(--muted);
}

.list-shell {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.list-head,
.record {
  display: grid;
  grid-template-columns: 40px 84px minmax(150px, 200px) 80px minmax(180px, 0.8fr) minmax(300px, 1.5fr);
  align-items: center;
  gap: 10px;
}

.list-head {
  min-height: 36px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 88%, var(--accent-soft));
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.record {
  min-height: 44px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
}

.record:last-child {
  border-bottom: 0;
}

.record:nth-child(even) {
  background: color-mix(in srgb, var(--bg) 50%, var(--panel) 50%);
}

.record:hover {
  background: color-mix(in srgb, var(--panel) 80%, var(--accent) 20%);
  color: var(--text);
}

.record:hover a {
  color: var(--accent);
}

.indicator {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--accent-soft);
  font-size: 15px;
}

.cell {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cve-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  font-family: "SF Mono", "Cascadia Code", "Consolas", monospace;
}

.cve-title a {
  color: var(--accent);
  text-decoration: none;
}

.cve-title a:hover {
  text-decoration: underline;
}

.description {
  color: var(--muted);
  font-size: 13px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  background: #eef2f7;
  color: #3d4b63;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 600;
}

[data-theme="dark"] .pill {
  background: #212936;
  color: #c9d1d9;
}

.pill.ransomware {
  background: #fef2f2;
  color: #991b1b;
}

[data-theme="dark"] .pill.ransomware {
  background: #450a0a;
  color: #fca5a5;
}

.month {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

[data-density="expanded"] .record {
  align-items: start;
  min-height: 72px;
  padding-block: 11px;
}

[data-density="expanded"] .cell {
  overflow: visible;
  text-overflow: initial;
  white-space: normal;
}

[data-density="expanded"] .description {
  line-height: 1.45;
}

.empty {
  padding: 32px;
  text-align: center;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.disclaimer-dialog {
  width: min(640px, 92vw);
  max-height: 85vh;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--shadow);
}

.disclaimer-dialog::backdrop {
  background: rgba(13, 17, 23, 0.55);
}

.disclaimer-dialog .dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}

.disclaimer-dialog h2 {
  margin: 0;
  font-size: 20px;
}

.disclaimer-dialog .dialog-body {
  padding: 20px 22px 24px;
  overflow-y: auto;
}

.disclaimer-dialog .dialog-body p {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.disclaimer-dialog h3 {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent);
}

.disclaimer-dialog ul {
  margin: 0 0 16px;
  padding-left: 18px;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.55;
}

.disclaimer-dialog li {
  margin-bottom: 4px;
}

.disclaimer-dialog a {
  color: var(--accent);
  text-decoration: none;
}

.disclaimer-dialog a:hover {
  text-decoration: underline;
}

@media (max-width: 920px) {
  .disclaimer {
    white-space: normal;
  }

  :root {
    --ui-zoom: 0.92;
  }

  .app-header {
    display: block;
  }

  .header-actions {
    justify-items: start;
    margin-top: 12px;
  }

  .status {
    text-align: left;
  }

  .filters,
  .summary {
    grid-template-columns: 1fr;
  }

  .list-shell {
    overflow-x: auto;
  }

  .list-head,
  .record {
    min-width: 860px;
  }
}

/* ── Retro 90s mode ── */
[data-retro="true"] body {
  font-family: "Courier New", "Lucida Console", monospace;
  background: #c0c0c0;
  color: #000;
}

[data-retro="true"] .app-header {
  background: linear-gradient(180deg, #000080, #1084d0);
  color: #fff;
  border-bottom: 2px solid #808080;
  padding: 8px 12px;
}

[data-retro="true"] .app-header h1 {
  font-size: 18px;
  margin: 0;
  text-shadow: 1px 1px 0 #000;
}

[data-retro="true"] .app-header .eyebrow {
  font-size: 11px;
  color: #ffff00;
  margin: 0 0 2px;
}

[data-retro="true"] .app-header .disclaimer {
  font-size: 11px;
  color: #c0c0c0;
  margin: 4px 0 0;
}

[data-retro="true"] .app-header .disclaimer a {
  color: #ffff00;
}

[data-retro="true"] .header-actions button {
  font-family: "Courier New", monospace;
  font-size: 11px;
  background: #c0c0c0;
  color: #000;
  border: 2px outset #fff;
  border-radius: 0;
  padding: 2px 8px;
  min-height: auto;
  box-shadow: none;
}

[data-retro="true"] .header-actions button:active {
  border-style: inset;
}

[data-retro="true"] .header-actions .status {
  font-family: "Courier New", monospace;
  font-size: 11px;
  color: #00ff00;
}

[data-retro="true"] main {
  background: #c0c0c0;
}

[data-retro="true"] .filters {
  background: #d4d0c8;
  border: 2px groove #808080;
  padding: 8px;
  margin: 8px;
}

[data-retro="true"] .filters label {
  font-family: "Courier New", monospace;
  font-size: 12px;
  color: #000;
}

[data-retro="true"] .filters select,
[data-retro="true"] .filters input {
  font-family: "Courier New", monospace;
  font-size: 12px;
  background: #fff;
  color: #000;
  border: 2px inset #808080;
  border-radius: 0;
  padding: 2px 4px;
}

[data-retro="true"] .summary {
  background: #d4d0c8;
  border: 2px groove #808080;
  margin: 8px;
  padding: 6px 10px;
  font-family: "Courier New", monospace;
  font-size: 12px;
}

[data-retro="true"] .list-shell {
  margin: 8px;
  border: 2px groove #808080;
  background: #fff;
}

[data-retro="true"] .list-head {
  background: #000080;
  color: #fff;
  font-family: "Courier New", monospace;
  font-size: 11px;
  font-weight: bold;
  border-bottom: 2px solid #808080;
}

[data-retro="true"] .record {
  font-family: "Courier New", monospace;
  font-size: 12px;
  border-bottom: 1px solid #c0c0c0;
  background: #fff;
  color: #000;
}

[data-retro="true"] .record:nth-child(even) {
  background: #e8e8e8;
}

[data-retro="true"] .record:hover {
  background: #000080;
  color: #fff;
}

[data-retro="true"] .record a {
  color: #00f;
}

[data-retro="true"] .record:hover a {
  color: #ffff00;
}

[data-retro="true"] .pill {
  font-family: "Courier New", monospace;
  font-size: 10px;
  background: #c0c0c0;
  color: #000;
  border: 1px outset #808080;
  border-radius: 0;
  padding: 1px 4px;
}

[data-retro="true"] .pill.ransomware {
  background: #800000;
  color: #ff0000;
}

[data-retro="true"] .empty {
  font-family: "Courier New", monospace;
  color: #800000;
  background: #ffffcc;
  border: 2px groove #808080;
  margin: 8px;
  padding: 12px;
}

[data-retro="true"] .disclaimer-dialog {
  font-family: "Courier New", monospace;
  background: #d4d0c8;
  border: 3px outset #808080;
  border-radius: 0;
  color: #000;
}

[data-retro="true"] .disclaimer-dialog .dialog-head {
  background: #000080;
  color: #fff;
  border-bottom: 2px solid #808080;
}

[data-retro="true"] .disclaimer-dialog .dialog-head button {
  font-family: "Courier New", monospace;
  background: #c0c0c0;
  border: 2px outset #fff;
  border-radius: 0;
  color: #000;
}

[data-retro="true"] .disclaimer-dialog a {
  color: #00f;
}

[data-retro="true"] .source-list {
  font-size: 12px;
}
